#include "classes.h" // 00429550 bool DeathmatchManager::is_active() { int *in_ECX; return 1 < *in_ECX; } // 00429560 bool DeathmatchManager::is_mode_4() { int *in_ECX; return *in_ECX == 4; } // 00429570 void DeathmatchManager::enter_arena() { char cVar1; int iVar2; uint32_t listCount; int dstCount; Game *game; uint32_t j; uint32_t i; KColor fadeColor; DeathmatchManager *self; void *local_14; void *local_10; uint8_t *puStack_c; uint32_t uStack_8; void *curRoom; uStack_8 = 0xffffffff; puStack_c = &LAB_00af1b00; local_10 = ExceptionList; ExceptionList = &local_10; cVar1 = (*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x8))); *GHIDRA_CAST(this) = 2; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) = 0; self = this; if (cVar1 == '\0') { (GHIDRA_CAST((&g_manager->_sfxManager)))->SoundEffects::Play(0x341,1.0,1,0,1.0,0.0); } local_14 = g_game->_room; game = g_game; if (*GHIDRA_CAST((GHIDRA_CAST(local_14) + 0x1254)) != 0) { do { curRoom = game->_room; i = 0; iVar2 = **GHIDRA_CAST((GHIDRA_CAST(local_14) + 0x124c)); if (*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1254)) != 0) { do { if (iVar2 == *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x124c)) + i * 4))) { listCount = *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1254)); if (listCount <= i) { KAGE_LogMessage(0x10,GHIDRA_CAST("EL: invalid index for remove\n")); listCount = *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1254)); } j = i; if (i < listCount - 1) { do { *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x124c)) + j * 4)) = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x124c)) + 4 + j * 4)); j = j + 1; listCount = *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1254)); } while (j < listCount - 1); } *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1254)) = listCount - 1; dstCount = *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1244)); if (*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1240)) < dstCount + 1U) { KAGE_LogMessage(0x10,GHIDRA_CAST("EL: not enough space for push_back\n")); dstCount = *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1244)); } *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x123c)) + dstCount * 4)) = iVar2; *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1244)) = *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1244)) + 1; } i = i + 1; } while (i < *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1254))); game = g_game; } } while (*GHIDRA_CAST((GHIDRA_CAST(local_14) + 0x1254)) != 0); this = self; } curRoom = game->_room; i = 0; if (*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1264)) != 0) { do { iVar2 = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x125c)) + i * 4)); i = i + 1; *GHIDRA_CAST((iVar2 + 0x16c)) = *GHIDRA_CAST((iVar2 + 0x16c)) & 0xffffffdf; *GHIDRA_CAST((iVar2 + 0x168)) = *GHIDRA_CAST((iVar2 + 0x168)); } while (i < *GHIDRA_CAST((GHIDRA_CAST(curRoom) + 0x1264))); game = g_game; } Game::StartRoomTransition(game,-0x13,-1,0x15,GHIDRA_CAST(0x0),-1); (GHIDRA_CAST((&g_game->_roomTransition)))->RoomTransition::Update(); game = g_game; iVar2 = 0; fadeColor._unk = 0; fadeColor._alpha = 1.0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((g_game->_roomTransition))) + 0x4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((game->_roomTransition))) + 0xc)))) = 0; *GHIDRA_CAST(&game->_roomTransition) = 0; (game->_roomTransition)._direction = 0; (game->_roomTransition)._animation = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((game->_roomTransition))) + 0x20)))) = 0; (game->_roomTransition)._flags = 0; (game->_playerManager)._roomTransitionPlayer = (void *)0x0; if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x8))) != '\0') { iVar2 = 0xff; } fadeColor._red = ((float)iVar2 + 0.0) / 255.0; fadeColor._green = fadeColor._red; fadeColor._blue = fadeColor._red; Game::Fadein(game,0.0,0,&fadeColor); ExceptionList = local_10; return; } // 00429be0 void DeathmatchManager::set_type(int type) { char isLastRef; void *loadedImage; uint32_t *deathmatchType; uint8_t imageResult [4]; int *imageResultRefCount; void *local_10; uint8_t *puStack_c; uint32_t local_8; int *ludovicoImage; local_8 = 0xffffffff; puStack_c = &LAB_00af1c45; local_10 = ExceptionList; ExceptionList = &local_10; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) != GHIDRA_CAST(0x0)) { (**(code **)**GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))))(1,__security_cookie ^ GHIDRA_UINT((imageResult + 0x18))) ; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 0; } switch(type) { case 1: deathmatchType = operator_new(0x34); local_8 = 0; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeNormal::vftable; deathmatchType[0xb] = 0xb4; deathmatchType[0xc] = 6; goto LAB_00429ed1; } break; case 2: deathmatchType = operator_new(0x2c); local_8 = 1; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeIpecac::vftable; goto LAB_00429ed1; } break; case 3: deathmatchType = operator_new(0x2c); local_8 = 2; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeBomberman::vftable; goto LAB_00429ed1; } break; case 4: deathmatchType = operator_new(0x34); local_8 = 3; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeLudovico::vftable; deathmatchType[0xb] = 0; deathmatchType[0xc] = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 5; loadedImage = Manager::LoadImage(imageResult, (uint8_t *) "gfx/Items/Collectibles/collectibles_329_theludovicotechnique.png" ); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; (GHIDRA_CAST((deathmatchType + 0xb)))->KAGE::SmartPointer::operator_assign(loadedImage); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; if (((imageResultRefCount != GHIDRA_CAST(0x0)) && (isLastRef = (**(code **)(*imageResultRefCount + 0xc))(), isLastRef != '\0')) && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(imageResult); } local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),5); ludovicoImage = GHIDRA_CAST(deathmatchType[0xb]); if ((ludovicoImage[0xc] != 1) || (ludovicoImage[0xd] != 1)) { (**(code **)(*ludovicoImage + 0x44))(1,1); ludovicoImage[0xc] = 1; ludovicoImage[0xd] = 1; } goto LAB_00429ed1; } break; case 5: deathmatchType = operator_new(0x2c); local_8 = 8; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeSumo::vftable; goto LAB_00429ed1; } break; case 6: deathmatchType = operator_new(0x2c); local_8 = 9; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeKnockout::vftable; goto LAB_00429ed1; } break; case 7: deathmatchType = operator_new(0x2c); local_8 = 10; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeSwordFight::vftable; goto LAB_00429ed1; } break; case 8: deathmatchType = operator_new(0x2c); local_8 = 0xb; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeMachineGun::vftable; goto LAB_00429ed1; } break; case 9: deathmatchType = operator_new(0x2c); local_8 = 0xc; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeIndigestion::vftable; goto LAB_00429ed1; } break; case 10: deathmatchType = operator_new(0x2c); local_8 = 0xd; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeKnifeFight::vftable; goto LAB_00429ed1; } break; case 0xb: deathmatchType = operator_new(0x2c); local_8 = 0xe; if (deathmatchType != GHIDRA_CAST(0x0)) { FUN_0042a350(); *deathmatchType = IsaacRepentancePlus::DeathmatchTypeVenom::vftable; goto LAB_00429ed1; } break; default: KAGE_LogMessage(0x10,GHIDRA_CAST("Unknown type specified\n")); } deathmatchType = GHIDRA_CAST(0x0); LAB_00429ed1: *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = deathmatchType; ExceptionList = local_10; return; }