Curation round 7: Game::Start, level generation, Room, Camera, the Entity hierarchy, Entity_Player, the run frame
Six agents took over Game::Start, Level::SetNextStage, BossPool, save_game_state, level generation to the first room (place_special_rooms, RoomDescriptor, load_room), Room, Camera, Entity/EntityList/EntityRef with a curated skeleton of every Entity_* subclass, Entity_Player, Game::Render, Manager::Update's run branch, RoomTransition, ItemInfoHUD and StatHUD. Integration wrote FirstTrinketOwner and room_shape_get_door_grid_index (checked against the decompile for every shape and slot) and folded the duplicated constants. A run now generates its floor, loads the start room and draws the HUD (under gdb); Isaac renders correctly when drawn, the room itself waits for Room::Render. 2479 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
addd027977
commit
b85591bdf4
146 files changed
+20124
-200863
No files matched your search
@@ -87,7 +87,7 @@ void Ambush::StartChallenge()
|
||||
targetRoomType = 0;
|
||||
}
|
||||
else {
|
||||
targetRoomType = (GHIDRA_CAST<Entity_Player *>((doorStopOwner)))->Entity_Player::GetTrinketMultiplier(0x7c);
|
||||
targetRoomType = Entity_Player::GetTrinketMultiplier(doorStopOwner,0x7c);
|
||||
}
|
||||
doorOffset = 0x724;
|
||||
doorSlot = 0;
|
||||
@@ -231,7 +231,7 @@ LAB_00833972:
|
||||
local_68 = GHIDRA_CAST<Entity *>(local_58[-1]);
|
||||
local_8c.x = (float)(GHIDRA_INT(local_68) % room->_gridWidth) * 40.0 + 40.0;
|
||||
local_8c.y = (float)(GHIDRA_INT(local_68) / room->_gridWidth) * 40.0 + 120.0;
|
||||
(GHIDRA_CAST<Room *>((room)))->Room::FindFreeTilePosition(&local_74,&local_8c,0.0);
|
||||
Room::FindFreeTilePosition(room,&local_74,&local_8c,0.0);
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x14))));
|
||||
if (*puVar6 - 10 < 0x3de) {
|
||||
if (uVar3 == 0) {
|
||||
@@ -279,7 +279,7 @@ LAB_00833972:
|
||||
&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(local_58) + 6))),
|
||||
uVar3);
|
||||
if (local_68->_type == 1000) {
|
||||
local_68->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(local_68) + 0xc))();
|
||||
}
|
||||
local_68->_spawnGridIndex = puVar6[-1];
|
||||
local_54 = g_game;
|
||||
@@ -305,7 +305,7 @@ LAB_00833b32:
|
||||
if (uVar3 < GHIDRA_UINT((GHIDRA_INT(pvVar5) - GHIDRA_INT(playerSlot) >> 2))) {
|
||||
playerSlot = playerSlot + uVar3;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::spawn_locusts();
|
||||
Entity_Player::spawn_locusts(GHIDRA_CAST<Entity_Player *>(*playerSlot));
|
||||
uVar3 = uVar3 + 1;
|
||||
playerManager = &g_game->_playerManager;
|
||||
} while (uVar3 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
||||
@@ -329,7 +329,7 @@ LAB_00833b32:
|
||||
}
|
||||
local_54 = GHIDRA_CAST<Game *>(&local_54->_roomConfig);
|
||||
local_90 = 0;
|
||||
local_74.y = (float)(GHIDRA_CAST<Room *>((room)))->Room::GetRoomShape();
|
||||
local_74.y = (float)Room::GetRoomShape(room);
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x14))));
|
||||
if (uVar3 == 0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
||||
@@ -403,7 +403,7 @@ LAB_008337d3:
|
||||
uVar4 = uVar4 << ((uint8_t)*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1c)))) & 0x1f) ^ uVar4;
|
||||
uVar4 = uVar4 >> ((uint8_t)*GHIDRA_CAST<uint32_t *>(&this[1]._isActive) & 0x1f) ^ uVar4;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x14)))) = uVar4;
|
||||
(GHIDRA_CAST<Room *>((room)))->Room::TransformEntry(&entry,uVar3,uVar4);
|
||||
Room::TransformEntry(room,&entry,uVar3,uVar4);
|
||||
if (&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Entity *>(entry))[-1])) + 0x40f))) < GHIDRA_CAST<uint8_t *>(0x3e7)) {
|
||||
entryType = GHIDRA_CAST<Entity *>(entry);
|
||||
if (GHIDRA_CAST<Entity *>(entry) == GHIDRA_CAST<Entity *>(0x3e7)) {
|
||||
@@ -502,7 +502,7 @@ void Ambush::SpawnBossrushWave()
|
||||
if (uVar3 < GHIDRA_UINT((GHIDRA_INT(pvVar5) - GHIDRA_INT(playerSlot) >> 2))) {
|
||||
playerSlot = playerSlot + uVar3;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::spawn_locusts();
|
||||
Entity_Player::spawn_locusts(GHIDRA_CAST<Entity_Player *>(*playerSlot));
|
||||
uVar3 = uVar3 + 1;
|
||||
playerManager = &g_game->_playerManager;
|
||||
} while (uVar3 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
||||
@@ -582,7 +582,7 @@ void Ambush::Update()
|
||||
tempEffect[1] = 0;
|
||||
local_c = 0;
|
||||
tempEffect[0] = iVar1;
|
||||
(GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::RemoveEffect(tempEffect,1);
|
||||
TemporaryEffects::RemoveEffect(&player->_temporaryeffects,tempEffect,1);
|
||||
}
|
||||
playerIndex = playerIndex + 1;
|
||||
} while (playerIndex <
|
||||
@@ -618,7 +618,7 @@ void Ambush::Update()
|
||||
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60) {
|
||||
(g_manager->_musicManager)._queuedMusicID = 0x25;
|
||||
}
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::SpawnClearAward();
|
||||
Room::SpawnClearAward(g_game->_room);
|
||||
PlayerManager::trigger_room_clear(&g_game->_playerManager);
|
||||
if (iVar1 == 0x11) {
|
||||
PlayerManager::trigger_room_clear(&g_game->_playerManager);
|
||||
|
||||
@@ -229,7 +229,7 @@ void BeastArena::update()
|
||||
entityType = this_00->_type;
|
||||
if (entityType == 1) {
|
||||
LAB_0083a185:
|
||||
(GHIDRA_CAST<Entity *>((this_00)))->Entity::PlayerCollideWithGrid(0);
|
||||
Entity::PlayerCollideWithGrid(this_00,0);
|
||||
}
|
||||
else {
|
||||
if (entityType != 3) {
|
||||
|
||||
@@ -45,7 +45,7 @@ void BossOverlay::update()
|
||||
game = g_game;
|
||||
(manager->_sfxManager)._volumeModifierStep = 0.005;
|
||||
Game::StartRoomTransition(game,-10,-1,1,GHIDRA_CAST<Entity_Player *>(0x0),-1);
|
||||
(GHIDRA_CAST<RoomTransition *>((&g_game->_roomTransition)))->RoomTransition::Update();
|
||||
RoomTransition::Update(&g_game->_roomTransition);
|
||||
return;
|
||||
}
|
||||
if ((in_ECX[0xf] != 0) && ((char)in_ECX[0x13] != '\0')) {
|
||||
|
||||
@@ -1,779 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 004218e0
|
||||
void BossPool::init(uint32_t seed)
|
||||
{
|
||||
uint32_t *pickedEntry;
|
||||
code *pcVar2;
|
||||
uint32_t uVar3;
|
||||
uint32_t uVar4;
|
||||
uint32_t lastEntryTail;
|
||||
uint32_t uVar6;
|
||||
uint32_t uVar7;
|
||||
uint32_t uVar8;
|
||||
uint32_t uVar9;
|
||||
uint8_t isFillValue;
|
||||
int wordOffset;
|
||||
uint32_t uVar10;
|
||||
uint32_t uVar11;
|
||||
uint32_t swapIndex;
|
||||
uint32_t uVar12;
|
||||
uint32_t *poolRng;
|
||||
int poolsLeft;
|
||||
int lastEntryOffset;
|
||||
int *local_9dc;
|
||||
MTRNG mtRng [832];
|
||||
uint32_t local_18;
|
||||
uint32_t local_c;
|
||||
uint8_t auStack_8 [4];
|
||||
int blacklistBits;
|
||||
uint32_t *lastEntry;
|
||||
uint32_t lastEntryTail;
|
||||
uint32_t *pickedEntry;
|
||||
|
||||
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
|
||||
poolRng = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28))));
|
||||
local_9dc = GHIDRA_CAST<int *>(0x25);
|
||||
do {
|
||||
if (seed == 0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
||||
pcVar2 = (code *)swi(3);
|
||||
(*pcVar2)();
|
||||
return;
|
||||
}
|
||||
uVar10 = seed >> 3 ^ seed;
|
||||
poolRng[1] = 2;
|
||||
poolRng[2] = 0x15;
|
||||
uVar10 = uVar10 << 0xd ^ uVar10;
|
||||
seed = uVar10 >> 7 ^ uVar10;
|
||||
*poolRng = seed;
|
||||
poolRng[3] = 9;
|
||||
poolRng = poolRng + 0xf;
|
||||
local_9dc = GHIDRA_CAST<int *>((GHIDRA_INT(local_9dc) + -1));
|
||||
} while (local_9dc != GHIDRA_CAST<int *>(0x0));
|
||||
vector_bool_resize(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8ac))),0x68,7);
|
||||
vector_bool_resize(this + 1,0x68,isFillValue);
|
||||
uVar10 = 0;
|
||||
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8b8)))) != 0) {
|
||||
do {
|
||||
wordOffset = (uVar10 >> 5) * 4;
|
||||
swapIndex = uVar10 & 0x1f;
|
||||
blacklistBits = *GHIDRA_CAST<int *>((this + 1));
|
||||
uVar11 = *GHIDRA_CAST<uint32_t *>((blacklistBits + wordOffset)) & ~(1 << swapIndex);
|
||||
*GHIDRA_CAST<uint32_t *>((blacklistBits + wordOffset)) = uVar11;
|
||||
uVar12 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8ac)))) + wordOffset));
|
||||
if ((uVar11 & 1 << (sbyte)swapIndex) == 0) {
|
||||
uVar12 = uVar12 & ~(1 << swapIndex);
|
||||
}
|
||||
else {
|
||||
uVar12 = uVar12 | 1 << swapIndex;
|
||||
}
|
||||
uVar10 = uVar10 + 1;
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8ac)))) + wordOffset)) = uVar12;
|
||||
} while (uVar10 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8b8)))));
|
||||
}
|
||||
load_xml("bosspools.xml",0);
|
||||
ModManager::LoadModBossPools();
|
||||
local_9dc = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18))));
|
||||
poolsLeft = 0x25;
|
||||
do {
|
||||
if (*local_9dc != local_9dc[1]) {
|
||||
local_18 = 0x271;
|
||||
(GHIDRA_CAST<MTRNG *>((mtRng)))->MTRNG::Init(local_9dc[4]);
|
||||
uVar10 = (local_9dc[1] - *local_9dc) / 0x14;
|
||||
uVar12 = uVar10 - 1;
|
||||
if (0 < GHIDRA_INT(uVar12)) {
|
||||
lastEntryOffset = uVar12 * 0x14;
|
||||
do {
|
||||
uVar11 = (GHIDRA_CAST<MTRNG *>((mtRng)))->MTRNG::Next();
|
||||
swapIndex = 0;
|
||||
if (uVar10 != 0) {
|
||||
swapIndex = uVar11 % uVar10;
|
||||
}
|
||||
if (uVar12 != swapIndex) {
|
||||
blacklistBits = *local_9dc;
|
||||
pickedEntry = GHIDRA_CAST<uint32_t *>((blacklistBits + swapIndex * 0x14));
|
||||
uVar3 = pickedEntry[1];
|
||||
uVar4 = pickedEntry[2];
|
||||
lastEntryTail = pickedEntry[3];
|
||||
pickedEntry = GHIDRA_CAST<uint32_t *>((blacklistBits + swapIndex * 0x14));
|
||||
lastEntryTail = *GHIDRA_CAST<uint32_t *>((lastEntryOffset + 0x10 + blacklistBits));
|
||||
lastEntry = GHIDRA_CAST<uint32_t *>((lastEntryOffset + blacklistBits));
|
||||
uVar6 = *lastEntry;
|
||||
uVar7 = lastEntry[1];
|
||||
uVar8 = lastEntry[2];
|
||||
uVar9 = lastEntry[3];
|
||||
lastEntry = GHIDRA_CAST<uint32_t *>((lastEntryOffset + blacklistBits));
|
||||
*lastEntry = *pickedEntry;
|
||||
lastEntry[1] = uVar3;
|
||||
lastEntry[2] = uVar4;
|
||||
lastEntry[3] = lastEntryTail;
|
||||
*GHIDRA_CAST<uint32_t *>((lastEntryOffset + 0x10 + blacklistBits)) = pickedEntry[4];
|
||||
*pickedEntry = uVar6;
|
||||
pickedEntry[1] = uVar7;
|
||||
pickedEntry[2] = uVar8;
|
||||
pickedEntry[3] = uVar9;
|
||||
pickedEntry[4] = lastEntryTail;
|
||||
}
|
||||
uVar12 = uVar12 - 1;
|
||||
lastEntryOffset = lastEntryOffset + -0x14;
|
||||
uVar10 = uVar10 - 1;
|
||||
} while (0 < GHIDRA_INT(uVar12));
|
||||
}
|
||||
}
|
||||
local_9dc = local_9dc + 0xf;
|
||||
poolsLeft = poolsLeft + -1;
|
||||
} while (poolsLeft != 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// 00421bf0
|
||||
void BossPool::load_xml(uint8_t *param_1, int param_2)
|
||||
{
|
||||
uint8_t bVar1;
|
||||
uint8_t *****pppppbVar2;
|
||||
int *file;
|
||||
int iVar3;
|
||||
void *pvVar4;
|
||||
uint8_t ****ppppbVar5;
|
||||
uint32_t uVar6;
|
||||
uint8_t *******pppppppbVar7;
|
||||
uint8_t ****bossAttrNameCursor;
|
||||
uint8_t *pbVar8;
|
||||
uint32_t length;
|
||||
char *keyCursor;
|
||||
uint32_t *poolAttr;
|
||||
uint8_t *poolAttrValue;
|
||||
bool bVar9;
|
||||
double dVar10;
|
||||
uint8_t auStack_100cc [8];
|
||||
void *pvStack_100c4;
|
||||
int iStack_100c0;
|
||||
uint8_t *xmlText;
|
||||
int poolNode;
|
||||
uint8_t ****attrName;
|
||||
uint8_t auStack_100b0 [4];
|
||||
uint8_t ******ppppppbStack_100ac;
|
||||
char *stageKeyName;
|
||||
uint8_t *******pppppppbStack_100a4;
|
||||
uint8_t bStack_1009d;
|
||||
uint8_t *****bossId;
|
||||
uint8_t *****bossWeight;
|
||||
uint8_t *****bossInitialWeight;
|
||||
uint8_t *****pppppbStack_10090;
|
||||
uint8_t *****bossRoom;
|
||||
uint8_t xmlDoc [48];
|
||||
uint8_t xmlPool [65564];
|
||||
uint8_t *******stageName [4];
|
||||
uint32_t stageNameSize;
|
||||
uint32_t stageNameCapacity;
|
||||
uint32_t local_24;
|
||||
uint8_t *puStack_20;
|
||||
void *local_1c;
|
||||
uint8_t *puStack_18;
|
||||
uint8_t ******local_14;
|
||||
uint8_t ******bossesEnd;
|
||||
Manager *manager;
|
||||
|
||||
puStack_20 = GHIDRA_CAST<uint8_t *>((stageName + 0xe));
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(0xffffffff);
|
||||
puStack_18 = &LAB_00af1814;
|
||||
local_1c = ExceptionList;
|
||||
local_24 = __security_cookie ^ GHIDRA_UINT((stageName + 0xb));
|
||||
ExceptionList = &local_1c;
|
||||
if (param_2 == 0) {
|
||||
pppppppbVar7 = GHIDRA_CAST<uint8_t *******>((stageName + 0xe));
|
||||
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c7f6f0) {
|
||||
_Init_thread_header(&DAT_00c7f6f0,local_24);
|
||||
pppppppbVar7 = GHIDRA_CAST<uint8_t *******>(puStack_20);
|
||||
if (DAT_00c7f6f0 == -1) {
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(0x0);
|
||||
DAT_00c7f6f4 = operator_new(0x2c);
|
||||
*(void **)DAT_00c7f6f4 = DAT_00c7f6f4;
|
||||
*(void **)(GHIDRA_CAST<char *>(DAT_00c7f6f4) + 4) = DAT_00c7f6f4;
|
||||
*(void **)(GHIDRA_CAST<char *>(DAT_00c7f6f4) + 8) = DAT_00c7f6f4;
|
||||
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(DAT_00c7f6f4) + 0xc)) = 0x101;
|
||||
_atexit(FUN_00b153a0);
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(0xffffffff);
|
||||
_Init_thread_footer(&DAT_00c7f6f0);
|
||||
pppppppbVar7 = GHIDRA_CAST<uint8_t *******>(puStack_20);
|
||||
}
|
||||
}
|
||||
puStack_20 = GHIDRA_CAST<uint8_t *>(pppppppbVar7);
|
||||
if (DAT_00c7f6f8 == 0) {
|
||||
stageKeyName = "basement";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "cellar";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x2);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "caves";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x4);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "catacombs";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x5);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "depths";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x7);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "necropolis";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x8);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "womb";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0xa);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "utero";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0xb);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "sheol";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0xe);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "cathedral";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0xf);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "dark room";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x10);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "chest";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x11);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "burning basement";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x3);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "flooded caves";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x6);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "dank depths";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x9);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "scarred womb";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0xc);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "blue womb";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0xd);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "void";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1a);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "downpour";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1b);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "mines";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1d);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "mausoleum";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1f);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "corpse";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x21);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "dross";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1c);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "ashpit";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x1e);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "gehenna";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x20);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
stageKeyName = "mortis";
|
||||
pppppppbStack_100a4 = GHIDRA_CAST<uint8_t *******>(0x22);
|
||||
FUN_00423500(auStack_100b0,&stageKeyName);
|
||||
}
|
||||
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(param_1,GHIDRA_CAST<int *>(0x0));
|
||||
if (file != GHIDRA_CAST<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 = GHIDRA_CAST<uint8_t ******>(0x1);
|
||||
iVar3 = 0x4220d8;
|
||||
pbVar8 = xmlText;
|
||||
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(xmlText);
|
||||
pvVar4 = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<uint8_t *>("bosspools"),iVar3,(uint8_t)pbVar8);
|
||||
if (pvVar4 != (void *)0x0) {
|
||||
for (poolNode = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x18)); poolNode != 0;
|
||||
poolNode = *GHIDRA_CAST<int *>((poolNode + 0x2c))) {
|
||||
stageNameSize = 0;
|
||||
stageNameCapacity = 0xf;
|
||||
stageName[0] = GHIDRA_CAST<uint8_t *******>(0x0);
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = (undefined3)(GHIDRA_UINT(local_14) >> 8);
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2));
|
||||
poolAttr = *GHIDRA_CAST<uint32_t **>((poolNode + 0x20));
|
||||
ppppppbStack_100ac = GHIDRA_CAST<uint8_t ******>(0x0);
|
||||
if (poolAttr != GHIDRA_CAST<uint32_t *>(0x0)) {
|
||||
do {
|
||||
pbVar8 = s_name;
|
||||
attrName = GHIDRA_CAST<uint8_t ****>(&g_xmlNullStr);
|
||||
if (GHIDRA_CAST<uint8_t ****>(*poolAttr) != GHIDRA_CAST<uint8_t ****>(0x0)) {
|
||||
attrName = GHIDRA_CAST<uint8_t ****>(*poolAttr);
|
||||
}
|
||||
poolAttrValue = &g_xmlNullStr;
|
||||
if (GHIDRA_CAST<uint8_t *>(poolAttr[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
||||
poolAttrValue = GHIDRA_CAST<uint8_t *>(poolAttr[1]);
|
||||
}
|
||||
ppppbVar5 = attrName;
|
||||
do {
|
||||
bStack_1009d = *GHIDRA_CAST<uint8_t *>(ppppbVar5);
|
||||
bVar9 = bStack_1009d < *pbVar8;
|
||||
if (bStack_1009d != *pbVar8) {
|
||||
LAB_004221a2:
|
||||
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
||||
goto LAB_004221a7;
|
||||
}
|
||||
if (bStack_1009d == 0) break;
|
||||
bStack_1009d = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(ppppbVar5) + 1));
|
||||
bVar9 = bStack_1009d < pbVar8[1];
|
||||
if (bStack_1009d != pbVar8[1]) goto LAB_004221a2;
|
||||
ppppbVar5 = GHIDRA_CAST<uint8_t ****>((GHIDRA_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);
|
||||
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(stageName))))->msvc::string::assign(poolAttrValue,
|
||||
GHIDRA_INT(pbVar8) - GHIDRA_INT((poolAttrValue + 1)));
|
||||
}
|
||||
else {
|
||||
keyCursor = "doubletrouble";
|
||||
ppppbVar5 = attrName;
|
||||
do {
|
||||
bVar1 = *GHIDRA_CAST<uint8_t *>(ppppbVar5);
|
||||
bVar9 = bVar1 < (uint8_t)*keyCursor;
|
||||
if (bVar1 != *keyCursor) {
|
||||
LAB_004221f0:
|
||||
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
||||
goto LAB_004221f5;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(ppppbVar5) + 1));
|
||||
bVar9 = bVar1 < (uint8_t)keyCursor[1];
|
||||
if (bVar1 != keyCursor[1]) goto LAB_004221f0;
|
||||
ppppbVar5 = GHIDRA_CAST<uint8_t ****>((GHIDRA_INT(ppppbVar5) + 2));
|
||||
keyCursor = keyCursor + 2;
|
||||
} while (bVar1 != 0);
|
||||
uVar6 = 0;
|
||||
LAB_004221f5:
|
||||
if (uVar6 == 0) {
|
||||
ppppppbStack_100ac = GHIDRA_CAST<uint8_t ******>(atoi(GHIDRA_CAST<char *>(poolAttrValue)));
|
||||
}
|
||||
}
|
||||
} while ((poolAttr[4] != 0) &&
|
||||
(poolAttr = GHIDRA_CAST<uint32_t *>(poolAttr[6]), poolAttr != GHIDRA_CAST<uint32_t *>(0x0)));
|
||||
}
|
||||
uVar6 = stageNameCapacity;
|
||||
FUN_00423530(auStack_100cc,stageName);
|
||||
pvVar4 = pvStack_100c4;
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvStack_100c4) + 0xd)) == '\0') {
|
||||
pbVar8 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(pvStack_100c4) + 0x10));
|
||||
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvStack_100c4) + 0x24))) {
|
||||
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
||||
}
|
||||
pppppppbVar7 = GHIDRA_CAST<uint8_t *******>(stageName);
|
||||
if (0xf < uVar6) {
|
||||
pppppppbVar7 = stageName[0];
|
||||
}
|
||||
iVar3 = string_compare(GHIDRA_CAST<uint8_t *>(pppppppbVar7),stageNameSize,pbVar8,
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvStack_100c4) + 0x20)));
|
||||
if ((iVar3 < 0) || (pvVar4 == DAT_00c7f6f4)) goto LAB_004224fe;
|
||||
pppppppbStack_100a4 =
|
||||
(uint8_t *******)
|
||||
(iStack_100c0 +
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x28)) * 0x10 - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x28))) * 4);
|
||||
if (GHIDRA_CAST<uint8_t ********>(pppppppbStack_100a4) != stageName) {
|
||||
pppppppbVar7 = GHIDRA_CAST<uint8_t *******>(stageName);
|
||||
if (0xf < uVar6) {
|
||||
pppppppbVar7 = stageName[0];
|
||||
}
|
||||
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(pppppppbStack_100a4))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(pppppppbVar7),length);
|
||||
}
|
||||
pppppppbStack_100a4[0xe] = ppppppbStack_100ac;
|
||||
pppppppbStack_100a4[7] = pppppppbStack_100a4[6];
|
||||
pppppppbStack_100a4[9] = GHIDRA_CAST<uint8_t ******>(0x0);
|
||||
ppppppbStack_100ac = *GHIDRA_CAST<uint8_t *******>((poolNode + 0x18));
|
||||
if (ppppppbStack_100ac != GHIDRA_CAST<uint8_t ******>(0x0)) {
|
||||
do {
|
||||
pppppbVar2 = ppppppbStack_100ac[8];
|
||||
bossId = GHIDRA_CAST<uint8_t *****>(0x0);
|
||||
bossRoom = GHIDRA_CAST<uint8_t *****>(0x0);
|
||||
for (; pppppbVar2 != GHIDRA_CAST<uint8_t *****>(0x0); pppppbVar2 = GHIDRA_CAST<uint8_t *****>(pppppbVar2[6])) {
|
||||
pbVar8 = s_id;
|
||||
attrName = GHIDRA_CAST<uint8_t ****>(&g_xmlNullStr);
|
||||
if (*pppppbVar2 != GHIDRA_CAST<uint8_t ****>(0x0)) {
|
||||
attrName = *pppppbVar2;
|
||||
}
|
||||
ppppbVar5 = GHIDRA_CAST<uint8_t ****>(&g_xmlNullStr);
|
||||
if (pppppbVar2[1] != GHIDRA_CAST<uint8_t ****>(0x0)) {
|
||||
ppppbVar5 = pppppbVar2[1];
|
||||
}
|
||||
bossAttrNameCursor = attrName;
|
||||
do {
|
||||
bStack_1009d = *GHIDRA_CAST<uint8_t *>(bossAttrNameCursor);
|
||||
bVar9 = bStack_1009d < *pbVar8;
|
||||
if (bStack_1009d != *pbVar8) {
|
||||
LAB_00422368:
|
||||
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
||||
goto LAB_0042236d;
|
||||
}
|
||||
if (bStack_1009d == 0) break;
|
||||
bStack_1009d = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(bossAttrNameCursor) + 1));
|
||||
bVar9 = bStack_1009d < pbVar8[1];
|
||||
if (bStack_1009d != pbVar8[1]) goto LAB_00422368;
|
||||
bossAttrNameCursor = GHIDRA_CAST<uint8_t ****>((GHIDRA_INT(bossAttrNameCursor) + 2));
|
||||
pbVar8 = pbVar8 + 2;
|
||||
} while (bStack_1009d != 0);
|
||||
uVar6 = 0;
|
||||
LAB_0042236d:
|
||||
if (uVar6 == 0) {
|
||||
bossId = GHIDRA_CAST<uint8_t *****>(atoi(GHIDRA_CAST<char *>(ppppbVar5)));
|
||||
}
|
||||
else {
|
||||
keyCursor = "weight";
|
||||
bossAttrNameCursor = attrName;
|
||||
do {
|
||||
bStack_1009d = *GHIDRA_CAST<uint8_t *>(bossAttrNameCursor);
|
||||
bVar9 = bStack_1009d < (uint8_t)*keyCursor;
|
||||
if (bStack_1009d != *keyCursor) {
|
||||
LAB_004223d2:
|
||||
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
||||
goto LAB_004223d7;
|
||||
}
|
||||
if (bStack_1009d == 0) break;
|
||||
bStack_1009d = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(bossAttrNameCursor) + 1));
|
||||
bVar9 = bStack_1009d < (uint8_t)keyCursor[1];
|
||||
if (bStack_1009d != keyCursor[1]) goto LAB_004223d2;
|
||||
bossAttrNameCursor = GHIDRA_CAST<uint8_t ****>((GHIDRA_INT(bossAttrNameCursor) + 2));
|
||||
keyCursor = keyCursor + 2;
|
||||
} while (bStack_1009d != 0);
|
||||
uVar6 = 0;
|
||||
LAB_004223d7:
|
||||
if (uVar6 == 0) {
|
||||
dVar10 = atof(GHIDRA_CAST<char *>(ppppbVar5));
|
||||
bossWeight = GHIDRA_CAST<uint8_t *****>((float)dVar10);
|
||||
}
|
||||
else {
|
||||
pbVar8 = &DAT_00b1c17c;
|
||||
bossAttrNameCursor = attrName;
|
||||
do {
|
||||
bVar1 = *GHIDRA_CAST<uint8_t *>(bossAttrNameCursor);
|
||||
bVar9 = bVar1 < *pbVar8;
|
||||
if (bVar1 != *pbVar8) {
|
||||
LAB_00422410:
|
||||
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
||||
goto LAB_00422415;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(bossAttrNameCursor) + 1));
|
||||
bVar9 = bVar1 < pbVar8[1];
|
||||
if (bVar1 != pbVar8[1]) goto LAB_00422410;
|
||||
bossAttrNameCursor = GHIDRA_CAST<uint8_t ****>((GHIDRA_INT(bossAttrNameCursor) + 2));
|
||||
pbVar8 = pbVar8 + 2;
|
||||
} while (bVar1 != 0);
|
||||
uVar6 = 0;
|
||||
LAB_00422415:
|
||||
if (uVar6 == 0) {
|
||||
bossRoom = GHIDRA_CAST<uint8_t *****>(atoi(GHIDRA_CAST<char *>(ppppbVar5)));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pppppbVar2[4] == GHIDRA_CAST<uint8_t ****>(0x0)) break;
|
||||
}
|
||||
pppppbVar2 = bossId;
|
||||
manager = g_manager;
|
||||
if ((GHIDRA_INT(bossId) < 0) ||
|
||||
((GHIDRA_INT((g_manager->_entityConfig)._bosses._end) -
|
||||
GHIDRA_INT((g_manager->_entityConfig)._bosses._begin)) / 100 <= GHIDRA_INT(bossId))) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("BossID out of bounds\n"));
|
||||
}
|
||||
pppppppbVar7 = pppppppbStack_100a4;
|
||||
bossInitialWeight = bossWeight;
|
||||
pppppbStack_10090 =
|
||||
*(uint8_t ******)
|
||||
(GHIDRA_INT((manager->_entityConfig)._bosses._begin) + GHIDRA_INT(pppppbVar2) * 100 + 0x54);
|
||||
bossesEnd = pppppppbStack_100a4[7];
|
||||
if (bossesEnd == pppppppbStack_100a4[8]) {
|
||||
msvc::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] = GHIDRA_CAST<uint8_t ******>(((float)bossInitialWeight + (float)pppppppbVar7[9]));
|
||||
ppppppbStack_100ac = GHIDRA_CAST<uint8_t ******>(ppppppbStack_100ac[0xb]);
|
||||
} while (ppppppbStack_100ac != GHIDRA_CAST<uint8_t ******>(0x0));
|
||||
ppppppbStack_100ac = GHIDRA_CAST<uint8_t ******>(0x0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LAB_004224fe:
|
||||
KAGE_LogMessage(4,GHIDRA_CAST<uint8_t *>("Boss pool: Unknown stage \'%s\'\n"));
|
||||
}
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1));
|
||||
if (0xf < stageNameCapacity) {
|
||||
uVar6 = stageNameCapacity + 1;
|
||||
pppppppbVar7 = stageName[0];
|
||||
if (0xfff < uVar6) {
|
||||
pppppppbVar7 = GHIDRA_CAST<uint8_t *******>(stageName[0][-1]);
|
||||
uVar6 = stageNameCapacity + 0x24;
|
||||
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(stageName[0]) + (-4 - GHIDRA_INT(pppppppbVar7))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pppppppbVar7,uVar6);
|
||||
}
|
||||
}
|
||||
}
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3));
|
||||
tracked_alloc(1,xmlText,0);
|
||||
local_14 = GHIDRA_CAST<uint8_t ******>(0x4);
|
||||
(GHIDRA_CAST<xml_memory_pool *>((xmlPool)))->xml_memory_pool::clear();
|
||||
}
|
||||
}
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00422830
|
||||
int BossPool::GetBossId(int leveltype, int levelvariant, RNG *rng)
|
||||
{
|
||||
code *pcVar1;
|
||||
bool bVar2;
|
||||
char cVar3;
|
||||
uint8_t bVar4;
|
||||
uint32_t uVar5;
|
||||
uint32_t uVar6;
|
||||
uint32_t uVar7;
|
||||
uint32_t conquestRoll;
|
||||
uint32_t specialRoll;
|
||||
uint32_t stateFlagBossRoll;
|
||||
int iVar8;
|
||||
int *bossEntry;
|
||||
uint32_t *poolEntry;
|
||||
int iVar9;
|
||||
int extraout_EDX;
|
||||
int *extraout_EDX_00;
|
||||
int bossId;
|
||||
Manager *manager;
|
||||
RNG *poolRng;
|
||||
int rngShift2;
|
||||
int rngShift3;
|
||||
uint8_t *stagePool;
|
||||
|
||||
manager = g_manager;
|
||||
uVar5 = RoomConfig::GetStageID(leveltype,levelvariant,-1);
|
||||
stagePool = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x0))) + uVar5 * 0x3c;
|
||||
poolRng = GHIDRA_CAST<RNG *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 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) &&
|
||||
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))) != 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 = (GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
uVar7 = (GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
conquestRoll = (GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
specialRoll = (GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
stateFlagBossRoll = (GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
(GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
(GHIDRA_CAST<RNG *>((poolRng)))->RNG::Next();
|
||||
uVar5 = poolRng->_seed;
|
||||
iVar8 = poolRng->_shift1;
|
||||
rngShift2 = poolRng->_shift2;
|
||||
rngShift3 = poolRng->_shift3;
|
||||
if (((uVar6 & 1) == 0) &&
|
||||
(((manager->_persistentGameData)._achievements[0x42] != 0 ||
|
||||
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<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 ||
|
||||
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<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')) {
|
||||
**GHIDRA_CAST<uint32_t **>((this + 1)) = **GHIDRA_CAST<uint32_t **>((this + 1)) | 0x400000;
|
||||
return 0x16;
|
||||
}
|
||||
switch(leveltype) {
|
||||
case 1:
|
||||
cVar3 = FUN_00421720(9);
|
||||
if (cVar3 == '\0') {
|
||||
**GHIDRA_CAST<uint32_t **>((this + 1)) = **GHIDRA_CAST<uint32_t **>((this + 1)) | 0x200;
|
||||
return 9;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
cVar3 = FUN_00421720(10);
|
||||
if (cVar3 == '\0') {
|
||||
**GHIDRA_CAST<uint32_t **>((this + 1)) = **GHIDRA_CAST<uint32_t **>((this + 1)) | 0x400;
|
||||
return 10;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
cVar3 = FUN_00421720(0xb);
|
||||
if (cVar3 == '\0') {
|
||||
**GHIDRA_CAST<uint32_t **>((this + 1)) = **GHIDRA_CAST<uint32_t **>((this + 1)) | 0x800;
|
||||
return 0xb;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
cVar3 = FUN_00421720(0xc);
|
||||
if (cVar3 == '\0') {
|
||||
**GHIDRA_CAST<uint32_t **>((this + 1)) = **GHIDRA_CAST<uint32_t **>((this + 1)) | 0x1000;
|
||||
if (bVar2) {
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 1)) + 4)) = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 1)) + 4)) | 0x40;
|
||||
}
|
||||
iVar8 = 0xc;
|
||||
if (bVar2) {
|
||||
iVar8 = 0x26;
|
||||
}
|
||||
return iVar8;
|
||||
}
|
||||
}
|
||||
}
|
||||
iVar9 = *GHIDRA_CAST<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')))) {
|
||||
**GHIDRA_CAST<uint32_t **>((this + 1)) = **GHIDRA_CAST<uint32_t **>((this + 1)) | 0x800000;
|
||||
return 0x17;
|
||||
}
|
||||
leveltype = 0;
|
||||
do {
|
||||
if (uVar5 == 0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
||||
pcVar1 = (code *)swi(3);
|
||||
iVar8 = (*pcVar1)();
|
||||
return iVar8;
|
||||
}
|
||||
uVar5 = uVar5 >> ((uint8_t)iVar8 & 0x1f) ^ uVar5;
|
||||
uVar5 = uVar5 << ((uint8_t)rngShift2 & 0x1f) ^ uVar5;
|
||||
uVar5 = uVar5 >> ((uint8_t)rngShift3 & 0x1f) ^ uVar5;
|
||||
bossEntry = GHIDRA_CAST<int *>(FUN_00422620(stagePool));
|
||||
if (bossEntry == GHIDRA_CAST<int *>(0x0)) {
|
||||
poolEntry = *GHIDRA_CAST<uint32_t **>((stagePool + 0x18));
|
||||
if (poolEntry != *GHIDRA_CAST<uint32_t **>((stagePool + 0x1c))) {
|
||||
do {
|
||||
uVar6 = *poolEntry >> 5;
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8ac)))) + uVar6 * 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8ac)))) + uVar6 * 4)) & ~(1 << (*poolEntry & 0x1f));
|
||||
uVar6 = *poolEntry;
|
||||
uVar7 = uVar6 >> 5;
|
||||
poolEntry = poolEntry + 5;
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 1)) + uVar7 * 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 1)) + uVar7 * 4)) & ~(1 << (uVar6 & 0x1f));
|
||||
} while (poolEntry != *GHIDRA_CAST<uint32_t **>((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,GHIDRA_CAST<uint8_t *>("Failed to pick a boss room variant, defaulting to Monstro\n"));
|
||||
return 1;
|
||||
}
|
||||
} while( true );
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,334 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 0041bb50
|
||||
void CellSpace::insert(Entity *entity)
|
||||
{
|
||||
float fVar1;
|
||||
int cellY;
|
||||
int minCellX;
|
||||
int maxCellX;
|
||||
int cellY;
|
||||
int maxCellY;
|
||||
float fVar3;
|
||||
float cosAngle;
|
||||
float fVar4;
|
||||
float fVar5;
|
||||
float fVar6;
|
||||
float fVar7;
|
||||
int cellX;
|
||||
|
||||
fVar3 = (entity->_sizeMulti).x;
|
||||
cosAngle = (entity->_sizeMulti).y;
|
||||
fVar4 = (entity->_pos).x;
|
||||
fVar1 = (entity->_pos).y;
|
||||
fVar6 = fVar3 * entity->_size;
|
||||
fVar5 = cosAngle * entity->_size;
|
||||
if (((fVar3 != g_vectorOne.x) || (cosAngle != g_vectorOne.y)) &&
|
||||
(fVar3 = (entity->_sprite)._rotation, fVar3 != 0.0)) {
|
||||
fVar3 = fVar3 * 0.017453292;
|
||||
cosAngle = cos(fVar3);
|
||||
fVar3 = sin(fVar3);
|
||||
fVar7 = fVar5 * fVar3;
|
||||
fVar5 = ABS(fVar5 * cosAngle) + ABS(fVar6 * fVar3);
|
||||
fVar6 = ABS(fVar7) + ABS(fVar6 * cosAngle);
|
||||
}
|
||||
cosAngle = fVar4 - fVar6;
|
||||
fVar6 = fVar6 + fVar4;
|
||||
fVar3 = fVar1 - fVar5;
|
||||
fVar5 = fVar5 + fVar1;
|
||||
if ((fVar6 <= cosAngle) || (fVar5 <= fVar3)) {
|
||||
KAGE_LogMessage(0x10,(uint8_t *)
|
||||
"Entity Teleport Detected! Type: %d, Variant: %d, Subtype: %d; Pos: %f, %f; Size: %f, %f\n"
|
||||
);
|
||||
}
|
||||
fVar4 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14));
|
||||
cellY = GHIDRA_INT((fVar3 / fVar4));
|
||||
maxCellY = GHIDRA_INT((fVar5 / fVar4));
|
||||
if (((maxCellY < cellY) || (cellY + 1 <= cellY)) || (maxCellY + 1 <= maxCellY)) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("CellSpace::insert: y1 > y2\n"));
|
||||
fVar4 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14));
|
||||
}
|
||||
minCellX = GHIDRA_INT((cosAngle / fVar4));
|
||||
maxCellX = GHIDRA_INT((fVar6 / fVar4));
|
||||
if (((maxCellX < minCellX) || (minCellX + 1 <= minCellX)) || (maxCellX + 1 <= maxCellX)) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("CellSpace::insert: x1 > x2\n"));
|
||||
}
|
||||
for (; cellX = minCellX, cellY <= maxCellY; cellY = cellY + 1) {
|
||||
for (; cellX <= maxCellX; cellX = cellX + 1) {
|
||||
cellY = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) * cellY + cellX;
|
||||
if ((-1 < cellY) && (cellY < (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1c)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18))) / 0xa4)
|
||||
) {
|
||||
cellY = cellY * 0xa4 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18));
|
||||
if (*GHIDRA_CAST<int *>((cellY + 0xa0)) < 0x28) {
|
||||
*GHIDRA_CAST<Entity **>((cellY + *GHIDRA_CAST<int *>((cellY + 0xa0)) * 4)) = entity;
|
||||
*GHIDRA_CAST<int *>((cellY + 0xa0)) = *GHIDRA_CAST<int *>((cellY + 0xa0)) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 0041bdf0
|
||||
void CellSpace::collide_entity(Entity *entity)
|
||||
{
|
||||
int iVar1;
|
||||
Entity *this_00;
|
||||
int iVar2;
|
||||
uint32_t pairWord;
|
||||
int iVar3;
|
||||
uint32_t pairIndex;
|
||||
float radiusY;
|
||||
float cellSize;
|
||||
float radiusX;
|
||||
float right;
|
||||
float bottom;
|
||||
int row;
|
||||
uint32_t slot;
|
||||
int column;
|
||||
int highIndex;
|
||||
int ownIndex;
|
||||
int pairStride;
|
||||
float posX;
|
||||
float posY;
|
||||
|
||||
if (entity->_entityCollisionClass != 0) {
|
||||
posX = (entity->_pos).x;
|
||||
radiusX = entity->_size * (entity->_sizeMulti).x;
|
||||
iVar1 = *GHIDRA_CAST<int *>(this);
|
||||
radiusY = entity->_size * (entity->_sizeMulti).y;
|
||||
cellSize = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14));
|
||||
right = radiusX + posX;
|
||||
pairStride = *GHIDRA_CAST<int *>((iVar1 + 0xd4));
|
||||
posY = (entity->_pos).y;
|
||||
bottom = radiusY + posY;
|
||||
row = GHIDRA_INT(((posY - radiusY) / cellSize));
|
||||
if (row <= GHIDRA_INT((bottom / cellSize))) {
|
||||
do {
|
||||
column = GHIDRA_INT(((posX - radiusX) / cellSize));
|
||||
if (column <= GHIDRA_INT((right / cellSize))) {
|
||||
do {
|
||||
iVar3 = column + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) * row;
|
||||
if ((-1 < iVar3) &&
|
||||
(iVar3 < (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1c)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18))) / 0xa4)) {
|
||||
slot = 0;
|
||||
iVar3 = iVar3 * 0xa4 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18));
|
||||
if (*GHIDRA_CAST<int *>((iVar3 + 0xa0)) != 0) {
|
||||
do {
|
||||
this_00 = *GHIDRA_CAST<Entity **>((iVar3 + slot * 4));
|
||||
ownIndex = entity->_collisionIndex;
|
||||
iVar2 = this_00->_collisionIndex;
|
||||
highIndex = iVar2;
|
||||
if (iVar2 < ownIndex) {
|
||||
highIndex = ownIndex;
|
||||
}
|
||||
if (ownIndex < iVar2) {
|
||||
iVar2 = ownIndex;
|
||||
}
|
||||
pairIndex = highIndex * pairStride + iVar2;
|
||||
if ((this_00 != entity) && (GHIDRA_INT(pairIndex) < *GHIDRA_CAST<int *>((iVar1 + 0xd0)))) {
|
||||
pairWord = pairIndex >> 5;
|
||||
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((iVar1 + 0xc4)) + pairWord * 4)) &
|
||||
1 << (sbyte)(pairIndex & 0x1f)) == 0) {
|
||||
if (((((this_00->_sizeMulti).x == g_vectorOne.x) &&
|
||||
((this_00->_sizeMulti).y == g_vectorOne.y)) &&
|
||||
((entity->_sizeMulti).x == g_vectorOne.x)) &&
|
||||
((entity->_sizeMulti).y == g_vectorOne.y)) {
|
||||
(GHIDRA_CAST<Entity *>((this_00)))->Entity::push_apart_circle(entity);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity *>((this_00)))->Entity::push_apart_capsule(entity);
|
||||
}
|
||||
_DAT_00c71650 = _DAT_00c71650 + 1;
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((iVar1 + 0xc4)) + pairWord * 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((iVar1 + 0xc4)) + pairWord * 4)) |
|
||||
1 << (pairIndex & 0x1f);
|
||||
}
|
||||
}
|
||||
slot = slot + 1;
|
||||
} while (slot < *GHIDRA_CAST<uint32_t *>((iVar3 + 0xa0)));
|
||||
}
|
||||
}
|
||||
cellSize = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14));
|
||||
column = column + 1;
|
||||
} while (column <= GHIDRA_INT((right / cellSize)));
|
||||
}
|
||||
row = row + 1;
|
||||
} while (row <= GHIDRA_INT((bottom / cellSize)));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 0041c070
|
||||
void CellSpace::collide(void *entityB)
|
||||
{
|
||||
void *entityA = this;
|
||||
int iVar1;
|
||||
int owner;
|
||||
int pairStride;
|
||||
uint32_t pairIndex;
|
||||
uint32_t otherSlot;
|
||||
uint32_t *entitySlot;
|
||||
uint32_t slot;
|
||||
uint32_t cellIndex;
|
||||
int cellOffset;
|
||||
uint32_t *cellEntityCount;
|
||||
Entity *entityA;
|
||||
Entity *entityB;
|
||||
int maxIndex;
|
||||
int owner;
|
||||
uint32_t pairBits;
|
||||
int pairStride;
|
||||
|
||||
owner = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityA) + 0x1c));
|
||||
if ((owner - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityA) + 0x18))) / 0xa4 !=
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityB) + 0x1c)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityB) + 0x18))) / 0xa4) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("CellSpace::collide - cell counts don\'t match!\n"));
|
||||
owner = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityA) + 0x1c));
|
||||
}
|
||||
owner = *GHIDRA_CAST<int *>(entityA);
|
||||
pairStride = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityA) + 0x18));
|
||||
cellIndex = 0;
|
||||
pairStride = *GHIDRA_CAST<int *>((owner + 0xd4));
|
||||
iVar1 = owner - pairStride >> 0x1f;
|
||||
if ((owner - pairStride) / 0xa4 + iVar1 != iVar1) {
|
||||
cellOffset = 0;
|
||||
do {
|
||||
entitySlot = GHIDRA_CAST<uint32_t *>((cellOffset + pairStride));
|
||||
slot = 0;
|
||||
owner = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityB) + 0x18)) + cellOffset;
|
||||
cellEntityCount = entitySlot + 0x28;
|
||||
if (*cellEntityCount != 0) {
|
||||
do {
|
||||
otherSlot = 0;
|
||||
if (*GHIDRA_CAST<int *>((owner + 0xa0)) != 0) {
|
||||
do {
|
||||
entityA = GHIDRA_CAST<Entity *>(*entitySlot);
|
||||
entityB = *GHIDRA_CAST<Entity **>((owner + otherSlot * 4));
|
||||
pairStride = entityA->_collisionIndex;
|
||||
iVar1 = entityB->_collisionIndex;
|
||||
maxIndex = pairStride;
|
||||
if (pairStride < iVar1) {
|
||||
maxIndex = iVar1;
|
||||
}
|
||||
if (iVar1 < pairStride) {
|
||||
pairStride = iVar1;
|
||||
}
|
||||
pairIndex = maxIndex * pairStride + pairStride;
|
||||
if ((entityA != entityB) && (GHIDRA_INT(pairIndex) < *GHIDRA_CAST<int *>((owner + 0xd0)))) {
|
||||
pairBits = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((owner + 0xc4)) + (pairIndex >> 5) * 4));
|
||||
if ((pairBits & 1 << (sbyte)(pairIndex & 0x1f)) == 0) {
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((owner + 0xc4)) + (pairIndex >> 5) * 4)) =
|
||||
pairBits | 1 << (pairIndex & 0x1f);
|
||||
if (((((entityA->_sizeMulti).x == g_vectorOne.x) &&
|
||||
((entityA->_sizeMulti).y == g_vectorOne.y)) &&
|
||||
((entityB->_sizeMulti).x == g_vectorOne.x)) &&
|
||||
((entityB->_sizeMulti).y == g_vectorOne.y)) {
|
||||
(GHIDRA_CAST<Entity *>((entityA)))->Entity::push_apart_circle(entityB);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity *>((entityA)))->Entity::push_apart_capsule(entityB);
|
||||
}
|
||||
_DAT_00c71650 = _DAT_00c71650 + 1;
|
||||
}
|
||||
}
|
||||
otherSlot = otherSlot + 1;
|
||||
} while (otherSlot < *GHIDRA_CAST<uint32_t *>((owner + 0xa0)));
|
||||
}
|
||||
slot = slot + 1;
|
||||
entitySlot = entitySlot + 1;
|
||||
} while (slot < *cellEntityCount);
|
||||
}
|
||||
cellIndex = cellIndex + 1;
|
||||
cellOffset = cellOffset + 0xa4;
|
||||
pairStride = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityA) + 0x18));
|
||||
} while (cellIndex < GHIDRA_UINT(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityA) + 0x1c)) - pairStride) / 0xa4)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 0041c2a0
|
||||
void CellSpace::collide_self()
|
||||
{
|
||||
void *first = this;
|
||||
uint32_t *puVar1;
|
||||
Entity *other;
|
||||
int owner;
|
||||
uint32_t uVar3;
|
||||
uint32_t j;
|
||||
int iVar4;
|
||||
bool bVar5;
|
||||
uint32_t *firstSlot;
|
||||
int cellOffset;
|
||||
uint32_t i;
|
||||
uint32_t cellIndex;
|
||||
Entity *first;
|
||||
int highIndex;
|
||||
int owner;
|
||||
int pairStride;
|
||||
uint32_t pairWord;
|
||||
|
||||
cellIndex = 0;
|
||||
owner = *GHIDRA_CAST<int *>(first);
|
||||
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(first) + 0x18));
|
||||
highIndex = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(first) + 0x1c)) - iVar4;
|
||||
pairStride = *GHIDRA_CAST<int *>((owner + 0xd4));
|
||||
owner = highIndex >> 0x1f;
|
||||
if (highIndex / 0xa4 + owner != owner) {
|
||||
cellOffset = 0;
|
||||
do {
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>((cellOffset + 0xa0 + iVar4));
|
||||
puVar1 = GHIDRA_CAST<uint32_t *>((cellOffset + iVar4));
|
||||
if (uVar3 != 0) {
|
||||
i = 1;
|
||||
firstSlot = puVar1;
|
||||
do {
|
||||
j = i;
|
||||
if (i < uVar3) {
|
||||
do {
|
||||
other = GHIDRA_CAST<Entity *>(puVar1[j]);
|
||||
first = GHIDRA_CAST<Entity *>(*firstSlot);
|
||||
iVar4 = other->_collisionIndex;
|
||||
owner = first->_collisionIndex;
|
||||
highIndex = owner;
|
||||
if (owner < iVar4) {
|
||||
highIndex = iVar4;
|
||||
}
|
||||
if (iVar4 < owner) {
|
||||
owner = iVar4;
|
||||
}
|
||||
uVar3 = highIndex * pairStride + owner;
|
||||
if ((first != other) && (GHIDRA_INT(uVar3) < *GHIDRA_CAST<int *>((owner + 0xd0)))) {
|
||||
pairWord = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((owner + 0xc4)) + (uVar3 >> 5) * 4));
|
||||
if ((pairWord & 1 << (sbyte)(uVar3 & 0x1f)) == 0) {
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((owner + 0xc4)) + (uVar3 >> 5) * 4)) =
|
||||
pairWord | 1 << (uVar3 & 0x1f);
|
||||
if (((((first->_sizeMulti).x == g_vectorOne.x) &&
|
||||
((first->_sizeMulti).y == g_vectorOne.y)) &&
|
||||
((other->_sizeMulti).x == g_vectorOne.x)) &&
|
||||
((other->_sizeMulti).y == g_vectorOne.y)) {
|
||||
(GHIDRA_CAST<Entity *>((first)))->Entity::push_apart_circle(other);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity *>((first)))->Entity::push_apart_capsule(other);
|
||||
}
|
||||
_DAT_00c71650 = _DAT_00c71650 + 1;
|
||||
}
|
||||
}
|
||||
j = j + 1;
|
||||
uVar3 = puVar1[0x28];
|
||||
} while (j < uVar3);
|
||||
}
|
||||
firstSlot = firstSlot + 1;
|
||||
bVar5 = i < uVar3;
|
||||
i = i + 1;
|
||||
} while (bVar5);
|
||||
}
|
||||
cellOffset = cellOffset + 0xa4;
|
||||
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(first) + 0x18));
|
||||
cellIndex = cellIndex + 1;
|
||||
} while (cellIndex < GHIDRA_UINT(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(first) + 0x1c)) - iVar4) / 0xa4)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
+243
-3789
File diff suppressed because it is too large.
Load diff
@@ -121,11 +121,11 @@ uint8_t DeathmatchTypeBase::Init()
|
||||
camera = *GHIDRA_CAST<Camera **>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f8));
|
||||
lobbyMembersBytes = (g_manager->_optionsConfig)._cameraStyle;
|
||||
if ((lobbyMembersBytes == 1) || (lobbyMembersBytes != 2)) {
|
||||
(GHIDRA_CAST<Camera *>((camera)))->Camera::update_focus_position(0);
|
||||
Camera::update_focus_position(camera,0);
|
||||
camera->_shouldOverride = 0;
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Camera *>((camera)))->Camera::update_follow();
|
||||
Camera::update_follow(camera);
|
||||
}
|
||||
uVar5 = 1;
|
||||
HUD::mark_all_slots_dirty(&g_game->_hud,1,1);
|
||||
@@ -193,7 +193,7 @@ void DeathmatchTypeBase::Update()
|
||||
if (iVar5 % 0x1e == 0) {
|
||||
iVar5 = GHIDRA_INT(((uint64_t)((int64_t)iVar5 * 0x77777777) >> 0x20)) - iVar5;
|
||||
uVar2 = Random();
|
||||
tilePos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetRandomPosition(&flyBombPos,0.0);
|
||||
tilePos = Room::GetRandomPosition(g_game->_room,&flyBombPos,0.0);
|
||||
Game::SpawnEx(g_game,0x333,0,tilePos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar2,0);
|
||||
uVar2 = (iVar5 >> 4) - (iVar5 >> 0x1f) & 0x80000003;
|
||||
if (GHIDRA_INT(uVar2) < 0) {
|
||||
@@ -205,8 +205,8 @@ void DeathmatchTypeBase::Update()
|
||||
do {
|
||||
room = game->_room;
|
||||
local_20 = GHIDRA_CAST<GridEntity *>((GHIDRA_INT(&local_20[-1]._sprite._bitflags) + 3));
|
||||
tilePos = (GHIDRA_CAST<Room *>((room)))->Room::GetRandomPosition(&randomTilePos,0.0);
|
||||
tilePos = (GHIDRA_CAST<Room *>((room)))->Room::FindFreeTilePosition(&freeTilePos,tilePos,0.0);
|
||||
tilePos = Room::GetRandomPosition(room,&randomTilePos,0.0);
|
||||
tilePos = Room::FindFreeTilePosition(room,&freeTilePos,tilePos,0.0);
|
||||
uVar2 = 0;
|
||||
playerManager = &g_game->_playerManager;
|
||||
fVar6 = tilePos->x;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,66 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 006a7f30
|
||||
void Entity_Dummy::Update()
|
||||
{
|
||||
Entity *in_ECX;
|
||||
|
||||
(GHIDRA_CAST<Entity *>((in_ECX)))->Entity::Update();
|
||||
(in_ECX->_velocity).x = (in_ECX->_velocity).x * 0.965;
|
||||
(in_ECX->_velocity).y = (in_ECX->_velocity).y * 0.965;
|
||||
if (in_ECX->_dead == 0) {
|
||||
return;
|
||||
}
|
||||
/* WARNING: Could not recover jumptable at 0x006a7f76. Too many branches */
|
||||
/* WARNING: Treating indirect jump as call */
|
||||
in_ECX->Remove();
|
||||
return;
|
||||
}
|
||||
|
||||
// 006a7f80
|
||||
void Entity_Dummy::Render(Vector *offset)
|
||||
{
|
||||
Manager *pMVar1;
|
||||
int iVar2;
|
||||
KColor textColor;
|
||||
uint32_t fontSettings;
|
||||
uint32_t local_12c;
|
||||
uint32_t local_128;
|
||||
uint32_t local_124;
|
||||
uint32_t local_120;
|
||||
uint32_t local_11c;
|
||||
uint32_t local_118;
|
||||
uint8_t text [256];
|
||||
uint32_t local_14;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00afa330;
|
||||
local_10 = ExceptionList;
|
||||
local_14 = __security_cookie ^ GHIDRA_UINT((text + 0x110));
|
||||
ExceptionList = &local_10;
|
||||
this->Entity::Render(offset);
|
||||
sprintf_s(text,0x100,GHIDRA_CAST<uint8_t *>("e%d.%d"));
|
||||
pMVar1 = g_manager;
|
||||
iVar2 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,text,-1);
|
||||
fontSettings = 0;
|
||||
local_12c = 0xffff;
|
||||
local_128 = 0;
|
||||
local_124 = 0x3f800000;
|
||||
local_120 = 0xffffffff;
|
||||
local_11c = 0;
|
||||
local_118 = 0;
|
||||
local_8 = 0;
|
||||
textColor._red = 1.0;
|
||||
textColor._green = 1.0;
|
||||
textColor._blue = 1.0;
|
||||
textColor._alpha = 1.0;
|
||||
textColor._unk = 0;
|
||||
Font::DrawString(&pMVar1->_font2_TeamMeatEx12,text,&textColor,&fontSettings,
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1a4)) - (float)iVar2 * 0.5,
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1a8)) - 8.0);
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,41 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 0060c620
|
||||
void Entity_Effect::ExtraDataRef::Set(void *extraData)
|
||||
{
|
||||
void *refCount = this;
|
||||
char isLastRef;
|
||||
uint32_t uVar1;
|
||||
ReferenceCountBase *refCount;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af6694;
|
||||
local_10 = ExceptionList;
|
||||
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
||||
ExceptionList = &local_10;
|
||||
refCount = operator_new(0x18);
|
||||
local_8 = 0;
|
||||
if (refCount == GHIDRA_CAST<ReferenceCountBase *>(0x0)) {
|
||||
refCount = GHIDRA_CAST<ReferenceCountBase *>(0x0);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<ReferenceCountBase *>((refCount)))->ReferenceCountBase::ReferenceCountBase();
|
||||
*GHIDRA_CAST<uint8_t ***>(refCount) =
|
||||
ReferenceCount<IsaacRepentancePlus::Entity_Effect::ExtraData>::vftable;
|
||||
*(void **)(refCount + 0x14) = extraData;
|
||||
}
|
||||
local_8 = 0xffffffff;
|
||||
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(refCount) + 4)) != GHIDRA_CAST<int *>(0x0)) {
|
||||
isLastRef = (**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(refCount) + 4)) + 0xc))(uVar1);
|
||||
if ((isLastRef != '\0') && (DAT_00c7e854 != (code *)0x0)) {
|
||||
(*DAT_00c7e854)(refCount);
|
||||
}
|
||||
}
|
||||
*GHIDRA_CAST<ReferenceCountBase **>((GHIDRA_CAST<char *>(refCount) + 4)) = refCount;
|
||||
*(void **)refCount = extraData;
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,65 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00417510
|
||||
void EntityList_EL::constructor(EntityList_EL *source)
|
||||
{
|
||||
*GHIDRA_CAST<uint8_t *>(this) = 1;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((source)) + 0x4))));
|
||||
this->_capacity = source->_capacity;
|
||||
this->_size = source->_size;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00417630
|
||||
void EntityList_EL::push_back(Entity *entity)
|
||||
{
|
||||
int count;
|
||||
|
||||
count = this->_size;
|
||||
if (GHIDRA_UINT(this->_capacity) < count + 1U) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
||||
count = this->_size;
|
||||
}
|
||||
*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + count * 4)) = entity;
|
||||
this->_size = this->_size + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00417670
|
||||
void EntityList_EL::remove(Entity *entity)
|
||||
{
|
||||
uint32_t shiftIndex;
|
||||
uint32_t size;
|
||||
uint32_t uVar1;
|
||||
uint32_t *slotPtr;
|
||||
|
||||
uVar1 = 0;
|
||||
size = this->_size;
|
||||
if (size != 0) {
|
||||
do {
|
||||
if (*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + uVar1 * 4)) == entity) {
|
||||
while ((uVar1 < size && (*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + uVar1 * 4)) == entity))) {
|
||||
if (size <= uVar1) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: invalid index for remove\n"));
|
||||
size = this->_size;
|
||||
}
|
||||
shiftIndex = uVar1;
|
||||
if (uVar1 < size - 1) {
|
||||
do {
|
||||
slotPtr = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + shiftIndex * 4));
|
||||
shiftIndex = shiftIndex + 1;
|
||||
*slotPtr = slotPtr[1];
|
||||
size = this->_size;
|
||||
} while (shiftIndex < size - 1);
|
||||
}
|
||||
size = size - 1;
|
||||
this->_size = size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uVar1 = uVar1 + 1;
|
||||
}
|
||||
} while (uVar1 < size);
|
||||
}
|
||||
return;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,90 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 0041c490
|
||||
void EntityPartition::query_box(EntityList_EL *outList, Vector *position, Vector *extent)
|
||||
{
|
||||
float *pfVar1;
|
||||
int iVar2;
|
||||
float *pfVar3;
|
||||
void *isSeen;
|
||||
int resultSize;
|
||||
uint64_t *allocatedBytes;
|
||||
int iVar4;
|
||||
int iVar5;
|
||||
int iVar6;
|
||||
uint32_t uVar7;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t uStack_8;
|
||||
float cellSize;
|
||||
int column;
|
||||
int entityIndex;
|
||||
float extentX;
|
||||
uint64_t oldAllocated;
|
||||
float posXCopy;
|
||||
|
||||
uStack_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af1690;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
if (*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0xd4)) != 0) {
|
||||
isSeen = operator_new_tracked(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0xd4)));
|
||||
memset(isSeen,0,*GHIDRA_CAST<size_t *>((*GHIDRA_CAST<int *>(this) + 0xd4)));
|
||||
extentX = extent->x;
|
||||
pfVar3 = &position->x;
|
||||
pfVar1 = &position->y;
|
||||
cellSize = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14));
|
||||
posXCopy = position->x;
|
||||
position = GHIDRA_CAST<Vector *>(GHIDRA_INT(((position->y - extent->y) / cellSize)));
|
||||
iVar5 = GHIDRA_INT(((extent->y + *pfVar1) / cellSize));
|
||||
iVar6 = GHIDRA_INT(((*pfVar3 - extentX) / cellSize));
|
||||
if (GHIDRA_INT(position) <= iVar5) {
|
||||
column = iVar6;
|
||||
do {
|
||||
for (; column <= GHIDRA_INT(((extentX + posXCopy) / cellSize)); column = column + 1) {
|
||||
iVar4 = column + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) * GHIDRA_INT(position);
|
||||
if ((-1 < iVar4) &&
|
||||
(iVar4 < (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1c)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18))) / 0xa4)) {
|
||||
uVar7 = 0;
|
||||
iVar4 = iVar4 * 0xa4 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18));
|
||||
if (*GHIDRA_CAST<int *>((iVar4 + 0xa0)) != 0) {
|
||||
do {
|
||||
iVar2 = *GHIDRA_CAST<int *>((iVar4 + uVar7 * 4));
|
||||
entityIndex = *GHIDRA_CAST<int *>((iVar2 + 0x24));
|
||||
if (*GHIDRA_CAST<char *>((entityIndex + GHIDRA_INT(isSeen))) == '\0') {
|
||||
resultSize = outList->_size;
|
||||
if (GHIDRA_UINT(outList->_capacity) < resultSize + 1U) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
||||
resultSize = outList->_size;
|
||||
}
|
||||
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((outList)) + 0x4)))) + resultSize * 4)) = iVar2;
|
||||
outList->_size = outList->_size + 1;
|
||||
*GHIDRA_CAST<uint8_t *>((entityIndex + GHIDRA_INT(isSeen))) = 1;
|
||||
}
|
||||
uVar7 = uVar7 + 1;
|
||||
} while (uVar7 < *GHIDRA_CAST<uint32_t *>((iVar4 + 0xa0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
position = GHIDRA_CAST<Vector *>((GHIDRA_INT(&position->x) + 1));
|
||||
column = iVar6;
|
||||
} while (GHIDRA_INT(position) <= iVar5);
|
||||
}
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
if (isSeen != (void *)0x0) {
|
||||
uVar7 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(isSeen) + -4));
|
||||
oldAllocated = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar7;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar7));
|
||||
free((void *)(GHIDRA_INT(isSeen) + -4));
|
||||
}
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,68 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 0040c3a0
|
||||
uint32_t EntityPtr::Ref()
|
||||
{
|
||||
uint32_t *in_ECX;
|
||||
|
||||
return *in_ECX;
|
||||
}
|
||||
|
||||
// 004cf1d0
|
||||
void EntityPtr::Set(Entity *entity)
|
||||
{
|
||||
Entity *newEntity;
|
||||
|
||||
newEntity = entity;
|
||||
if (*GHIDRA_CAST<Entity **>(this) != entity) {
|
||||
if (*GHIDRA_CAST<Entity **>(this) != GHIDRA_CAST<Entity *>(0x0)) {
|
||||
entity = GHIDRA_CAST<Entity *>(this);
|
||||
msvc::multiset<unsigned_int>::erase(&entity);
|
||||
}
|
||||
*GHIDRA_CAST<Entity **>(this) = newEntity;
|
||||
if (newEntity != GHIDRA_CAST<Entity *>(0x0)) {
|
||||
msvc::multiset<unsigned_int>::insert(this);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 006b5b50
|
||||
void EntityPtr::SetReference(EntityPtr *ptr, Entity *entity)
|
||||
{
|
||||
EntityPtr *local_8;
|
||||
|
||||
local_8 = ptr;
|
||||
if (*GHIDRA_CAST<int *>(ptr) != 0) {
|
||||
msvc::multiset<unsigned_int>::erase(&local_8);
|
||||
}
|
||||
*GHIDRA_CAST<Entity **>(ptr) = entity;
|
||||
if (entity != GHIDRA_CAST<Entity *>(0x0)) {
|
||||
msvc::multiset<unsigned_int>::insert(ptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00872050
|
||||
void EntityPtr::SetReference(Entity *entity)
|
||||
{
|
||||
EntityPtr *selfKey;
|
||||
|
||||
if (*GHIDRA_CAST<int *>(this) != 0) {
|
||||
selfKey = this;
|
||||
msvc::multiset<unsigned_int>::erase(&selfKey);
|
||||
}
|
||||
*GHIDRA_CAST<Entity **>(this) = entity;
|
||||
if (entity != GHIDRA_CAST<Entity *>(0x0)) {
|
||||
msvc::multiset<unsigned_int>::insert(this);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00a0fe80
|
||||
EntityPtr * EntityPtr::clear()
|
||||
{
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) = 0;
|
||||
*GHIDRA_CAST<uint32_t *>(this) = 0;
|
||||
return this;
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00431310
|
||||
void EntityRef::constructor(Entity *entity)
|
||||
{
|
||||
float copyX;
|
||||
uint32_t weaknessBit;
|
||||
float copyY;
|
||||
uint32_t friendlyBit;
|
||||
uint32_t charmedBit;
|
||||
|
||||
if (entity == GHIDRA_CAST<Entity *>(0x0)) {
|
||||
this->_type = 0;
|
||||
this->_variant = 0;
|
||||
this->_spawnerType = 0;
|
||||
this->_spawnerVariant = 0;
|
||||
copyX = g_vectorZero.x;
|
||||
copyY = g_vectorZero.y;
|
||||
}
|
||||
else {
|
||||
this->_type = entity->_type;
|
||||
this->_variant = entity->_variant;
|
||||
this->_spawnerType = entity->_spawnerType;
|
||||
this->_spawnerVariant = entity->_spawnerVariant;
|
||||
copyX = (entity->_pos).x;
|
||||
copyY = (entity->_pos).y;
|
||||
}
|
||||
(this->_position).x = copyX;
|
||||
(this->_position).y = copyY;
|
||||
if (entity == GHIDRA_CAST<Entity *>(0x0)) {
|
||||
copyX = g_vectorZero.x;
|
||||
copyY = g_vectorZero.y;
|
||||
}
|
||||
else {
|
||||
copyX = (entity->_velocity).x;
|
||||
copyY = (entity->_velocity).y;
|
||||
}
|
||||
(this->_velocity).x = copyX;
|
||||
(this->_velocity).y = copyY;
|
||||
if ((entity == GHIDRA_CAST<Entity *>(0x0)) || ((entity->_flags & 0x100) == 0)) {
|
||||
charmedBit = 0;
|
||||
if (entity != GHIDRA_CAST<Entity *>(0x0)) goto LAB_004313dc;
|
||||
charmedBit = 0;
|
||||
LAB_004313f5:
|
||||
friendlyBit = 0;
|
||||
if (entity != GHIDRA_CAST<Entity *>(0x0)) goto LAB_004313fb;
|
||||
}
|
||||
else {
|
||||
charmedBit = 1;
|
||||
LAB_004313dc:
|
||||
if ((entity->_flags & 0x20000000) == 0) goto LAB_004313f5;
|
||||
friendlyBit = 2;
|
||||
LAB_004313fb:
|
||||
if ((entity->_flags & 0x40000000000000) != 0) {
|
||||
weaknessBit = 4;
|
||||
goto LAB_00431416;
|
||||
}
|
||||
}
|
||||
weaknessBit = 0;
|
||||
LAB_00431416:
|
||||
this->_entity = entity;
|
||||
this->_flags = weaknessBit | friendlyBit | charmedBit;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00435c70
|
||||
EntityRef::EntityRef()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
// 00499960
|
||||
EntityRef * EntityRef::operator_(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;
|
||||
}
|
||||
|
||||
// 004a2910
|
||||
uint32_t EntityRef::IsFriendly()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->_flags) >> 9),(char)(GHIDRA_UINT(this->_flags) >> 1)) & 0xffffff01;
|
||||
}
|
||||
|
||||
// 004bc670
|
||||
uint8_t EntityRef::IsCharmed()
|
||||
{
|
||||
return (uint8_t)this->_flags & 1;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,191 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 005ccd80
|
||||
void Entity_Text::Update()
|
||||
{
|
||||
int iVar1;
|
||||
uint32_t timer;
|
||||
uint32_t uVar2;
|
||||
float fVar3;
|
||||
float velY;
|
||||
Game *game;
|
||||
|
||||
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c));
|
||||
if (iVar1 == 0) {
|
||||
fVar3 = 1.0 - (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410)) / (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414));
|
||||
fVar3 = fVar3 * fVar3;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x524)) = fVar3;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x34c)) = 0;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) = (1.0 - fVar3) * -50.0;
|
||||
}
|
||||
else if (iVar1 == 1) {
|
||||
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410));
|
||||
if (iVar1 == 0) {
|
||||
sprintf_s(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(this) + 0x418)),0x100,&DAT_00b62fe0);
|
||||
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410));
|
||||
}
|
||||
game = g_game;
|
||||
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) - iVar1;
|
||||
if (10 < iVar1) {
|
||||
iVar1 = 10;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x524)) = (float)iVar1 / 10.0;
|
||||
fVar3 = sin((float)(game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x328))) * 0.2);
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 0x20)) & 1) == 0) {
|
||||
fVar3 = fVar3 * 15.0;
|
||||
}
|
||||
else {
|
||||
fVar3 = fVar3 * -15.0;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34c)) = fVar3;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0;
|
||||
}
|
||||
else if (iVar1 == 2) {
|
||||
timer = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x410));
|
||||
if (timer == 0) {
|
||||
sprintf_s(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(this) + 0x418)),0x100,s__d);
|
||||
timer = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x410));
|
||||
}
|
||||
uVar2 = 0x3f800000;
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) + -0xf <= GHIDRA_INT(timer)) && ((timer & 1) != 0)) {
|
||||
uVar2 = 0;
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x518)) = 0x3f800000;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x51c)) = 0x3f800000;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x520)) = 0x3f800000;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x524)) = uVar2;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x528)) = 0;
|
||||
}
|
||||
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x360));
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410)) + 1;
|
||||
velY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x364));
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x36c)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x368));
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x360)) = fVar3;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x364)) = velY;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c)) = fVar3 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c));
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) = velY + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340));
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410))) {
|
||||
this->Remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 005ccfc0
|
||||
void Entity_Text::Render(Vector *offset)
|
||||
{
|
||||
void *font = this;
|
||||
uint8_t *str;
|
||||
Vector pos;
|
||||
Vector scale;
|
||||
uint8_t isPaused;
|
||||
uint32_t flickerPhase;
|
||||
Font *font;
|
||||
float fVar1;
|
||||
double dVar2;
|
||||
uint32_t fontSettings;
|
||||
uint32_t local_3c;
|
||||
uint32_t local_38;
|
||||
uint32_t local_34;
|
||||
uint32_t local_30;
|
||||
uint32_t local_2c;
|
||||
uint32_t local_28;
|
||||
float screenY;
|
||||
float worldY;
|
||||
int textWidth;
|
||||
float pixelScale;
|
||||
float screenX;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af5fe5;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(font) + 0x172)) != '\0') {
|
||||
str = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(font) + 0x418));
|
||||
font = &g_manager->_font6_PFTempestaSevenCondensed;
|
||||
textWidth = Font::get_string_width_n(font,str,-1);
|
||||
worldY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x340)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x350));
|
||||
screenY = (g_screenHeight - 182.0) * 0.5;
|
||||
pixelScale = g_displayPixelRatio * g_screenPointScale;
|
||||
screenX = (((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x34c)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x33c))) - 60.0) * 0.65 +
|
||||
(g_screenWidth - 338.0) * 0.5) * pixelScale + 0.5;
|
||||
dVar2 = floor((double)screenX);
|
||||
screenX = (float)dVar2 / pixelScale;
|
||||
screenY = ((worldY - 140.0) * 0.65 + screenY) * pixelScale + 0.5;
|
||||
dVar2 = floor((double)screenY);
|
||||
screenY = (float)dVar2;
|
||||
screenX = screenX + offset->x;
|
||||
fVar1 = offset->y;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a4)) = screenX;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a8)) = screenY / pixelScale + fVar1;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(font) + 0x2c)) == 2) {
|
||||
isPaused = Game::IsPaused(g_game);
|
||||
if (isPaused == 0) {
|
||||
flickerPhase = g_manager->_framecount + 1U & 0x80000001;
|
||||
if (GHIDRA_INT(flickerPhase) < 0) {
|
||||
flickerPhase = (flickerPhase - 1 | 0xfffffffe) + 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
flickerPhase = 0;
|
||||
}
|
||||
fontSettings = 0;
|
||||
local_3c = 0xffff;
|
||||
local_38 = 0;
|
||||
local_34 = 0x3f800000;
|
||||
local_30 = 0xffffffff;
|
||||
local_2c = 0;
|
||||
local_28 = 0;
|
||||
fVar1 = ((float)GHIDRA_INT((flickerPhase + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(font) + 0x410)) * 2)) * 0.5 - 0.0) * 0.25;
|
||||
if (fVar1 <= 0.0) {
|
||||
fVar1 = 0.0;
|
||||
}
|
||||
if (1.0 <= fVar1) {
|
||||
fVar1 = 1.0;
|
||||
}
|
||||
fVar1 = 4.0 - fVar1 * 2.5;
|
||||
local_8 = 0;
|
||||
pos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a8)) - fVar1 * 4.0;
|
||||
pos.x = screenX - (float)textWidth * 0.5 * fVar1;
|
||||
scale.y = fVar1;
|
||||
scale.x = fVar1;
|
||||
Font::DrawString(font,str,pos,scale,GHIDRA_CAST<KColor *>((GHIDRA_INT(font) + 0x518)),
|
||||
GHIDRA_CAST<FontSettings *>(&fontSettings));
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
fontSettings = 0;
|
||||
local_3c = 0xffff;
|
||||
local_38 = 0;
|
||||
local_34 = 0x3f800000;
|
||||
local_30 = 0xffffffff;
|
||||
local_2c = 0;
|
||||
local_28 = 0;
|
||||
local_8 = 1;
|
||||
Font::DrawString(font,str,GHIDRA_CAST<KColor *>((GHIDRA_INT(font) + 0x518)),&fontSettings,
|
||||
screenX - (float)textWidth * 0.5,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a8)));
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
|
||||
// 005cd2e0
|
||||
void Entity_Text::Interpolate()
|
||||
{
|
||||
float wobble;
|
||||
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) {
|
||||
wobble = sin(((float)(g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x328))) + 0.5) * 0.2);
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0;
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 0x20)) & 1) == 0) {
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34c)) = wobble * 15.0;
|
||||
this->Entity::Interpolate();
|
||||
return;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34c)) = wobble * -15.0;
|
||||
}
|
||||
this->Entity::Interpolate();
|
||||
return;
|
||||
}
|
||||
@@ -256,7 +256,7 @@ void GridEntity::trigger_output(GridEntity *gridEntity)
|
||||
}
|
||||
else if (iVar1 == 2) {
|
||||
if ((gridEntity->_varData != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xc)))) == 1)) {
|
||||
source = (GHIDRA_CAST<EntityRef *>((&destroySource)))->EntityRef::EntityRef();
|
||||
source = EntityRef::EntityRef(&destroySource);
|
||||
gridEntity->Destroy(1,source);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ void GridEntity_Decoration::Update()
|
||||
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetTexel(&texelR,sampleX,sampleY,decoRenderX,decoRenderY,0x3c23d70a,
|
||||
0xffffffff);
|
||||
if (0.0 < texelA) {
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_footstep_triggered(-1);
|
||||
Entity_Player::is_footstep_triggered(player,-1);
|
||||
if (player->_canFly == 0) {
|
||||
isSecondFoot = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_footstep_triggered(0);
|
||||
isSecondFoot = Entity_Player::is_footstep_triggered(player,0);
|
||||
if (isSecondFoot == 0) {
|
||||
(player->_footprintColor1)._offset[0] = texelR;
|
||||
(player->_footprintColor1)._offset[1] = texelG;
|
||||
|
||||
@@ -325,7 +325,7 @@ LAB_0070c9b8:
|
||||
local_88._colorize[3] = g_vectorZero.y;
|
||||
local_88._offset[0] = 0.0;
|
||||
local_88._offset[1] = 0.0;
|
||||
player->TakeDamage(0x3f800000,0x10010000,0,&local_88);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(player) + 0x20))(0x3f800000,0x10010000,0,&local_88);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2036,7 +2036,7 @@ LAB_0070f79f:
|
||||
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5)) &&
|
||||
(padlockOwner = PlayerManager::FirstTrinketOwner(&game->_playerManager,0x88),
|
||||
padlockOwner != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
||||
doorVariant = (GHIDRA_CAST<Entity_Player *>((padlockOwner)))->Entity_Player::GetTrinketMultiplier(0x88);
|
||||
doorVariant = Entity_Player::GetTrinketMultiplier(padlockOwner,0x88);
|
||||
if (doorVariant == 2) {
|
||||
if ((this->_doorFlags & 9) != 0) {
|
||||
return 1;
|
||||
@@ -2185,11 +2185,11 @@ uint8_t GridEntity_Door::TryBlowOpen(uint8_t isFromExplosion, Entity *source)
|
||||
if (source == GHIDRA_CAST<Entity *>(0x0)) {
|
||||
return 1;
|
||||
}
|
||||
player = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((source)))->Entity)::GetPlayerAncestor();
|
||||
player = GHIDRA_CAST<Entity_Player *>(Entity)::GetPlayerAncestor(source);
|
||||
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
return 1;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::DonateLuck(-7);
|
||||
Entity_Player::DonateLuck(player,-7);
|
||||
return 1;
|
||||
}
|
||||
iVar5 = get_secret_exit_kind(this);
|
||||
@@ -2284,7 +2284,7 @@ LAB_0070ffae:
|
||||
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5)) &&
|
||||
(player = PlayerManager::FirstTrinketOwner(&g_game->_playerManager,0x88),
|
||||
player != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
||||
iVar5 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x88);
|
||||
iVar5 = Entity_Player::GetTrinketMultiplier(player,0x88);
|
||||
if (iVar5 == 2) {
|
||||
if ((this->_doorFlags & 9) != 0) goto LAB_00710063;
|
||||
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
||||
@@ -2439,7 +2439,7 @@ uint8_t GridEntity_Door::TryUnlock(Entity_Player *player, uint8_t isForce)
|
||||
return 0;
|
||||
}
|
||||
if (local_64 != 0.0) {
|
||||
(GHIDRA_CAST<Entity_Player *>((trinketHolder)))->Entity_Player::TryRemoveTrinket(GHIDRA_UINT(local_64));
|
||||
Entity_Player::TryRemoveTrinket(trinketHolder,GHIDRA_UINT(local_64));
|
||||
}
|
||||
manager = g_manager;
|
||||
local_60 = 8;
|
||||
@@ -2489,12 +2489,12 @@ LAB_007106c5:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
iVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetHealthType();
|
||||
if ((iVar2 != 2) && (bVar1 = (GHIDRA_CAST<Entity_Player *>((trinketHolder)))->Entity_Player::HasInstantDeathCurse(), bVar1 == 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) {
|
||||
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(&local_34))))->EntityRef::EntityRef();
|
||||
EntityRef::EntityRef(GHIDRA_CAST<EntityRef *>(&local_34));
|
||||
takeDamage = *(code **)(*GHIDRA_CAST<int *>(player) + 0x20);
|
||||
local_34._tint[0] = 0.0;
|
||||
local_34._tint[1] = 1.40172e-41;
|
||||
@@ -2539,13 +2539,13 @@ LAB_007106c5:
|
||||
VStack_3c.y = particleVelocity.y * 0.2;
|
||||
particle = Game::SpawnEx(g_game,1000,5,&particlePos,&VStack_3c,GHIDRA_CAST<Entity *>(0x0),0,
|
||||
in_stack_ffffff80,0);
|
||||
particle->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(particle) + 0xc))();
|
||||
local_60 = uVar5;
|
||||
}
|
||||
else {
|
||||
particle = Game::SpawnEx(g_game,1000,5,&particlePos,&particleVelocity,GHIDRA_CAST<Entity *>(0x0),
|
||||
99,in_stack_ffffff80,0);
|
||||
particle->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(particle) + 0xc))();
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(particle[1])) + 0x4)))) = 0xc1000000;
|
||||
}
|
||||
local_60 = local_60 + 1;
|
||||
@@ -2577,7 +2577,7 @@ LAB_007109b9:
|
||||
bVar7 = false;
|
||||
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2)) {
|
||||
in_stack_ffffff80 = 0x96;
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x96,0);
|
||||
bVar1 = Entity_Player::HasTrinket(player,0x96,0);
|
||||
if (bVar1 != 0) {
|
||||
isForce = 1;
|
||||
bVar7 = true;
|
||||
@@ -2585,7 +2585,7 @@ LAB_007109b9:
|
||||
}
|
||||
if (g_game->_stage == 9) {
|
||||
in_stack_ffffff80 = 0x71051b;
|
||||
iVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0xaf);
|
||||
iVar2 = Entity_Player::GetTrinketMultiplier(player,0xaf);
|
||||
if (iVar2 < 2) goto LAB_00710a08;
|
||||
isForce = 1;
|
||||
}
|
||||
@@ -2612,7 +2612,7 @@ LAB_00710a08:
|
||||
if ((this->_doorFlags & 1) == 0) {
|
||||
if (this->_targetRoomType == 2) {
|
||||
in_stack_ffffff80 = 0x53;
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x53,0);
|
||||
bVar1 = Entity_Player::HasTrinket(player,0x53,0);
|
||||
if (bVar1 != 0) goto LAB_00710af5;
|
||||
}
|
||||
}
|
||||
@@ -2623,10 +2623,10 @@ LAB_00710a08:
|
||||
}
|
||||
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2)) {
|
||||
in_stack_ffffff80 = 0x710ade;
|
||||
iVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x13);
|
||||
iVar2 = Entity_Player::GetTrinketMultiplier(player,0x13);
|
||||
if (2 < iVar2) goto LAB_00710af5;
|
||||
}
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::TryUseKey();
|
||||
bVar1 = Entity_Player::TryUseKey(player);
|
||||
if (bVar1 == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2639,7 +2639,7 @@ LAB_00710af5:
|
||||
}
|
||||
else if (isForce == 0) {
|
||||
in_stack_ffffff80 = 0x710b0b;
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddCoins(-1);
|
||||
Entity_Player::AddCoins(player,-1);
|
||||
goto LAB_00710b1b;
|
||||
}
|
||||
this->_isUnlockedByPlayer = 1;
|
||||
|
||||
@@ -462,7 +462,7 @@ LAB_0067e2c6:
|
||||
local_38.y = dirToPlayer->y * 25.0 + local_38.y;
|
||||
fVar8 = sqrtf(fVar8 * fVar8 + deltaX * deltaX);
|
||||
if (((fVar8 < 160.0) &&
|
||||
(bVar1 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&local_38,&local_30,3,0,0,0,GHIDRA_CAST<Vector *>(0x0)),
|
||||
(bVar1 = Room::CheckLine(g_game->_room,&local_38,&local_30,3,0,0,0,GHIDRA_CAST<Vector *>(0x0)),
|
||||
bVar1 != 0)) && (uVar2 = Random(), uVar2 % 0xf == 0)) {
|
||||
uVar2 = Random();
|
||||
dirToPlayer = (GHIDRA_CAST<Vector *>((&local_40)))->Vector::Normalized(&normalized);
|
||||
|
||||
@@ -160,9 +160,9 @@ void GridEntity_Lock::try_unlock(Entity_Player *player, uint8_t isForce)
|
||||
if (isForce == 0) {
|
||||
soundId[0] = this;
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x154))) == '\0') {
|
||||
paperClipMultiplier = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x13);
|
||||
paperClipMultiplier = Entity_Player::GetTrinketMultiplier(player,0x13);
|
||||
if ((paperClipMultiplier < 2) &&
|
||||
(isKeyUsed = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::TryUseKey(), isKeyUsed == 0)) {
|
||||
(isKeyUsed = Entity_Player::TryUseKey(player), isKeyUsed == 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ void GridEntity_Lock::try_unlock(Entity_Player *player, uint8_t isForce)
|
||||
if (player->_numCoins < 1) {
|
||||
return;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddCoins(-1);
|
||||
Entity_Player::AddCoins(player,-1);
|
||||
}
|
||||
}
|
||||
manager = g_manager;
|
||||
@@ -248,7 +248,7 @@ void GridEntity_Lock::break_open(Entity_Player *player)
|
||||
do {
|
||||
player = GHIDRA_CAST<Entity_Player *>(*playerIt);
|
||||
if ((player->_variant == 0) &&
|
||||
(bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x16,0), bVar1 != 0)) goto LAB_00711d1a;
|
||||
(bVar1 = Entity_Player::HasTrinket(player,0x16,0), bVar1 != 0)) goto LAB_00711d1a;
|
||||
playerIt = playerIt + 1;
|
||||
} while (playerIt != (game->_playerManager)._playerList._end);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ LAB_00712ec3:
|
||||
iVar11 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar13) + 0x1214));
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar13) + 0x1214)) = iVar11 + 1;
|
||||
pEVar5->_index = iVar11;
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar13) + 0x1218)))))->EntityList::AddEntity(pEVar5);
|
||||
EntityList::AddEntity(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar13) + 0x1218)),pEVar5);
|
||||
bVar6 = Game::ShouldEraseEnemy(pEVar5);
|
||||
if (bVar6 != 0) {
|
||||
Entity::RemoveWithPoof(pEVar5,unusedArg_00);
|
||||
@@ -523,7 +523,7 @@ LAB_00712860:
|
||||
iVar11 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar13) + 0x1214));
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar13) + 0x1214)) = iVar11 + 1;
|
||||
pEVar5->_index = iVar11;
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar13) + 0x1218)))))->EntityList::AddEntity(pEVar5);
|
||||
EntityList::AddEntity(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar13) + 0x1218)),pEVar5);
|
||||
bVar6 = Game::ShouldEraseEnemy(pEVar5);
|
||||
if (bVar6 != 0) {
|
||||
Entity::RemoveWithPoof(pEVar5,unusedArg);
|
||||
@@ -1214,9 +1214,9 @@ void GridEntity_Pit::guard_check_icall()
|
||||
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
||||
(player->_pos).x = (float)(iVar4 % iVar2) * 40.0 + 40.0;
|
||||
(player->_pos).y = (float)(iVar4 / iVar2) * 40.0 + 120.0;
|
||||
isMegaMush = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
||||
isMegaMush = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x271);
|
||||
if (isMegaMush == 0) {
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("FallIn"));
|
||||
Entity_Player::PlayExtraAnimation(player,GHIDRA_CAST<uint8_t *>("FallIn"));
|
||||
game = g_game;
|
||||
player->_isControlsEnabled = 0;
|
||||
player->_entityCollisionClass = 0;
|
||||
|
||||
@@ -343,9 +343,9 @@ LAB_00714c16:
|
||||
iStack_60 = 0x3f800000;
|
||||
local_5c = 0;
|
||||
switchD_00714d3f_caseD_2:
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_footstep_triggered(-1);
|
||||
bVar1 = Entity_Player::is_footstep_triggered(player,-1);
|
||||
if ((bVar1 != 0) && (player->_canFly == 0)) {
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_footstep_triggered(0);
|
||||
bVar1 = Entity_Player::is_footstep_triggered(player,0);
|
||||
if (bVar1 == 0) {
|
||||
(player->_footprintColor1)._offset[0] = footprintR;
|
||||
(player->_footprintColor1)._offset[1] = fStack_68;
|
||||
@@ -442,7 +442,7 @@ LAB_00714fce:
|
||||
player->_hallowedGroundCountdown = iVar5;
|
||||
if (0 < prevHolyAura != 0 < iVar5) {
|
||||
player->_cacheFlags = player->_cacheFlags | 99;
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::EvaluateItems();
|
||||
Entity_Player::EvaluateItems(player);
|
||||
}
|
||||
}
|
||||
playerManager = &g_game->_playerManager;
|
||||
@@ -1197,8 +1197,8 @@ switchD_0071688e_default:
|
||||
fVar2 = sin((float)local_68);
|
||||
local_74.y = fVar2 * 0.5 * local_6c;
|
||||
pEVar1 = Game::Spawn(g_game,1000,0x3a,position,&local_74,GHIDRA_CAST<Entity *>(0x0),0,rngResult);
|
||||
pEVar1->SetColor(&gibColor,0xffffffff,0xff,0,1);
|
||||
pEVar1->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar1) + 0x3c))(&gibColor,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar1) + 0xc))();
|
||||
count = count + -1;
|
||||
if (count == 0) {
|
||||
return;
|
||||
@@ -1391,7 +1391,7 @@ GridEntity_Poop * GridEntity_Poop::get_giga_part(int variant, uint8_t isCreate)
|
||||
}
|
||||
if (isCreate != 0) {
|
||||
if ((pGVar4 != GHIDRA_CAST<GridEntity_Poop *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar4)) + 0x4)))) == 0xe)) {
|
||||
(GHIDRA_CAST<Room *>((this_00)))->Room::RemoveGridEntity(uVar3,0,1);
|
||||
Room::RemoveGridEntity(this_00,uVar3,0,1);
|
||||
}
|
||||
uVar5 = Random();
|
||||
if ((GHIDRA_INT(uVar3) < 0) || (0x1bf < GHIDRA_INT(uVar3))) {
|
||||
|
||||
@@ -69,7 +69,7 @@ void GridEntity_PressurePlate::update_press()
|
||||
if (((iVar4 == 1) && (presser->_isCoopGhost != 0)) ||
|
||||
((presser->_dead == 0 &&
|
||||
((((iVar4 == 1 && (presser->_isCoopGhost == 0)) &&
|
||||
(bVar1 = (GHIDRA_CAST<Entity_Player *>((presser)))->Entity_Player::IsHologram(), bVar1 == 0)) ||
|
||||
(bVar1 = Entity_Player::IsHologram(presser), bVar1 == 0)) ||
|
||||
(((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 || (iVar4 != 1)) &&
|
||||
((iVar4 - 10U < 0x3de && ((iVar4 == 0x36d || (iVar4 == 0x35)))))))))))) {
|
||||
manager = g_manager;
|
||||
@@ -427,8 +427,8 @@ void GridEntity_PressurePlate::update_greed_button()
|
||||
}
|
||||
if ((fVar7 < 625.0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 0)) {
|
||||
if (0 < waveTimer) {
|
||||
iVar5 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetHealthType();
|
||||
if ((iVar5 == 2) || (bVar3 = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasInstantDeathCurse(), bVar3 != 0))
|
||||
iVar5 = Entity_Player::GetHealthType(player);
|
||||
if ((iVar5 == 2) || (bVar3 = Entity_Player::HasInstantDeathCurse(this_00), bVar3 != 0))
|
||||
{
|
||||
game->_levelStateFlags = game->_levelStateFlags | 0x800;
|
||||
}
|
||||
@@ -443,7 +443,7 @@ void GridEntity_PressurePlate::update_greed_button()
|
||||
damageSource._velocity.y = g_vectorZero.y;
|
||||
damageSource._flags = 0;
|
||||
damageSource._entity = (void *)0x0;
|
||||
player->TakeDamage(0x3f800000,0x10000080,0,&damageSource,0x1e);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(player) + 0x20))(0x3f800000,0x10000080,0,&damageSource,0x1e);
|
||||
game = g_game;
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ LAB_00983c85:
|
||||
((this->_sprite)._animState._isPlaying == 0)) {
|
||||
if (iVar5 == 1) {
|
||||
if (waveTimer < 1) {
|
||||
(GHIDRA_CAST<Room *>((game->_room)))->Room::SpawnGreedModeWave(0);
|
||||
Room::SpawnGreedModeWave(game->_room,0);
|
||||
uVar4 = 0;
|
||||
playerManager = &g_game->_playerManager;
|
||||
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
||||
@@ -516,9 +516,9 @@ LAB_00983c85:
|
||||
playerSlot = playerSlot + uVar4;
|
||||
}
|
||||
player = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
||||
bVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(299,0);
|
||||
if (((bVar3 != 0) || (iVar5 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetZodiacEffect(), iVar5 == 299)) &&
|
||||
(bVar3 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(299),
|
||||
bVar3 = Entity_Player::HasCollectible(player,299,0);
|
||||
if (((bVar3 != 0) || (iVar5 = Entity_Player::GetZodiacEffect(player), iVar5 == 299)) &&
|
||||
(bVar3 = TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,299),
|
||||
bVar3 == 0)) {
|
||||
player->_taurusSpeedBonus = 0.0;
|
||||
flashColor._colorize[0] = 0.0;
|
||||
@@ -532,7 +532,7 @@ LAB_00983c85:
|
||||
flashColor._tint[1] = 1.0;
|
||||
flashColor._tint[2] = 1.0;
|
||||
flashColor._tint[3] = 1.0;
|
||||
player->SetColor(&flashColor,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(player) + 0x3c))(&flashColor,0xffffffff,0xff,0,1);
|
||||
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
||||
if ((0x4ac < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) &
|
||||
0xfffffffcU))) && (iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x4ac)), iVar5 != 0)
|
||||
@@ -541,7 +541,7 @@ LAB_00983c85:
|
||||
effectEntry[1] = 0;
|
||||
uStack_64 = 0;
|
||||
effectEntry[0] = iVar5;
|
||||
(GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::AddEffect(effectEntry,1,1);
|
||||
TemporaryEffects::AddEffect(&player->_temporaryeffects,effectEntry,1,1);
|
||||
}
|
||||
}
|
||||
uVar4 = uVar4 + 1;
|
||||
@@ -648,7 +648,7 @@ void GridEntity_PressurePlate::Reward()
|
||||
if (uVar8 < 0xe) {
|
||||
ExceptionList = &local_1c;
|
||||
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TriggerOutput(uVar8 - 10);
|
||||
Room::TriggerOutput(g_game->_room,uVar8 - 10);
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
@@ -684,7 +684,7 @@ void GridEntity_PressurePlate::Reward()
|
||||
Game::ShakeScreen(g_game,0xf);
|
||||
timerEffect = Entity_Effect::CreateTimer
|
||||
(pressure_plate_kill_enemies_timer_callback,1,0xffffffff,0);
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(timerEffect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(player));
|
||||
Entity::SetParent(GHIDRA_CAST<Entity *>(timerEffect),GHIDRA_CAST<Entity *>(player));
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
@@ -730,8 +730,8 @@ void GridEntity_PressurePlate::Reward()
|
||||
if (isTrapDoorAllowed != 0) {
|
||||
room = g_game->_room;
|
||||
uVar8 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridIndex(&local_4c);
|
||||
(GHIDRA_CAST<Room *>((room)))->Room::SpawnGridEntity(targetRoomType,0x11,0,uVar8,0);
|
||||
targetRoomType = Room::GetGridIndex(g_game->_room,&local_4c);
|
||||
Room::SpawnGridEntity(room,targetRoomType,0x11,0,uVar8,0);
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
@@ -741,7 +741,7 @@ void GridEntity_PressurePlate::Reward()
|
||||
pvVar6 = g_game->_room;
|
||||
local_30 = pvVar6;
|
||||
local_38 = (void *)(GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
||||
uVar8 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridIndex(&local_4c);
|
||||
uVar8 = Room::GetGridIndex(g_game->_room,&local_4c);
|
||||
if ((GHIDRA_INT(uVar8) < 0) || (0x1bf < GHIDRA_INT(uVar8))) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
||||
}
|
||||
@@ -892,7 +892,7 @@ void GridEntity_PressurePlate::Reward()
|
||||
pos_03.y = local_58.y;
|
||||
pos_03.x = local_58.x;
|
||||
local_38 = (void *)local_58.y;
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_03);
|
||||
targetRoomType = Room::GetGridCollisionAtPos(room,pos_03);
|
||||
if (targetRoomType == 0) {
|
||||
LAB_00984f49:
|
||||
local_58.x = local_4c.x + 0.0;
|
||||
@@ -900,13 +900,13 @@ LAB_00984f49:
|
||||
pos_05.y = local_58.y;
|
||||
pos_05.x = local_58.x;
|
||||
local_38 = (void *)local_58.x;
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_05);
|
||||
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 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_06);
|
||||
targetRoomType = Room::GetGridCollisionAtPos(room,pos_06);
|
||||
if (targetRoomType == 0) goto LAB_00984fe7;
|
||||
}
|
||||
else {
|
||||
@@ -914,7 +914,7 @@ LAB_00984f49:
|
||||
local_58.y = (float)local_38;
|
||||
pos_04.y = (float)local_38;
|
||||
pos_04.x = local_58.x;
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_04);
|
||||
targetRoomType = Room::GetGridCollisionAtPos(room,pos_04);
|
||||
if (targetRoomType == 0) goto LAB_00984f49;
|
||||
}
|
||||
tmpPos = Room::GetCenterPos(&local_60);
|
||||
@@ -933,7 +933,7 @@ LAB_00984fe7:
|
||||
pos.y = local_58.y;
|
||||
pos.x = local_58.x;
|
||||
local_38 = (void *)local_58.y;
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos);
|
||||
targetRoomType = Room::GetGridCollisionAtPos(room,pos);
|
||||
if (targetRoomType == 0) {
|
||||
LAB_00984de5:
|
||||
local_58.x = local_4c.x + 0.0;
|
||||
@@ -941,13 +941,13 @@ LAB_00984de5:
|
||||
pos_01.y = local_58.y;
|
||||
pos_01.x = local_58.x;
|
||||
local_38 = (void *)local_58.x;
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_01);
|
||||
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 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_02);
|
||||
targetRoomType = Room::GetGridCollisionAtPos(room,pos_02);
|
||||
if (targetRoomType == 0) goto LAB_00984e83;
|
||||
}
|
||||
else {
|
||||
@@ -955,7 +955,7 @@ LAB_00984de5:
|
||||
local_58.y = (float)local_38;
|
||||
pos_00.y = (float)local_38;
|
||||
pos_00.x = local_58.x;
|
||||
targetRoomType = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos_00);
|
||||
targetRoomType = Room::GetGridCollisionAtPos(room,pos_00);
|
||||
if (targetRoomType == 0) goto LAB_00984de5;
|
||||
}
|
||||
tmpPos = Room::GetCenterPos(&local_60);
|
||||
@@ -973,7 +973,7 @@ LAB_00984e83:
|
||||
pvVar6 = g_game->_room;
|
||||
local_30 = pvVar6;
|
||||
local_38 = (void *)(GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
||||
uVar8 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridIndex(&local_4c);
|
||||
uVar8 = Room::GetGridIndex(g_game->_room,&local_4c);
|
||||
if ((GHIDRA_INT(uVar8) < 0) || (0x1bf < GHIDRA_INT(uVar8))) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ LAB_0071905d:
|
||||
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
||||
pEVar3 = GHIDRA_CAST<Entity_Player *>(FUN_0090b0e0(uVar2));
|
||||
local_50[3] = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((pEVar3)))->Entity_Player::HasTrinket(0x3e,0);
|
||||
bVar1 = Entity_Player::HasTrinket(pEVar3,0x3e,0);
|
||||
if (bVar1 == 0) goto LAB_007191ab;
|
||||
}
|
||||
iVar6 = 300;
|
||||
@@ -204,7 +204,7 @@ LAB_0071926c:
|
||||
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,GHIDRA_CAST<Entity *>(0x0),0,uVar2);
|
||||
sourceRef = (GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_90 + 4)))))->EntityRef::EntityRef();
|
||||
sourceRef = EntityRef::EntityRef(GHIDRA_CAST<EntityRef *>((local_90 + 4)));
|
||||
(*extraout_EDX_00)(1,sourceRef);
|
||||
game = g_game;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ LAB_0071926c:
|
||||
else {
|
||||
iVar6 = iVar4 * room->_gridWidth + iVar6;
|
||||
}
|
||||
uVar8 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(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],
|
||||
@@ -266,7 +266,7 @@ LAB_0071926c:
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < 4);
|
||||
if ((spawnPos.x == g_vectorZero.x) && (spawnPos.y == g_vectorZero.y)) goto LAB_00719576;
|
||||
(GHIDRA_CAST<Entity_Player *>((local_50[3])))->Entity_Player::AddBlueSpider(&spawnPos);
|
||||
Entity_Player::AddBlueSpider(local_50[3],&spawnPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,7 +275,7 @@ LAB_0071926c:
|
||||
iVar4 = this->_frameCnt;
|
||||
this->_frameCnt = iVar4 + -1;
|
||||
if (0 < iVar4) goto LAB_00719576;
|
||||
sourceRef = (GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_90 + 4)))))->EntityRef::EntityRef();
|
||||
sourceRef = EntityRef::EntityRef(GHIDRA_CAST<EntityRef *>((local_90 + 4)));
|
||||
(*extraout_EDX)(0,sourceRef);
|
||||
}
|
||||
game = g_game;
|
||||
@@ -808,11 +808,11 @@ void GridEntity_Rock::guard_check_icall()
|
||||
uVar2 = GHIDRA_UINT(this->_gridIndex) / GHIDRA_UINT(currentRoom->_gridWidth);
|
||||
uVar3 = GHIDRA_UINT(this->_gridIndex) % GHIDRA_UINT(currentRoom->_gridWidth);
|
||||
nextColumn = uVar3 + 1;
|
||||
neighborIndices[0] = (GHIDRA_CAST<Room *>((currentRoom)))->Room::GetGridIndexByTile(nextColumn,uVar2);
|
||||
neighborIndices[0] = Room::GetGridIndexByTile(currentRoom,nextColumn,uVar2);
|
||||
nextRow = uVar2 + 1;
|
||||
neighborIndices[1] = (GHIDRA_CAST<Room *>((currentRoom)))->Room::GetGridIndexByTile(uVar3,nextRow);
|
||||
neighborIndices[1] = Room::GetGridIndexByTile(currentRoom,uVar3,nextRow);
|
||||
room = currentRoom;
|
||||
neighborIndices[2] = (GHIDRA_CAST<Room *>((currentRoom)))->Room::GetGridIndexByTile(nextColumn,nextRow);
|
||||
neighborIndices[2] = Room::GetGridIndexByTile(currentRoom,nextColumn,nextRow);
|
||||
uVar2 = 0;
|
||||
neighborRocks[0] = GHIDRA_CAST<GridEntity_Rock *>(0x0);
|
||||
uVar3 = 0;
|
||||
@@ -1280,7 +1280,7 @@ void GridEntity_Rock::TrySpawnWorms()
|
||||
local_14 = trig * 20.0 + rockY;
|
||||
worm = Game::Spawn(g_game,1000,0x3f,GHIDRA_CAST<Vector *>((local_20 + 8)),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
||||
seed);
|
||||
worm->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(worm) + 0xc))();
|
||||
wormCount = wormCount - 1;
|
||||
} while (wormCount != 0);
|
||||
}
|
||||
@@ -1348,7 +1348,7 @@ uint8_t GridEntity_Rock::TrySpawnLadder()
|
||||
do {
|
||||
player = GHIDRA_CAST<Entity_Player *>(*playerIt);
|
||||
if ((player->_variant == 0) &&
|
||||
(isHasStudFinder = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x4a,0), isHasStudFinder != 0)) {
|
||||
(isHasStudFinder = Entity_Player::HasTrinket(player,0x4a,0), isHasStudFinder != 0)) {
|
||||
pvVar3 = (player->_trinketRNGs)._end;
|
||||
if (GHIDRA_INT(pvVar3) - GHIDRA_INT((player->_trinketRNGs)._begin) >> 4 < 0x4b) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Trinket ID out of bounds!\n"));
|
||||
@@ -1395,7 +1395,7 @@ LAB_0071b300:
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
||||
}
|
||||
if ((uVar2 < 0x1c0) &&
|
||||
(gridCollision = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(uVar2), GHIDRA_INT(gridCollision) < 1)) {
|
||||
(gridCollision = Room::GetGridCollision(room,uVar2), GHIDRA_INT(gridCollision) < 1)) {
|
||||
stairs = operator_new(0x154);
|
||||
local_8 = 0x11;
|
||||
if (stairs == GHIDRA_CAST<GridEntity *>(0x0)) {
|
||||
|
||||
@@ -515,7 +515,7 @@ void GridEntity_TrapDoor::Update()
|
||||
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
||||
(_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) {
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
||||
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
||||
RoomDescriptor::constructor(&g_roomDescriptorDummy);
|
||||
_atexit(FUN_00b15b30);
|
||||
local_8 = GHIDRA_CAST<char ******>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8));
|
||||
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
||||
@@ -957,7 +957,7 @@ LAB_007208e8:
|
||||
}
|
||||
pEVar6 = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
||||
if (pEVar6->_variant == 0) {
|
||||
(GHIDRA_CAST<Entity_Player *>((pEVar6)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
||||
Entity_Player::PlayExtraAnimation(pEVar6,GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
||||
game = g_game;
|
||||
iVar15 = savedTrapDoor->_gridIndex;
|
||||
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
||||
@@ -1055,7 +1055,7 @@ LAB_00720d35:
|
||||
do {
|
||||
local_4c.y = (float)Game::GetPlayer(game,preventedCurses);
|
||||
if ((GHIDRA_CAST<Entity_Player *>(local_4c.y))->_variant == 0) {
|
||||
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_4c.y))))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
||||
Entity_Player::PlayExtraAnimation(GHIDRA_CAST<Entity_Player *>(local_4c.y),GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
||||
game = g_game;
|
||||
iVar15 = trapDoor->_gridIndex;
|
||||
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
||||
@@ -1085,7 +1085,7 @@ LAB_00720e0b:
|
||||
}
|
||||
}
|
||||
LAB_00720b0f:
|
||||
(GHIDRA_CAST<Entity_Player *>((pEVar6)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
||||
Entity_Player::PlayExtraAnimation(pEVar6,GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
||||
game = g_game;
|
||||
iVar15 = trapDoor->_gridIndex;
|
||||
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
||||
|
||||
@@ -136,7 +136,7 @@ void GridEntity_Wall::guard_check_icall()
|
||||
else {
|
||||
local_34.x = (float)(this->_gridIndex % room->_gridWidth) * 40.0 + 40.0 + 0.0;
|
||||
local_34.y = ((float)(this->_gridIndex / room->_gridWidth) * 40.0 + 120.0) - 40.0;
|
||||
(GHIDRA_CAST<Room *>((room)))->Room::GetGridEntityFromPos(&local_34);
|
||||
Room::GetGridEntityFromPos(room,&local_34);
|
||||
Random();
|
||||
sprintf_s(animNameBuf,0x1f,&DAT_00b69520);
|
||||
anim = GHIDRA_CAST<char *>(animNameBuf);
|
||||
|
||||
@@ -168,10 +168,10 @@ void GridEntity_Web::Update()
|
||||
player = GHIDRA_CAST<Entity_Player *>(*puVar4);
|
||||
iVar1 = player->_entityGridCollisionClass;
|
||||
if ((((iVar1 != 0) && (iVar1 != 3)) && (iVar1 != 1)) && (iVar1 != 2)) {
|
||||
isHasEvilCharm = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x278,0);
|
||||
isHasEvilCharm = Entity_Player::HasCollectible(player,0x278,0);
|
||||
if ((isHasEvilCharm != 0) ||
|
||||
(isHasEvilCharm =
|
||||
(GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x278),
|
||||
TemporaryEffects::HasCollectibleEffect(&player->_temporaryeffects,0x278),
|
||||
isHasEvilCharm != 0)) {
|
||||
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 10) goto LAB_007219cb;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26d4))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26d4))) != '\0';
|
||||
@@ -206,7 +206,7 @@ void GridEntity_Web::Update()
|
||||
color._colorize[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)auVar2)) + 0x1c)));
|
||||
color._offset[1] = 0.15686275;
|
||||
color._offset[2] = 0.15686275;
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(player))))->Entity::AddSlowing(&sourceRef,4,0.75,color,0);
|
||||
Entity::AddSlowing(GHIDRA_CAST<Entity *>(player),&sourceRef,4,0.75,color,0);
|
||||
}
|
||||
}
|
||||
LAB_007219cb:
|
||||
|
||||
@@ -1,245 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00721a70
|
||||
void History::AddHistoryItem(void *historyItem)
|
||||
{
|
||||
int iVar1;
|
||||
int iVar2;
|
||||
int *item;
|
||||
int iVar3;
|
||||
int *itemsBegin;
|
||||
int *itemsEnd;
|
||||
void **itemsEndPtr;
|
||||
|
||||
if (this->_isLocked != 0) {
|
||||
return;
|
||||
}
|
||||
itemsBegin = (this->_historyItems)._begin;
|
||||
itemsEnd = (this->_historyItems)._end;
|
||||
item = itemsBegin;
|
||||
if (itemsBegin != itemsEnd) {
|
||||
do {
|
||||
item = item + 7;
|
||||
} while (item != itemsEnd);
|
||||
item = itemsBegin;
|
||||
if (*GHIDRA_CAST<int *>(historyItem) < itemsEnd[-7]) {
|
||||
do {
|
||||
if (*GHIDRA_CAST<int *>(historyItem) < *item) {
|
||||
FUN_00722250(&historyItem,item,historyItem);
|
||||
iVar3 = (GHIDRA_INT(item) - GHIDRA_INT(itemsBegin)) / 0x1c + (GHIDRA_INT(item) - GHIDRA_INT(itemsBegin) >> 0x1f);
|
||||
iVar2 = iVar3;
|
||||
goto LAB_00721b3f;
|
||||
}
|
||||
item = item + 7;
|
||||
} while (item != itemsEnd);
|
||||
goto LAB_00721b4c;
|
||||
}
|
||||
}
|
||||
if (itemsEnd == (this->_historyItems)._capacity) {
|
||||
msvc::vector<28byte>::_Emplace_reallocate(itemsEnd,historyItem);
|
||||
}
|
||||
else {
|
||||
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyItem) + 4));
|
||||
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyItem) + 8));
|
||||
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyItem) + 0xc));
|
||||
*itemsEnd = *GHIDRA_CAST<int *>(historyItem);
|
||||
itemsEnd[1] = iVar2;
|
||||
itemsEnd[2] = iVar3;
|
||||
itemsEnd[3] = iVar1;
|
||||
*GHIDRA_CAST<uint64_t *>((itemsEnd + 4)) = *GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(historyItem) + 0x10));
|
||||
itemsEnd[6] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyItem) + 0x18));
|
||||
itemsEndPtr = &(this->_historyItems)._end;
|
||||
*itemsEndPtr = (void *)(GHIDRA_INT(*itemsEndPtr) + 0x1c);
|
||||
}
|
||||
iVar2 = GHIDRA_INT((this->_historyItems)._end) - GHIDRA_INT((this->_historyItems)._begin);
|
||||
iVar3 = iVar2 / 0x1c + (iVar2 >> 0x1f);
|
||||
iVar2 = iVar3 + -1;
|
||||
LAB_00721b3f:
|
||||
FUN_00722020(iVar2 - (iVar3 >> 0x1f));
|
||||
LAB_00721b4c:
|
||||
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
||||
return;
|
||||
}
|
||||
|
||||
// 00721c00
|
||||
uint8_t History::RemoveHistoryItemByIndex(int index)
|
||||
{
|
||||
void *historyBegin;
|
||||
int removedIndex;
|
||||
|
||||
removedIndex = index;
|
||||
if (this->_isLocked == 0) {
|
||||
historyBegin = (this->_historyItems)._begin;
|
||||
if (index < (GHIDRA_INT((this->_historyItems)._end) - GHIDRA_INT(historyBegin)) / 0x1c) {
|
||||
msvc::vector<HistoryItem>::erase(&index,(void *)(GHIDRA_INT(historyBegin) + index * 0x1c));
|
||||
remove_index_refs(this,removedIndex);
|
||||
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 00721c80
|
||||
void History::merge(void *other)
|
||||
{
|
||||
void **ppvVar1;
|
||||
int iVar2;
|
||||
int iVar3;
|
||||
int iVar4;
|
||||
uint32_t size;
|
||||
int *oldItem;
|
||||
int *oldItem;
|
||||
uint8_t oldBegin [16];
|
||||
void *oldCapacity;
|
||||
History *history;
|
||||
int *oldEnd;
|
||||
int *otherEnd;
|
||||
uint8_t *puStack_20;
|
||||
void *local_1c;
|
||||
uint8_t *puStack_18;
|
||||
uint32_t local_14;
|
||||
|
||||
puStack_20 = oldBegin + 0x3c;
|
||||
puStack_18 = &LAB_00afcd4d;
|
||||
local_1c = ExceptionList;
|
||||
ExceptionList = &local_1c;
|
||||
if (this->_isLocked == 0) {
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x0))) = GHIDRA_CAST<int *>(0x0);
|
||||
oldCapacity = (void *)0x0;
|
||||
local_14 = 0;
|
||||
oldEnd = GHIDRA_CAST<int *>(0x0);
|
||||
if (GHIDRA_CAST<History *>(oldBegin) != this) {
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x0))) = (this->_historyItems)._begin;
|
||||
oldCapacity = (this->_historyItems)._capacity;
|
||||
(this->_historyItems)._begin = (void *)0x0;
|
||||
oldEnd = (this->_historyItems)._end;
|
||||
(this->_historyItems)._end = (void *)0x0;
|
||||
(this->_historyItems)._capacity = (void *)0x0;
|
||||
}
|
||||
oldItem = *GHIDRA_CAST<int **>(other);
|
||||
otherEnd = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(other) + 4));
|
||||
oldItem = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(oldBegin))) + 0x0)));
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x4))) = oldEnd;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x8))) = oldCapacity;
|
||||
history = this;
|
||||
while( true ) {
|
||||
while (oldItem != oldEnd) {
|
||||
if ((oldItem != otherEnd) && (*oldItem < *oldItem)) goto LAB_00721d9e;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) = (this->_historyItems)._end;
|
||||
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)oldBegin)) + 0xc))) == (this->_historyItems)._capacity) {
|
||||
msvc::vector<28byte>::_Emplace_reallocate((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))),oldItem);
|
||||
oldItem = oldItem + 7;
|
||||
this = history;
|
||||
}
|
||||
else {
|
||||
iVar2 = oldItem[1];
|
||||
iVar3 = oldItem[2];
|
||||
iVar4 = oldItem[3];
|
||||
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(oldBegin))) + 0xc))) = *oldItem;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 4)) = iVar2;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 8)) = iVar3;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0xc)) = iVar4;
|
||||
iVar2 = oldItem[5];
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0x10)) = oldItem[4];
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0x14)) = iVar2;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0x18)) = oldItem[6];
|
||||
ppvVar1 = &(this->_historyItems)._end;
|
||||
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x1c);
|
||||
oldItem = oldItem + 7;
|
||||
}
|
||||
}
|
||||
if (oldItem == otherEnd) break;
|
||||
LAB_00721d9e:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) = (this->_historyItems)._end;
|
||||
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)oldBegin)) + 0xc))) == (this->_historyItems)._capacity) {
|
||||
msvc::vector<28byte>::_Emplace_reallocate((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))),oldItem);
|
||||
oldItem = oldItem + 7;
|
||||
this = history;
|
||||
}
|
||||
else {
|
||||
iVar2 = oldItem[1];
|
||||
iVar3 = oldItem[2];
|
||||
iVar4 = oldItem[3];
|
||||
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(oldBegin))) + 0xc))) = *oldItem;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 4)) = iVar2;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 8)) = iVar3;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0xc)) = iVar4;
|
||||
iVar2 = oldItem[5];
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0x10)) = oldItem[4];
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0x14)) = iVar2;
|
||||
*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0xc))) + 0x18)) = oldItem[6];
|
||||
ppvVar1 = &(this->_historyItems)._end;
|
||||
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x1c);
|
||||
oldItem = oldItem + 7;
|
||||
}
|
||||
}
|
||||
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
||||
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(oldBegin))) + 0x0))) != GHIDRA_CAST<int *>(0x0)) {
|
||||
size = ((GHIDRA_INT(oldCapacity) - (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x0)))) / 0x1c) * 0x1c;
|
||||
oldItem = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(oldBegin))) + 0x0)));
|
||||
if (0xfff < size) {
|
||||
oldItem = *GHIDRA_CAST<int **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x0))) + -4));
|
||||
size = size + 0x23;
|
||||
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(oldBegin)) + 0x0))) + (-4 - GHIDRA_INT(oldItem))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(oldItem,size);
|
||||
}
|
||||
}
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
|
||||
// 007220a0
|
||||
void History::remove_index_refs(int index)
|
||||
{
|
||||
History *slot;
|
||||
History *compactSlot;
|
||||
int iVar1;
|
||||
int iVar2;
|
||||
int iVar3;
|
||||
int firstFreeSlot;
|
||||
void *storedIndex;
|
||||
|
||||
compactSlot = this + 1;
|
||||
slot = compactSlot;
|
||||
iVar3 = 0x10;
|
||||
do {
|
||||
iVar1 = iVar3;
|
||||
storedIndex = (slot->_historyItems)._begin;
|
||||
if (storedIndex == (void *)index) {
|
||||
(slot->_historyItems)._begin = (void *)0xffffffff;
|
||||
}
|
||||
else if (index < GHIDRA_INT(storedIndex)) {
|
||||
(slot->_historyItems)._begin = (void *)(GHIDRA_INT(storedIndex) + -1);
|
||||
}
|
||||
slot = GHIDRA_CAST<History *>(&(slot->_historyItems)._end);
|
||||
iVar3 = iVar1 + -1;
|
||||
} while (iVar3 != 0);
|
||||
firstFreeSlot = -1;
|
||||
iVar3 = 0;
|
||||
iVar1 = iVar1 + -5;
|
||||
do {
|
||||
storedIndex = (compactSlot->_historyItems)._begin;
|
||||
iVar2 = iVar1;
|
||||
if (GHIDRA_INT(storedIndex) < 0) {
|
||||
if (firstFreeSlot < 0) {
|
||||
iVar2 = (-0x14 - GHIDRA_INT(this)) + GHIDRA_INT(compactSlot);
|
||||
firstFreeSlot = iVar3;
|
||||
}
|
||||
}
|
||||
else if (-1 < firstFreeSlot) {
|
||||
firstFreeSlot = firstFreeSlot + 1;
|
||||
iVar2 = iVar1 + 4;
|
||||
(compactSlot->_historyItems)._begin = *(void **)(GHIDRA_INT(&this[1]._historyItems._begin) + iVar1);
|
||||
*(void **)(GHIDRA_INT(&this[1]._historyItems._begin) + iVar1) = storedIndex;
|
||||
}
|
||||
iVar3 = iVar3 + 1;
|
||||
compactSlot = GHIDRA_CAST<History *>(&(compactSlot->_historyItems)._end);
|
||||
iVar1 = iVar2;
|
||||
} while (iVar3 < 0x10);
|
||||
return;
|
||||
}
|
||||
@@ -193,7 +193,7 @@ void HomingLaser::build_bezier_path(int homingType, Entity *source)
|
||||
do {
|
||||
local_44 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_2c) + 0x125c)) + entityIndex * 4));
|
||||
local_24 = local_44;
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((local_44)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
||||
bVar2 = Entity::IsVulnerableEnemy(local_44,GHIDRA_CAST<Entity *>(0x0));
|
||||
if ((((bVar2 == 0) || ((local_44->_flags & 0x20000010) != 0)) || (local_44 == source)) ||
|
||||
((homingType == 4 && (local_44->_type == source->_type)))) {
|
||||
local_25 = '\0';
|
||||
@@ -203,7 +203,7 @@ void HomingLaser::build_bezier_path(int homingType, Entity *source)
|
||||
}
|
||||
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (local_44->_type != 3)) ||
|
||||
((local_44->_variant != 0x43 ||
|
||||
(bVar2 = (GHIDRA_CAST<Entity *>((local_44)))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(source->_spawnerEntity)), bVar2 != 0))
|
||||
(bVar2 = Entity::IsDescendantOf(local_44,GHIDRA_CAST<Entity *>(source->_spawnerEntity)), bVar2 != 0))
|
||||
)) {
|
||||
isEnemyFamiliar = false;
|
||||
}
|
||||
@@ -788,7 +788,7 @@ LAB_0099d600:
|
||||
*GHIDRA_CAST<uint64_t *>((puVar5 + 4)) = CONCAT44(fVar8,fVar6);
|
||||
*(void **)(GHIDRA_CAST<char *>(fVar7) + 4) = (void *)(GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(fVar7) + 4)) + 0x18);
|
||||
}
|
||||
bVar2 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsPositionInRoom(&local_a4,0.0);
|
||||
bVar2 = Room::IsPositionInRoom(g_game->_room,&local_a4,0.0);
|
||||
if (bVar2 == 0) break;
|
||||
pEVar11 = local_3c;
|
||||
pEVar13 = local_40;
|
||||
@@ -1757,7 +1757,7 @@ void HomingLaser::build_wiggle_bezier()
|
||||
}
|
||||
local_44.x = -dirX;
|
||||
local_44.y = -dirY;
|
||||
endPoint = (GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(*in_ECX))))->Entity_Laser::calc_end_point(&local_4c,&startPos,&local_44);
|
||||
endPoint = Entity_Laser::calc_end_point(GHIDRA_CAST<Entity_Laser *>(*in_ECX),&local_4c,&startPos,&local_44);
|
||||
fVar2 = endPoint->x;
|
||||
in_ECX[3] = fVar2;
|
||||
fVar3 = endPoint->y;
|
||||
@@ -1826,7 +1826,7 @@ uint8_t HomingLaser::clip_samples_to_grid(Vector *pos, int gridCollisionClass)
|
||||
else {
|
||||
gridIndex = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_24.x) + 0xc)) * gridIndex + GHIDRA_INT(fVar3);
|
||||
}
|
||||
(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_24.x))))->Room::GetGridCollision(gridIndex);
|
||||
Room::GetGridCollision(GHIDRA_CAST<Room *>(local_24.x),gridIndex);
|
||||
isBlocked = FUN_0070be60();
|
||||
fVar3 = local_1c.x;
|
||||
if (isBlocked != '\0') {
|
||||
@@ -2214,8 +2214,8 @@ LAB_009a1371:
|
||||
}
|
||||
else {
|
||||
candidate = *GHIDRA_CAST<Entity **>((candidateData + candidateIndex * 4));
|
||||
ancestor = (GHIDRA_CAST<Entity *>((param_5)))->Entity::GetPlayerAncestor();
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((candidate)))->Entity::IsDescendantOf(ancestor);
|
||||
ancestor = Entity::GetPlayerAncestor(param_5);
|
||||
bVar2 = Entity::IsDescendantOf(candidate,ancestor);
|
||||
if (bVar2 == 0) {
|
||||
in_ECX = homingLaser;
|
||||
goto LAB_009a1371;
|
||||
|
||||
@@ -41,7 +41,7 @@ void * InputManager::GetDeviceByPlayerEntity(Entity_Player *player)
|
||||
}
|
||||
devicePlayer = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
LAB_0090ad07:
|
||||
mainTwin = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetMainTwin();
|
||||
mainTwin = Entity_Player::GetMainTwin(player);
|
||||
if ((devicePlayer == mainTwin) || (deviceId == *GHIDRA_CAST<int *>((extraout_ECX + 0x1618)))) {
|
||||
return pvVar1;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ IsaacRepentancePlus::Weapon::~Weapon()
|
||||
}
|
||||
else if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
local_14 = this;
|
||||
::(GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::stop_costume_item_anims();
|
||||
::Entity_Player::stop_costume_item_anims(ownerPlayer);
|
||||
}
|
||||
technology2LaserRef = &this->_technology2Laser;
|
||||
if (*technology2LaserRef != 0) {
|
||||
|
||||
@@ -169,7 +169,7 @@ LAB_009accdf:
|
||||
playerSlot = playerSlot + playerIndex;
|
||||
}
|
||||
if ((GHIDRA_CAST<Entity_Player *>(*playerSlot))->_playerType != 0x28) {
|
||||
iVar2 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::GetHealthType();
|
||||
iVar2 = Entity_Player::GetHealthType(GHIDRA_CAST<Entity_Player *>(*playerSlot));
|
||||
if ((iVar2 == 1) || (iVar2 == 2)) {
|
||||
iVar2 = player->_maxHearts;
|
||||
}
|
||||
@@ -177,16 +177,16 @@ LAB_009accdf:
|
||||
iVar2 = player->_maxHearts + player->_boneHearts * 2;
|
||||
}
|
||||
if (iVar2 < 1) {
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddSoulHearts(6,0);
|
||||
Entity_Player::AddSoulHearts(player,6,0);
|
||||
}
|
||||
else {
|
||||
healthType = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetHealthType();
|
||||
healthType = Entity_Player::GetHealthType(player);
|
||||
iVar2 = extraout_EDX;
|
||||
if ((healthType != 1) && (healthType != 2)) {
|
||||
iVar2 = extraout_EDX + heartPlayer->_boneHearts * 2;
|
||||
}
|
||||
if (iVar2 <= heartPlayer->_redHearts) goto LAB_009ace00;
|
||||
(GHIDRA_CAST<Entity_Player *>((heartPlayer)))->Entity_Player::SetFullHearts();
|
||||
Entity_Player::SetFullHearts(heartPlayer);
|
||||
}
|
||||
manager = g_manager;
|
||||
if (unk == 0) {
|
||||
@@ -217,7 +217,7 @@ LAB_009ace00:
|
||||
_unk = 0x51;
|
||||
seed_fart_sound_override(GHIDRA_CAST<int *>(&unk));
|
||||
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(_unk,1.0,2,0,1.0,0.0);
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::PlayMusic();
|
||||
Room::PlayMusic(g_game->_room);
|
||||
MusicManager::EnableLayer(&g_manager->_musicManager,0,1);
|
||||
return;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ LAB_009ace00:
|
||||
if (((roomDesc != GHIDRA_CAST<int *>(0x0)) && (game->_stage == 0xd)) &&
|
||||
((game->_stageType == 0 && ((*roomDesc == 0x23 && (roomDesc[4] == 2)))))) {
|
||||
Level::SetStage(GHIDRA_CAST<Level *>(game),0xd,1);
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::reload_backdrop();
|
||||
Room::reload_backdrop(g_game->_room);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ bool KAGE_Filesys_FileManager::OpenRead(int param_2, int param_3)
|
||||
int totalCharge;
|
||||
|
||||
if (-1 < param_3) {
|
||||
iVar1 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(this))))->Entity_Player::GetActiveMaxCharge(param_3);
|
||||
totalCharge = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(this))))->Entity_Player::GetTotalActiveCharge(param_3);
|
||||
iVar1 = Entity_Player::GetActiveMaxCharge(GHIDRA_CAST<Entity_Player *>(this),param_3);
|
||||
totalCharge = Entity_Player::GetTotalActiveCharge(GHIDRA_CAST<Entity_Player *>(this),param_3);
|
||||
if (totalCharge < iVar1) {
|
||||
return false;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ bool KAGE_Filesys_FileManager::OpenRead(int param_2, int param_3)
|
||||
case 0x27b:
|
||||
iVar1 = FUN_005c92f0();
|
||||
if (iVar1 != 0) {
|
||||
iVar1 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridCollisionAtPos(*GHIDRA_CAST<Vector *>((iVar1 + 0x33c)));
|
||||
iVar1 = Room::GetGridCollisionAtPos(g_game->_room,*GHIDRA_CAST<Vector *>((iVar1 + 0x33c)));
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x725])) + 0x1))) != '\0') {
|
||||
return iVar1 != 4;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ bool KAGE_Filesys_FileManager::OpenRead(int param_2, int param_3)
|
||||
}
|
||||
break;
|
||||
case 0x282:
|
||||
iVar1 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(this))))->Entity_Player::GetEffectiveMaxHearts();
|
||||
iVar1 = Entity_Player::GetEffectiveMaxHearts(GHIDRA_CAST<Entity_Player *>(this));
|
||||
return 0 < iVar1 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x66e])) + 0x2))));
|
||||
case 0x2c5:
|
||||
if ((*GHIDRA_CAST<int *>((this + 0xa64)) == 0) &&
|
||||
@@ -50,7 +50,7 @@ bool KAGE_Filesys_FileManager::OpenRead(int param_2, int param_3)
|
||||
}
|
||||
break;
|
||||
case 0x2ca:
|
||||
isHasFlags = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x600000000000000);
|
||||
isHasFlags = Entity::HasEntityFlags(GHIDRA_CAST<Entity *>(this),0x600000000000000);
|
||||
if ((isHasFlags == 0) && (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11a])) + 0x2)))) == 0.0)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+125
-123
@@ -23,7 +23,7 @@ void NpcHelper::the_lamb_pattern(Entity_NPC *npc, int pattern, int frame)
|
||||
params.Scale = 1.8;
|
||||
params.FallingAccelModifier = -0.06;
|
||||
params.FallingSpeedModifier = -2.0;
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
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);
|
||||
@@ -480,7 +480,7 @@ Vector * NpcHelper::colostomia_pick_target(Entity_NPC *npc, Vector *outTarget, u
|
||||
} while (uVar4 < GHIDRA_UINT(effects._size));
|
||||
outTarget = local_718;
|
||||
}
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((local_720)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(local_720);
|
||||
game = g_game;
|
||||
local_718 = GHIDRA_CAST<Vector *>((playerTarget->_pos).x);
|
||||
local_720 = GHIDRA_CAST<Entity_NPC *>((playerTarget->_pos).y);
|
||||
@@ -606,7 +606,7 @@ void NpcHelper::colostomia_pick_dive_target(Entity_NPC *npc)
|
||||
npcLocal = npc;
|
||||
do {
|
||||
room = *roomRef;
|
||||
candidatePos = (GHIDRA_CAST<Room *>((room)))->Room::GetRandomPosition(&randomPos,0.0);
|
||||
candidatePos = Room::GetRandomPosition(room,&randomPos,0.0);
|
||||
candidatePos = Room::FindFreePickupSpawnPosition(room,&freePos,candidatePos,0.0,0,0,0);
|
||||
pEVar7 = npcLocal;
|
||||
fVar10 = candidatePos->x;
|
||||
@@ -621,7 +621,7 @@ void NpcHelper::colostomia_pick_dive_target(Entity_NPC *npc)
|
||||
fVar9 = (nearestPlayer->_pos).x - diveTarget->x;
|
||||
local_24 = GHIDRA_CAST<int *>(sqrtf(fVar10 * fVar10 + fVar9 * fVar9));
|
||||
roomSlot = &g_game->_room;
|
||||
bVar1 = (GHIDRA_CAST<Room *>((*roomSlot)))->Room::IsPositionInRoom(diveTarget,60.0);
|
||||
bVar1 = Room::IsPositionInRoom(*roomSlot,diveTarget,60.0);
|
||||
if (bVar1 != 0) {
|
||||
room = *roomSlot;
|
||||
iVar6 = GHIDRA_INT(((diveTarget->x - 40.0) / 40.0 + 0.5));
|
||||
@@ -633,7 +633,7 @@ void NpcHelper::colostomia_pick_dive_target(Entity_NPC *npc)
|
||||
else {
|
||||
iVar6 = room->_gridWidth * iVar4 + iVar6;
|
||||
}
|
||||
uVar2 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(iVar6);
|
||||
uVar2 = Room::GetGridCollision(room,iVar6);
|
||||
pEVar7 = npcLocal;
|
||||
if ((((uVar2 == 0) && (80.0 <= (float)local_20)) &&
|
||||
(((float)local_20 <= 200.0 && (120.0 < (float)local_24)))) &&
|
||||
@@ -743,7 +743,7 @@ void NpcHelper::delirium_remove_minions(int type, int variant, Entity *self, Ent
|
||||
do {
|
||||
tmpEntity = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x125c)) + npcIdx * 4));
|
||||
if ((tmpEntity == self) ||
|
||||
(cVar4 = tmpEntity->IsBoss(uVar5), cVar4 == '\0')) {
|
||||
(cVar4 = (**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x4c))(uVar5), cVar4 == '\0')) {
|
||||
LAB_004a62c2:
|
||||
if (other != GHIDRA_CAST<Entity *>(0x0)) {
|
||||
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x125c));
|
||||
@@ -902,7 +902,7 @@ void NpcHelper::delirium_spawn_form_parts(Entity_NPC *npc, float maxHealth)
|
||||
if (npc->_type == 0x13) {
|
||||
uVar5 = Random();
|
||||
segmentCount = uVar5 % 6 + 4;
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(npc);
|
||||
dirY = (npc->_pos).x - (target->_pos).x;
|
||||
local_c = (void *)((npc->_pos).y - (target->_pos).y);
|
||||
fVar8 = sqrtf(dirY * dirY + (float)local_c * (float)local_c);
|
||||
@@ -1055,7 +1055,7 @@ LAB_004a8abb:
|
||||
((animData[0x34] != 0 && ((pEVar6->_sprite)._animState._isPlaying == 0))))
|
||||
goto LAB_004a8acc;
|
||||
}
|
||||
pEVar6->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar6) + 0xc))();
|
||||
segmentIndex = (float)(GHIDRA_INT(segmentIndex) + 1);
|
||||
npc = local_24;
|
||||
pEVar6 = formNpc;
|
||||
@@ -1337,7 +1337,7 @@ LAB_004a912d:
|
||||
case 10:
|
||||
burstCount = 1;
|
||||
fireInterval = 0x12;
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
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);
|
||||
@@ -2024,7 +2024,7 @@ void NpcHelper::gideon_spawn_stairs(Entity_NPC *npc)
|
||||
__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
||||
if (g_invalidRoomDescriptorGuard == -1) {
|
||||
local_8 = 0;
|
||||
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
||||
RoomDescriptor::constructor(&g_roomDescriptorDummy);
|
||||
_atexit(FUN_00b15b30);
|
||||
local_8 = 0xffffffff;
|
||||
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
||||
@@ -2064,7 +2064,7 @@ void NpcHelper::gideon_spawn_stairs(Entity_NPC *npc)
|
||||
}
|
||||
pRVar2 = local_18;
|
||||
if (uVar3 < 0x1c0) {
|
||||
gridCollision = (GHIDRA_CAST<Room *>((local_18)))->Room::GetGridCollision(uVar3);
|
||||
gridCollision = Room::GetGridCollision(local_18,uVar3);
|
||||
if (GHIDRA_INT(gridCollision) < 1) {
|
||||
stairs = operator_new(0x154);
|
||||
local_8 = 0x12;
|
||||
@@ -2601,7 +2601,7 @@ void NpcHelper::gideon_spawn_wave()
|
||||
while (local_50 == puVar4) {
|
||||
local_84.y = (float)&local_4c->_roomConfig;
|
||||
local_60 = 0;
|
||||
local_9c.y = (float)(GHIDRA_CAST<Room *>((room)))->Room::GetRoomShape();
|
||||
local_9c.y = (float)Room::GetRoomShape(room);
|
||||
if (local_4c->_challenge == 0x2c) {
|
||||
stageType = Level::GetRoomStageType(GHIDRA_CAST<Level *>(local_4c),local_4c->_currentRoomIdx);
|
||||
uVar5 = local_4c->_stage;
|
||||
@@ -2670,7 +2670,7 @@ LAB_004b1ace:
|
||||
spawnVariant = spawnVariant >> ((uint8_t)local_90 & 0x1f) ^ spawnVariant;
|
||||
spawnVariant = spawnVariant << ((uint8_t)((uint64_t)local_90 >> 0x20) & 0x1f) ^ spawnVariant;
|
||||
spawnVariant = spawnVariant >> ((uint8_t)local_5c & 0x1f) ^ spawnVariant;
|
||||
(GHIDRA_CAST<Room *>((room)))->Room::TransformEntry(&spawnEntry,uVar5,spawnVariant);
|
||||
Room::TransformEntry(room,&spawnEntry,uVar5,spawnVariant);
|
||||
if (GHIDRA_INT(spawnEntry) < 1000) {
|
||||
if ((spawnEntry == 0x339) && (pitCount < 6)) {
|
||||
local_50 = entriesBegin;
|
||||
@@ -2712,7 +2712,7 @@ LAB_004b1ccf:
|
||||
do {
|
||||
local_84.x = (float)(GHIDRA_INT(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_4c) + -4))) % room->_gridWidth) * 40.0 + 40.0;
|
||||
local_84.y = (float)(GHIDRA_INT(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_4c) + -4))) / room->_gridWidth) * 40.0 + 120.0;
|
||||
(GHIDRA_CAST<Room *>((room)))->Room::FindFreeTilePosition(&local_9c,&local_84,0.0);
|
||||
Room::FindFreeTilePosition(room,&local_9c,&local_84,0.0);
|
||||
if (spawnVariant == 0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
||||
pcVar1 = (code *)swi(3);
|
||||
@@ -3010,7 +3010,7 @@ LAB_004b3c68:
|
||||
*GHIDRA_CAST<uint16_t *>((afterimage + 1)) = 0;
|
||||
afterimage->_health = 0.0;
|
||||
afterimage->_maxHitPoints = 0.0;
|
||||
afterimage->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(afterimage) + 0xc))();
|
||||
ExceptionList = local_10;
|
||||
return afterimage;
|
||||
}
|
||||
@@ -3190,7 +3190,7 @@ LAB_004b42a6:
|
||||
*GHIDRA_CAST<uint16_t *>(&npcLocal->_stateFrame) = 0xffff;
|
||||
npcLocal->_state = uVar2;
|
||||
if (uVar2 == 7) {
|
||||
(GHIDRA_CAST<Entity_NPC *>((npcLocal)))->Entity_NPC::ClearDequeRefs();
|
||||
Entity_NPC::ClearDequeRefs(npcLocal);
|
||||
if (pEVar1->_child != 0) {
|
||||
local_38 = &pEVar1->_child;
|
||||
msvc::multiset<unsigned_int>::erase(&local_38);
|
||||
@@ -3634,7 +3634,7 @@ void NpcHelper::hornfel_remove_doors()
|
||||
scratchVec.x = *GHIDRA_CAST<float *>((*hornfelDoorIter + 0x33c));
|
||||
scratchVec.y = *GHIDRA_CAST<float *>((*hornfelDoorIter + 0x340));
|
||||
pEVar4 = Game::Spawn(g_game,1000,0xf,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3);
|
||||
pEVar4->SetColor(&local_40,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0x3c))(&local_40,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(*hornfelDoorIter) + 0x28))();
|
||||
hornfelDoorIter = local_44;
|
||||
local_44 = piVar6;
|
||||
@@ -4057,7 +4057,7 @@ LAB_004b8213:
|
||||
local_58.y = (float)npc->_minecart;
|
||||
if (GHIDRA_CAST<Entity_NPC *>(local_58.y) != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
||||
FUN_004cf0f0(1);
|
||||
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(local_58.y))))->Entity_NPC::SetMinecartPosVel(&pEVar5->_targetPosition,&local_50);
|
||||
Entity_NPC::SetMinecartPosVel(GHIDRA_CAST<Entity_NPC *>(local_58.y),&pEVar5->_targetPosition,&local_50);
|
||||
fVar8 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_58.y) + 0x33c)))->y;
|
||||
(npc->_pos).x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_58.y) + 0x33c)))->x;
|
||||
(npc->_pos).y = fVar8;
|
||||
@@ -4306,7 +4306,7 @@ void NpcHelper::hornfel_ride_minecart(Entity_NPC *linkedNpc)
|
||||
if ('\0' < *GHIDRA_CAST<char *>((GHIDRA_INT(&linkedNpc->_projectileDelay) + 2))) {
|
||||
ExceptionList = &local_10;
|
||||
hornfel_get_rail_direction(linkedNpc,&scratchVec);
|
||||
(GHIDRA_CAST<Entity_NPC *>((minecart)))->Entity_NPC::SetMinecartPosVel(&linkedNpc->_targetPosition,&scratchVec);
|
||||
Entity_NPC::SetMinecartPosVel(minecart,&linkedNpc->_targetPosition,&scratchVec);
|
||||
fVar4 = (minecart->_pos).x;
|
||||
fVar6 = (minecart->_pos).y;
|
||||
pcVar1 = GHIDRA_CAST<char *>((GHIDRA_INT(&linkedNpc->_projectileDelay) + 2));
|
||||
@@ -4495,7 +4495,7 @@ LAB_004b8df1:
|
||||
rng._shift2 = 9;
|
||||
rng._shift3 = 7;
|
||||
uVar1 = (GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<WeightedOutcomePicker *>(&picker))))->WeightedOutcomePicker::PickOutcome(rng);
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_28 = GHIDRA_CAST<uint32_t *>(((target->_pos).x - (npc->_pos).x));
|
||||
targetDirY = (target->_pos).y - (npc->_pos).y;
|
||||
targetDist = sqrtf((float)local_28 * (float)local_28 + targetDirY * targetDirY);
|
||||
@@ -4848,7 +4848,7 @@ int NpcHelper::hornfel_next_rail_index(Entity_NPC *npc)
|
||||
}
|
||||
nextPos.x = (float)directionSign * 40.0 + (npc->_targetPosition).x;
|
||||
nextPos.y = (npc->_targetPosition).y + 0.0;
|
||||
iVar1 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&nextPos);
|
||||
iVar1 = Room::GetGridIndex(room,&nextPos);
|
||||
return iVar1;
|
||||
}
|
||||
if (GHIDRA_INT(railDirection) < 0) {
|
||||
@@ -4859,7 +4859,7 @@ int NpcHelper::hornfel_next_rail_index(Entity_NPC *npc)
|
||||
}
|
||||
nextPos.x = (npc->_targetPosition).x + 0.0;
|
||||
nextPos.y = (float)directionSign * 40.0 + (npc->_targetPosition).y;
|
||||
iVar1 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&nextPos);
|
||||
iVar1 = Room::GetGridIndex(room,&nextPos);
|
||||
return iVar1;
|
||||
}
|
||||
}
|
||||
@@ -4982,7 +4982,7 @@ void NpcHelper::hornfel_room_controller(Entity_Effect *effect)
|
||||
}
|
||||
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x44)) & 1) != 0) {
|
||||
hornfel_remove_doors();
|
||||
effect->Remove();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(effect) + 0x28))();
|
||||
}
|
||||
roomWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x12cc)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x12c8));
|
||||
iVar4 = 0;
|
||||
@@ -5017,7 +5017,7 @@ void NpcHelper::hornfel_room_controller(Entity_Effect *effect)
|
||||
*GHIDRA_CAST<uint32_t *>(&cart->_flags) = GHIDRA_UINT(cart->_flags) & 0xfffffffb;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&cart->_flags) + 4)) = uVar1;
|
||||
cart->_spawnerType = 0x38a;
|
||||
(GHIDRA_CAST<Entity *>((cart)))->Entity::GiveMinecart(&npc->_targetPosition,&railDirection);
|
||||
Entity::GiveMinecart(cart,&npc->_targetPosition,&railDirection);
|
||||
hornfel_claim_target(npc,cart);
|
||||
}
|
||||
}
|
||||
@@ -5061,7 +5061,7 @@ uint8_t NpcHelper::horny_boys_pick_position(Entity_NPC *npc)
|
||||
(npc->_targetPosition).x = g_vectorZero.x;
|
||||
(npc->_targetPosition).y = g_vectorZero.y;
|
||||
do {
|
||||
(GHIDRA_CAST<Room *>((game->_room)))->Room::GetRandomPosition(&candidatePos,20.0);
|
||||
Room::GetRandomPosition(game->_room,&candidatePos,20.0);
|
||||
room = g_game->_room;
|
||||
gridX = GHIDRA_INT(((candidatePos.x - 40.0) / 40.0 + 0.5));
|
||||
iVar1 = GHIDRA_INT(((candidatePos.y - 120.0) / 40.0 + 0.5));
|
||||
@@ -5375,7 +5375,7 @@ void NpcHelper::horny_boys_render(Entity_NPC *npc, Vector *offset)
|
||||
void *animData;
|
||||
float offsetY;
|
||||
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::Render(offset);
|
||||
Entity::Render(GHIDRA_CAST<Entity *>(npc),offset);
|
||||
renderScale = g_displayPixelRatio * g_screenPointScale;
|
||||
dVar2 = floor((double)(((((npc->_posOffset).x + (npc->_pos).x) - 60.0) * 0.65 +
|
||||
(g_screenWidth - 338.0) * 0.5) * renderScale + 0.5));
|
||||
@@ -5469,7 +5469,7 @@ void NpcHelper::minecart_break(Entity_NPC *minecart)
|
||||
Manager *manager;
|
||||
|
||||
local_14 = (float)(__security_cookie ^ GHIDRA_UINT(((&particleColor)[1]._tint + 1)));
|
||||
minecart->Remove();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(minecart) + 0x28))();
|
||||
manager = g_manager;
|
||||
local_44 = GHIDRA_CAST<uint32_t *>(0x1e1);
|
||||
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_44));
|
||||
@@ -5595,7 +5595,7 @@ void NpcHelper::moms_heart_attack_pattern(Entity_NPC *npc, int pattern, int stat
|
||||
projParams.Scale = 1.5;
|
||||
projParams.FallingAccelModifier = -0.06;
|
||||
projParams.FallingSpeedModifier = -2.0;
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
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);
|
||||
@@ -5799,7 +5799,7 @@ void NpcHelper::moms_heart_attack_pattern(Entity_NPC *npc, int pattern, int stat
|
||||
laser->_rotationDegrees = local_d0.x;
|
||||
laser->_rotationSpd = rotationSpeed;
|
||||
laser->_timeout = iVar1 + GHIDRA_INT(local_f4) + 1;
|
||||
laser->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
||||
local_f0 = (float)(GHIDRA_INT(local_f0) + 1);
|
||||
} while (GHIDRA_INT(local_f0) < 4);
|
||||
return;
|
||||
@@ -6015,7 +6015,7 @@ LAB_004d358e:
|
||||
laser->_rotationDegrees = fVar5;
|
||||
laser->_rotationSpd = fVar3;
|
||||
laser->_timeout = GHIDRA_INT(local_d4);
|
||||
laser->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
||||
iVar1 = iVar1 + 1;
|
||||
} while (iVar1 < 2);
|
||||
return;
|
||||
@@ -6184,7 +6184,7 @@ Entity_NPC * NpcHelper::gaper_l2_spawn_maggot(Vector *origin, float yOffset, Vec
|
||||
else {
|
||||
(maggot->_posOffset).y = yOffset;
|
||||
}
|
||||
maggot->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(maggot) + 0xc))();
|
||||
fVar3 = (maggot->_velocity).x;
|
||||
dirY = (maggot->_velocity).y;
|
||||
seed = maggot->_initSeed;
|
||||
@@ -6254,8 +6254,8 @@ void NpcHelper::twitchy_jump_target(Vector *outTarget, Entity_NPC *npc)
|
||||
Room *room;
|
||||
|
||||
room = g_game->_room;
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(outTarget,0.0);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
Entity_NPC::CalcTargetPosition(npc,outTarget,0.0);
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_8 = (playerTarget->_velocity).y;
|
||||
fVar2 = (npc->_pos).x - (playerTarget->_pos).x;
|
||||
local_c = (playerTarget->_velocity).x;
|
||||
@@ -6316,9 +6316,9 @@ void NpcHelper::twitchy_jump_target(Vector *outTarget, Entity_NPC *npc)
|
||||
else {
|
||||
gridIndex = room->_gridWidth * gridRow + gridIndex;
|
||||
}
|
||||
gridCollision = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(gridIndex);
|
||||
gridCollision = Room::GetGridCollision(room,gridIndex);
|
||||
if (0 < GHIDRA_INT(gridCollision)) {
|
||||
resultPos = (GHIDRA_CAST<Room *>((room)))->Room::FindFreeTilePosition(&scratchVec,outTarget,64.0);
|
||||
resultPos = Room::FindFreeTilePosition(room,&scratchVec,outTarget,64.0);
|
||||
outTarget->x = resultPos->x;
|
||||
outTarget->y = resultPos->y;
|
||||
}
|
||||
@@ -6380,7 +6380,7 @@ void NpcHelper::gutted_fatty_burst_projectiles(Entity *timer)
|
||||
Entity_Projectile::apply_spawn_flags
|
||||
(pEVar1,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(timer[1])) + 0x40)))),
|
||||
*GHIDRA_CAST<float *>((timer[1]._sprite._animDefaultName._buf + 8)),timer->_flags,GHIDRA_CAST<Entity *>(0x0));
|
||||
pEVar1->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar1) + 0xc))();
|
||||
projectilesLeft = projectilesLeft + -1;
|
||||
} while (projectilesLeft != 0);
|
||||
projectilesLeft = 2;
|
||||
@@ -6421,7 +6421,7 @@ void NpcHelper::gutted_fatty_burst_projectiles(Entity *timer)
|
||||
Entity_Projectile::apply_spawn_flags
|
||||
(pEVar1,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(timer[1])) + 0x40)))),
|
||||
*GHIDRA_CAST<float *>((timer[1]._sprite._animDefaultName._buf + 8)),timer->_flags,GHIDRA_CAST<Entity *>(0x0));
|
||||
pEVar1->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar1) + 0xc))();
|
||||
projectilesLeft = projectilesLeft + -1;
|
||||
} while (projectilesLeft != 0);
|
||||
return;
|
||||
@@ -6445,7 +6445,7 @@ uint8_t NpcHelper::candler_is_free_cell(Vector *position)
|
||||
else {
|
||||
gridY = room->_gridWidth * gridY + gridY;
|
||||
}
|
||||
uVar1 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(gridY);
|
||||
uVar1 = Room::GetGridCollision(room,gridY);
|
||||
if (((((uVar1 == 0) && (gridY = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5)), -1 < gridY)) &&
|
||||
((gridY < room->_gridWidth &&
|
||||
((gridY = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5)), -1 < gridY &&
|
||||
@@ -6506,7 +6506,7 @@ uint8_t NpcHelper::whipper_is_target(Entity_NPC *npc, Entity *entity)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
||||
bVar2 = Entity::IsVulnerableEnemy(entity,GHIDRA_CAST<Entity *>(0x0));
|
||||
if (bVar2 != 0) {
|
||||
return 1;
|
||||
}
|
||||
@@ -6776,7 +6776,7 @@ LAB_0052926a:
|
||||
if (uVar7 < 0x12d) {
|
||||
if (uVar7 == 300) {
|
||||
while ((local_124 = local_114, local_114 == 0.0 ||
|
||||
(cVar6 = pEVar11->Kill(), cVar6 != '\0'))) {
|
||||
(cVar6 = (**(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0x24))(), cVar6 != '\0'))) {
|
||||
if (uVar8 == 0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
||||
fnPtr = (code *)swi(3);
|
||||
@@ -6841,7 +6841,7 @@ LAB_005290ba:
|
||||
else {
|
||||
if (uVar7 != 0x15e) goto LAB_0052926a;
|
||||
while ((local_124 = local_114, local_114 == 0.0 ||
|
||||
(cVar6 = pEVar11->guard_check_icall(), cVar6 != '\0'))) {
|
||||
(cVar6 = (**(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0x2c))(), cVar6 != '\0'))) {
|
||||
local_114 = (float)ItemPool::GetTrinket(&g_game->_itemPool,0);
|
||||
}
|
||||
}
|
||||
@@ -6883,7 +6883,7 @@ LAB_00529272:
|
||||
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x1214));
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x1214)) = iVar10 + 1;
|
||||
pEVar11->_index = iVar10;
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar12) + 0x1218)))))->EntityList::AddEntity(pEVar11);
|
||||
EntityList::AddEntity(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar12) + 0x1218)),pEVar11);
|
||||
isErased = Game::ShouldEraseEnemy(pEVar11);
|
||||
if (isErased != 0) {
|
||||
Entity::RemoveWithPoof(pEVar11,unusedArg);
|
||||
@@ -6952,7 +6952,7 @@ LAB_00529568:
|
||||
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_120[1])) + 0x4)))) = iVar10;
|
||||
uVar7 = Random();
|
||||
pEVar11 = Game::Spawn(g_game,1000,2,&spawnPos,bloodVel,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
||||
pEVar11->SetColor(&DAT_00c5c800,0xffffffff,0xff);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0x3c))(&DAT_00c5c800,0xffffffff,0xff);
|
||||
(pEVar11->_sprite)._offset.x = 0.0;
|
||||
(pEVar11->_sprite)._offset.y = -5.0;
|
||||
pEVar11->_renderDepthOffset = 10.0;
|
||||
@@ -7108,7 +7108,7 @@ LAB_00529a2e:
|
||||
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x1214));
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x1214)) = iVar10 + 1;
|
||||
pEVar11->_index = iVar10;
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar12) + 0x1218)))))->EntityList::AddEntity(pEVar11);
|
||||
EntityList::AddEntity(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar12) + 0x1218)),pEVar11);
|
||||
isErased = Game::ShouldEraseEnemy(pEVar11);
|
||||
if (isErased != 0) {
|
||||
Entity::RemoveWithPoof(pEVar11,unusedArg_00);
|
||||
@@ -7171,7 +7171,7 @@ LAB_00529ca4:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) + (((uVar14 >> 0x12) - uStack_cc) - GHIDRA_UINT((uVar8 < uVar7))) +
|
||||
GHIDRA_UINT(bVar15);
|
||||
}
|
||||
pEVar11->SetColor(&DAT_00c5c800,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0x3c))(&DAT_00c5c800,0xffffffff,0xff,0,1);
|
||||
spriteColor = &(pEVar11->_sprite)._color;
|
||||
if (&pEVar11->_splatColor != spriteColor) {
|
||||
fVar16 = (pEVar11->_sprite)._color._tint[1];
|
||||
@@ -7192,7 +7192,7 @@ LAB_00529ca4:
|
||||
*GHIDRA_CAST<uint64_t *>((pEVar11->_sprite)._color._offset);
|
||||
(pEVar11->_splatColor)._offset[2] = (pEVar11->_sprite)._color._offset[2];
|
||||
}
|
||||
pEVar11->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0xc))();
|
||||
local_11c = GHIDRA_CAST<Game *>((GHIDRA_INT(local_11c) + -1));
|
||||
} while( true );
|
||||
}
|
||||
@@ -7276,7 +7276,7 @@ void NpcHelper::leper_flesh_ai(Entity_NPC *npc)
|
||||
if (npc->_state != 0) {
|
||||
if (npc->_state == 4) {
|
||||
npc->_friction = npc->_friction * 0.95;
|
||||
pVVar3 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&local_d4,0.0);
|
||||
pVVar3 = Entity_NPC::CalcTargetPosition(npc,&local_d4,0.0);
|
||||
local_c8 = GHIDRA_CAST<uint8_t *>((pVVar3->y - (npc->_pos).y));
|
||||
local_c4 = pVVar3->x - (npc->_pos).x;
|
||||
fVar8 = sqrtf((float)local_c8 * (float)local_c8 + local_c4 * local_c4);
|
||||
@@ -7285,7 +7285,7 @@ void NpcHelper::leper_flesh_ai(Entity_NPC *npc)
|
||||
local_c8 = GHIDRA_CAST<uint8_t *>(((float)local_c8 * (1.0 / fVar8)));
|
||||
}
|
||||
if (npc->_controllerID != -1) {
|
||||
pVVar3 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetControllerInput(&local_d4,0.0);
|
||||
pVVar3 = Entity_NPC::GetControllerInput(npc,&local_d4,0.0);
|
||||
local_c4 = pVVar3->x;
|
||||
local_c8 = GHIDRA_CAST<uint8_t *>(pVVar3->y);
|
||||
}
|
||||
@@ -7363,14 +7363,14 @@ LAB_005489bd:
|
||||
(npc->_sprite)._flipX = ~((uint8_t)(uVar4 >> (SUB41(local_c4,0) & 0x1f)) ^ (uint8_t)uVar4) & 1;
|
||||
npc->_isKillOnTouch = 1;
|
||||
LAB_00548a4b:
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::IsFrame(10,0);
|
||||
bVar2 = Entity::IsFrame(GHIDRA_CAST<Entity *>(npc),10,0);
|
||||
if (bVar2 != 0) {
|
||||
uVar4 = Random();
|
||||
Entity_NPC::MakeSplat
|
||||
(npc,(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
||||
2.3283064e-10 * 0.4 + 0.4);
|
||||
}
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::IsFrame(6,0);
|
||||
bVar2 = Entity::IsFrame(GHIDRA_CAST<Entity *>(npc),6,0);
|
||||
local_f0 = 0.3;
|
||||
uStack_ec = 0;
|
||||
uStack_e8 = 0;
|
||||
@@ -7420,10 +7420,10 @@ LAB_00548a4b:
|
||||
local_fc = g_vectorZero.y;
|
||||
local_f8 = 0;
|
||||
local_f4 = 0;
|
||||
npc->Kill(&sourceRef);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x24))(&sourceRef);
|
||||
}
|
||||
if ((npc->_dead != 0) && ((npc->_flags & 0x1000000) == 0)) {
|
||||
pEVar7 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
pEVar7 = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_c8 = GHIDRA_CAST<uint8_t *>((pEVar7->_velocity).x);
|
||||
fVar8 = (npc->_pos).y - (pEVar7->_pos).y;
|
||||
local_c4 = (pEVar7->_velocity).y;
|
||||
@@ -7503,11 +7503,11 @@ void NpcHelper::bulb_player_collision(Entity_NPC *npc, Entity *collider)
|
||||
}
|
||||
damageSource._flags = uVar1 | uVar2 | GHIDRA_UINT(local_3c.x);
|
||||
damageSource._entity = npc;
|
||||
collider->TakeDamage(0x3f800000,0,0,&damageSource,0x1e);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(collider) + 0x20))(0x3f800000,0,0,&damageSource,0x1e);
|
||||
}
|
||||
else {
|
||||
sourceRef = (GHIDRA_CAST<EntityRef *>((&damageSource)))->EntityRef::EntityRef();
|
||||
collider->TakeDamage(0x41200000,0,0,sourceRef,0x1e);
|
||||
sourceRef = EntityRef::EntityRef(&damageSource);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(collider) + 0x20))(0x41200000,0,0,sourceRef,0x1e);
|
||||
}
|
||||
npc->_state = 6;
|
||||
fVar5 = -(npc->_v1).x;
|
||||
@@ -7539,8 +7539,8 @@ void NpcHelper::bulb_player_collision(Entity_NPC *npc, Entity *collider)
|
||||
fVar3 = npc->_speedMultiplier;
|
||||
(npc->_velocity).x = proceduralIdx * 16.0 * fVar3 + (npc->_velocity).x;
|
||||
(npc->_velocity).y = fVar5 * 16.0 * fVar3 + (npc->_velocity).y;
|
||||
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(collider))))->Entity_Player::PlayExtraAnimation(&DAT_00b1d3b0);
|
||||
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(collider))))->Entity_Player::ResetItemState();
|
||||
Entity_Player::PlayExtraAnimation(GHIDRA_CAST<Entity_Player *>(collider),&DAT_00b1d3b0);
|
||||
Entity_Player::ResetItemState(GHIDRA_CAST<Entity_Player *>(collider));
|
||||
uVar2 = 0;
|
||||
game = g_game;
|
||||
do {
|
||||
@@ -7588,7 +7588,7 @@ LAB_0054cfd6:
|
||||
}
|
||||
if (((itemConfig != 0) && (0 < GHIDRA_INT(local_3c.x))) &&
|
||||
((uVar2 < 4 && (0 < GHIDRA_INT(collider[5]._sprite._championColor._colorize[uVar2 * 8 + 3]))))) {
|
||||
chargeChange = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(collider))))->Entity_Player::GetActiveMaxCharge(uVar2);
|
||||
chargeChange = Entity_Player::GetActiveMaxCharge(GHIDRA_CAST<Entity_Player *>(collider),uVar2);
|
||||
if (chargeChange == 1) {
|
||||
chargeChange = -1000;
|
||||
}
|
||||
@@ -8000,7 +8000,7 @@ void NpcHelper::willo_attack(Entity_NPC *npc)
|
||||
local_bc = 2.14399e-43;
|
||||
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_bc));
|
||||
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_bc),1.0,2,0,local_b8,0.0);
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(npc);
|
||||
(GHIDRA_CAST<ProjectileParams *>((&projParams)))->ProjectileParams::ProjectileParams();
|
||||
local_bc = ((target->_pos).x + (target->_velocity).x) - (npc->_pos).x;
|
||||
local_b8 = ((target->_pos).y + (target->_velocity).y) - (npc->_pos).y;
|
||||
@@ -8220,7 +8220,7 @@ void NpcHelper::bubbles_death_geyser_tick(Entity *owner)
|
||||
Entity_Projectile::apply_spawn_flags
|
||||
(projectile,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(owner[1])) + 0x40)))),
|
||||
*GHIDRA_CAST<float *>((owner[1]._sprite._animDefaultName._buf + 8)),owner->_flags,GHIDRA_CAST<Entity *>(0x0));
|
||||
projectile->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(projectile) + 0xc))();
|
||||
lowShotsLeft = lowShotsLeft + -1;
|
||||
} while (lowShotsLeft != 0);
|
||||
highShotsLeft = 2;
|
||||
@@ -8262,7 +8262,7 @@ void NpcHelper::bubbles_death_geyser_tick(Entity *owner)
|
||||
Entity_Projectile::apply_spawn_flags
|
||||
(projectile,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(owner[1])) + 0x40)))),
|
||||
*GHIDRA_CAST<float *>((owner[1]._sprite._animDefaultName._buf + 8)),owner->_flags,GHIDRA_CAST<Entity *>(0x0));
|
||||
projectile->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(projectile) + 0xc))();
|
||||
highShotsLeft = highShotsLeft + -1;
|
||||
} while (highShotsLeft != 0);
|
||||
return;
|
||||
@@ -8294,7 +8294,7 @@ uint8_t NpcHelper::polty_is_target_liftable(Entity_NPC *npc)
|
||||
return 0;
|
||||
}
|
||||
room = g_game->_room;
|
||||
local_AL_113 = (GHIDRA_CAST<Room *>((room)))->Room::CanPickupGridEntity(npc->_i2);
|
||||
local_AL_113 = Room::CanPickupGridEntity(room,npc->_i2);
|
||||
if (local_AL_113 == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -8409,21 +8409,22 @@ void NpcHelper::mother_spawn_parts()
|
||||
npc->_isInvicible = 1;
|
||||
*GHIDRA_CAST<uint32_t *>(&npc->_flags) = GHIDRA_UINT(npc->_flags) & 0xfffffffb | 0x80100011;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&npc->_flags) + 4)) = uVar1;
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::SetVisibleFlag(0);
|
||||
Entity::SetVisibleFlag(GHIDRA_CAST<Entity *>(npc),0);
|
||||
if (npc->_parent != 0) {
|
||||
local_14 = GHIDRA_CAST<Entity *>(&npc->_parent);
|
||||
msvc::multiset<unsigned_int>::erase(&local_14);
|
||||
}
|
||||
npc->_parent = in_ECX;
|
||||
msvc::multiset<unsigned_int>::insert(&npc->_parent);
|
||||
npc->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0xc))();
|
||||
part2Pos.x = DAT_00c33d44 + (in_ECX->_pos).x;
|
||||
part2Pos.y = DAT_00c33d48 + (in_ECX->_pos).y;
|
||||
part2 = Game::Spawn(g_game,0x390,0,&part2Pos,&g_vectorZero,in_ECX,2,in_ECX->_initSeed);
|
||||
local_20 = -g_vectorOne.x;
|
||||
local_1c = GHIDRA_CAST<Entity_NPC *>(-g_vectorOne.y);
|
||||
local_14 = part2;
|
||||
(GHIDRA_CAST<Entity *>((part2)))->Entity::SetSize(70.0,(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1);
|
||||
Entity::SetSize(part2,70.0,(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1
|
||||
);
|
||||
offsetY = (in_ECX->_posOffset).y - DAT_00c33d48;
|
||||
(part2->_posOffset).x = (in_ECX->_posOffset).x - DAT_00c33d44;
|
||||
(part2->_posOffset).y = offsetY;
|
||||
@@ -8436,13 +8437,14 @@ void NpcHelper::mother_spawn_parts()
|
||||
flags = part2->_flags;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&part2->_flags) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&part2->_flags) + 4));
|
||||
*GHIDRA_CAST<uint32_t *>(&part2->_flags) = GHIDRA_UINT(flags) & 0xfffffffb | 0x80000000;
|
||||
part2->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(part2) + 0xc))();
|
||||
part3Pos.x = DAT_00c33d4c + (in_ECX->_pos).x;
|
||||
part3Pos.y = DAT_00c33d50 + (in_ECX->_pos).y;
|
||||
part2 = Game::Spawn(g_game,0x390,0,&part3Pos,&g_vectorZero,in_ECX,3,in_ECX->_initSeed);
|
||||
local_20 = -g_vectorOne.x;
|
||||
local_1c = GHIDRA_CAST<Entity_NPC *>(-g_vectorOne.y);
|
||||
(GHIDRA_CAST<Entity *>((part2)))->Entity::SetSize(70.0,(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1);
|
||||
Entity::SetSize(part2,70.0,(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1
|
||||
);
|
||||
offsetY = (in_ECX->_posOffset).y - DAT_00c33d50;
|
||||
(part2->_posOffset).x = (in_ECX->_posOffset).x - DAT_00c33d4c;
|
||||
(part2->_posOffset).y = offsetY;
|
||||
@@ -8455,7 +8457,7 @@ void NpcHelper::mother_spawn_parts()
|
||||
flags = part2->_flags;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&part2->_flags) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&part2->_flags) + 4));
|
||||
*GHIDRA_CAST<uint32_t *>(&part2->_flags) = GHIDRA_UINT(flags) & 0xfffffffb | 0x80000000;
|
||||
part2->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(part2) + 0xc))();
|
||||
local_18 = GHIDRA_CAST<int *>(0x0);
|
||||
msvc::deque<int>::resize(3,&local_18);
|
||||
uVar2 = in_ECX[2]._dropRNG._seed;
|
||||
@@ -8544,8 +8546,8 @@ void NpcHelper::mother_2_slam_burst(float *param_1)
|
||||
(spawnedEffect->_posOffset).y =
|
||||
-10.0 - (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
||||
2.3283064e-10 * 20.0;
|
||||
spawnedEffect->SetColor(&g_colorGreenSplat,0xffffffff,0xff,0,1);
|
||||
spawnedEffect->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(spawnedEffect) + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(spawnedEffect) + 0xc))();
|
||||
local_18 = param_1[1];
|
||||
backDirX = *param_1;
|
||||
fVar4 = sqrtf(local_18 * local_18 + backDirX * backDirX);
|
||||
@@ -8577,7 +8579,7 @@ void NpcHelper::mother_2_slam_burst(float *param_1)
|
||||
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,GHIDRA_CAST<Entity *>(0x0),0,rngResult);
|
||||
spawnedEffect->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(spawnedEffect) + 0xc))();
|
||||
iVar2 = iVar3 + -1;
|
||||
} while (iVar2 != 0);
|
||||
iVar3 = iVar3 + 0xb;
|
||||
@@ -8617,7 +8619,7 @@ void NpcHelper::mother_2_slam_burst(float *param_1)
|
||||
(float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
||||
2.3283064e-10 * 360.0;
|
||||
(**(code **)(iVar2 + 0x3c))(&g_colorGreenSplat,0xffffffff,0xff,0,1);
|
||||
spawnedEffect->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(spawnedEffect) + 0xc))();
|
||||
iVar3 = iVar3 + -1;
|
||||
} while (iVar3 != 0);
|
||||
return;
|
||||
@@ -8711,7 +8713,7 @@ void NpcHelper::mother_render(Entity_NPC *npc, Vector *offset)
|
||||
}
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::Render(offset);
|
||||
Entity::Render(GHIDRA_CAST<Entity *>(npc),offset);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -8753,7 +8755,7 @@ Entity * NpcHelper::clutch_find_farthest_orbital(Entity_NPC *clutch, int unused)
|
||||
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (tmpEntity->_type == 1)) ||
|
||||
(tmpEntity->_type - 10U < 0x3de)) {
|
||||
local_24 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&tmpEntity->_flags) + 4));
|
||||
isClutchFriendly = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(clutch))))->Entity::IsFriendly();
|
||||
isClutchFriendly = Entity::IsFriendly(GHIDRA_CAST<Entity *>(clutch));
|
||||
if (((extraout_DL == isClutchFriendly) && (GHIDRA_CAST<Entity_NPC *>(tmpEntity->_parent) == clutch)) &&
|
||||
((tmpEntity != GHIDRA_CAST<Entity *>(clutch->_child) &&
|
||||
((tmpEntity[2]._updateTime != 1.38729e-43 &&
|
||||
@@ -8843,7 +8845,7 @@ void NpcHelper::clutch_spawn_fire(Entity_NPC *npc, Entity *target)
|
||||
addFlagsFn = *(code **)(*GHIDRA_CAST<int *>(target) + 0x24);
|
||||
local_54 = npc;
|
||||
local_24 = uVar5;
|
||||
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_4c))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(npc));
|
||||
EntityRef::constructor(GHIDRA_CAST<EntityRef *>(local_4c),GHIDRA_CAST<Entity *>(npc));
|
||||
(*addFlagsFn)(local_4c,uVar5);
|
||||
uVar5 = Random();
|
||||
local_64.x = (local_58->_pos).x;
|
||||
@@ -8935,7 +8937,7 @@ LAB_00572e7c:
|
||||
} while (pbVar6 < GHIDRA_CAST<uint8_t *>((local_50->_sprite)._layerCount));
|
||||
npc = local_54;
|
||||
}
|
||||
local_50->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(local_50) + 0xc))();
|
||||
local_50 = GHIDRA_CAST<Entity *>(0x2);
|
||||
do {
|
||||
uVar5 = Random();
|
||||
@@ -9189,7 +9191,7 @@ LAB_00575ed0:
|
||||
pLVar1->_visible = 0;
|
||||
}
|
||||
}
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::Render(offset);
|
||||
Entity::Render(GHIDRA_CAST<Entity *>(npc),offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9239,7 +9241,7 @@ void NpcHelper::raglich_pick_target_pos(Entity_NPC *npc, float speed)
|
||||
local_24.y = local_24.y * 40.0;
|
||||
local_c.x = clampedPos.x + local_14.y;
|
||||
local_c.y = clampedPos.y + local_24.y;
|
||||
isInRoom = (GHIDRA_CAST<Room *>((room)))->Room::IsPositionInRoom(&local_c,0.0);
|
||||
isInRoom = Room::IsPositionInRoom(room,&local_c,0.0);
|
||||
if (isInRoom == 0) {
|
||||
direction = (GHIDRA_INT((short)npc->_i1) - GHIDRA_INT(*GHIDRA_CAST<char *>((GHIDRA_INT(&npc->_i1) + 2)))) + 4U & 0x80000003;
|
||||
if (GHIDRA_INT(direction) < 0) {
|
||||
@@ -9265,18 +9267,18 @@ void NpcHelper::raglich_pick_target_pos(Entity_NPC *npc, float speed)
|
||||
probePos.y = clampedPos.y - local_1c.y * 40.0;
|
||||
local_1c.y = probePos.y;
|
||||
local_c.y = probePos.x;
|
||||
isInRoom = (GHIDRA_CAST<Room *>((room)))->Room::IsPositionInRoom(&probePos,0.0);
|
||||
isInRoom = Room::IsPositionInRoom(room,&probePos,0.0);
|
||||
if (isInRoom == 0) goto LAB_00576404;
|
||||
probePos.x = local_c.y - local_14.y;
|
||||
probePos.y = local_1c.y - local_24.y;
|
||||
isInRoom = (GHIDRA_CAST<Room *>((room)))->Room::IsPositionInRoom(&probePos,0.0);
|
||||
isInRoom = Room::IsPositionInRoom(room,&probePos,0.0);
|
||||
if (isInRoom != 0) goto LAB_00576404;
|
||||
direction = (short)npc->_i1 + 4 + GHIDRA_INT(*GHIDRA_CAST<char *>((GHIDRA_INT(&npc->_i1) + 2))) & 0x80000003;
|
||||
if (GHIDRA_INT(direction) < 0) {
|
||||
direction = (direction - 1 | 0xfffffffc) + 1;
|
||||
}
|
||||
*GHIDRA_CAST<short *>(&npc->_i1) = (short)direction;
|
||||
iVar3 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&clampedPos);
|
||||
iVar3 = Room::GetGridIndex(room,&clampedPos);
|
||||
row = iVar3 / room->_gridWidth;
|
||||
iVar3 = iVar3 % room->_gridWidth;
|
||||
}
|
||||
@@ -9341,11 +9343,11 @@ void NpcHelper::raglich_slam_spawn_grid(Entity_NPC *npc)
|
||||
posY = (npc->_pos).y;
|
||||
(npc->_velocity).x = (npc->_targetPosition).x - (npc->_pos).x;
|
||||
(npc->_velocity).y = targetY - posY;
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::GetNullOffset(&slamOffset,&DAT_00b1d3b0);
|
||||
Entity::GetNullOffset(GHIDRA_CAST<Entity *>(npc),&slamOffset,&DAT_00b1d3b0);
|
||||
if ((slamOffset.x != g_vectorZero.x) || (slamOffset.y != g_vectorZero.y)) {
|
||||
if (npc->_i1 == 0) {
|
||||
npc->_i1 = 1;
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::PlaySound(0x34,1.0,2,0,1.0);
|
||||
Entity_NPC::PlaySound(npc,0x34,1.0,2,0,1.0);
|
||||
Game::ShakeScreen(g_game,0xe);
|
||||
}
|
||||
local_68.x = slamOffset.x + (npc->_pos).x;
|
||||
@@ -9430,7 +9432,7 @@ void NpcHelper::raglich_slam_spawn_grid(Entity_NPC *npc)
|
||||
}
|
||||
if (((npc->_sprite)._animState._animData == (void *)0x0) ||
|
||||
((npc->_sprite)._animState._isPlaying == 0)) {
|
||||
npc->Remove(uVar2);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x28))(uVar2);
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
@@ -9601,7 +9603,7 @@ Entity_Laser * NpcHelper::ReapCreep_ThinLaser(Entity_NPC *npc, float startAngle,
|
||||
pEVar1->_rotationSpd = (float)rotationSpeed;
|
||||
pEVar1->_renderDepthOffset = 1000.0;
|
||||
pEVar1->_rotationDegrees = savedEndAngle - savedStartAngle;
|
||||
pEVar1->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar1) + 0xc))();
|
||||
return pEVar1;
|
||||
}
|
||||
|
||||
@@ -9770,7 +9772,7 @@ void NpcHelper::scourge_chain_shoot()
|
||||
}
|
||||
local_e8 = *GHIDRA_CAST<float *>((chainEnd + 0x33c)) - local_e8;
|
||||
local_ec = *GHIDRA_CAST<float *>((chainEnd + 0x340)) - local_ec;
|
||||
pEVar1 = (GHIDRA_CAST<Entity_NPC *>((in_ECX)))->Entity_NPC::GetPlayerTarget();
|
||||
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;
|
||||
@@ -9877,7 +9879,7 @@ void NpcHelper::scourge_chain_shoot()
|
||||
effectPos.y = local_c8 * 4.0 + shootPos.y;
|
||||
rngResult = Random();
|
||||
pEVar1 = Game::Spawn(g_game,1000,2,&effectPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,rngResult);
|
||||
pEVar1->SetColor(&g_colorGreenSplat,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<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;
|
||||
@@ -10060,7 +10062,7 @@ void NpcHelper::siren_charm_familiar(Entity_NPC *npc, Entity_Familiar *familiar)
|
||||
if ((void *)local_14.y != (void *)0x0) {
|
||||
msvc::multiset<unsigned_int>::insert(refSlot);
|
||||
}
|
||||
familiar->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(familiar) + 0xc))();
|
||||
seed = Random();
|
||||
local_1c.x = (pEVar3->_velocity).x;
|
||||
local_1c.y = (pEVar3->_velocity).y;
|
||||
@@ -10100,7 +10102,7 @@ void NpcHelper::siren_charm_familiar(Entity_NPC *npc, Entity_Familiar *familiar)
|
||||
if (pvVar1 != (void *)0x0) {
|
||||
msvc::multiset<unsigned_int>::insert(refSlot);
|
||||
}
|
||||
secondEffect->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(secondEffect) + 0xc))();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -10205,7 +10207,7 @@ int NpcHelper::siren_charmed_count(Entity_NPC *npc)
|
||||
familiar = *GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) + uVar2 * 4));
|
||||
if ((((familiar != GHIDRA_CAST<Entity_Familiar *>(0x0)) && (familiar->_type == 3)) &&
|
||||
((familiar->_flags & 0x100) != 0)) &&
|
||||
((isDetached = (GHIDRA_CAST<Entity_Familiar *>((familiar)))->Entity_Familiar::is_detached_from_follow(), uVar2 = extraout_EDX,
|
||||
((isDetached = Entity_Familiar::is_detached_from_follow(familiar), uVar2 = extraout_EDX,
|
||||
isDetached != 0 && (*(void **)(extraout_ECX + 0x410) == siren->_sirenPlayerEntity)))) {
|
||||
count = count + 1;
|
||||
}
|
||||
@@ -10589,7 +10591,7 @@ void NpcHelper::siren_familiar_orbit(Entity_NPC *siren, Entity_Familiar *familia
|
||||
if (chainFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
||||
chainType = chainFamiliar->_type;
|
||||
while (chainType == 3) {
|
||||
isDetached = (GHIDRA_CAST<Entity_Familiar *>((chainFamiliar)))->Entity_Familiar::is_detached_from_follow();
|
||||
isDetached = Entity_Familiar::is_detached_from_follow(chainFamiliar);
|
||||
if (isDetached != 0) {
|
||||
detachedAheadCount = detachedAheadCount + 1;
|
||||
}
|
||||
@@ -10603,7 +10605,7 @@ void NpcHelper::siren_familiar_orbit(Entity_NPC *siren, Entity_Familiar *familia
|
||||
if (chainFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
||||
chainType = chainFamiliar->_type;
|
||||
while (chainType == 3) {
|
||||
isDetached = (GHIDRA_CAST<Entity_Familiar *>((chainFamiliar)))->Entity_Familiar::is_detached_from_follow();
|
||||
isDetached = Entity_Familiar::is_detached_from_follow(chainFamiliar);
|
||||
orbitSlot = extraout_EDX_00;
|
||||
if (isDetached != 0) {
|
||||
orbitSlot = extraout_EDX_00 + 1;
|
||||
@@ -11127,7 +11129,7 @@ void NpcHelper::UltraGreed_Heal(Entity_NPC *npc, int amount)
|
||||
uStack_18 = 0;
|
||||
local_10 = flashIntensity * 0.84;
|
||||
local_c = flashIntensity * 0.0;
|
||||
npc->SetColor(&healColor,healStacks,0xff,1,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x3c))(&healColor,healStacks,0xff,1,1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11243,7 +11245,7 @@ void NpcHelper::UltraGreed_Smash(Entity_NPC *npc, Vector position)
|
||||
local_24 = __security_cookie ^ GHIDRA_UINT(((&explosionColor)[1]._colorize + 1));
|
||||
ExceptionList = &local_1c;
|
||||
boss = npc;
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CreateGoldParticles(0x1e);
|
||||
Entity_NPC::CreateGoldParticles(npc,0x1e);
|
||||
manager = g_manager;
|
||||
local_80 = 1.93379e-43;
|
||||
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_80));
|
||||
@@ -11685,7 +11687,7 @@ float NpcHelper::visage_score_position(Entity_NPC *npc, Vector *position)
|
||||
float local_1c;
|
||||
float local_18;
|
||||
|
||||
pEVar2 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
pEVar2 = Entity_NPC::GetPlayerTarget(npc);
|
||||
iVar1 = npc->_child;
|
||||
if (iVar1 == 0) {
|
||||
fVar3 = (pEVar2->_pos).y - position->y;
|
||||
@@ -11888,7 +11890,7 @@ LAB_005ab33c:
|
||||
fVar3 = 1000.0;
|
||||
}
|
||||
laser->_renderDepthOffset = fVar3;
|
||||
laser->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12075,9 +12077,9 @@ uint8_t NpcHelper::visage_handle_collision(Entity_NPC *npc, Entity *collider, in
|
||||
if (((npc->_state != 0x76) || (collider->_type != 0x387)) || (collider->_variant != 0x14)) {
|
||||
return 0xff;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::PlaySound(0xb9,1.0,2,0,(float)npc->_stateFrame * 0.15 + 1.0);
|
||||
Entity_NPC::PlaySound(npc,0xb9,1.0,2,0,(float)npc->_stateFrame * 0.15 + 1.0);
|
||||
npc->_stateFrame = npc->_stateFrame + 1;
|
||||
collider->Remove();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(collider) + 0x28))();
|
||||
local_34 = 0x3f800000;
|
||||
uStack_30 = 0x3f800000;
|
||||
uStack_2c = 0x3f800000;
|
||||
@@ -12089,7 +12091,7 @@ uint8_t NpcHelper::visage_handle_collision(Entity_NPC *npc, Entity *collider, in
|
||||
uStack_20 = 0;
|
||||
uStack_1c = 0;
|
||||
uStack_18 = 0;
|
||||
npc->SetColor(&local_34,10,0xff,1,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x3c))(&local_34,10,0xff,1,1);
|
||||
healCap = npc->_maxHitPoints * 0.4;
|
||||
newHealth = npc->_maxHitPoints * 0.025 + npc->_health;
|
||||
if (healCap <= newHealth) {
|
||||
@@ -12116,7 +12118,7 @@ uint8_t NpcHelper::visage_handle_collision(Entity_NPC *npc, Entity *collider, in
|
||||
return 0xff;
|
||||
}
|
||||
if ((npc->_state == 0x6a) || (npc->_state == 0x6d)) {
|
||||
collider->Remove();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(collider) + 0x28))();
|
||||
local_34 = 0x3f800000;
|
||||
uStack_30 = 0x3f800000;
|
||||
uStack_2c = 0x3f800000;
|
||||
@@ -12128,7 +12130,7 @@ uint8_t NpcHelper::visage_handle_collision(Entity_NPC *npc, Entity *collider, in
|
||||
uStack_20 = 0;
|
||||
uStack_1c = 0;
|
||||
uStack_18 = 0;
|
||||
npc->SetColor(&local_34,10,0xff,1,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x3c))(&local_34,10,0xff,1,1);
|
||||
visage_start_charge(npc);
|
||||
return 0xff;
|
||||
}
|
||||
@@ -12166,7 +12168,7 @@ uint8_t NpcHelper::visage_handle_collision(Entity_NPC *npc, Entity *collider, in
|
||||
}
|
||||
iVar2 = 0x8a;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::PlaySound(iVar2,1.0,2,0,1.0);
|
||||
Entity_NPC::PlaySound(npc,iVar2,1.0,2,0,1.0);
|
||||
LAB_005adfbb:
|
||||
targetRef = GHIDRA_CAST<Entity *>(FUN_005acc70());
|
||||
if ((collider == targetRef) && (collider[2]._preInterpolatePos.x == 1.48538e-43)) {
|
||||
@@ -12197,7 +12199,7 @@ Entity * NpcHelper::wormwood_spawn_splash(Entity_NPC *npc)
|
||||
|
||||
seed = Random();
|
||||
splash = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed);
|
||||
splash->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(splash) + 0xc))();
|
||||
manager = g_manager;
|
||||
soundId = 0x1da;
|
||||
seed_fart_sound_override(&soundId);
|
||||
@@ -12215,11 +12217,11 @@ uint8_t NpcHelper::is_target_valid(Entity *target)
|
||||
if (target->_type != 1) {
|
||||
return 0;
|
||||
}
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(target))))->Entity_Player::IsInvisible();
|
||||
bVar1 = Entity_Player::IsInvisible(GHIDRA_CAST<Entity_Player *>(target));
|
||||
isTargetable = bVar1 == 0;
|
||||
}
|
||||
else {
|
||||
bVar1 = (GHIDRA_CAST<Entity *>((target)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
||||
bVar1 = Entity::IsVulnerableEnemy(target,GHIDRA_CAST<Entity *>(0x0));
|
||||
if (bVar1 == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -12372,11 +12374,11 @@ void NpcHelper::ChampionDrop(Entity_NPC *npc)
|
||||
return;
|
||||
}
|
||||
nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos);
|
||||
(GHIDRA_CAST<Entity_Player *>((nearestPlayer)))->Entity_Player::AddBlueFlies(3,&npc->_pos,GHIDRA_CAST<Entity *>(0x0));
|
||||
Entity_Player::AddBlueFlies(nearestPlayer,3,&npc->_pos,GHIDRA_CAST<Entity *>(0x0));
|
||||
return;
|
||||
case 5:
|
||||
dropVariant = 0x28;
|
||||
if (((!isIceFrozen) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::HasEntityFlags(0x1000000), bVar2 == 0)) &&
|
||||
if (((!isIceFrozen) && (bVar2 = Entity::HasEntityFlags(GHIDRA_CAST<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,
|
||||
@@ -12412,7 +12414,7 @@ void NpcHelper::ChampionDrop(Entity_NPC *npc)
|
||||
case 0xd:
|
||||
dropVariant = 10;
|
||||
local_130 = GHIDRA_CAST<Vector *>(0x2);
|
||||
if (((!isIceFrozen) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::HasEntityFlags(0x1000000), bVar2 == 0)) &&
|
||||
if (((!isIceFrozen) && (bVar2 = Entity::HasEntityFlags(GHIDRA_CAST<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,
|
||||
@@ -12469,7 +12471,7 @@ void NpcHelper::ChampionDrop(Entity_NPC *npc)
|
||||
if (!isIceFrozen) {
|
||||
uVar5 = Random();
|
||||
spawned = Game::SpawnEx(g_game,0x12,0,&npc->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(npc),0,uVar5,0);
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::HasEntityFlags(0x1000000);
|
||||
bVar2 = Entity::HasEntityFlags(GHIDRA_CAST<Entity *>(npc),0x1000000);
|
||||
if (bVar2 != 0) {
|
||||
*GHIDRA_CAST<uint32_t *>(&spawned->_flags) = GHIDRA_UINT(spawned->_flags) & 0xfeffffff;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
|
||||
@@ -12496,7 +12498,7 @@ void NpcHelper::ChampionDrop(Entity_NPC *npc)
|
||||
}
|
||||
sourceRef._flags = uVar6 | uVar5 | GHIDRA_UINT(local_120);
|
||||
sourceRef._entity = npc;
|
||||
(GHIDRA_CAST<Entity *>((spawned)))->Entity::AddShrink(&sourceRef,0x96,0,0);
|
||||
Entity::AddShrink(spawned,&sourceRef,0x96,0,0);
|
||||
if (0 < spawned->_shrinkCountdown) {
|
||||
flagsHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
|
||||
*GHIDRA_CAST<uint32_t *>(&spawned->_flags) = GHIDRA_UINT(spawned->_flags) | 0x1000000;
|
||||
@@ -12602,7 +12604,7 @@ void NpcHelper::ChampionDrop(Entity_NPC *npc)
|
||||
}
|
||||
nearestPlayer = Game::GetNearestPlayer(g_game,&npc->_pos);
|
||||
uVar5 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_11c.x))))->RNG::RandomInt(3);
|
||||
(GHIDRA_CAST<Entity_Player *>((nearestPlayer)))->Entity_Player::AddBlueFlies(uVar5 + 4,&npc->_pos,GHIDRA_CAST<Entity *>(0x0));
|
||||
Entity_Player::AddBlueFlies(nearestPlayer,uVar5 + 4,&npc->_pos,GHIDRA_CAST<Entity *>(0x0));
|
||||
return;
|
||||
case 0x16:
|
||||
if (isDropping == '\0') {
|
||||
@@ -12718,7 +12720,7 @@ LAB_006c0128:
|
||||
local_130 = GHIDRA_CAST<Vector *>((GHIDRA_INT(&local_130->x) + 1));
|
||||
} while (local_130 < GHIDRA_CAST<Vector *>(0x7));
|
||||
if ((char)local_12c == '\0') {
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::HasEntityFlags(0x1000000);
|
||||
bVar2 = Entity::HasEntityFlags(GHIDRA_CAST<Entity *>(npc),0x1000000);
|
||||
if ((bVar2 == 0) &&
|
||||
((dropDir = &npc->_pos, 0x1e < g_game->_frameCount - npc->_spawnFrame ||
|
||||
(nearestPlayer = Game::GetNearestPlayer(g_game,dropDir),
|
||||
@@ -12729,7 +12731,7 @@ LAB_006c0128:
|
||||
uVar5 = Random();
|
||||
Game::SpawnEx(g_game,1000,1,dropDir,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar5,0);
|
||||
}
|
||||
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::HasEntityFlags(0x1000000);
|
||||
bVar2 = Entity::HasEntityFlags(GHIDRA_CAST<Entity *>(npc),0x1000000);
|
||||
if ((bVar2 == 0) &&
|
||||
((dropDir = &npc->_pos, 0x1e < g_game->_frameCount - npc->_spawnFrame ||
|
||||
(nearestPlayer = Game::GetNearestPlayer(g_game,dropDir),
|
||||
@@ -12758,9 +12760,9 @@ LAB_006c0128:
|
||||
}
|
||||
local_114.x = (float)local_120;
|
||||
local_114.y = local_138;
|
||||
uVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(iVar4);
|
||||
uVar5 = Room::GetGridCollision(room,iVar4);
|
||||
if (0 < GHIDRA_INT(uVar5)) {
|
||||
dropDir = (GHIDRA_CAST<Room *>((room)))->Room::FindFreeTilePosition(GHIDRA_CAST<Vector *>(&local_c8),&local_114,40.0);
|
||||
dropDir = Room::FindFreeTilePosition(room,GHIDRA_CAST<Vector *>(&local_c8),&local_114,40.0);
|
||||
local_120 = GHIDRA_CAST<Entity_NPC *>(dropDir->x);
|
||||
local_138 = dropDir->y;
|
||||
}
|
||||
@@ -12809,7 +12811,7 @@ LAB_006c0128:
|
||||
local_12c = GHIDRA_CAST<PlayerManager *>(dropCount);
|
||||
do {
|
||||
if (glyphOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
(GHIDRA_CAST<Entity_Player *>((glyphOwner)))->Entity_Player::GetGlyphOfBalanceDrop(GHIDRA_CAST<int *>(&dropVariant),GHIDRA_CAST<int *>(&local_130));
|
||||
Entity_Player::GetGlyphOfBalanceDrop(glyphOwner,GHIDRA_CAST<int *>(&dropVariant),GHIDRA_CAST<int *>(&local_130));
|
||||
uVar5 = dropVariant;
|
||||
}
|
||||
if (uVar5 != 0) {
|
||||
@@ -12900,9 +12902,9 @@ void NpcHelper::fireplace_moveable_update(Entity_NPC *npc)
|
||||
else {
|
||||
isIgnoreDamage = '\0';
|
||||
if ((0.2 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x7240))) &&
|
||||
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::IsFrame(5,npc->_index), bVar1 != 0)) {
|
||||
damageSource = (GHIDRA_CAST<EntityRef *>((&damageSourceRef)))->EntityRef::EntityRef();
|
||||
npc->TakeDamage(0x3f800000,0,0,damageSource,0x1e);
|
||||
(bVar1 = Entity::IsFrame(GHIDRA_CAST<Entity *>(npc),5,npc->_index), bVar1 != 0)) {
|
||||
damageSource = EntityRef::EntityRef(&damageSourceRef);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x20))(0x3f800000,0,0,damageSource,0x1e);
|
||||
}
|
||||
}
|
||||
iVar3 = npc->_state;
|
||||
@@ -12916,7 +12918,7 @@ void NpcHelper::fireplace_moveable_update(Entity_NPC *npc)
|
||||
npc->_health = fVar4;
|
||||
if (((npc->_sprite)._animState._animData == (void *)0x0) ||
|
||||
((npc->_sprite)._animState._isPlaying == 0)) {
|
||||
npc->Remove();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x28))();
|
||||
}
|
||||
}
|
||||
goto LAB_006d1556;
|
||||
@@ -13007,10 +13009,10 @@ LAB_006d114a:
|
||||
}
|
||||
}
|
||||
if (((npc->_spawnerType == 0x3b7) &&
|
||||
(iVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(npc))))->Entity::GetIntervalTicks(30.0,0.0), iVar3 != 0)) &&
|
||||
(iVar3 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(npc),30.0,0.0), iVar3 != 0)) &&
|
||||
(uVar2 = Random(), (uVar2 & 3) == 0)) {
|
||||
damageSource = (GHIDRA_CAST<EntityRef *>((&damageSourceRef)))->EntityRef::EntityRef();
|
||||
npc->TakeDamage(0x3f800000,0x20000,0,damageSource,0x1e);
|
||||
damageSource = EntityRef::EntityRef(&damageSourceRef);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(npc) + 0x20))(0x3f800000,0x20000,0,damageSource,0x1e);
|
||||
}
|
||||
if (npc->_pendingDamage <= 0.0) goto LAB_006d1556;
|
||||
if ((npc->_pendingDamageFlags & 4) == 0) {
|
||||
|
||||
@@ -109,7 +109,7 @@ LAB_0091d341:
|
||||
local_58._blue = *GHIDRA_CAST<float *>((iVar3 + 0x5e4));
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(&g_game->_playerManager))))->Entity_Familiar::GetPlayerSlot(&local_58,player);
|
||||
Entity_Familiar::GetPlayerSlot(GHIDRA_CAST<Entity_Familiar *>(&g_game->_playerManager),&local_58,player);
|
||||
iVar3 = *GHIDRA_CAST<int *>(this);
|
||||
}
|
||||
drawFont = font;
|
||||
|
||||
@@ -104,7 +104,7 @@ uint8_t PathFinder::is_entity_friendly()
|
||||
if (((*GHIDRA_CAST<uint32_t *>((iVar1 + 0x168)) & 0x100) == 0) &&
|
||||
(entityType = *GHIDRA_CAST<int *>((iVar1 + 0x28)), entityType != 0x322)) {
|
||||
if ((*GHIDRA_CAST<Entity **>((iVar1 + 0x3c4)) != GHIDRA_CAST<Entity *>(0x0)) &&
|
||||
(isTargetFriendly = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((iVar1 + 0x3c4)))))->Entity::HasEntityFlags(0x10000000000000),
|
||||
(isTargetFriendly = Entity::HasEntityFlags(*GHIDRA_CAST<Entity **>((iVar1 + 0x3c4)),0x10000000000000),
|
||||
isTargetFriendly != 0)) {
|
||||
return 1;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ void PathFinder::EvadeTarget(Vector *targetPos, uint8_t isIgnoreStatusEffects)
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(*GHIDRA_CAST<uint32_t *>(this),0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
|
||||
,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
scratchPos.x = (playerTarget->_pos).x;
|
||||
scratchPos.y = (playerTarget->_pos).y;
|
||||
FindGridPath(this,&scratchPos,1.079,0,1);
|
||||
@@ -209,7 +209,7 @@ void PathFinder::EvadeTarget(Vector *targetPos, uint8_t isIgnoreStatusEffects)
|
||||
(GHIDRA_INT(pfVar1) + g_game->_frameCount) % 0xe == 0)) {
|
||||
scratchPos.x = *local_38;
|
||||
scratchPos.y = local_38[1];
|
||||
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&scratchPos,targetPos,1,0,0,0,GHIDRA_CAST<Vector *>(0x0));
|
||||
bVar3 = Room::CheckLine(g_game->_room,&scratchPos,targetPos,1,0,0,0,GHIDRA_CAST<Vector *>(0x0));
|
||||
if (bVar3 == 0) {
|
||||
fVar9 = 170.0;
|
||||
}
|
||||
@@ -366,16 +366,16 @@ LAB_007e4e8c:
|
||||
local_38 = GHIDRA_CAST<float *>(scratchPos.y);
|
||||
local_2c = scratchPos.x;
|
||||
local_28 = pRVar11;
|
||||
uVar4 = (GHIDRA_CAST<Room *>((pRVar11)))->Room::GetGridCollision(iVar8);
|
||||
uVar4 = Room::GetGridCollision(pRVar11,iVar8);
|
||||
if (uVar4 == 0) {
|
||||
npcPos.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
npcPos.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
bVar3 = (GHIDRA_CAST<Room *>((pRVar11)))->Room::CheckLine(&npcPos,&scratchPos,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
bVar3 = Room::CheckLine(pRVar11,&npcPos,&scratchPos,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
GHIDRA_CAST<Vector *>(0x0));
|
||||
if (bVar3 != 0) {
|
||||
npcPosCopy.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
npcPosCopy.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(targetPos,&npcPosCopy,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
bVar3 = Room::CheckLine(g_game->_room,targetPos,&npcPosCopy,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
GHIDRA_CAST<Vector *>(0x0));
|
||||
if ((bVar3 == 0) || (20.0 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))) {
|
||||
local_44 = *GHIDRA_CAST<float *>((this + 1));
|
||||
@@ -420,7 +420,8 @@ LAB_007e4e8c:
|
||||
targetPos_00 = local_3c;
|
||||
fVar9 = local_3c->x;
|
||||
if (iVar6 % 10 == 0) {
|
||||
bVar3 = (GHIDRA_CAST<Room *>((game->_room)))->Room::CheckLine(targetPos,local_3c,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,GHIDRA_CAST<Vector *>(0x0));
|
||||
bVar3 = Room::CheckLine(game->_room,targetPos,local_3c,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,GHIDRA_CAST<Vector *>(0x0)
|
||||
);
|
||||
if ((bVar3 == 0) ||
|
||||
(20.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) || *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) == 20.0)) {
|
||||
fVar10 = targetPos->x - local_3c->x;
|
||||
@@ -504,15 +505,15 @@ void PathFinder::MoveRandomlyAxisAligned(float speed, uint8_t isIgnoreStatusEffe
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
||||
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&scratchVec,0.0);
|
||||
Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0);
|
||||
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0x168)) & 0x20000000) != 0) &&
|
||||
((playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget(), playerTarget->_type == 1 &&
|
||||
((playerTarget = Entity_NPC::GetPlayerTarget(npc), playerTarget->_type == 1 &&
|
||||
(scratchVec.x = (npc->_pos).x - scratchVec.x, scratchVec.y = (npc->_pos).y - scratchVec.y,
|
||||
scratchVec.y * scratchVec.y + scratchVec.x * scratchVec.x < 1600.0)))) {
|
||||
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x36c)) = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x36c)) * 0.8;
|
||||
return;
|
||||
}
|
||||
pVVar2 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&scratchVec,0.0);
|
||||
pVVar2 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0);
|
||||
FindGridPath(this,pVVar2,speed,0,1);
|
||||
scratchVec.y = (npc->_velocity).y;
|
||||
scratchVec.x = (npc->_velocity).x;
|
||||
@@ -721,7 +722,7 @@ LAB_007e5b55:
|
||||
} while (GHIDRA_INT(uVar4) < iVar8);
|
||||
}
|
||||
else {
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
fVar14 = (playerTarget->_pos).x - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
fVar12 = (playerTarget->_pos).y - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
uVar7 = uVar4;
|
||||
@@ -783,7 +784,7 @@ LAB_007e5b55:
|
||||
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0x168)) & 0x1000800) != 0)) && (-1 < GHIDRA_INT(uVar3))) {
|
||||
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0x168)) & 0x1000800) != 0) {
|
||||
pVVar2 = Isaac::GetAxisAlignedUnitVectorFromDir(&chosenDirVec,uVar3);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
fVar14 = (playerTarget->_pos).y - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
toPlayerDirX = (playerTarget->_pos).x - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
fVar12 = sqrtf(fVar14 * fVar14 + toPlayerDirX * toPlayerDirX);
|
||||
@@ -863,7 +864,7 @@ LAB_007e5e93:
|
||||
else {
|
||||
iVar8 = gridRoom->_gridWidth * iVar10 + iVar8;
|
||||
}
|
||||
uVar6 = (GHIDRA_CAST<Room *>((gridRoom)))->Room::GetGridCollision(iVar8);
|
||||
uVar6 = Room::GetGridCollision(gridRoom,iVar8);
|
||||
if (uVar6 != 4) goto LAB_007e5ee3;
|
||||
}
|
||||
}
|
||||
@@ -996,7 +997,7 @@ uint8_t PathFinder::MoveRandomly(uint8_t isIgnoreStatusEffects)
|
||||
bVar1 = 1;
|
||||
iVar5 = 0;
|
||||
fVar4 = 0.5;
|
||||
targetPos = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&local_10,0.0);
|
||||
targetPos = Entity_NPC::CalcTargetPosition(npc,&local_10,0.0);
|
||||
FindGridPath(this,targetPos,fVar4,iVar5,bVar1);
|
||||
return 1;
|
||||
}
|
||||
@@ -1004,7 +1005,7 @@ uint8_t PathFinder::MoveRandomly(uint8_t isIgnoreStatusEffects)
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(iVar5,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
||||
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_10.x = (target->_pos).x;
|
||||
local_10.y = (target->_pos).y;
|
||||
EvadeTarget(this,&local_10,0);
|
||||
@@ -1025,7 +1026,7 @@ uint8_t PathFinder::MoveRandomly(uint8_t isIgnoreStatusEffects)
|
||||
local_10.x = fVar2 * 40.0 + local_10.x;
|
||||
pos.y = local_10.x;
|
||||
pos.x = fVar4;
|
||||
iVar5 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridCollisionAtPos(pos);
|
||||
iVar5 = Room::GetGridCollisionAtPos(g_game->_room,pos);
|
||||
if (iVar5 == 0) {
|
||||
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = fVar4;
|
||||
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = local_10.x;
|
||||
@@ -1091,7 +1092,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
bVar1 = 1;
|
||||
iVar7 = 0;
|
||||
fVar6 = 0.5;
|
||||
pVVar2 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&local_10,0.0);
|
||||
pVVar2 = Entity_NPC::CalcTargetPosition(npc,&local_10,0.0);
|
||||
FindGridPath(this,pVVar2,fVar6,iVar7,bVar1);
|
||||
return;
|
||||
}
|
||||
@@ -1099,7 +1100,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(iVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
||||
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_10.x = (playerTarget->_pos).x;
|
||||
local_10.y = (playerTarget->_pos).y;
|
||||
EvadeTarget(this,&local_10,0);
|
||||
@@ -1131,7 +1132,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
}
|
||||
local_10.x = (GHIDRA_CAST<Vector *>((iVar7 + 0x33c)))->x;
|
||||
local_10.y = *GHIDRA_CAST<float *>((iVar7 + 0x340));
|
||||
iVar7 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridCollisionAtPos(*GHIDRA_CAST<Vector *>((iVar7 + 0x33c)));
|
||||
iVar7 = Room::GetGridCollisionAtPos(g_game->_room,*GHIDRA_CAST<Vector *>((iVar7 + 0x33c)));
|
||||
if (iVar7 == 0) {
|
||||
uVar3 = Random();
|
||||
if (uVar3 % 0x1e == 0) {
|
||||
@@ -1147,7 +1148,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
}
|
||||
}
|
||||
if (((*GHIDRA_CAST<Entity **>(this))->_collidesWithGrid != 0) &&
|
||||
(bVar1 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>(this))))->Entity::IsFrame(5,0), bVar1 != 0)) {
|
||||
(bVar1 = Entity::IsFrame(*GHIDRA_CAST<Entity **>(this),5,0), bVar1 != 0)) {
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) ^ 0x80000000;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) ^ 0x80000000;
|
||||
}
|
||||
@@ -1166,7 +1167,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
else {
|
||||
iVar7 = room->_gridWidth * gridY + iVar7;
|
||||
}
|
||||
uVar3 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(iVar7);
|
||||
uVar3 = Room::GetGridCollision(room,iVar7);
|
||||
if ((uVar3 == 0) || (triesLeft < 1)) break;
|
||||
uVar3 = Random();
|
||||
local_18.x = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
||||
@@ -1238,7 +1239,7 @@ void PathFinder::update_chase_movement()
|
||||
local_20.y = (float)pEVar1;
|
||||
if (pEVar1->_controllerID != -1) {
|
||||
pEVar1->_friction = pEVar1->_friction * 0.6;
|
||||
controllerInput = (GHIDRA_CAST<Entity_NPC *>((pEVar1)))->Entity_NPC::GetControllerInput(&local_20,0.0);
|
||||
controllerInput = Entity_NPC::GetControllerInput(pEVar1,&local_20,0.0);
|
||||
fVar3 = pEVar1->_speedMultiplier;
|
||||
fVar4 = controllerInput->y;
|
||||
(pEVar1->_velocity).x = controllerInput->x * 1.2 * 1.25 * fVar3 + (pEVar1->_velocity).x;
|
||||
@@ -1259,13 +1260,13 @@ void PathFinder::update_chase_movement()
|
||||
if ((npcFlags & 0x200) == 0) {
|
||||
if ((npcFlags & 0x100) == 0) {
|
||||
if ((npcFlags & 0x1000800) == 0) goto LAB_007e6de9;
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(fVar3))))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(GHIDRA_CAST<Entity_NPC *>(fVar3));
|
||||
fVar4 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar3) + 0x33c)))->x - (target->_pos).x;
|
||||
fVar3 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar3) + 0x33c)))->y - (target->_pos).y;
|
||||
}
|
||||
else {
|
||||
local_20.y = (float)(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(fVar3))))->Entity_NPC::GetPlayerTarget();
|
||||
isFrame = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar3))))->Entity::IsFrame(5,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar3) + 0x20)));
|
||||
local_20.y = (float)Entity_NPC::GetPlayerTarget(GHIDRA_CAST<Entity_NPC *>(fVar3));
|
||||
isFrame = Entity::IsFrame(GHIDRA_CAST<Entity *>(fVar3),5,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar3) + 0x20)));
|
||||
if (isFrame == 0) goto LAB_007e6de9;
|
||||
Reset(in_ECX);
|
||||
local_20.x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_20.y) + 0x33c)))->x;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 007538f0
|
||||
uint8_t QueueItemData::Touched()
|
||||
{
|
||||
int in_ECX;
|
||||
|
||||
return *GHIDRA_CAST<uint8_t *>((in_ECX + 8)) & 1;
|
||||
}
|
||||
-29637
File diff suppressed because it is too large.
Load diff
@@ -1,552 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00436010
|
||||
uint8_t RoomDescriptor::Clear()
|
||||
{
|
||||
return (uint8_t)this->Flags & 1;
|
||||
}
|
||||
|
||||
// 00456560
|
||||
uint32_t RoomDescriptor::PressurePlatesTriggered()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 9),(char)(GHIDRA_UINT(this->Flags) >> 1)) & 0xffffff01;
|
||||
}
|
||||
|
||||
// 00505c30
|
||||
uint32_t RoomDescriptor::HasWater()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xd),(char)(GHIDRA_UINT(this->Flags) >> 5)) & 0xffffff01;
|
||||
}
|
||||
|
||||
// 005cd640
|
||||
uint32_t RoomDescriptor::SacrificeDone()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 10),(char)(GHIDRA_UINT(this->Flags) >> 2)) & 0xffffff01;
|
||||
}
|
||||
|
||||
// 006ef590
|
||||
RoomConfig_Room * RoomDescriptor::constructor()
|
||||
{
|
||||
void *pvVar1;
|
||||
void *pvVar2;
|
||||
uint32_t *gridSave;
|
||||
int gridSavesLeft;
|
||||
uint32_t gridSaveOffset;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t 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 *)(GHIDRA_INT(pvVar1) + 0x23U & 0xffffffe0);
|
||||
*(void **)(GHIDRA_INT(pvVar2) - 4) = pvVar1;
|
||||
gridSavesLeft = 0x1c0;
|
||||
(this->SavedGridEntities)._begin = pvVar2;
|
||||
(this->SavedGridEntities)._capacity = (void *)(GHIDRA_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;
|
||||
*GHIDRA_CAST<uint8_t *>((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;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
||||
(this->RestrictedGridIndexes)._head = (void *)0x0;
|
||||
(this->RestrictedGridIndexes)._size = 0;
|
||||
pvVar1 = operator_new(0x14);
|
||||
*(void **)pvVar1 = pvVar1;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
||||
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(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((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),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 *)(GHIDRA_INT(pvVar2) + 0x78);
|
||||
} while (pvVar2 != pvVar1);
|
||||
pvVar2 = (this->SavedEntities)._begin;
|
||||
}
|
||||
(this->SavedEntities)._end = pvVar2;
|
||||
if (GHIDRA_UINT(((GHIDRA_INT((this->SavedEntities)._capacity) - GHIDRA_INT((this->SavedEntities)._begin)) / 0x78)) <
|
||||
0x10) {
|
||||
msvc::vector<EntitySaveState>::_Reallocate_exactly(0x10);
|
||||
}
|
||||
pvVar1 = (this->SavedEffects)._end;
|
||||
pvVar2 = (this->SavedEffects)._begin;
|
||||
if (pvVar2 != pvVar1) {
|
||||
do {
|
||||
invoke_pending_callbacks(pvVar2);
|
||||
pvVar2 = (void *)(GHIDRA_INT(pvVar2) + 0x78);
|
||||
} while (pvVar2 != pvVar1);
|
||||
pvVar2 = (this->SavedEffects)._begin;
|
||||
}
|
||||
(this->SavedEffects)._end = pvVar2;
|
||||
if (GHIDRA_UINT(((GHIDRA_INT((this->SavedEffects)._capacity) - GHIDRA_INT((this->SavedEffects)._begin)) / 0x78)) < 0x20
|
||||
) {
|
||||
msvc::vector<EntitySaveState>::_Reallocate_exactly(0x20);
|
||||
}
|
||||
pvVar1 = (this->RestrictedGridIndexes)._head;
|
||||
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
||||
(&this->RestrictedGridIndexes,
|
||||
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&this->RestrictedGridIndexes,
|
||||
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar1) + 4));
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
||||
gridSaveOffset = 0;
|
||||
*(void **)pvVar1 = pvVar1;
|
||||
*(void **)(GHIDRA_CAST<char *>(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 {
|
||||
*GHIDRA_CAST<uint32_t *>((gridSaveOffset + GHIDRA_INT((this->SavedGridEntities)._begin))) = 0;
|
||||
gridSaveOffset = gridSaveOffset + 0x20;
|
||||
} while (gridSaveOffset < 0x3800);
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = 0;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = 0;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = 0;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = 0;
|
||||
ExceptionList = local_10;
|
||||
return GHIDRA_CAST<RoomConfig_Room *>(this);
|
||||
}
|
||||
|
||||
// 006ef9c0
|
||||
void RoomDescriptor::destructor()
|
||||
{
|
||||
std_set *restrictedGridIndexes;
|
||||
|
||||
msvc::vector<RoomEntry>::_Tidy();
|
||||
restrictedGridIndexes = &this->RestrictedGridIndexes;
|
||||
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
||||
(restrictedGridIndexes,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)restrictedGridIndexes,
|
||||
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT((this->RestrictedGridIndexes)._head) + 4));
|
||||
operator_delete(restrictedGridIndexes->_head,0x14);
|
||||
msvc::vector<RoomEntry>::_Tidy();
|
||||
FUN_00708f90();
|
||||
return;
|
||||
}
|
||||
|
||||
// 0070c550
|
||||
uint32_t RoomDescriptor::ChallengeDone()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xb),(char)(GHIDRA_UINT(this->Flags) >> 3)) & 0xffffff01;
|
||||
}
|
||||
|
||||
// 00738180
|
||||
uint32_t RoomDescriptor::SurpriseMiniboss()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xc),(char)(GHIDRA_UINT(this->Flags) >> 4)) & 0xffffff01;
|
||||
}
|
||||
|
||||
// 007387d0
|
||||
RoomDescriptor * RoomDescriptor::operator_assign(RoomDescriptor *other)
|
||||
{
|
||||
std_set *restrictedIndexes;
|
||||
void *pvVar1;
|
||||
std_vector *otherVector;
|
||||
uint32_t setSize;
|
||||
|
||||
otherVector = &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 != otherVector) {
|
||||
FUN_00708f90();
|
||||
(this->SavedGridEntities)._begin = otherVector->_begin;
|
||||
(this->SavedGridEntities)._end = (other->SavedGridEntities)._end;
|
||||
(this->SavedGridEntities)._capacity = (other->SavedGridEntities)._capacity;
|
||||
otherVector->_begin = (void *)0x0;
|
||||
(other->SavedGridEntities)._end = (void *)0x0;
|
||||
(other->SavedGridEntities)._capacity = (void *)0x0;
|
||||
}
|
||||
otherVector = &other->SavedEntities;
|
||||
if (&this->SavedEntities != otherVector) {
|
||||
msvc::vector<RoomEntry>::_Tidy();
|
||||
(this->SavedEntities)._begin = otherVector->_begin;
|
||||
(this->SavedEntities)._end = (other->SavedEntities)._end;
|
||||
(this->SavedEntities)._capacity = (other->SavedEntities)._capacity;
|
||||
otherVector->_begin = (void *)0x0;
|
||||
(other->SavedEntities)._end = (void *)0x0;
|
||||
(other->SavedEntities)._capacity = (void *)0x0;
|
||||
}
|
||||
restrictedIndexes = &this->RestrictedGridIndexes;
|
||||
if (restrictedIndexes != &other->RestrictedGridIndexes) {
|
||||
pvVar1 = restrictedIndexes->_head;
|
||||
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
||||
(restrictedIndexes,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)restrictedIndexes,
|
||||
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar1) + 4));
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
||||
*(void **)pvVar1 = pvVar1;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
||||
(this->RestrictedGridIndexes)._size = 0;
|
||||
pvVar1 = (this->RestrictedGridIndexes)._head;
|
||||
(this->RestrictedGridIndexes)._head = (other->RestrictedGridIndexes)._head;
|
||||
(other->RestrictedGridIndexes)._head = pvVar1;
|
||||
setSize = (this->RestrictedGridIndexes)._size;
|
||||
(this->RestrictedGridIndexes)._size = (other->RestrictedGridIndexes)._size;
|
||||
(other->RestrictedGridIndexes)._size = setSize;
|
||||
}
|
||||
otherVector = &other->SavedEffects;
|
||||
if (&this->SavedEffects != otherVector) {
|
||||
msvc::vector<RoomEntry>::_Tidy();
|
||||
(this->SavedEffects)._begin = otherVector->_begin;
|
||||
(this->SavedEffects)._end = (other->SavedEffects)._end;
|
||||
(this->SavedEffects)._capacity = (other->SavedEffects)._capacity;
|
||||
otherVector->_begin = (void *)0x0;
|
||||
(other->SavedEffects)._end = (void *)0x0;
|
||||
(other->SavedEffects)._capacity = (void *)0x0;
|
||||
}
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x94))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x96)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x96))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x98))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9a)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x9a))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x9c))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9e)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x9e))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa0))));
|
||||
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa2)))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa2))));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa4))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa4)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa5))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa5)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa6))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa6)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa7))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa7)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa8))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa8)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa9))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa9)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xaa))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xaa)));
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xab))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xab)));
|
||||
this->ShopItemIdx = other->ShopItemIdx;
|
||||
this->ShopItemDiscountIdx = other->ShopItemDiscountIdx;
|
||||
this->DeliriumDistance = other->DeliriumDistance;
|
||||
this->Group = other->Group;
|
||||
return this;
|
||||
}
|
||||
|
||||
// 00749040
|
||||
RoomDescriptor * RoomDescriptor::copy_constructor(RoomDescriptor *other)
|
||||
{
|
||||
uint32_t *puVar1;
|
||||
uint32_t uVar2;
|
||||
int iVar3;
|
||||
int iVar4;
|
||||
int iVar5;
|
||||
uint32_t uVar6;
|
||||
uint32_t uVar7;
|
||||
uint32_t uVar8;
|
||||
uint32_t byteCount;
|
||||
void *pvVar9;
|
||||
uint32_t *dstGridEntity;
|
||||
uint32_t *srcGridEntity;
|
||||
void *local_1c;
|
||||
uint8_t *puStack_18;
|
||||
uint32_t local_14;
|
||||
std_set *restrictedGridIndexes;
|
||||
uint32_t *srcGridEnd;
|
||||
|
||||
local_14 = 0xffffffff;
|
||||
puStack_18 = &LAB_00afdfc1;
|
||||
local_1c = ExceptionList;
|
||||
uVar8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
||||
ExceptionList = &local_1c;
|
||||
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;
|
||||
iVar3 = other->_doors[1];
|
||||
iVar4 = other->_doors[2];
|
||||
iVar5 = other->_doors[3];
|
||||
this->_doors[0] = other->_doors[0];
|
||||
this->_doors[1] = iVar3;
|
||||
this->_doors[2] = iVar4;
|
||||
this->_doors[3] = iVar5;
|
||||
iVar3 = other->_doors[5];
|
||||
iVar4 = other->_doors[6];
|
||||
iVar5 = other->_doors[7];
|
||||
this->_doors[4] = other->_doors[4];
|
||||
this->_doors[5] = iVar3;
|
||||
this->_doors[6] = iVar4;
|
||||
this->_doors[7] = iVar5;
|
||||
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;
|
||||
(this->SavedGridEntities)._begin = (void *)0x0;
|
||||
(this->SavedGridEntities)._end = (void *)0x0;
|
||||
(this->SavedGridEntities)._capacity = (void *)0x0;
|
||||
srcGridEnd = (other->SavedGridEntities)._end;
|
||||
srcGridEntity = (other->SavedGridEntities)._begin;
|
||||
if (srcGridEntity != srcGridEnd) {
|
||||
byteCount = GHIDRA_INT(srcGridEnd) - GHIDRA_INT(srcGridEntity) >> 5;
|
||||
if (0x7ffffff < byteCount) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
FUN_0040cee0(uVar8);
|
||||
}
|
||||
byteCount = byteCount * 0x20;
|
||||
pvVar9 = msvc::_Allocate(byteCount);
|
||||
(this->SavedGridEntities)._begin = pvVar9;
|
||||
(this->SavedGridEntities)._end = pvVar9;
|
||||
(this->SavedGridEntities)._capacity = (void *)(GHIDRA_INT(pvVar9) + byteCount);
|
||||
dstGridEntity = (this->SavedGridEntities)._begin;
|
||||
do {
|
||||
uVar2 = srcGridEntity[1];
|
||||
uVar6 = srcGridEntity[2];
|
||||
uVar7 = srcGridEntity[3];
|
||||
*dstGridEntity = *srcGridEntity;
|
||||
dstGridEntity[1] = uVar2;
|
||||
dstGridEntity[2] = uVar6;
|
||||
dstGridEntity[3] = uVar7;
|
||||
puVar1 = srcGridEntity + 4;
|
||||
uVar2 = srcGridEntity[5];
|
||||
uVar6 = srcGridEntity[6];
|
||||
uVar7 = srcGridEntity[7];
|
||||
srcGridEntity = srcGridEntity + 8;
|
||||
dstGridEntity[4] = *puVar1;
|
||||
dstGridEntity[5] = uVar2;
|
||||
dstGridEntity[6] = uVar6;
|
||||
dstGridEntity[7] = uVar7;
|
||||
dstGridEntity = dstGridEntity + 8;
|
||||
} while (srcGridEntity != srcGridEnd);
|
||||
(this->SavedGridEntities)._end = dstGridEntity;
|
||||
}
|
||||
local_14 = 0;
|
||||
FUN_00752830(&other->SavedEntities);
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
||||
restrictedGridIndexes = &this->RestrictedGridIndexes;
|
||||
restrictedGridIndexes->_head = (void *)0x0;
|
||||
(this->RestrictedGridIndexes)._size = 0;
|
||||
pvVar9 = operator_new(0x14);
|
||||
*(void **)pvVar9 = pvVar9;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 4) = pvVar9;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 8) = pvVar9;
|
||||
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(pvVar9) + 0xc)) = 0x101;
|
||||
restrictedGridIndexes->_head = pvVar9;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
||||
std_set_uint_copy(restrictedGridIndexes,&other->RestrictedGridIndexes,GHIDRA_INT(this));
|
||||
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
||||
FUN_00752830(&other->SavedEffects);
|
||||
uVar2 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x98))));
|
||||
uVar6 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x9c))));
|
||||
uVar7 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa0))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x94))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = uVar2;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = uVar6;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = uVar7;
|
||||
uVar2 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa8))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa4))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa8)))) = uVar2;
|
||||
this->ShopItemIdx = other->ShopItemIdx;
|
||||
this->ShopItemDiscountIdx = other->ShopItemDiscountIdx;
|
||||
this->DeliriumDistance = other->DeliriumDistance;
|
||||
this->Group = other->Group;
|
||||
ExceptionList = local_1c;
|
||||
return this;
|
||||
}
|
||||
|
||||
// 00752e80
|
||||
RoomDescriptor * RoomDescriptor::move_constructor(RoomDescriptor *other)
|
||||
{
|
||||
void *pvVar1;
|
||||
void *pvVar2;
|
||||
uint32_t swappedListSize;
|
||||
int iVar4;
|
||||
int iVar5;
|
||||
int iVar6;
|
||||
uint32_t uVar7;
|
||||
uint32_t uVar8;
|
||||
void *pvVar9;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
uint32_t swappedListSize;
|
||||
|
||||
puStack_c = &LAB_00afe73b;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
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;
|
||||
iVar4 = other->_doors[1];
|
||||
iVar5 = other->_doors[2];
|
||||
iVar6 = other->_doors[3];
|
||||
this->_doors[0] = other->_doors[0];
|
||||
this->_doors[1] = iVar4;
|
||||
this->_doors[2] = iVar5;
|
||||
this->_doors[3] = iVar6;
|
||||
iVar4 = other->_doors[5];
|
||||
iVar5 = other->_doors[6];
|
||||
iVar6 = other->_doors[7];
|
||||
this->_doors[4] = other->_doors[4];
|
||||
this->_doors[5] = iVar4;
|
||||
this->_doors[6] = iVar5;
|
||||
this->_doors[7] = iVar6;
|
||||
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;
|
||||
pvVar9 = (other->SavedGridEntities)._capacity;
|
||||
pvVar1 = (other->SavedGridEntities)._end;
|
||||
pvVar2 = (other->SavedGridEntities)._begin;
|
||||
(other->SavedGridEntities)._capacity = (void *)0x0;
|
||||
(other->SavedGridEntities)._end = (void *)0x0;
|
||||
(other->SavedGridEntities)._begin = (void *)0x0;
|
||||
(this->SavedGridEntities)._begin = pvVar2;
|
||||
(this->SavedGridEntities)._end = pvVar1;
|
||||
(this->SavedGridEntities)._capacity = pvVar9;
|
||||
pvVar9 = (other->SavedEntities)._capacity;
|
||||
pvVar1 = (other->SavedEntities)._end;
|
||||
pvVar2 = (other->SavedEntities)._begin;
|
||||
(other->SavedEntities)._capacity = (void *)0x0;
|
||||
(other->SavedEntities)._end = (void *)0x0;
|
||||
(other->SavedEntities)._begin = (void *)0x0;
|
||||
(this->SavedEntities)._begin = pvVar2;
|
||||
(this->SavedEntities)._end = pvVar1;
|
||||
(this->SavedEntities)._capacity = pvVar9;
|
||||
local_8 = 1;
|
||||
(this->RestrictedGridIndexes)._head = (void *)0x0;
|
||||
(this->RestrictedGridIndexes)._size = 0;
|
||||
pvVar9 = operator_new(0x14);
|
||||
*(void **)pvVar9 = pvVar9;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 4) = pvVar9;
|
||||
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 8) = pvVar9;
|
||||
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(pvVar9) + 0xc)) = 0x101;
|
||||
(this->RestrictedGridIndexes)._head = pvVar9;
|
||||
(this->RestrictedGridIndexes)._head = (other->RestrictedGridIndexes)._head;
|
||||
(other->RestrictedGridIndexes)._head = pvVar9;
|
||||
swappedListSize = (this->RestrictedGridIndexes)._size;
|
||||
(this->RestrictedGridIndexes)._size = (other->RestrictedGridIndexes)._size;
|
||||
(other->RestrictedGridIndexes)._size = swappedListSize;
|
||||
pvVar9 = (other->SavedEffects)._end;
|
||||
pvVar1 = (other->SavedEffects)._begin;
|
||||
pvVar2 = (other->SavedEffects)._capacity;
|
||||
(other->SavedEffects)._capacity = (void *)0x0;
|
||||
(other->SavedEffects)._end = (void *)0x0;
|
||||
(other->SavedEffects)._begin = (void *)0x0;
|
||||
(this->SavedEffects)._begin = pvVar1;
|
||||
(this->SavedEffects)._end = pvVar9;
|
||||
(this->SavedEffects)._capacity = pvVar2;
|
||||
swappedListSize = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x98))));
|
||||
uVar7 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x9c))));
|
||||
uVar8 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa0))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0x94))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = swappedListSize;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = uVar7;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = uVar8;
|
||||
swappedListSize = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa8))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((other)) + 0xa4))));
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa8)))) = swappedListSize;
|
||||
this->ShopItemIdx = other->ShopItemIdx;
|
||||
this->ShopItemDiscountIdx = other->ShopItemDiscountIdx;
|
||||
this->DeliriumDistance = other->DeliriumDistance;
|
||||
this->Group = other->Group;
|
||||
ExceptionList = local_10;
|
||||
return this;
|
||||
}
|
||||
|
||||
// 007e9190
|
||||
uint32_t RoomDescriptor::NoReward()
|
||||
{
|
||||
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xf),(char)(GHIDRA_UINT(this->Flags) >> 7)) & 0xffffff01;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -67,7 +67,7 @@ void StageTransition::Update()
|
||||
exitingPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
minExitFrame = 1000;
|
||||
local_2e = '\0';
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)))))->EntityList::Update(1);
|
||||
EntityList::Update(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),1);
|
||||
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(catchUpPlayer[1])) + 0x4)))) == 4) &&
|
||||
(pvVar7 = (g_game->_playerManager)._stageTransitionPlayer,
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar7) + 0x1b1c)) == g_vectorZero.x)) &&
|
||||
@@ -104,7 +104,7 @@ LAB_0092f31d:
|
||||
}
|
||||
isExitAnimDone = '\x01';
|
||||
}
|
||||
player->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(player) + 0xc))();
|
||||
if ((player->_dead == 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(catchUpPlayer[1])) + 0x4)))) != 1)) {
|
||||
if (((player->_isPlayingExtraAnimation == 0) && (player->_isPlayingItemAnimation == 0))
|
||||
|| ((player->_isCoopGhost != 0 &&
|
||||
@@ -269,7 +269,7 @@ LAB_0092f849:
|
||||
if (0xf < animName->_capacity) {
|
||||
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((catchUpPlayer)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>(animName));
|
||||
Entity_Player::PlayExtraAnimation(catchUpPlayer,GHIDRA_CAST<uint8_t *>(animName));
|
||||
local_8 = (void *)0xffffffff;
|
||||
if (0xf < tmpStringCapacity) {
|
||||
uVar4 = tmpStringCapacity + 1;
|
||||
@@ -390,7 +390,7 @@ LAB_0092fe68:
|
||||
(player,0x7f,GHIDRA_CAST<uint8_t *>("Pickup"),GHIDRA_CAST<uint8_t *>("PlayerPickupSparkle"));
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Appear"));
|
||||
Entity_Player::PlayExtraAnimation(player,GHIDRA_CAST<uint8_t *>("Appear"));
|
||||
}
|
||||
game = g_game;
|
||||
}
|
||||
@@ -405,13 +405,13 @@ LAB_0092fe68:
|
||||
do {
|
||||
player = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
||||
if ((player != GHIDRA_CAST<Entity_Player *>(0x0)) && (player->_variant == 0)) {
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Appear"));
|
||||
Entity_Player::PlayExtraAnimation(player,GHIDRA_CAST<uint8_t *>("Appear"));
|
||||
game = g_game;
|
||||
}
|
||||
playerSlot = playerSlot + 1;
|
||||
} while (playerSlot != (game->_playerManager)._playerList._end);
|
||||
}
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)))))->EntityList::Update(1);
|
||||
EntityList::Update(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),1);
|
||||
playerIt = (g_game->_playerManager)._playerList._begin;
|
||||
game = g_game;
|
||||
if (playerIt != (g_game->_playerManager)._playerList._end) {
|
||||
@@ -469,7 +469,7 @@ LAB_0092fbfd:
|
||||
((game->_gameStateFlags & 0x1000000000000) != 0)) goto LAB_0092fc1b;
|
||||
}
|
||||
Level::Init(GHIDRA_CAST<Level *>(game),0);
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::Update();
|
||||
Room::Update(g_game->_room);
|
||||
Manager::save_game_state();
|
||||
PlayerManager::trigger_new_room_effects(&g_game->_playerManager);
|
||||
game = g_game;
|
||||
@@ -489,7 +489,7 @@ LAB_0092fbfd:
|
||||
(&g_game->_roomTransition,
|
||||
g_game->_roomList[g_game->_lastBossRoomListIdx].GridIndex,-1,0xf,
|
||||
GHIDRA_CAST<Entity_Player *>(0x0),-1);
|
||||
(GHIDRA_CAST<RoomTransition *>((&g_game->_roomTransition)))->RoomTransition::Update();
|
||||
RoomTransition::Update(&g_game->_roomTransition);
|
||||
startingRoom = Level::GetRoomByIdx(GHIDRA_CAST<Level *>(g_game),g_game->_startingRoomIdx,-1);
|
||||
game = g_game;
|
||||
startingRoom->Flags = startingRoom->Flags & 0xfffffffe;
|
||||
@@ -510,7 +510,7 @@ LAB_0092fbfd:
|
||||
case 3:
|
||||
uVar4 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((catchUpPlayer)) + 0x4))));
|
||||
if ((uVar4 == 2) && ((char)catchUpPlayer[1]._duration != '\0')) {
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::PlayMusic();
|
||||
Room::PlayMusic(g_game->_room);
|
||||
uVar4 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((catchUpPlayer)) + 0x4))));
|
||||
}
|
||||
game = g_game;
|
||||
@@ -522,7 +522,7 @@ LAB_0092fbfd:
|
||||
break;
|
||||
case 4:
|
||||
local_2e = '\x01';
|
||||
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)))))->EntityList::Update(1);
|
||||
EntityList::Update(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),1);
|
||||
playerIt = (g_game->_playerManager)._playerList._begin;
|
||||
game = g_game;
|
||||
if (playerIt == (g_game->_playerManager)._playerList._end) {
|
||||
|
||||
@@ -299,14 +299,14 @@ void StatsPanel::preview_collectible(uint8_t param_1)
|
||||
*GHIDRA_CAST<uint8_t *>((iVar2 + 0x2ef0)) = param_1;
|
||||
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((in_ECX + 0x48)) + 0x1574));
|
||||
*puVar1 = *puVar1 | 0x41f;
|
||||
(GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)))))->Entity_Player::EvaluateItems();
|
||||
Entity_Player::EvaluateItems(*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)));
|
||||
snapshot_stats(1);
|
||||
iVar2 = *GHIDRA_CAST<int *>((in_ECX + 0x48));
|
||||
*GHIDRA_CAST<uint32_t *>((iVar2 + 0x2ef4)) = 0;
|
||||
*GHIDRA_CAST<uint8_t *>((iVar2 + 0x2ef0)) = 1;
|
||||
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((in_ECX + 0x48)) + 0x1574));
|
||||
*puVar1 = *puVar1 | 0x41f;
|
||||
(GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)))))->Entity_Player::EvaluateItems();
|
||||
Entity_Player::EvaluateItems(*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -330,14 +330,14 @@ void StatsPanel::preview_trinket(uint8_t param_1, int param_2)
|
||||
*GHIDRA_CAST<uint8_t *>((iVar2 + 0x2ef0)) = param_1;
|
||||
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((in_ECX + 0x48)) + 0x1574));
|
||||
*puVar1 = *puVar1 | 0x41f;
|
||||
(GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)))))->Entity_Player::EvaluateItems();
|
||||
Entity_Player::EvaluateItems(*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)));
|
||||
snapshot_stats(1);
|
||||
iVar2 = *GHIDRA_CAST<int *>((in_ECX + 0x48));
|
||||
*GHIDRA_CAST<uint32_t *>((iVar2 + 0x2ef8)) = 0;
|
||||
*GHIDRA_CAST<uint8_t *>((iVar2 + 0x2ef0)) = 1;
|
||||
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((in_ECX + 0x48)) + 0x1574));
|
||||
*puVar1 = *puVar1 | 0x41f;
|
||||
(GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)))))->Entity_Player::EvaluateItems();
|
||||
Entity_Player::EvaluateItems(*GHIDRA_CAST<Entity_Player **>((in_ECX + 0x48)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
+64
-1473
File diff suppressed because it is too large.
Load diff
@@ -1,11 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00435f80
|
||||
TemporaryEffect::TemporaryEffect(ItemConfig_Item *item)
|
||||
{
|
||||
*GHIDRA_CAST<ItemConfig_Item **>(this) = item;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4)) = 0;
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 8)) = item->maxCooldown;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0xc)) = 0;
|
||||
return this;
|
||||
}
|
||||
@@ -1,509 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 007537a0
|
||||
void * TemporaryEffects::GetEffectsList()
|
||||
{
|
||||
return &this->_effects;
|
||||
}
|
||||
|
||||
// 00930220
|
||||
void TemporaryEffects::AddEffect(void *Effect, uint8_t addcostume, int count)
|
||||
{
|
||||
int *effectIt;
|
||||
int effectCooldown;
|
||||
int effectCount;
|
||||
int effectExtra;
|
||||
void *effectsBegin;
|
||||
int *effectsEnd;
|
||||
void **effectsEndField;
|
||||
|
||||
if ((this->_disabled == 0) && (count != 0)) {
|
||||
effectsEnd = (this->_effects)._end;
|
||||
effectIt = (this->_effects)._begin;
|
||||
if (effectIt != effectsEnd) {
|
||||
do {
|
||||
if (*effectIt == *GHIDRA_CAST<int *>(Effect)) {
|
||||
if (effectIt != effectsEnd) {
|
||||
effectIt[1] = effectIt[1] + count;
|
||||
effectIt[2] = effectIt[2] + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(Effect) + 8));
|
||||
this->_cacheFlags = this->_cacheFlags | *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(Effect) + 0x54));
|
||||
this->_shouldEvaluateCache = 1;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
effectIt = effectIt + 4;
|
||||
} while (effectIt != effectsEnd);
|
||||
}
|
||||
if (effectsEnd == (this->_effects)._capacity) {
|
||||
msvc::vector<Vec16>::_Emplace_reallocate(effectsEnd,Effect);
|
||||
}
|
||||
else {
|
||||
effectCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(Effect) + 4));
|
||||
effectCooldown = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(Effect) + 8));
|
||||
effectExtra = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(Effect) + 0xc));
|
||||
*effectsEnd = *GHIDRA_CAST<int *>(Effect);
|
||||
effectsEnd[1] = effectCount;
|
||||
effectsEnd[2] = effectCooldown;
|
||||
effectsEnd[3] = effectExtra;
|
||||
effectsEndField = &(this->_effects)._end;
|
||||
*effectsEndField = (void *)(GHIDRA_INT(*effectsEndField) + 0x10);
|
||||
}
|
||||
effectsBegin = (this->_effects)._begin;
|
||||
*GHIDRA_CAST<int *>((((GHIDRA_INT((this->_effects)._end) - GHIDRA_INT(effectsBegin) & 0xfffffff0U) - 0xc) +
|
||||
GHIDRA_INT(effectsBegin))) = count;
|
||||
if ((this->_player != GHIDRA_CAST<Entity_Player *>(0x0)) && (addcostume != 0)) {
|
||||
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddCostume(*GHIDRA_CAST<ItemConfig_Item **>(Effect),0);
|
||||
}
|
||||
this->_cacheFlags = this->_cacheFlags | *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(Effect) + 0x54));
|
||||
this->_shouldEvaluateCache = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 009302e0
|
||||
void TemporaryEffects::AddCollectibleEffect(int coltype, uint8_t addcostume, int count)
|
||||
{
|
||||
ItemConfig_Item *effectItem;
|
||||
uint32_t local_14;
|
||||
int effectCooldown;
|
||||
uint32_t local_c;
|
||||
|
||||
effectItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,coltype);
|
||||
if (effectItem != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
||||
effectCooldown = effectItem->maxCooldown;
|
||||
local_14 = 0;
|
||||
local_c = 0;
|
||||
AddEffect(this,&effectItem,addcostume,count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00930330
|
||||
void TemporaryEffects::AddTrinketEffect(int trinkettype, uint8_t addcostume, int count)
|
||||
{
|
||||
int effect [3];
|
||||
uint32_t local_c;
|
||||
void *trinkets;
|
||||
|
||||
trinkets = (g_manager->_itemConfig)._trinkets._begin;
|
||||
if ((GHIDRA_INT((trinkettype & 0x7fffU)) <
|
||||
GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(trinkets) >> 2) &&
|
||||
(effect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(trinkets) + (trinkettype & 0x7fffU) * 4)), effect[0] != 0)) {
|
||||
effect[2] = *GHIDRA_CAST<uint32_t *>((effect[0] + 0x78));
|
||||
effect[1] = 0;
|
||||
local_c = 0;
|
||||
AddEffect(this,effect,addcostume,count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00930390
|
||||
void TemporaryEffects::AddNullEffect(int nulleffectid, uint8_t addcostume, int count)
|
||||
{
|
||||
int effect [3];
|
||||
uint32_t local_c;
|
||||
void *nullItems;
|
||||
|
||||
if (((-1 < nulleffectid) &&
|
||||
(nullItems = (g_manager->_itemConfig)._nullItems._begin,
|
||||
nulleffectid < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) >> 2)) &&
|
||||
(effect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nullItems) + nulleffectid * 4)), effect[0] != 0)) {
|
||||
effect[2] = *GHIDRA_CAST<uint32_t *>((effect[0] + 0x78));
|
||||
effect[1] = 0;
|
||||
local_c = 0;
|
||||
AddEffect(this,effect,addcostume,count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 009303f0
|
||||
void TemporaryEffects::RemoveEffect(void *effect, int count)
|
||||
{
|
||||
void **ppvVar1;
|
||||
ItemConfig_Item *item;
|
||||
int *entry;
|
||||
uint32_t removedCount;
|
||||
int *effectsEnd;
|
||||
uint32_t entryCount;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
effectsEnd = (this->_effects)._end;
|
||||
entry = (this->_effects)._begin;
|
||||
if (entry != effectsEnd) {
|
||||
while (*entry != *GHIDRA_CAST<int *>(effect)) {
|
||||
entry = entry + 4;
|
||||
if (entry == effectsEnd) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (entry != effectsEnd) {
|
||||
entryCount = entry[1];
|
||||
item = GHIDRA_CAST<ItemConfig_Item *>(*entry);
|
||||
removedCount = entryCount;
|
||||
if (GHIDRA_UINT(count) < entryCount) {
|
||||
removedCount = count;
|
||||
}
|
||||
entry[1] = entryCount - removedCount;
|
||||
if (GHIDRA_INT((entryCount - removedCount)) < 1) {
|
||||
memmove(entry,entry + 4,GHIDRA_INT((this->_effects)._end) - GHIDRA_INT((entry + 4)));
|
||||
ppvVar1 = &(this->_effects)._end;
|
||||
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + -0x10);
|
||||
}
|
||||
if (this->_player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TriggerEffectRemoved(item,0);
|
||||
}
|
||||
else {
|
||||
Entity_Player::trigger_collectible_effect_removed(this->_player,item,removedCount);
|
||||
}
|
||||
this->_cacheFlags = this->_cacheFlags | *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(effect) + 0x54));
|
||||
this->_shouldEvaluateCache = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 009304a0
|
||||
void TemporaryEffects::RemoveCollectibleEffect(int coltype, int count)
|
||||
{
|
||||
ItemConfig_Item *effectItem;
|
||||
uint32_t local_10;
|
||||
int effectCooldown;
|
||||
uint32_t local_8;
|
||||
|
||||
effectItem = ItemConfig::GetCollectible(&g_manager->_itemConfig,coltype);
|
||||
if (effectItem != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
||||
effectCooldown = effectItem->maxCooldown;
|
||||
local_10 = 0;
|
||||
local_8 = 0;
|
||||
RemoveEffect(this,&effectItem,count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 009304f0
|
||||
void TemporaryEffects::RemoveTrinketEffect(int trinkettype, int count)
|
||||
{
|
||||
int effectKey [3];
|
||||
uint32_t local_8;
|
||||
void *trinkets;
|
||||
|
||||
trinkets = (g_manager->_itemConfig)._trinkets._begin;
|
||||
if ((GHIDRA_INT((trinkettype & 0x7fffU)) <
|
||||
GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(trinkets) >> 2) &&
|
||||
(effectKey[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(trinkets) + (trinkettype & 0x7fffU) * 4)), effectKey[0] != 0)) {
|
||||
effectKey[2] = *GHIDRA_CAST<uint32_t *>((effectKey[0] + 0x78));
|
||||
effectKey[1] = 0;
|
||||
local_8 = 0;
|
||||
RemoveEffect(this,effectKey,count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00930550
|
||||
void TemporaryEffects::RemoveNullEffect(int nulleffectid, int count)
|
||||
{
|
||||
int effect [3];
|
||||
uint32_t local_c;
|
||||
void *nullItems;
|
||||
|
||||
if (((-1 < nulleffectid) &&
|
||||
(nullItems = (g_manager->_itemConfig)._nullItems._begin,
|
||||
nulleffectid < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) >> 2)) &&
|
||||
(effect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nullItems) + nulleffectid * 4)), effect[0] != 0)) {
|
||||
effect[2] = *GHIDRA_CAST<uint32_t *>((effect[0] + 0x78));
|
||||
effect[1] = 0;
|
||||
local_c = 0;
|
||||
RemoveEffect(this,effect,count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 009305c0
|
||||
uint8_t TemporaryEffects::has_item_effect(TemporaryEffects *effects, ItemConfig_Item *item)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (effects->_disabled == 0) {
|
||||
for (effect = (effects->_effects)._begin; effect != (effects->_effects)._end;
|
||||
effect = effect + 4) {
|
||||
if (GHIDRA_CAST<ItemConfig_Item *>(*effect) == item) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 009305f0
|
||||
uint8_t TemporaryEffects::HasCollectibleEffect(int coltype)
|
||||
{
|
||||
int *effect;
|
||||
int effectType;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
effectType = *GHIDRA_CAST<int *>(*effect);
|
||||
if ((((effectType == 1) || (effectType == 3)) || (effectType == 4)) &&
|
||||
((GHIDRA_CAST<int *>(*effect))[1] == coltype)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 00930640
|
||||
uint8_t TemporaryEffects::HasTrinketEffect(int trinkettype)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
if ((*GHIDRA_CAST<int *>(*effect) == 2) && ((GHIDRA_CAST<int *>(*effect))[1] == trinkettype)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 00930680
|
||||
uint8_t TemporaryEffects::HasNullEffect(int nulleffectid)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
if ((*GHIDRA_CAST<int *>(*effect) == 0) && ((GHIDRA_CAST<int *>(*effect))[1] == nulleffectid)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 009306c0
|
||||
void TemporaryEffects::ClearEffects(uint8_t isClearPersistent)
|
||||
{
|
||||
void **ppvVar1;
|
||||
ItemConfig_Item *item;
|
||||
void *pvVar2;
|
||||
uint32_t effectCount;
|
||||
int iVar3;
|
||||
int effectOffset;
|
||||
uint32_t i;
|
||||
void *effectsBegin;
|
||||
bool isAnyRemoved;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
pvVar2 = (this->_effects)._end;
|
||||
do {
|
||||
effectsBegin = (this->_effects)._begin;
|
||||
isAnyRemoved = false;
|
||||
effectCount = GHIDRA_INT(pvVar2) - GHIDRA_INT(effectsBegin) >> 4;
|
||||
i = effectCount - 1;
|
||||
if (effectCount <= i) {
|
||||
return;
|
||||
}
|
||||
effectOffset = i * 0x10;
|
||||
do {
|
||||
item = *GHIDRA_CAST<ItemConfig_Item **>((effectOffset + GHIDRA_INT(effectsBegin)));
|
||||
if ((isClearPersistent != 0) || (item->persistentEffect == 0)) {
|
||||
iVar3 = item->type;
|
||||
if ((((iVar3 == 1) || ((iVar3 == 3 || (iVar3 == 4)))) && (item->id == 0x75)) &&
|
||||
(pvVar2 = this->_player, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar2) + 0x20a9)) == '\0')) {
|
||||
iVar3 = 0;
|
||||
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1340))) {
|
||||
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1344));
|
||||
}
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1d88)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x134c)) + iVar3 <=
|
||||
GHIDRA_INT(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x13c0)) == 5) + 1))) goto LAB_009307de;
|
||||
}
|
||||
this->_cacheFlags = this->_cacheFlags | item->cacheFlags;
|
||||
iVar3 = (GHIDRA_CAST<uint32_t *>((effectOffset + GHIDRA_INT(effectsBegin))))[1];
|
||||
pvVar2 = (void *)(GHIDRA_INT(effectsBegin) + effectOffset + 0x10);
|
||||
memmove((void *)(GHIDRA_INT(effectsBegin) + effectOffset),pvVar2,
|
||||
GHIDRA_INT((this->_effects)._end) - GHIDRA_INT(pvVar2));
|
||||
ppvVar1 = &(this->_effects)._end;
|
||||
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + -0x10);
|
||||
if (this->_player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TriggerEffectRemoved(item,0);
|
||||
}
|
||||
else {
|
||||
Entity_Player::trigger_collectible_effect_removed(this->_player,item,iVar3);
|
||||
}
|
||||
this->_shouldEvaluateCache = 1;
|
||||
isAnyRemoved = true;
|
||||
}
|
||||
LAB_009307de:
|
||||
pvVar2 = (this->_effects)._end;
|
||||
effectOffset = effectOffset + -0x10;
|
||||
effectsBegin = (this->_effects)._begin;
|
||||
i = i - 1;
|
||||
} while (i < GHIDRA_UINT((GHIDRA_INT(pvVar2) - GHIDRA_INT(effectsBegin) >> 4)));
|
||||
} while (isAnyRemoved);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00930820
|
||||
void TemporaryEffects::Update()
|
||||
{
|
||||
uint32_t effectCount;
|
||||
int iVar1;
|
||||
int *piVar2;
|
||||
void *_Dst;
|
||||
void *pvVar3;
|
||||
int effectOffset;
|
||||
ItemConfig_Item *local_14;
|
||||
uint32_t effectIndex;
|
||||
TemporaryEffects *local_c;
|
||||
void **effectsEnd;
|
||||
Manager *manager;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
this->_cacheFlags = 0;
|
||||
pvVar3 = (this->_effects)._begin;
|
||||
effectCount = GHIDRA_INT((this->_effects)._end) - GHIDRA_INT(pvVar3) >> 4;
|
||||
effectIndex = effectCount - 1;
|
||||
if (effectIndex < effectCount) {
|
||||
effectOffset = effectIndex * 0x10;
|
||||
local_c = this;
|
||||
do {
|
||||
iVar1 = *GHIDRA_CAST<int *>((effectOffset + 8 + GHIDRA_INT(pvVar3)));
|
||||
if ((0 < iVar1) &&
|
||||
(iVar1 = iVar1 + -1, *GHIDRA_CAST<int *>((effectOffset + 8 + GHIDRA_INT(pvVar3))) = iVar1,
|
||||
manager = g_manager, iVar1 == 0)) {
|
||||
piVar2 = *GHIDRA_CAST<int **>((effectOffset + GHIDRA_INT(pvVar3)));
|
||||
if (piVar2 != GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar1 = *piVar2;
|
||||
if (((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) {
|
||||
if ((piVar2[1] == 0x3a) && (*GHIDRA_CAST<int *>((effectOffset + 0xc + GHIDRA_INT(pvVar3))) == 0)) {
|
||||
local_14 = GHIDRA_CAST<ItemConfig_Item *>(0x403);
|
||||
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_14));
|
||||
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_14),1.0,2,0,1.0,0.0);
|
||||
piVar2 = *GHIDRA_CAST<int **>((effectOffset + GHIDRA_INT(pvVar3)));
|
||||
this = local_c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
}
|
||||
this->_cacheFlags = this->_cacheFlags | piVar2[0x15];
|
||||
local_14 = *GHIDRA_CAST<ItemConfig_Item **>((effectOffset + GHIDRA_INT(pvVar3)));
|
||||
_Dst = (void *)(GHIDRA_INT((this->_effects)._begin) + effectOffset);
|
||||
iVar1 = *GHIDRA_CAST<int *>((effectOffset + 4 + GHIDRA_INT(pvVar3)));
|
||||
pvVar3 = (void *)(GHIDRA_INT(_Dst) + 0x10);
|
||||
memmove(_Dst,pvVar3,GHIDRA_INT((this->_effects)._end) - GHIDRA_INT(pvVar3));
|
||||
effectsEnd = &(this->_effects)._end;
|
||||
*effectsEnd = (void *)(GHIDRA_INT(*effectsEnd) + -0x10);
|
||||
if (this->_player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TriggerEffectRemoved(local_14,0);
|
||||
}
|
||||
else {
|
||||
Entity_Player::trigger_collectible_effect_removed(this->_player,local_14,iVar1);
|
||||
}
|
||||
this->_shouldEvaluateCache = 1;
|
||||
}
|
||||
effectIndex = effectIndex - 1;
|
||||
pvVar3 = (this->_effects)._begin;
|
||||
effectOffset = effectOffset + -0x10;
|
||||
} while (effectIndex < GHIDRA_UINT((GHIDRA_INT((this->_effects)._end) - GHIDRA_INT(pvVar3) >> 4)));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00930980
|
||||
void * TemporaryEffects::GetCollectibleEffect(int coltype)
|
||||
{
|
||||
int *effect;
|
||||
int effectType;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
effectType = *GHIDRA_CAST<int *>(*effect);
|
||||
if ((((effectType == 1) || (effectType == 3)) || (effectType == 4)) &&
|
||||
((GHIDRA_CAST<int *>(*effect))[1] == coltype)) {
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (void *)0x0;
|
||||
}
|
||||
|
||||
// 009309c0
|
||||
void * TemporaryEffects::GetTrinketEffect(int trinkettype)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
if ((*GHIDRA_CAST<int *>(*effect) == 2) && ((GHIDRA_CAST<int *>(*effect))[1] == trinkettype)) {
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (void *)0x0;
|
||||
}
|
||||
|
||||
// 00930a30
|
||||
void * TemporaryEffects::GetNullEffect(int nulleffectid)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
if ((*GHIDRA_CAST<int *>(*effect) == 0) && ((GHIDRA_CAST<int *>(*effect))[1] == nulleffectid)) {
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (void *)0x0;
|
||||
}
|
||||
|
||||
// 00930a70
|
||||
int TemporaryEffects::GetCollectibleEffectNum(int coltype)
|
||||
{
|
||||
void *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
effect = GetCollectibleEffect(this,coltype);
|
||||
if (effect != (void *)0x0) {
|
||||
return *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(effect) + 4));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 00930aa0
|
||||
int TemporaryEffects::GetTrinketEffectNum(int trinkettype)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
if ((*GHIDRA_CAST<int *>(*effect) == 2) && ((GHIDRA_CAST<int *>(*effect))[1] == trinkettype)) {
|
||||
return effect[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 00930ae0
|
||||
int TemporaryEffects::GetNullEffectNum(int nulleffectid)
|
||||
{
|
||||
int *effect;
|
||||
|
||||
if (this->_disabled == 0) {
|
||||
for (effect = (this->_effects)._begin; effect != (this->_effects)._end; effect = effect + 4) {
|
||||
if ((*GHIDRA_CAST<int *>(*effect) == 0) && ((GHIDRA_CAST<int *>(*effect))[1] == nulleffectid)) {
|
||||
return effect[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+63
-63
@@ -93,9 +93,9 @@ uint8_t Weapon::IsAxisAligned()
|
||||
(player = *GHIDRA_CAST<Entity_Player **>(&player->_isControlsEnabled), player != GHIDRA_CAST<Entity_Player *>(0x0))))
|
||||
) && (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) == g_vectorZero.x)))) &&
|
||||
(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)))) == g_vectorZero.y)) {
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x1d1,0);
|
||||
isHasItem = Entity_Player::HasCollectible(player,0x1d1,0);
|
||||
if (isHasItem == 0) {
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasItem = Entity_Player::HasCollectible(player,0x18a,0);
|
||||
if (isHasItem == 0) {
|
||||
return 1;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ Vector * Weapon::get_aim_direction(Vector *outDir, Vector *defaultDir)
|
||||
((this_00->_type == 3 &&
|
||||
(this_00 = *GHIDRA_CAST<Entity_Player **>(&this_00->_isControlsEnabled), this_00 != GHIDRA_CAST<Entity_Player *>(0x0))
|
||||
))))) && ((this->_modifiers & 0x40000000U) == 0)) {
|
||||
isHasMarked = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasMarked = Entity_Player::HasCollectible(this_00,0x18a,0);
|
||||
if ((((isHasMarked == 0) || (this_00->_markedTarget == (void *)0x0)) &&
|
||||
(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) == g_vectorZero.x)) &&
|
||||
(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)))) == g_vectorZero.y)) {
|
||||
@@ -257,8 +257,8 @@ LAB_009f3b99:
|
||||
}
|
||||
return;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((player2)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
bVar5 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(0x98,0);
|
||||
Entity_Player::HasCollectible(player2,0x18a,0);
|
||||
bVar5 = Entity_Player::HasCollectible(ownerPlayer,0x98,0);
|
||||
if ((bVar5 == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x30)))) == 0xf)) goto LAB_009f3b99;
|
||||
local_64 = *GHIDRA_CAST<Entity_Laser **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_54)) + 0x0))));
|
||||
aimDirY = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_54)) + 0x4))));
|
||||
@@ -333,7 +333,7 @@ LAB_009f3b99:
|
||||
}
|
||||
local_64->_damageMultiplier = 0.13;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_64)) + 0x517))) = 1;
|
||||
local_64->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(local_64) + 0xc))();
|
||||
aimDirY = local_50.y;
|
||||
local_64 = GHIDRA_CAST<Entity_Laser *>(local_50.x);
|
||||
player = player2;
|
||||
@@ -343,7 +343,7 @@ LAB_009f39d5:
|
||||
}
|
||||
else if (isInterpolated == 0) {
|
||||
fVar12 = atan2f(aimDirY,(float)local_64);
|
||||
(GHIDRA_CAST<Entity_NPC *>((local_5c)))->Entity_NPC::SetAimAngle(fVar12 * 57.295776);
|
||||
Entity_NPC::SetAimAngle(local_5c,fVar12 * 57.295776);
|
||||
GetOwnerLaserOffset(this,&scratchVec,1,&local_50);
|
||||
player = player2;
|
||||
(local_5c->_posOffset).y = scratchVec.y;
|
||||
@@ -361,9 +361,9 @@ LAB_009f39d5:
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((local_5c->_pathfinder))) + 0x18)))) = notExplosiveLoHi & uVar9;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((local_5c->_pathfinder))) + 0x1c)))) = notExplosiveHiLo & GHIDRA_UINT(qVar3);
|
||||
(local_5c->_pathfinder)._gridIndex = notExplosiveHiHi & uVar2;
|
||||
laserColorPtr = (GHIDRA_CAST<Entity_Player *>((player2)))->Entity_Player::get_laser_color_copy(&laserColor);
|
||||
laserColorPtr = Entity_Player::get_laser_color_copy(player2,&laserColor);
|
||||
pEVar10 = local_5c;
|
||||
local_5c->SetColor(laserColorPtr,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(local_5c) + 0x3c))(laserColorPtr,0xffffffff,0xff,0,1);
|
||||
if ((aimDirY <= -0.5) || ((float)local_64 <= -0.5)) {
|
||||
pEVar10->_renderDepthOffset = -10.0;
|
||||
}
|
||||
@@ -375,10 +375,10 @@ LAB_009f39d5:
|
||||
cVar6 = FUN_0097e7c0();
|
||||
iVar8 = extraout_ECX;
|
||||
if (cVar6 == '\0') goto LAB_009f3b6a;
|
||||
bVar5 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(0x37,0);
|
||||
bVar5 = Entity_Player::HasCollectible(ownerPlayer,0x37,0);
|
||||
if (bVar5 == 0) {
|
||||
LAB_009f3a27:
|
||||
bVar5 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(0x57,0);
|
||||
bVar5 = Entity_Player::HasCollectible(ownerPlayer,0x57,0);
|
||||
iVar8 = extraout_ECX_00;
|
||||
if (bVar5 == 0) goto LAB_009f3b6a;
|
||||
iVar8 = 0x50 - GHIDRA_INT(((float)local_3c * 5.0));
|
||||
@@ -403,20 +403,20 @@ LAB_009f3a27:
|
||||
local_3c = GHIDRA_CAST<Weapon *>(scratchVec.x);
|
||||
pVVar7 = get_owner_position(this,&local_50);
|
||||
laser = fire_laser(this,pVVar7,5,&scratchVec,0,1,0.13);
|
||||
laser->Update();
|
||||
bVar5 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(0x57,0);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
||||
bVar5 = Entity_Player::HasCollectible(ownerPlayer,0x57,0);
|
||||
iVar8 = extraout_ECX_02;
|
||||
if (bVar5 != 0) {
|
||||
scratchVec.x = aimDirY;
|
||||
scratchVec.y = (float)local_3c;
|
||||
pVVar7 = get_owner_position(this,&local_50);
|
||||
laser = fire_laser(this,pVVar7,5,&scratchVec,0,1,0.13);
|
||||
laser->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
||||
scratchVec.x = (float)local_40;
|
||||
scratchVec.y = (float)local_64;
|
||||
pVVar7 = get_owner_position(this,&local_50);
|
||||
laser = fire_laser(this,pVVar7,5,&scratchVec,0,1,0.13);
|
||||
laser->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
||||
iVar8 = extraout_ECX_03;
|
||||
}
|
||||
LAB_009f3b6a:
|
||||
@@ -462,7 +462,7 @@ float Weapon::get_damage()
|
||||
if (this_00->_playerType != 0xd) {
|
||||
damage = damage * 0.5;
|
||||
}
|
||||
isHasBffs = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasCollectible(0xf7,0);
|
||||
isHasBffs = Entity_Player::HasCollectible(this_00,0xf7,0);
|
||||
if (isHasBffs == 0) {
|
||||
return damage;
|
||||
}
|
||||
@@ -514,7 +514,7 @@ LAB_009f3d36:
|
||||
*GHIDRA_CAST<int *>(&outFlags->_h) = GHIDRA_INT(highFlags);
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&outFlags->_h) + 4)) = highFlagsHigh;
|
||||
if (familiarOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
isBabyBender = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasTrinket(0x7f,0);
|
||||
isBabyBender = Entity_Player::HasTrinket(this_00,0x7f,0);
|
||||
if (isBabyBender != 0) {
|
||||
*GHIDRA_CAST<uint32_t *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagHoming._l);
|
||||
flagsDword = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&outFlags->_l) + 4));
|
||||
@@ -599,7 +599,7 @@ LAB_009f3de7:
|
||||
outColor->_colorize[3] = colorizeA;
|
||||
}
|
||||
if (pEVar2 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
bVar1 = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasTrinket(0x7f,0);
|
||||
bVar1 = Entity_Player::HasTrinket(this_00,0x7f,0);
|
||||
if (bVar1 == 0) {
|
||||
if ((char)pEVar2->_chargeBarSprites[5]._shadowLayerIndex != '\0') {
|
||||
outColor->_colorize[0] = 2.4;
|
||||
@@ -716,7 +716,7 @@ LAB_009f3f9a:
|
||||
outColor->_colorize[3] = fVar8;
|
||||
}
|
||||
if (GHIDRA_CAST<Entity_Player *>(ownerFamiliar) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
bVar9 = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasTrinket(0x7f,0);
|
||||
bVar9 = Entity_Player::HasTrinket(this_00,0x7f,0);
|
||||
if (bVar9 == 0) {
|
||||
if ((char)(GHIDRA_CAST<Entity_Player *>(ownerFamiliar))->_chargeBarSprites[5]._shadowLayerIndex != '\0')
|
||||
{
|
||||
@@ -1193,7 +1193,7 @@ Vector * Weapon::get_tear_movement_inheritance(Vector *outResult, Vector *direct
|
||||
}
|
||||
if (pEVar1->_type == 3) {
|
||||
pEVar1 = *GHIDRA_CAST<Entity_Player **>(&pEVar1->_isControlsEnabled);
|
||||
isHasMarked = (GHIDRA_CAST<Entity_Player *>((pEVar1)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasMarked = Entity_Player::HasCollectible(pEVar1,0x18a,0);
|
||||
if ((isHasMarked == 0) || (pEVar1->_markedTarget == (void *)0x0)) {
|
||||
familiarPlayer = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x410));
|
||||
inheritX = *GHIDRA_CAST<float *>((familiarPlayer + 0x360)) * 0.6;
|
||||
@@ -1291,7 +1291,7 @@ LAB_009f5b91:
|
||||
randomValue = Random();
|
||||
shooter = (Entity_Tear *)
|
||||
Game::SpawnEx(g_game,2,0,position,velocity,*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))),0,randomValue,0);
|
||||
shooter->SetCollisionDamage(damageMultiplier * shooter->_collisionDamage);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(shooter) + 0x40))(damageMultiplier * shooter->_collisionDamage);
|
||||
local_14 = *GHIDRA_CAST<Weapon **>((iStack_18 + 4));
|
||||
if (shooter->_parent != 0) {
|
||||
local_10 = &shooter->_parent;
|
||||
@@ -1301,11 +1301,11 @@ LAB_009f5b91:
|
||||
if (local_14 != GHIDRA_CAST<Weapon *>(0x0)) {
|
||||
msvc::multiset<unsigned_int>::insert(&shooter->_parent);
|
||||
}
|
||||
shooter->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(shooter) + 0xc))();
|
||||
LAB_009f5c1f:
|
||||
shooter = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_14)) + 0x4))));
|
||||
if ((shooter != GHIDRA_CAST<Entity_Player *>(0x0)) && (shooter->_type == 1)) {
|
||||
seededVariant = (GHIDRA_CAST<Entity_Player *>((shooter)))->Entity_Player::get_seeded_variant();
|
||||
seededVariant = Entity_Player::get_seeded_variant(shooter);
|
||||
if (seededVariant == 2) {
|
||||
local_c = (shooter->_velocity).x;
|
||||
local_10 = GHIDRA_CAST<uint32_t *>((shooter->_velocity).y);
|
||||
@@ -1363,7 +1363,7 @@ Entity_Bomb * Weapon::fire_bomb(Weapon *weapon, Vector *position, Vector *veloci
|
||||
if (source->_type != 3) goto LAB_009f5eb6;
|
||||
player = *GHIDRA_CAST<Entity_Player **>(&source->_isControlsEnabled);
|
||||
}
|
||||
pEVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::FireBomb(position,velocity,GHIDRA_CAST<Entity *>(source));
|
||||
pEVar3 = Entity_Player::FireBomb(player,position,velocity,GHIDRA_CAST<Entity *>(source));
|
||||
manager = g_manager;
|
||||
if (pEVar3 != GHIDRA_CAST<Entity_Bomb *>(0x0)) {
|
||||
if ((pEVar3->_variant == 0x13) || (pEVar3->_variant == 0x14)) {
|
||||
@@ -1406,7 +1406,7 @@ LAB_009f5eb6:
|
||||
if (iVar2 != 0) {
|
||||
msvc::multiset<unsigned_int>::insert(parentSlot);
|
||||
}
|
||||
pEVar3->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar3) + 0xc))();
|
||||
return pEVar3;
|
||||
}
|
||||
|
||||
@@ -1550,7 +1550,7 @@ Entity_Laser * Weapon::fire_laser(Vector *position, uint32_t offsetId, Vector *d
|
||||
uVar5 = Random();
|
||||
Entity_Player::GetTearHitParams
|
||||
(local_e4,&TStack_a8,3,savedDamageScale,(uVar5 & 1) * 2 + -1,pEVar3);
|
||||
pEVar4->SetCollisionDamage(TStack_a8._tearDamage);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0x40))(TStack_a8._tearDamage);
|
||||
pEVar4->_mass = fStack_54 * pEVar4->_mass;
|
||||
}
|
||||
}
|
||||
@@ -1691,7 +1691,7 @@ Entity_Knife * Weapon::FireSword(Entity *param_2, uint32_t param_3, float param_
|
||||
randomValue = Random();
|
||||
Entity_Player::GetTearHitParams
|
||||
(parentRef,&hitParams,0xd,1.0,(randomValue & 1) * 2 + -1,GHIDRA_CAST<Entity *>(source));
|
||||
knife->SetColor(&hitParams._tearColor,0xffffffff,0xff,0,1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(knife) + 0x3c))(&hitParams._tearColor,0xffffffff,0xff,0,1);
|
||||
owner = *GHIDRA_CAST<int *>(knife);
|
||||
*GHIDRA_CAST<float *>(&(knife->_tearFlags)._l) = hitParams._tearColor._colorize[3];
|
||||
*GHIDRA_CAST<float *>((GHIDRA_INT(&(knife->_tearFlags)._l) + 4)) = hitParams._tearColor._offset[0];
|
||||
@@ -1901,7 +1901,7 @@ LAB_009f8615:
|
||||
}
|
||||
trigger_set_dispatch
|
||||
((void *)(GHIDRA_INT(player) + 0x1fc8),1,GHIDRA_CAST<Entity *>(0x0),&triggerPos,GHIDRA_CAST<Vector *>(local_238));
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xd9,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0xd9,0);
|
||||
if (isHasCollectible != 0) {
|
||||
FUN_009f3c10();
|
||||
fVar6 = fVar6 + fVar6;
|
||||
@@ -1912,7 +1912,7 @@ LAB_009f8615:
|
||||
if (((local_2ac == (EntityPtr)0x0) || (uVar3 = Random(), uVar3 % GHIDRA_UINT(local_2ac) == 0)) &&
|
||||
((local_2ac = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(player) + 0x1370)),
|
||||
GHIDRA_UINT(local_2ac) <= GHIDRA_CAST<Entity *>(&DAT_00000004) ||
|
||||
(((isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xf8,0),
|
||||
(((isHasCollectible = Entity_Player::HasCollectible(player,0xf8,0),
|
||||
isHasCollectible != 0 ||
|
||||
(isHasCollectible =
|
||||
TemporaryEffects::HasCollectibleEffect
|
||||
@@ -1933,7 +1933,7 @@ LAB_009f8615:
|
||||
spawn_blue_spider(&spiderPos,GHIDRA_CAST<Entity *>(player),&g_vectorZero);
|
||||
}
|
||||
}
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x23d,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x23d,0);
|
||||
if (isHasCollectible != 0) {
|
||||
uVar3 = Random();
|
||||
if ((uVar3 & 3) == 0) {
|
||||
@@ -2007,7 +2007,7 @@ LAB_009f7c88:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_02._h)) + 0x0))) = uStack_208;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_02._h)) + 0x4))) = uStack_204;
|
||||
local_2a0 = tear;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags_02);
|
||||
Entity_Tear::SetTearFlags(tear,flags_02);
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c0)) + 0x28))) = (tear->_sprite)._color._offset[2];
|
||||
tearTint._colorize[0] = 0.0;
|
||||
tearTint._colorize[1] = 0.0;
|
||||
@@ -2042,12 +2042,12 @@ LAB_009f7c88:
|
||||
heartOffset0 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c0)) + 0x20)));
|
||||
heartOffset1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c0)) + 0x24)));
|
||||
fVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c0)) + 0x20)));
|
||||
tear->SetColor();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x3c))();
|
||||
player = GHIDRA_CAST<Entity_Player *>(VStack_290.y);
|
||||
}
|
||||
}
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x2ef8)) == 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x2ef8)) != 0x9d)) {
|
||||
iVar9 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x9d);
|
||||
iVar9 = Entity_Player::GetTrinketMultiplier(player,0x9d);
|
||||
bVar5 = false;
|
||||
bVar4 = iVar9 == 0;
|
||||
LAB_009f7fe7:
|
||||
@@ -2055,7 +2055,7 @@ LAB_009f7fe7:
|
||||
}
|
||||
else {
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(player) + 0x2ef0)) == '\0') {
|
||||
iVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x9d);
|
||||
iVar1 = Entity_Player::GetTrinketMultiplier(player,0x9d);
|
||||
bVar5 = SBORROW4(iVar1,1);
|
||||
iVar9 = iVar1 + -1;
|
||||
bVar4 = iVar1 == 1;
|
||||
@@ -2063,7 +2063,7 @@ LAB_009f7fe7:
|
||||
}
|
||||
LAB_009f7ff2:
|
||||
local_2a8.y = 2.10195e-44;
|
||||
iVar9 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x9d);
|
||||
iVar9 = Entity_Player::GetTrinketMultiplier(player,0x9d);
|
||||
if (iVar9 == 2) {
|
||||
local_2a8.y = 1.4013e-44;
|
||||
}
|
||||
@@ -2072,7 +2072,7 @@ LAB_009f7ff2:
|
||||
}
|
||||
if (*GHIDRA_CAST<uint32_t *>(((uint32_t)weapon + 1)) % GHIDRA_UINT(local_2a8.y) == 0) {
|
||||
Entity_Player::GetTearHitParams();
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x95,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x95,0);
|
||||
if (isHasCollectible == 0) {
|
||||
fStack_10c = fStack_10c + 40.0;
|
||||
fStack_108 = fStack_108 + 0.3;
|
||||
@@ -2123,27 +2123,27 @@ LAB_009f7ff2:
|
||||
Game::SpawnEx(g_game,2,tornCardVariant,GHIDRA_CAST<Vector *>((auStack_248 + 4)),&local_2a8,
|
||||
GHIDRA_CAST<Entity *>(player),0,uVar3,0);
|
||||
tear->_height = tornCardHeight;
|
||||
fVar6 = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::get_height_offset_y(tornCardHeight);
|
||||
fVar6 = Entity_Tear::get_height_offset_y(tear,tornCardHeight);
|
||||
game = g_game;
|
||||
(tear->_posOffset).y = fVar6;
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
|
||||
(fVar6 = tear->_height, (tear->_posOffset).y = -18.0, -5.1 < fVar6)) {
|
||||
tear->_height = -5.1;
|
||||
}
|
||||
tear->SetCollisionDamage();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x40))();
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = uStack_11c;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = uStack_120;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = uStack_118;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = uStack_114;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
||||
Entity_Tear::SetTearFlags(tear,flags);
|
||||
fVar6 = fStack_10c;
|
||||
if (fStack_10c <= 0.01) {
|
||||
fVar6 = 0.01;
|
||||
}
|
||||
tear->_baseScale = fVar6;
|
||||
tear->_fScale = fVar6;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
||||
tear->SetColor(tornCardColor,0xffffffff,0xff,0,1);
|
||||
Entity_Tear::ResetSpriteScale(tear);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x3c))(tornCardColor,0xffffffff,0xff,0,1);
|
||||
if (tear->_parent != (EntityPtr)0x0) {
|
||||
msvc::multiset<unsigned_int>::erase(auStackY_374 + 0x9c);
|
||||
}
|
||||
@@ -2159,7 +2159,7 @@ LAB_009f7ff2:
|
||||
fVar6 = 0.01;
|
||||
}
|
||||
tear->_fallingSpeed = ((-5.0 - tear->_height) - (50.0 - fVar6) * 9.0) / fVar6;
|
||||
tear->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0xc))();
|
||||
fVar6 = (tear->_pos).x - (tear->_velocity).x;
|
||||
fVar8 = (tear->_velocity).y;
|
||||
(tear->_pos).x = fVar6;
|
||||
@@ -2185,11 +2185,11 @@ LAB_009f7ff2:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_248)) + 0x0))) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(owner) + 0x33c));
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_248)) + 0x4))) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(owner) + 0x340));
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddBlueFlies(1,GHIDRA_CAST<Vector *>(auStack_248),GHIDRA_CAST<Entity *>(0x0));
|
||||
Entity_Player::AddBlueFlies(player,1,GHIDRA_CAST<Vector *>(auStack_248),GHIDRA_CAST<Entity *>(0x0));
|
||||
}
|
||||
}
|
||||
isBirdsEye = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x268,0);
|
||||
isGhostPepper = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x1ef,0);
|
||||
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) {
|
||||
@@ -2222,7 +2222,7 @@ LAB_009f84ed:
|
||||
if (isBirdsEye == 0) {
|
||||
if (isGhostPepper != 0) {
|
||||
LAB_009f858f:
|
||||
local_2ac = (EntityPtr)(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::ShootBlueCandle(GHIDRA_CAST<Vector *>(auStack_240));
|
||||
local_2ac = (EntityPtr)Entity_Player::ShootBlueCandle(player,GHIDRA_CAST<Vector *>(auStack_240));
|
||||
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
||||
Random();
|
||||
Entity_Player::GetTearHitParams();
|
||||
@@ -2239,10 +2239,10 @@ LAB_009f858f:
|
||||
uVar3 = Random();
|
||||
if ((uVar3 & 1) != 0) goto LAB_009f858f;
|
||||
}
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::ShootRedCandle(GHIDRA_CAST<Vector *>(auStack_240));
|
||||
Entity_Player::ShootRedCandle(player,GHIDRA_CAST<Vector *>(auStack_240));
|
||||
*GHIDRA_CAST<int *>((weapon + 1)) = *GHIDRA_CAST<int *>((weapon + 1)) + 1;
|
||||
LAB_009f8620:
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x1c2,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x1c2,0);
|
||||
if (isHasCollectible != 0) {
|
||||
if (*GHIDRA_CAST<uint32_t *>((weapon + 1)) % 0x14 == 0) {
|
||||
Entity_Player::GetTearHitParams();
|
||||
@@ -2291,7 +2291,7 @@ LAB_009f8620:
|
||||
Game::SpawnEx(g_game,2,0x14,GHIDRA_CAST<Vector *>((auStack_240 + 4)),&VStack_290,
|
||||
GHIDRA_CAST<Entity *>(player),0,uVar3,0);
|
||||
tear->_height = hitParamsHeight;
|
||||
fVar6 = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::get_height_offset_y(hitParamsHeight);
|
||||
fVar6 = Entity_Tear::get_height_offset_y(tear,hitParamsHeight);
|
||||
game = g_game;
|
||||
(tear->_posOffset).y = fVar6;
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
|
||||
@@ -2299,7 +2299,7 @@ LAB_009f8620:
|
||||
tear->_height = -5.1;
|
||||
}
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x1368)) < 1) {
|
||||
tear->SetCollisionDamage();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x40))();
|
||||
greedFlags0 = hitParamsFlags0 | GHIDRA_UINT(g_tearFlagMidas._l);
|
||||
uVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagMidas._l)) + 0x4))) | hitParamsFlags1;
|
||||
greedFlags2 = hitParamsFlags2 | GHIDRA_UINT(g_tearFlagMidas._h);
|
||||
@@ -2310,8 +2310,8 @@ LAB_009f8620:
|
||||
uStack_1fc = uVar2;
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddCoins(-1);
|
||||
tear->SetCollisionDamage();
|
||||
Entity_Player::AddCoins(player,-1);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x40))();
|
||||
greedFlags0 = hitParamsFlags0 | GHIDRA_UINT(g_tearFlagMidas._l) | GHIDRA_UINT(g_tearFlagCoinDrop._l);
|
||||
uVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagMidas._l)) + 0x4))) | hitParamsFlags1 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCoinDrop._l)) + 0x4)));
|
||||
greedFlags2 = hitParamsFlags2 | GHIDRA_UINT(g_tearFlagMidas._h) | GHIDRA_UINT(g_tearFlagCoinDrop._h);
|
||||
@@ -2325,7 +2325,7 @@ LAB_009f8620:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x0))) = greedFlags0;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x0))) = greedFlags2;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = uVar2;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags_00);
|
||||
Entity_Tear::SetTearFlags(tear,flags_00);
|
||||
if (tear->_parent != (EntityPtr)0x0) {
|
||||
msvc::multiset<unsigned_int>::erase(auStackY_374 + 0xb0);
|
||||
}
|
||||
@@ -2339,7 +2339,7 @@ LAB_009f8620:
|
||||
((float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
||||
2.3283064e-10 * 0.2 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1478))) - 7.0;
|
||||
tear->_fallingAccel = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x147c)) * 0.01;
|
||||
tear->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0xc))();
|
||||
manager = g_manager;
|
||||
fVar6 = (tear->_pos).x - (tear->_velocity).x;
|
||||
fVar8 = (tear->_velocity).y;
|
||||
@@ -2352,7 +2352,7 @@ LAB_009f8620:
|
||||
weapon = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Weapon *>(local_288))) + 0x0)));
|
||||
}
|
||||
}
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x1bc,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x1bc,0);
|
||||
if ((isHasCollectible != 0) && (*GHIDRA_CAST<uint32_t *>((weapon + 1)) % 0xf == 0)) {
|
||||
local_2ac = (EntityPtr)0xc;
|
||||
do {
|
||||
@@ -2400,19 +2400,19 @@ LAB_009f8620:
|
||||
Game::SpawnEx(g_game,2,hitParamsVariant,pencilSpawnPos,GHIDRA_CAST<Vector *>((local_238 + 4)),
|
||||
GHIDRA_CAST<Entity *>(player),0,uVar3,0);
|
||||
tear->_height = hitParamsHeight;
|
||||
fVar6 = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::get_height_offset_y(hitParamsHeight);
|
||||
fVar6 = Entity_Tear::get_height_offset_y(tear,hitParamsHeight);
|
||||
game = g_game;
|
||||
(tear->_posOffset).y = fVar6;
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
|
||||
(fVar6 = tear->_height, (tear->_posOffset).y = -18.0, -5.1 < fVar6)) {
|
||||
tear->_height = -5.1;
|
||||
}
|
||||
tear->SetCollisionDamage();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x40))();
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x4))) = hitParamsFlags1;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x0))) = hitParamsFlags0;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x0))) = hitParamsFlags2;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x4))) = hitParamsFlags3;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags_01);
|
||||
Entity_Tear::SetTearFlags(tear,flags_01);
|
||||
uVar3 = Random();
|
||||
uVar2 = Random();
|
||||
fVar6 = (((float)(uVar3 & 1) + 0.0) * 0.4 + 0.9 +
|
||||
@@ -2423,8 +2423,8 @@ LAB_009f8620:
|
||||
}
|
||||
tear->_baseScale = fVar6;
|
||||
tear->_fScale = fVar6;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
||||
tear->SetColor(hitParamsColor,0xffffffff,0xff,0,1);
|
||||
Entity_Tear::ResetSpriteScale(tear);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0x3c))(hitParamsColor,0xffffffff,0xff,0,1);
|
||||
if (tear->_parent != (EntityPtr)0x0) {
|
||||
msvc::multiset<unsigned_int>::erase(auStackY_374 + 0xa8);
|
||||
}
|
||||
@@ -2439,7 +2439,7 @@ LAB_009f8620:
|
||||
(float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
||||
2.3283064e-10 * 0.2 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1478));
|
||||
tear->_fallingAccel = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x147c));
|
||||
tear->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0xc))();
|
||||
game = g_game;
|
||||
fVar6 = (tear->_pos).x - (tear->_velocity).x;
|
||||
fVar8 = (tear->_velocity).y;
|
||||
@@ -2455,9 +2455,9 @@ LAB_009f8620:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_03._h)) + 0x0))) = pvpFlags2;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_03._h)) + 0x4))) = pvpFlags3;
|
||||
pvpFlags0 = fVar6;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags_03);
|
||||
Entity_Tear::SetTearFlags(tear,flags_03);
|
||||
}
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x95,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x95,0);
|
||||
if (isHasCollectible == 0) {
|
||||
tear->_fallingAccel = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x147c)) + 0.5;
|
||||
uVar3 = Random();
|
||||
|
||||
@@ -30,11 +30,11 @@ uint32_t Weapon_Bombs::GetMarkedTargetVariant()
|
||||
}
|
||||
player = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
LAB_009fa1e0:
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasItem = Entity_Player::HasCollectible(player,0x18a,0);
|
||||
if (isHasItem == 0) {
|
||||
return 0;
|
||||
}
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x23c,0);
|
||||
isHasItem = Entity_Player::HasCollectible(player,0x23c,0);
|
||||
targetVariant = 0x1e;
|
||||
if (isHasItem != 0) {
|
||||
targetVariant = 0x99;
|
||||
|
||||
@@ -315,15 +315,15 @@ LAB_009ff273:
|
||||
modifierBits = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(player) + 0x34));
|
||||
modifiers = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(player) + 0x34));
|
||||
if ((((iVar1 == 0xb) || (player == GHIDRA_CAST<Entity_Player *>(0x0))) ||
|
||||
(isDrFetusOnly = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x34,0), isDrFetusOnly == 0)) ||
|
||||
(isDrFetusOnly = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xa8,0), isDrFetusOnly != 0)) {
|
||||
(isDrFetusOnly = Entity_Player::HasCollectible(player,0x34,0), isDrFetusOnly == 0)) ||
|
||||
(isDrFetusOnly = Entity_Player::HasCollectible(player,0xa8,0), isDrFetusOnly != 0)) {
|
||||
isDrFetusOnly = false;
|
||||
if ((iVar1 != 0xb) && (player != GHIDRA_CAST<Entity_Player *>(0x0))) goto LAB_009ff2f1;
|
||||
}
|
||||
else {
|
||||
isDrFetusOnly = true;
|
||||
LAB_009ff2f1:
|
||||
isDrFetusOnly = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xa8,0);
|
||||
isDrFetusOnly = Entity_Player::HasCollectible(player,0xa8,0);
|
||||
if (isDrFetusOnly != 0) {
|
||||
bVar2 = true;
|
||||
goto LAB_009ff309;
|
||||
|
||||
@@ -69,7 +69,7 @@ void Weapon_Brimstone::fire_c_section_fetuses()
|
||||
tearVelocity.x = (jitterX * 3.0 + dirX) * shotSpeed;
|
||||
tearVelocity.y = (jitterY * 3.0 + dirY) * shotSpeed;
|
||||
tear = fire_fetus_tear(weapon,&laserPos,&tearVelocity,0,source,1.0,unused);
|
||||
tear->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0xc))();
|
||||
}
|
||||
rngResult = rngResult + 1;
|
||||
} while (rngResult < GHIDRA_UINT(lasers._size));
|
||||
@@ -200,11 +200,11 @@ uint32_t Weapon_Brimstone::GetMarkedTargetVariant()
|
||||
}
|
||||
owner = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
LAB_00a02830:
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasCollectible(0x23c,0);
|
||||
isHasItem = Entity_Player::HasCollectible(owner,0x23c,0);
|
||||
if (isHasItem != 0) {
|
||||
return 0x99;
|
||||
}
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasItem = Entity_Player::HasCollectible(owner,0x18a,0);
|
||||
if (isHasItem == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ LAB_00a02934:
|
||||
multiShotParams[0],fStack_6c,fStack_68,fStack_64,local_60,iStack_5c,fStack_58,
|
||||
auStack_54[0],(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))));
|
||||
pEVar4 = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::fire_brimstone_with_color(&local_78,damageMultiplier,0);
|
||||
pEVar4->Update();
|
||||
(**(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0xc))();
|
||||
if (local_8c == GHIDRA_CAST<Entity_Laser *>(0x0)) {
|
||||
local_8c = pEVar4;
|
||||
if (GHIDRA_CAST<Entity_Laser *>(this->_mainLaser) != pEVar4) {
|
||||
@@ -563,7 +563,7 @@ LAB_00a02bed:
|
||||
local_78.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_80.x) + 0x78));
|
||||
local_80.y = 0.0;
|
||||
local_78.y = 0.0;
|
||||
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(local_8c) + 0x1508)))))->TemporaryEffects::RemoveEffect(&local_80,-1);
|
||||
TemporaryEffects::RemoveEffect(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(local_8c) + 0x1508)),&local_80,-1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ LAB_00a05166:
|
||||
}
|
||||
tearFlagsWord1 = this_00->_entityGridCollisionClass;
|
||||
if ((((tearFlagsWord1 == 0) || (tearFlagsWord1 == 3)) || (tearFlagsWord1 == 1)) || (tearFlagsWord1 == 2)) {
|
||||
(GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::GetFlyingOffset(flyingOffset);
|
||||
Entity_Player::GetFlyingOffset(this_00,flyingOffset);
|
||||
knifeOffsetX = *extraout_EAX / 0.65 + knifeOffsetX;
|
||||
knifeOffsetY = extraout_EAX[1] / 0.65 + knifeOffsetY;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ LAB_00a08a1b:
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = uStack_18;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = uStack_14;
|
||||
uStack_1c = in_stack_ffffff94;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
||||
Entity_Tear::SetTearFlags(tear,flags);
|
||||
}
|
||||
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
||||
if (0.0 < player->_tearfallaccel) {
|
||||
@@ -100,10 +100,10 @@ LAB_00a08a1b:
|
||||
else {
|
||||
tear->_fallingAccel = player->_tearfallaccel + 0.5;
|
||||
in_stack_ffffff94 = 0xa08af7;
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x95,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x95,0);
|
||||
if (isHasCollectible == 0) {
|
||||
in_stack_ffffff94 = 0xa08b09;
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x213,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x213,0);
|
||||
if (isHasCollectible != 0) goto LAB_00a08b44;
|
||||
rngResult = Random();
|
||||
fVar2 = 5.0;
|
||||
@@ -133,11 +133,11 @@ LAB_00a08b44:
|
||||
}
|
||||
tear->_baseScale = in_XMM0_Da;
|
||||
tear->_fScale = in_XMM0_Da;
|
||||
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
||||
Entity_Tear::ResetSpriteScale(tear);
|
||||
}
|
||||
else {
|
||||
in_stack_ffffff94 = 0xa088a7;
|
||||
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x34,0);
|
||||
isHasCollectible = Entity_Player::HasCollectible(player,0x34,0);
|
||||
if (isHasCollectible == 0) goto LAB_00a08a1b;
|
||||
rngResult = Random();
|
||||
local_30.y = (float)((double)GHIDRA_INT(rngResult) +
|
||||
@@ -208,11 +208,11 @@ uint32_t Weapon_MonstrosLung::GetMarkedTargetVariant()
|
||||
}
|
||||
player = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
LAB_00a08cf6:
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasItem = Entity_Player::HasCollectible(player,0x18a,0);
|
||||
if (isHasItem == 0) {
|
||||
return 0;
|
||||
}
|
||||
isHasItem = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x23c,0);
|
||||
isHasItem = Entity_Player::HasCollectible(player,0x23c,0);
|
||||
targetVariant = 0x1e;
|
||||
if (isHasItem != 0) {
|
||||
targetVariant = 0x99;
|
||||
|
||||
@@ -17,6 +17,6 @@ uint32_t Weapon_Rockets::GetMarkedTargetVariant()
|
||||
}
|
||||
player = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
LAB_00a099be:
|
||||
isHasMarked = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18a,0);
|
||||
isHasMarked = Entity_Player::HasCollectible(player,0x18a,0);
|
||||
return -GHIDRA_UINT((isHasMarked != 0)) & 0x1e;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ stubs, dataStubs = [], [] # (owner, declaration, address): everything src/ has
|
||||
def class_emit(cls, stack=()):
|
||||
if cls in done or cls in stack or cls in PRELUDE_TYPES: return
|
||||
if cls in curatedClasses or cls.rpartition('::')[0] in curatedClasses: return # declared by src/ (a nested class with its outer one), only forward-declared here
|
||||
parent = base.get(cls) if base.get(cls) in names and base.get(cls) not in curatedClasses else None # a src/ parent stays bytes
|
||||
parent = base.get(cls) if base.get(cls) in names and base.get(cls) not in curatedClasses and (base.get(cls) or '').rpartition('::')[0] not in curatedClasses else None # a src/ parent (or one nested in a src/ class) stays bytes
|
||||
if parent: class_emit(parent, stack + (cls,))
|
||||
namespace, _, shortName = cls.rpartition('::')
|
||||
isNested = namespace in names # Cutscene::ANM2Part: declared inside Cutscene, defined after it
|
||||
|
||||
+5
-4
@@ -5,6 +5,7 @@
|
||||
#include "manager.h"
|
||||
#include "log.h"
|
||||
#include "render_passes.h"
|
||||
#include "room.h"
|
||||
#include "texture_cache.h"
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@@ -108,7 +109,7 @@ static bool is_screen_shake_applied()
|
||||
}
|
||||
|
||||
// A colour a fraction t of the way to another, every channel, as Color::Lerp does.
|
||||
static ColorMod color_lerp(const ColorMod& from, const ColorMod& to, float t)
|
||||
ColorMod color_lerp(const ColorMod& from, const ColorMod& to, float t)
|
||||
{
|
||||
float rest = 1 - t;
|
||||
ColorMod color;
|
||||
@@ -143,8 +144,8 @@ static float angle_wrap(float angle)
|
||||
return angle;
|
||||
}
|
||||
|
||||
// An angle a fraction t of the way to another, the short way round.
|
||||
static float angle_lerp(float from, float to, float t)
|
||||
// 006828b0 An angle in degrees a fraction t of the way to another, the short way round.
|
||||
float angle_lerp(float from, float to, float t)
|
||||
{
|
||||
from = angle_wrap(from);
|
||||
to = angle_wrap(to);
|
||||
@@ -1175,7 +1176,7 @@ static ColorMod layer_color_get(const AnimationFrame& frame, const LayerState& l
|
||||
if (is_reflection_pass())
|
||||
{
|
||||
color._tint[3] *= HALF;
|
||||
if (g_game) color._tint[3] *= g_game->room->_waterAmount;
|
||||
if (g_game) color._tint[3] *= g_game->room->waterAmount;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -367,3 +367,6 @@ struct AnmCache
|
||||
static void Clear();
|
||||
static void LogMemoryUsage();
|
||||
};
|
||||
|
||||
float angle_lerp(float from, float to, float t);
|
||||
ColorMod color_lerp(const ColorMod& from, const ColorMod& to, float t);
|
||||
+7
-6
@@ -3,6 +3,7 @@
|
||||
#include "game.h"
|
||||
#include "log.h"
|
||||
#include "platform.h"
|
||||
#include "room.h"
|
||||
#include "room_config.h"
|
||||
#include <cstdlib>
|
||||
|
||||
@@ -157,15 +158,15 @@ void Backdrop::Init(uint32_t id, bool isLoadGraphics)
|
||||
|
||||
backdropId = (int)id < 0 || (int)id >= BACKDROP_COUNT ? 1 : id;
|
||||
roomTopLeft = vector_make(ROOM_OFFSET, ROOM_OFFSET);
|
||||
roomBottomRight = vector_make((float)((int)room._gridWidth - WALL_CELLS) * GRID_SIZE + ROOM_OFFSET,
|
||||
(float)((int)room._gridHeight - WALL_CELLS) * GRID_SIZE + ROOM_OFFSET);
|
||||
roomBottomRight = vector_make((float)((int)room.gridWidth - WALL_CELLS) * GRID_SIZE + ROOM_OFFSET,
|
||||
(float)((int)room.gridHeight - WALL_CELLS) * GRID_SIZE + ROOM_OFFSET);
|
||||
if (isLoadGraphics) load_details();
|
||||
}
|
||||
|
||||
// 00935270 A floor variant for the room: one of the backdrop's floors at random, with exceptions by backdrop and room.
|
||||
uint32_t Backdrop::get_random_floor_variant()
|
||||
{
|
||||
RoomDescriptor* descriptor = g_game->room->_descriptor;
|
||||
RoomDescriptor* descriptor = g_game->room->descriptor;
|
||||
uint32_t floors = (uint32_t)configs[backdropId].floors;
|
||||
RNG levelRng = {};
|
||||
levelRng.SetSeed(seed, RNG_SHIFT_LEVEL_FLOOR);
|
||||
@@ -173,14 +174,14 @@ uint32_t Backdrop::get_random_floor_variant()
|
||||
switch (backdropId)
|
||||
{
|
||||
case BACKDROP_DROSS:
|
||||
if (descriptor->Flags & ROOM_FLAG_ALT_FLOOR) return rng.RandomInt(floors - 1);
|
||||
if (descriptor->flags & ROOM_FLAG_ALT_FLOOR) return rng.RandomInt(floors - 1);
|
||||
break;
|
||||
case BACKDROP_ASHPIT:
|
||||
case BACKDROP_ASHPIT_SHAFT:
|
||||
return descriptor->Flags & ROOM_FLAG_ALT_FLOOR ? FLOOR_SECOND : levelRng.RandomInt(floors);
|
||||
return descriptor->flags & ROOM_FLAG_ALT_FLOOR ? FLOOR_SECOND : levelRng.RandomInt(floors);
|
||||
case BACKDROP_MAUSOLEUM:
|
||||
case BACKDROP_MAUSOLEUM2:
|
||||
if (descriptor && descriptor->Data && descriptor->Data->shape != ROOMSHAPE_1x1)
|
||||
if (descriptor && descriptor->data && descriptor->data->shape != ROOMSHAPE_1x1)
|
||||
return rng.RandomInt(floors - 1);
|
||||
break;
|
||||
case BACKDROP_GEHENNA:
|
||||
|
||||
@@ -0,0 +1,416 @@
|
||||
#include "boss_pool.h"
|
||||
#include "data.h"
|
||||
#include "game.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "platform.h"
|
||||
#include <cstdlib>
|
||||
#include <random>
|
||||
|
||||
constexpr const char* BOSS_POOLS_XML = "bosspools.xml";
|
||||
|
||||
// The xorshift triples by shift index: the one stepping init's seed into each pool, and the pools' own.
|
||||
constexpr uint32_t POOL_SEEDER_SHIFT = 26;
|
||||
constexpr uint32_t POOL_RNG_SHIFT = 17;
|
||||
|
||||
constexpr int BOSS_PICK_ATTEMPTS = 10;
|
||||
constexpr int BOSS_REPICKS = 9;
|
||||
constexpr uint32_t HORSEMAN_ODDS = 10;
|
||||
constexpr uint32_t HEADLESS_HORSEMAN_ODDS = 10;
|
||||
constexpr uint32_t FALLEN_ODDS = 10;
|
||||
constexpr uint32_t DOUBLE_TROUBLE_ODDS_ULTRA_HARD = 1;
|
||||
constexpr uint32_t DOUBLE_TROUBLE_ODDS_CHAPTER_2 = 50;
|
||||
constexpr uint32_t DOUBLE_TROUBLE_ODDS_CHAPTER_3 = 25;
|
||||
constexpr uint32_t DOUBLE_TROUBLE_ODDS_CHAPTER_4 = 40;
|
||||
|
||||
constexpr int BOSS_MONSTRO = 1;
|
||||
constexpr int BOSS_MOM = 6;
|
||||
constexpr int BOSS_MOMS_HEART = 8;
|
||||
constexpr int BOSS_DEATH = 12;
|
||||
constexpr int BOSS_HEADLESS_HORSEMAN = 22;
|
||||
constexpr int BOSS_THE_FALLEN = 23;
|
||||
constexpr int BOSS_SATAN = 24;
|
||||
constexpr int BOSS_IT_LIVES = 25;
|
||||
constexpr int BOSS_THE_BLOAT = 30;
|
||||
constexpr int BOSS_CONQUEST = 38;
|
||||
constexpr int BOSS_ISAAC = 39;
|
||||
constexpr int BOSS_BLUE_BABY = 40;
|
||||
constexpr int BOSS_THE_LAMB = 54;
|
||||
constexpr int BOSS_DELIRIUM = 70;
|
||||
constexpr int BOSS_REAP_CREEP = 74;
|
||||
constexpr int BOSS_MOTHER = 88;
|
||||
constexpr int BOSS_MOM_MAUSOLEUM = 89;
|
||||
|
||||
// The Horsemen of the first floor of chapters 1 to 4, by chapter.
|
||||
constexpr std::array<int, 4> HORSEMEN = {9, 10, 11, BOSS_DEATH};
|
||||
|
||||
// The bosses the dark bosses special daily fixes on stages 1 to 7 (none on stage 6).
|
||||
constexpr int SPECIAL_DAILY_DARK_BOSSES = 13;
|
||||
constexpr std::array<int, 8> SPECIAL_DAILY_BOSSES = {0, 60, 43, 50, 23, 51, 0, 15};
|
||||
|
||||
constexpr int ACHIEVEMENT_HARBINGERS = 5;
|
||||
constexpr int ACHIEVEMENT_IT_LIVES = 34;
|
||||
constexpr int ACHIEVEMENT_FORGOTTEN_HORSEMAN = 66;
|
||||
|
||||
constexpr int STAGE_CHAPTER_1 = 1;
|
||||
constexpr int STAGE_CHAPTER_2 = 3;
|
||||
constexpr int STAGE_CHAPTER_2_END = 4;
|
||||
constexpr int STAGE_CHAPTER_3 = 5;
|
||||
constexpr int STAGE_MOM = 6;
|
||||
constexpr int STAGE_CHAPTER_4 = 7;
|
||||
constexpr int STAGE_MOMS_HEART = 8;
|
||||
constexpr int STAGE_SHEOL = 10;
|
||||
constexpr int STAGE_DARK_ROOM = 11;
|
||||
constexpr int STAGE_VOID = 12;
|
||||
|
||||
constexpr int CHALLENGE_APRILS_FOOL = 32;
|
||||
constexpr int CHALLENGE_ULTRA_HARD = 34;
|
||||
constexpr int CHALLENGE_SCAT_MAN = 36;
|
||||
|
||||
// A pool element's name and the stage id (StbType) whose pool it fills.
|
||||
struct BossPoolStage
|
||||
{
|
||||
std::string_view name;
|
||||
int stageId = 0;
|
||||
};
|
||||
|
||||
constexpr std::array<BossPoolStage, 26> BOSS_POOL_STAGES = {{{"basement", 1},
|
||||
{"cellar", 2},
|
||||
{"burning basement", 3},
|
||||
{"caves", 4},
|
||||
{"catacombs", 5},
|
||||
{"flooded caves", 6},
|
||||
{"depths", 7},
|
||||
{"necropolis", 8},
|
||||
{"dank depths", 9},
|
||||
{"womb", 10},
|
||||
{"utero", 11},
|
||||
{"scarred womb", 12},
|
||||
{"blue womb", 13},
|
||||
{"sheol", 14},
|
||||
{"cathedral", 15},
|
||||
{"dark room", 16},
|
||||
{"chest", 17},
|
||||
{"void", 26},
|
||||
{"downpour", 27},
|
||||
{"dross", 28},
|
||||
{"mines", 29},
|
||||
{"ashpit", 30},
|
||||
{"mausoleum", 31},
|
||||
{"gehenna", 32},
|
||||
{"corpse", 33},
|
||||
{"mortis", 34}}};
|
||||
|
||||
// Calls visit with each attribute of an element, in document order.
|
||||
template <class Visit> static void attrs_walk(DataNode node, Visit visit)
|
||||
{
|
||||
simdjson::dom::object attrs;
|
||||
if (node["attrs"].get(attrs) != simdjson::SUCCESS) return;
|
||||
|
||||
for (auto [name, value] : attrs) visit(name, value.get_string().value_unsafe());
|
||||
}
|
||||
|
||||
// Whether a boss id is one the pools track, as only those have a bit in the removed and blacklisted sets.
|
||||
static bool is_boss_tracked(int bossId)
|
||||
{
|
||||
return bossId >= 0 && bossId < BOSS_ID_COUNT;
|
||||
}
|
||||
|
||||
// Adds a boss to a set of bosses. The original sets the bit of an untracked id past the set, here it is dropped.
|
||||
static void boss_mark(std::bitset<BOSS_ID_COUNT>& bosses, int bossId)
|
||||
{
|
||||
if (is_boss_tracked(bossId)) bosses.set(bossId);
|
||||
}
|
||||
|
||||
// Whether a boss may show up in this run: Reap Creep sits out Scat Man, and a boss needs its achievement.
|
||||
static bool is_boss_allowed(BossPool_Entry& entry)
|
||||
{
|
||||
if (entry.id == BOSS_REAP_CREEP && g_game->challenge == CHALLENGE_SCAT_MAN) return false;
|
||||
return entry.achievementID < 0 || g_manager->persistentGameData.Unlocked(entry.achievementID);
|
||||
}
|
||||
|
||||
// The boss a chapter's end always has, or 0. The alternate path has its own Mom and Mother.
|
||||
static int chapter_end_boss(int levelStage, int stageType)
|
||||
{
|
||||
bool isAltPath = stageType == STAGETYPE_REPENTANCE || stageType == STAGETYPE_REPENTANCE_B;
|
||||
bool isWotl = stageType == STAGETYPE_WOTL;
|
||||
|
||||
switch (levelStage)
|
||||
{
|
||||
case STAGE_MOM:
|
||||
return isAltPath ? BOSS_MOM_MAUSOLEUM : BOSS_MOM;
|
||||
case STAGE_MOMS_HEART:
|
||||
if (isAltPath) return BOSS_MOTHER;
|
||||
return g_manager->persistentGameData.Unlocked(ACHIEVEMENT_IT_LIVES) ? BOSS_IT_LIVES : BOSS_MOMS_HEART;
|
||||
case STAGE_SHEOL:
|
||||
if (isAltPath) return BOSS_BLUE_BABY;
|
||||
return isWotl ? BOSS_ISAAC : BOSS_SATAN;
|
||||
case STAGE_DARK_ROOM:
|
||||
if (isAltPath) return BOSS_BLUE_BABY;
|
||||
return isWotl ? BOSS_BLUE_BABY : BOSS_THE_LAMB;
|
||||
case STAGE_VOID:
|
||||
return BOSS_DELIRIUM;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// How rarely a stage's floor has its Double Trouble room, or 0 when it never does. Ultra Hard always does.
|
||||
static uint32_t double_trouble_odds(int levelStage)
|
||||
{
|
||||
if (g_game->challenge == CHALLENGE_ULTRA_HARD) return DOUBLE_TROUBLE_ODDS_ULTRA_HARD;
|
||||
if (levelStage == STAGE_CHAPTER_2 || levelStage == STAGE_CHAPTER_2_END) return DOUBLE_TROUBLE_ODDS_CHAPTER_2;
|
||||
if (levelStage == STAGE_CHAPTER_3) return DOUBLE_TROUBLE_ODDS_CHAPTER_3;
|
||||
if (levelStage == STAGE_CHAPTER_4) return DOUBLE_TROUBLE_ODDS_CHAPTER_4;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 004218e0 Starts the run's pools: seeds each pool's generator from seed, forgets every boss met, reads
|
||||
// bosspools.xml (and the mods', which are ignored) and shuffles each pool.
|
||||
// The original stops in the debugger on a zero seed. Here it only logs and leaves the pools as they are.
|
||||
void BossPool::init(uint32_t seed)
|
||||
{
|
||||
RNG seeder{};
|
||||
|
||||
if (seed == 0)
|
||||
{
|
||||
log_printf(LOG_ASSERT, "RNG Seed is zero!\n");
|
||||
return;
|
||||
}
|
||||
seeder.SetSeed(seed, POOL_SEEDER_SHIFT);
|
||||
for (BossPool_Pool& pool : pools) pool.rng.SetSeed(seeder.Next(), POOL_RNG_SHIFT);
|
||||
removedBosses.reset();
|
||||
levelBlacklist.reset();
|
||||
|
||||
load_xml(BOSS_POOLS_XML, BOSS_POOL_GAME);
|
||||
g_manager->modManager.LoadModBossPools();
|
||||
|
||||
for (BossPool_Pool& pool : pools)
|
||||
{
|
||||
std::mt19937 twister(pool.rng._seed);
|
||||
for (size_t count = pool.entries.size(); count > 1; count--)
|
||||
std::swap(pool.entries[count - 1], pool.entries[twister() % count]);
|
||||
}
|
||||
}
|
||||
|
||||
// 00421bf0 Reads a bosspools.xml: each <pool> named after a stage is emptied and refilled with its children's bosses
|
||||
// (id, weight, alternate room range), its Double Trouble range kept. A mod's file is ignored, as in the original.
|
||||
// A boss without a weight takes the one before it, from 0. The original reads that from memory it never wrote, and an
|
||||
// out of bounds id's achievement past the boss table. Here that id has none.
|
||||
void BossPool::load_xml(std::string_view path, BossPoolSource source)
|
||||
{
|
||||
Data data;
|
||||
float weight = 0;
|
||||
|
||||
if (source == BOSS_POOL_MOD) return;
|
||||
data_load(data, path);
|
||||
if (!data.isLoaded || node_tag(data.root) != "bosspools") return;
|
||||
std::vector<EntityConfig_Boss>& bosses = g_manager->entityConfig.bosses;
|
||||
|
||||
for (DataNode poolNode : node_children(data.root))
|
||||
{
|
||||
std::string name;
|
||||
int doubleTrouble = 0;
|
||||
|
||||
attrs_walk(poolNode, [&](std::string_view attr, std::string_view value) {
|
||||
if (attr == "name") name = value;
|
||||
else if (attr == "doubletrouble") doubleTrouble = std::atoi(std::string(value).c_str());
|
||||
});
|
||||
auto stage = std::ranges::find(BOSS_POOL_STAGES, std::string_view(name), &BossPoolStage::name);
|
||||
if (stage == BOSS_POOL_STAGES.end())
|
||||
{
|
||||
log_printf(LOG_WARN, "Boss pool: Unknown stage '%s'\n", name.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
BossPool_Pool& pool = pools[stage->stageId];
|
||||
pool.name = name;
|
||||
pool.doubleTroubleRoomVariantStart = doubleTrouble;
|
||||
pool.entries.clear();
|
||||
pool.totalWeight = 0;
|
||||
|
||||
for (DataNode bossNode : node_children(poolNode))
|
||||
{
|
||||
BossPool_Entry entry;
|
||||
|
||||
attrs_walk(bossNode, [&](std::string_view attr, std::string_view value) {
|
||||
std::string text(value);
|
||||
if (attr == "id") entry.id = std::atoi(text.c_str());
|
||||
else if (attr == "weight") weight = (float)std::atof(text.c_str());
|
||||
else if (attr == "room") entry.roomVariantStart = std::atoi(text.c_str());
|
||||
});
|
||||
bool isKnownBoss = entry.id >= 0 && entry.id < (int)bosses.size();
|
||||
if (!isKnownBoss) log_printf(LOG_ASSERT, "BossID out of bounds\n");
|
||||
|
||||
entry.initialWeight = weight;
|
||||
entry.weight = weight;
|
||||
entry.achievementID = isKnownBoss ? bosses[entry.id].achievement : -1;
|
||||
pool.entries.push_back(entry);
|
||||
pool.totalWeight += weight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 00422830 The boss of a stage's boss room: a challenge's, the special daily's or a chapter end's fixed boss, one of
|
||||
// the Horsemen (on one in ten first floors of chapters 1 to 4 once unlocked), the pool's Double Trouble room (as minus
|
||||
// its first room variant), The Fallen after a devil room, else a pick from the stage's pool, which ten failed picks
|
||||
// leave on Monstro. Each roll comes from the pool's own generator.
|
||||
// The original's RNG argument is never read, so it is left out.
|
||||
int BossPool::GetBossId(int levelStage, int stageType)
|
||||
{
|
||||
Game& game = *g_game;
|
||||
PersistentGameData& data = g_manager->persistentGameData;
|
||||
BossPool_Pool& pool = pools[RoomConfig::GetStageID(levelStage, stageType, ROOM_MODE_CURRENT)];
|
||||
bool isAltPath = stageType == STAGETYPE_REPENTANCE || stageType == STAGETYPE_REPENTANCE_B;
|
||||
|
||||
if (game.challenge == CHALLENGE_APRILS_FOOL) return BOSS_THE_BLOAT;
|
||||
bool isDailyStage = levelStage >= 0 && levelStage < (int)SPECIAL_DAILY_BOSSES.size();
|
||||
if (game.dailyChallenge._specialDailyId == SPECIAL_DAILY_DARK_BOSSES && isDailyStage &&
|
||||
SPECIAL_DAILY_BOSSES[levelStage] != 0)
|
||||
return SPECIAL_DAILY_BOSSES[levelStage];
|
||||
if (int boss = chapter_end_boss(levelStage, stageType)) return boss;
|
||||
|
||||
uint32_t conquestRoll = pool.rng.Next();
|
||||
uint32_t horsemanRoll = pool.rng.Next();
|
||||
uint32_t headlessRoll = pool.rng.Next();
|
||||
uint32_t doubleTroubleRoll = pool.rng.Next();
|
||||
uint32_t fallenRoll = pool.rng.Next();
|
||||
pool.rng.Next();
|
||||
pool.rng.Next();
|
||||
RNG pickRng = pool.rng;
|
||||
bool isConquest = (conquestRoll & 1) == 0 && data.Unlocked(ACHIEVEMENT_FORGOTTEN_HORSEMAN);
|
||||
|
||||
bool isHorsemanStage = levelStage == STAGE_CHAPTER_1 || levelStage == STAGE_CHAPTER_2 ||
|
||||
levelStage == STAGE_CHAPTER_3 || levelStage == STAGE_CHAPTER_4;
|
||||
if (horsemanRoll % HORSEMAN_ODDS == 0 && data.Unlocked(ACHIEVEMENT_HARBINGERS) && isHorsemanStage && !isAltPath)
|
||||
{
|
||||
if (headlessRoll % HEADLESS_HORSEMAN_ODDS == 0 && !WasBossRemoved(BOSS_HEADLESS_HORSEMAN))
|
||||
{
|
||||
boss_mark(levelBlacklist, BOSS_HEADLESS_HORSEMAN);
|
||||
return BOSS_HEADLESS_HORSEMAN;
|
||||
}
|
||||
|
||||
int horseman = HORSEMEN[levelStage / 2];
|
||||
if (!WasBossRemoved(horseman))
|
||||
{
|
||||
boss_mark(levelBlacklist, horseman);
|
||||
if (horseman != BOSS_DEATH || !isConquest) return horseman;
|
||||
boss_mark(levelBlacklist, BOSS_CONQUEST);
|
||||
return BOSS_CONQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t doubleTroubleOdds = double_trouble_odds(levelStage);
|
||||
if (pool.doubleTroubleRoomVariantStart != 0 && doubleTroubleOdds != 0 && doubleTroubleRoll % doubleTroubleOdds == 0)
|
||||
return -pool.doubleTroubleRoomVariantStart;
|
||||
|
||||
if (fallenRoll % FALLEN_ODDS == 0 && !isAltPath && game.GetStateFlag(GAME_STATE_DEVILROOM_VISITED) &&
|
||||
!WasBossRemoved(BOSS_THE_FALLEN))
|
||||
{
|
||||
boss_mark(levelBlacklist, BOSS_THE_FALLEN);
|
||||
return BOSS_THE_FALLEN;
|
||||
}
|
||||
|
||||
for (int attempt = 0; attempt < BOSS_PICK_ATTEMPTS; attempt++)
|
||||
{
|
||||
BossPool_Entry* entry = PickBoss(pool, pickRng.RandomFloat() * pool.totalWeight);
|
||||
if (!entry)
|
||||
{
|
||||
for (BossPool_Entry& met : pool.entries)
|
||||
if (is_boss_tracked(met.id))
|
||||
{
|
||||
removedBosses.reset(met.id);
|
||||
levelBlacklist.reset(met.id);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_boss_allowed(*entry)) continue;
|
||||
return entry->roomVariantStart != 0 ? -entry->roomVariantStart : entry->id;
|
||||
}
|
||||
log_printf(LOG_WARN, "Failed to pick a boss room variant, defaulting to Monstro\n");
|
||||
return BOSS_MONSTRO;
|
||||
}
|
||||
|
||||
// The first boss after a pool's entry, around the pool, that can still be picked, or null.
|
||||
static BossPool_Entry* boss_after_find(BossPool& bossPool, BossPool_Pool& pool, BossPool_Entry& entry)
|
||||
{
|
||||
size_t index = &entry - pool.entries.data();
|
||||
|
||||
log_printf(LOG_WARN, "boss pool ran out of repicks\n");
|
||||
for (size_t i = (index + 1) % pool.entries.size(); i != index; i = (i + 1) % pool.entries.size())
|
||||
{
|
||||
BossPool_Entry& other = pool.entries[i];
|
||||
if (other.weight > 0 && is_boss_allowed(other) && !bossPool.WasBossRemoved(other.id)) return &other;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 00422620 A boss of the pool by weight, roll at most the pool's total: the entry roll lands in, when it can still
|
||||
// win (weighted, allowed, not met this run or floor). Else roll moves through that entry's share, up to nine times,
|
||||
// then the next boss around the pool that can be picked does. The pick joins the floor's blacklist. Null for an empty
|
||||
// or weightless pool, or when nothing can be picked.
|
||||
BossPool_Entry* BossPool::PickBoss(BossPool_Pool& pool, float roll)
|
||||
{
|
||||
BossPool_Entry* picked = nullptr;
|
||||
|
||||
if (pool.entries.empty() || !(pool.totalWeight > 0)) return nullptr;
|
||||
for (int repicks = BOSS_REPICKS; repicks >= 0 && !picked; repicks--)
|
||||
{
|
||||
float end = 0;
|
||||
for (BossPool_Entry& entry : pool.entries)
|
||||
{
|
||||
float start = end;
|
||||
end += entry.initialWeight;
|
||||
if (!(roll < end)) continue;
|
||||
|
||||
bool isWinning = entry.weight > 0 && entry.weight + start > roll;
|
||||
if (isWinning && is_boss_allowed(entry) && !WasBossRemoved(entry.id)) picked = &entry;
|
||||
else if (repicks == 0) picked = boss_after_find(*this, pool, entry);
|
||||
else roll = (end - roll) / entry.initialWeight * pool.totalWeight;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!picked)
|
||||
{
|
||||
log_printf(LOG_WARN, "failed to pick random boss from pool\n");
|
||||
return nullptr;
|
||||
}
|
||||
boss_mark(levelBlacklist, picked->id);
|
||||
return picked;
|
||||
}
|
||||
|
||||
// 00421720 Whether a boss was met on an earlier floor or picked for this one. An untracked id never was.
|
||||
bool BossPool::WasBossRemoved(int bossId)
|
||||
{
|
||||
return is_boss_tracked(bossId) && (removedBosses[bossId] || levelBlacklist[bossId]);
|
||||
}
|
||||
|
||||
// 007382c0 Forgets the bosses picked for the floor, as a floor's generation starts over.
|
||||
void BossPool::blacklist_clear()
|
||||
{
|
||||
levelBlacklist.reset();
|
||||
}
|
||||
|
||||
// 00421b50 Counts the floor's picked bosses as met for the rest of the run.
|
||||
void BossPool::blacklist_commit()
|
||||
{
|
||||
removedBosses |= levelBlacklist;
|
||||
levelBlacklist.reset();
|
||||
}
|
||||
|
||||
// 00422f80 Saves each pool's generator seed and the bosses met.
|
||||
void BossPool::store_game_state(BossPoolState& state)
|
||||
{
|
||||
for (int i = 0; i < BOSS_POOL_COUNT; i++) state.rngSeeds[i] = pools[i].rng._seed;
|
||||
state.removedBosses = removedBosses;
|
||||
}
|
||||
|
||||
// 00422ea0 Restores each pool's generator and the bosses met, with nothing picked for the floor.
|
||||
void BossPool::restore_game_state(const BossPoolState& state)
|
||||
{
|
||||
for (int i = 0; i < BOSS_POOL_COUNT; i++) pools[i].rng.SetSeed(state.rngSeeds[i], POOL_RNG_SHIFT);
|
||||
removedBosses = state.removedBosses;
|
||||
levelBlacklist.reset();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
#pragma once
|
||||
|
||||
#include "classes.h"
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
constexpr int BOSS_POOL_COUNT = 37;
|
||||
constexpr int BOSS_ID_COUNT = 104;
|
||||
|
||||
// Whose bosspools.xml load_xml reads: the game's, or a mod's, which the original ignores.
|
||||
enum BossPoolSource
|
||||
{
|
||||
BOSS_POOL_GAME,
|
||||
BOSS_POOL_MOD
|
||||
};
|
||||
|
||||
// A boss a pool can pick: its id, its weight (the one picks walk) beside the weight that lets it win, the achievement
|
||||
// that unlocks it, and the first of the 50 boss room variants it takes, or 0 for its own rooms.
|
||||
struct BossPool_Entry
|
||||
{
|
||||
float initialWeight = 0;
|
||||
float weight = 0;
|
||||
int achievementID = 0;
|
||||
int id = 0;
|
||||
int roomVariantStart = 0;
|
||||
};
|
||||
|
||||
// A stage's bosses from bosspools.xml (BossPool_Pool), shuffled once a run: their weights together, the pool's
|
||||
// generator, and the first boss room variant of its Double Trouble rooms (0 without any).
|
||||
struct BossPool_Pool
|
||||
{
|
||||
std::string name;
|
||||
std::vector<BossPool_Entry> entries;
|
||||
RNG rng{};
|
||||
float totalWeight = 0;
|
||||
int doubleTroubleRoomVariantStart = 0;
|
||||
};
|
||||
|
||||
// What a saved run keeps of the boss pools: each pool's generator seed and the bosses met on earlier floors.
|
||||
struct BossPoolState
|
||||
{
|
||||
std::array<uint32_t, BOSS_POOL_COUNT> rngSeeds{};
|
||||
std::bitset<BOSS_ID_COUNT> removedBosses;
|
||||
};
|
||||
|
||||
// The run's boss pools (Game::bossPool), one per stage id: the bosses met on earlier floors, and those this floor's
|
||||
// generation picked (its blacklist), which a finished floor adds to them.
|
||||
// Its construction and destruction were inlined into Game's.
|
||||
class BossPool
|
||||
{
|
||||
public:
|
||||
std::array<BossPool_Pool, BOSS_POOL_COUNT> pools;
|
||||
std::bitset<BOSS_ID_COUNT> levelBlacklist;
|
||||
std::bitset<BOSS_ID_COUNT> removedBosses;
|
||||
|
||||
void init(uint32_t seed);
|
||||
void load_xml(std::string_view path, BossPoolSource source);
|
||||
int GetBossId(int levelStage, int stageType);
|
||||
BossPool_Entry* PickBoss(BossPool_Pool& pool, float roll);
|
||||
bool WasBossRemoved(int bossId);
|
||||
void blacklist_clear();
|
||||
void blacklist_commit();
|
||||
void store_game_state(BossPoolState& state);
|
||||
void restore_game_state(const BossPoolState& state);
|
||||
};
|
||||
+516
@@ -0,0 +1,516 @@
|
||||
#include "camera.h"
|
||||
#include "entity_knife.h"
|
||||
#include "entity_list.h"
|
||||
#include "entity_player.h"
|
||||
#include "game.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "seeds.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
// The playfield a 1x1 room fills on screen, the world point its corner sits at, and the scale the world is drawn at.
|
||||
constexpr float PLAYFIELD_WIDTH = 338;
|
||||
constexpr float PLAYFIELD_HEIGHT = 182;
|
||||
constexpr float WORLD_ORIGIN_X = 60;
|
||||
constexpr float WORLD_ORIGIN_Y = 140;
|
||||
constexpr float WORLD_SCALE = 0.65f;
|
||||
constexpr float SCREEN_TO_WORLD = 1.5384616f;
|
||||
|
||||
// How far past the walls the camera may show, and the wall's own thickness on each side of the floor.
|
||||
constexpr float CLAMP_MARGIN = 80;
|
||||
constexpr float WALL_SIDE = 20;
|
||||
constexpr float WALL_TOP = 60;
|
||||
constexpr float CELL_ON_SCREEN = 26;
|
||||
constexpr float DOOR_CLAMP_MARGIN = 20;
|
||||
|
||||
// How far aim and speed lead the camera with a single player, how far enemies pull it and how much.
|
||||
constexpr float AIM_LEAD = 35;
|
||||
constexpr float VELOCITY_LEAD = 4.5f;
|
||||
constexpr float FOCUS_ENTITY_PULL = 0.2f;
|
||||
constexpr float SPREAD_PULL = 0.25f;
|
||||
constexpr float ENEMY_RANGE = 550;
|
||||
constexpr float ENEMY_PULL = 0.4f;
|
||||
constexpr float BOSS_WEIGHT = 0.6f;
|
||||
|
||||
// The weighted averages' peaks, as fractions of each ring.
|
||||
constexpr float AIM_PEAK = 0.75f;
|
||||
constexpr float VELOCITY_PEAK = 0.85f;
|
||||
constexpr float ENEMY_PEAK = 0.75f;
|
||||
constexpr float SPREAD_PEAK = 0.5f;
|
||||
constexpr float FOCUS_PEAK = 0.5f;
|
||||
constexpr float SHAKE_PEAK = 0.9f;
|
||||
|
||||
// The shake: a new kick every few frames, its size, and the timer it fades out over.
|
||||
constexpr int SHAKE_KICK_FRAMES = 3;
|
||||
constexpr float SHAKE_KICK = 10;
|
||||
constexpr float SHAKE_FADE_FRAMES = 11;
|
||||
constexpr float SHAKE_PI = 3.14f;
|
||||
|
||||
// A door pulls the camera toward it from this close, fully from DOOR_PULL_FULL.
|
||||
constexpr float DOOR_PULL_RANGE = 30;
|
||||
constexpr float DOOR_PULL_FADE = 20;
|
||||
|
||||
// The follow camera's lag: it speeds up far from its target and slows down close to it.
|
||||
constexpr float FOLLOW_LERP_START = 0.1f;
|
||||
constexpr float FOLLOW_LERP_MIN = 0.1f;
|
||||
constexpr float FOLLOW_LERP_MAX = 0.5f;
|
||||
constexpr float FOLLOW_LERP_STEP = 0.01f;
|
||||
constexpr float FOLLOW_FAR = 676;
|
||||
constexpr float FOLLOW_NEAR = 338;
|
||||
|
||||
// The half view of a networked player, in world units.
|
||||
constexpr float NET_VIEW_HALF_WIDTH = 369.23077f;
|
||||
constexpr float NET_VIEW_HALF_HEIGHT = 207.6923f;
|
||||
|
||||
constexpr int LASER_VARIANT_THICK_RED = 1;
|
||||
constexpr int LASER_VARIANT_THICKER_RED = 3;
|
||||
constexpr int ITEM_STATE_LUDOVICO_CHARGE = 49;
|
||||
constexpr int WEAPON_TYPE_BRIMSTONE = 2;
|
||||
constexpr int COLLECTIBLE_LUDOVICO_TECHNIQUE = 329;
|
||||
constexpr int WEAPON_TYPE_KNIFE = 4;
|
||||
|
||||
static float random_unit()
|
||||
{
|
||||
return (float)Random() * 2.3283064e-10f;
|
||||
}
|
||||
|
||||
// 00945130 Adds a vector, dropping the oldest when full.
|
||||
void VectorRing::push(Vector vector)
|
||||
{
|
||||
int capacity = (int)data.size();
|
||||
|
||||
if (count == capacity)
|
||||
{
|
||||
if (count < 1) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"Cannot erase from empty buffer");
|
||||
head = (head + 1) % capacity;
|
||||
count--;
|
||||
}
|
||||
data[(head + count) % capacity] = vector;
|
||||
count++;
|
||||
}
|
||||
|
||||
// Pushes a vector once per slot, so the ring holds only it, as the constructor and SnapToPosition do.
|
||||
void VectorRing::fill(Vector vector)
|
||||
{
|
||||
for (size_t i = 0; i < data.size(); i++) push(vector);
|
||||
}
|
||||
|
||||
// The newest vector.
|
||||
Vector& VectorRing::back()
|
||||
{
|
||||
return at(count - 1);
|
||||
}
|
||||
|
||||
// The vector index places after the oldest.
|
||||
Vector& VectorRing::at(int index)
|
||||
{
|
||||
return data[(head + index) % (int)data.size()];
|
||||
}
|
||||
|
||||
// 00943190 The average of the ring weighted by a triangle rising from the oldest to the vector at peakFraction of
|
||||
// the ring, then falling to the newest.
|
||||
// An empty ring divides by a zero weight, as in the original.
|
||||
Vector VectorRing::average(float peakFraction)
|
||||
{
|
||||
Vector sum = vector_make(0, 0);
|
||||
float weightSum = 0;
|
||||
float peak = (float)(int)((float)count * peakFraction);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
float start = i > (int)((float)count * peakFraction) ? (float)count + 1 : -1;
|
||||
float weight = ((float)i - start) / (peak - start);
|
||||
Vector& sample = at(i);
|
||||
|
||||
if (start == peak) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"Start and End parameters cannot be the same!");
|
||||
weightSum += weight;
|
||||
sum.x += sample.x * weight;
|
||||
sum.y += sample.y * weight;
|
||||
}
|
||||
return vector_make(1 / weightSum * sum.x, 1 / weightSum * sum.y);
|
||||
}
|
||||
|
||||
// 009428d0 Starts centered on the room, or on the door the players come in by, or on where they enter.
|
||||
Camera::Camera(Room& owner)
|
||||
{
|
||||
room = &owner;
|
||||
screenAnchor = vector_make(0.5f, 0.5f);
|
||||
position = ClampedToRoom(vector_make(0, 0));
|
||||
rings_reset();
|
||||
followLerp = FOLLOW_LERP_START;
|
||||
|
||||
uint32_t enterDoor = (uint32_t)g_game->enterDoor;
|
||||
if (enterDoor != UINT32_MAX)
|
||||
{
|
||||
Vector door = enterDoor < DOOR_SLOT_COUNT ? room->GetGridPosition(room->doorGridPositions[enterDoor])
|
||||
: vector_make(0, 0);
|
||||
position = ClampedToRoom(room->GetClampedPosition(door, DOOR_CLAMP_MARGIN));
|
||||
}
|
||||
|
||||
Vector enter = g_game->GetEnterPosition();
|
||||
if (enter.x != 0 || enter.y != 0) position = soft_clamp_position(ClampedToRoom(enter));
|
||||
room->renderScrollOffset = position;
|
||||
}
|
||||
|
||||
// Fills the smoothing rings with nothing: no offsets, no shake, and no focus position.
|
||||
void Camera::rings_reset()
|
||||
{
|
||||
Vector zero = vector_make(0, 0);
|
||||
|
||||
aimOffsets.fill(zero);
|
||||
velocityOffsets.fill(zero);
|
||||
enemyOffsets.fill(zero);
|
||||
playerSpreads.fill(zero);
|
||||
shakeOffsets.fill(zero);
|
||||
focusPositions.fill(vector_make(-1, -1));
|
||||
}
|
||||
|
||||
// 009432f0 The camera positions that keep the room's walls (and a margin past them) on screen, both centered on an
|
||||
// axis the room is too small to scroll along. The Beast's arena has no margin.
|
||||
CameraBounds Camera::get_clamp_bounds()
|
||||
{
|
||||
Vector margin = vector_make(CLAMP_MARGIN, CLAMP_MARGIN);
|
||||
Vector surface = room->renderSurfaceTopLeft;
|
||||
Vector offset = surface;
|
||||
|
||||
if (room->IsBeastDungeon())
|
||||
{
|
||||
margin = vector_make(0, 0);
|
||||
offset = vector_make(0, 0);
|
||||
}
|
||||
|
||||
float highX = -surface.x - ((room->topLeftPos.x + WALL_SIDE - margin.x) * WORLD_SCALE - offset.x);
|
||||
float highY = -surface.y - ((room->topLeftPos.y - WALL_TOP - margin.y) * WORLD_SCALE - offset.y);
|
||||
float lowX = g_screenWidth - surface.x - ((room->bottomRightPos.x + WALL_SIDE + margin.x) * WORLD_SCALE + offset.x);
|
||||
float lowY = g_screenHeight - surface.y - ((room->bottomRightPos.y - WALL_TOP + margin.y) * WORLD_SCALE + offset.y);
|
||||
|
||||
if (highX < lowX) highX = lowX = (highX + lowX) * 0.5f;
|
||||
if (highY < lowY) highY = lowY = (highY + lowY) * 0.5f;
|
||||
return {vector_make(lowX, lowY), vector_make(highX, highY)};
|
||||
}
|
||||
|
||||
// The camera position that shows a world position at the screen anchor.
|
||||
Vector Camera::to_camera(Vector worldPosition)
|
||||
{
|
||||
float x = g_screenWidth * screenAnchor.x -
|
||||
((g_screenWidth - PLAYFIELD_WIDTH) * 0.5f + (worldPosition.x - WORLD_ORIGIN_X) * WORLD_SCALE);
|
||||
float y = g_screenHeight * screenAnchor.y -
|
||||
((g_screenHeight - PLAYFIELD_HEIGHT) * 0.5f + (worldPosition.y - WORLD_ORIGIN_Y) * WORLD_SCALE);
|
||||
return vector_make(x, y);
|
||||
}
|
||||
|
||||
// 00943490 The camera position for a world position, kept within the room's bounds unless the room scrolls freely.
|
||||
// The Beast's arena scrolls freely sideways while a focus position is set.
|
||||
Vector Camera::ClampedToRoom(Vector worldPosition)
|
||||
{
|
||||
CameraBounds bounds = get_clamp_bounds();
|
||||
Vector target = to_camera(worldPosition);
|
||||
|
||||
if (room->descriptor->flags & ROOM_DESCRIPTOR_FLAG_NO_WALLS) return target;
|
||||
|
||||
Vector clamped = vector_make(std::max(std::min(target.x, bounds.high.x), bounds.low.x),
|
||||
std::max(std::min(target.y, bounds.high.y), bounds.low.y));
|
||||
|
||||
if (room->IsBeastDungeon() && isShouldOverride && focusPositions.count > 0) clamped.x = target.x;
|
||||
return clamped;
|
||||
}
|
||||
|
||||
// 00943610 A camera position eased into the room's bounds, each axis along a smooth curve instead of a hard clamp.
|
||||
Vector Camera::soft_clamp_position(Vector cameraPosition)
|
||||
{
|
||||
CameraBounds bounds = get_clamp_bounds();
|
||||
Vector result = bounds.high;
|
||||
|
||||
if (cameraPosition.x <= bounds.low.x) result.x = bounds.low.x;
|
||||
else if (cameraPosition.x < bounds.high.x)
|
||||
{
|
||||
if (bounds.low.x == bounds.high.x)
|
||||
KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"Start and End parameters cannot be the same!");
|
||||
float t = (cameraPosition.x - bounds.low.x) / (bounds.high.x - bounds.low.x);
|
||||
result.x = (bounds.high.x - bounds.low.x) * ((t * 6 * t * t - t * 15 * t) + t * 14 - 6) * -(t * t) +
|
||||
bounds.low.x;
|
||||
}
|
||||
|
||||
if (cameraPosition.y <= bounds.low.y) result.y = bounds.low.y;
|
||||
else if (cameraPosition.y < bounds.high.y)
|
||||
{
|
||||
if (bounds.low.y == bounds.high.y)
|
||||
KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"Start and End parameters cannot be the same!");
|
||||
float t = (cameraPosition.y - bounds.low.y) / (bounds.high.y - bounds.low.y);
|
||||
result.y = (bounds.high.y - bounds.low.y) * ((t * 4 * t * t - t * 10 * t) + t * 10 - 5) * -(t * t) +
|
||||
bounds.low.y;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 00942f20 The average pull of the visible active enemies near the players toward them, closer ones pulling more.
|
||||
// Bosses count for less in the average, but pull as hard. A versus match counts the other players as enemies.
|
||||
Vector Camera::get_enemy_focus_offset()
|
||||
{
|
||||
Vector offset = vector_make(0, 0);
|
||||
float totalWeight = 0;
|
||||
|
||||
for (Entity* enemy : room->entityList.updateEL)
|
||||
{
|
||||
bool isVersusPlayer = g_game->deathmatchManager.state >= DEATHMATCH_INTRO && enemy->type == ENTITY_PLAYER;
|
||||
bool isEnemy = enemy->type >= ENTITY_FIRST_ENEMY && enemy->type < ENTITY_EFFECT;
|
||||
|
||||
if (!isVersusPlayer && !isEnemy) continue;
|
||||
if (!enemy->CanShutDoors() || !enemy->isVisible) continue;
|
||||
|
||||
Vector center;
|
||||
players_center_position(&g_game->playerManager, ¢er, true);
|
||||
float dx = enemy->pos.x - center.x;
|
||||
float dy = enemy->pos.y - center.y;
|
||||
float distance = std::sqrt(dx * dx + dy * dy);
|
||||
if (distance >= ENEMY_RANGE) continue;
|
||||
|
||||
float falloff = (distance - ENEMY_RANGE) / -ENEMY_RANGE;
|
||||
totalWeight += enemy->IsBoss() ? BOSS_WEIGHT : 1;
|
||||
offset.x += dx * falloff * ENEMY_PULL;
|
||||
offset.y += dy * falloff * ENEMY_PULL;
|
||||
}
|
||||
if (totalWeight == 0) return vector_make(0, 0);
|
||||
return vector_make(1 / totalWeight * offset.x, 1 / totalWeight * offset.y);
|
||||
}
|
||||
|
||||
// 009437e0 Moves the camera for a frame: the active camera unless its option is off, which follows the players.
|
||||
// The active camera always drops the focus position. The follow camera drops it when told to.
|
||||
void Camera::DoUpdate(bool isSkipFocusBuffer)
|
||||
{
|
||||
if (g_manager->optionsConfig.cameraStyle != CAMERA_STYLE_ACTIVE_CAM_OFF)
|
||||
{
|
||||
update_focus_position(isSkipFocusBuffer);
|
||||
isShouldOverride = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
update_follow();
|
||||
if (isSkipFocusBuffer) isShouldOverride = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 009439d0 The active camera: frames the players' center led by the main player's aim and speed, nearby enemies and
|
||||
// the co-op babies' spread, each averaged over recent frames, and the focus position while one is set. It eases into the
|
||||
// room's bounds, shakes, leans toward a door the players stand at, and scrolls the room there.
|
||||
void Camera::update_focus_position(bool isSkipFocusBuffer)
|
||||
{
|
||||
Entity_Player* player = g_game->playerManager.get_first_local_main_player();
|
||||
|
||||
if (!player)
|
||||
{
|
||||
KAGE_LogMessage(LOG_ERROR, (uint8_t*)"No main player detected when trying to update camera \n");
|
||||
return;
|
||||
}
|
||||
|
||||
Vector center;
|
||||
players_center_position(&g_game->playerManager, ¢er, true);
|
||||
|
||||
bool isSolo = g_game->playerManager.playerList.size() == 1;
|
||||
float lead = isSolo ? AIM_LEAD : 0;
|
||||
Vector aim = vector_make(lead * player->aimDirection.x, lead * player->aimDirection.y);
|
||||
Entity* focus = player->GetFocusEntity();
|
||||
|
||||
if (focus)
|
||||
{
|
||||
Vector pull = vector_make((focus->pos.x - player->pos.x) * FOCUS_ENTITY_PULL,
|
||||
(focus->pos.y - player->pos.y) * FOCUS_ENTITY_PULL);
|
||||
float aimLength = std::sqrt(aim.x * aim.x + aim.y * aim.y);
|
||||
|
||||
if (lead < std::sqrt(pull.y * pull.y + pull.x * pull.x) && aimLength > 0)
|
||||
aim = vector_make(lead / aimLength * aim.x, lead / aimLength * aim.y);
|
||||
if (!player->HasWeaponType(WEAPON_TYPE_KNIFE) || player->HasCollectible(COLLECTIBLE_LUDOVICO_TECHNIQUE)) aim = pull;
|
||||
else if (Entity_Knife* knife = dynamic_cast<Entity_Knife*>(focus); knife && knife->isFlying)
|
||||
aim = vector_make(pull.x + lead * player->lastDirection.x, pull.y + lead * player->lastDirection.y);
|
||||
}
|
||||
|
||||
bool isBrimstoneAim = player->HasWeaponType(WEAPON_TYPE_BRIMSTONE) && !player->HasCollectible(COLLECTIBLE_LUDOVICO_TECHNIQUE) &&
|
||||
!player->isPlayingExtraAnimation && !player->isPlayingItemAnimation;
|
||||
if (player->itemState == ITEM_STATE_LUDOVICO_CHARGE || isBrimstoneAim)
|
||||
{
|
||||
for (Entity* laser : room->entityList.updateEL)
|
||||
{
|
||||
if (laser->type != ENTITY_LASER) continue;
|
||||
bool isThick = laser->variant == LASER_VARIANT_THICK_RED || laser->variant == LASER_VARIANT_THICKER_RED;
|
||||
if (isThick && laser->spawnerType == ENTITY_PLAYER && laser->spawnerVariant == 0)
|
||||
aim = vector_make(lead * player->lastDirection.x, lead * player->lastDirection.y);
|
||||
}
|
||||
}
|
||||
aimOffsets.push(aim);
|
||||
|
||||
float velocityLead = isSolo ? VELOCITY_LEAD : 0;
|
||||
velocityOffsets.push(vector_make(player->velocity.x * velocityLead, player->velocity.y * velocityLead));
|
||||
enemyOffsets.push(get_enemy_focus_offset());
|
||||
|
||||
Vector spreadCenter;
|
||||
Vector spread = vector_make(0, 0);
|
||||
int mainPlayers = 0;
|
||||
players_center_position(&g_game->playerManager, &spreadCenter, true);
|
||||
for (Entity_Player* other : g_game->playerManager.playerList)
|
||||
{
|
||||
if (other->variant != PLAYER_VARIANT_COOP_BABY) continue;
|
||||
mainPlayers++;
|
||||
spread.y += (other->pos.y - spreadCenter.y) * SPREAD_PULL;
|
||||
spread.x += (other->pos.x - spreadCenter.x) * SPREAD_PULL;
|
||||
}
|
||||
if (mainPlayers > 0) spread = vector_make(1 / (float)mainPlayers * spread.x, 1 / (float)mainPlayers * spread.y);
|
||||
playerSpreads.push(spread);
|
||||
|
||||
if (!isShouldOverride)
|
||||
{
|
||||
if (isSkipFocusBuffer) focusPositions.push(focusPositions.back());
|
||||
else
|
||||
{
|
||||
focusPositions.push(vector_make(-1, -1));
|
||||
isShouldOverride = true;
|
||||
}
|
||||
}
|
||||
|
||||
Vector aimAverage = aimOffsets.average(AIM_PEAK);
|
||||
Vector velocityAverage = velocityOffsets.average(VELOCITY_PEAK);
|
||||
Vector enemyAverage = enemyOffsets.average(ENEMY_PEAK);
|
||||
Vector spreadAverage = playerSpreads.average(SPREAD_PEAK);
|
||||
Vector target = vector_make(spreadAverage.x + enemyAverage.x + velocityAverage.x + center.x + aimAverage.x,
|
||||
spreadAverage.y + enemyAverage.y + velocityAverage.y + (center.y + aimAverage.y));
|
||||
|
||||
VectorRing focusCopy = focusPositions;
|
||||
for (int i = 0; i < focusCopy.count; i++)
|
||||
if (focusCopy.at(i).x == -1 && focusCopy.at(i).y == -1) focusCopy.at(i) = target;
|
||||
position = soft_clamp_position(to_camera(focusCopy.average(FOCUS_PEAK)));
|
||||
shake_update();
|
||||
|
||||
for (int slot = 0; slot < DOOR_SLOT_COUNT; slot++)
|
||||
{
|
||||
if (!room->doors[slot]) continue;
|
||||
|
||||
Vector door = room->GetGridPosition(room->doorGridPositions[slot]);
|
||||
float distance = std::sqrt((door.y - center.y) * (door.y - center.y) + (door.x - center.x) * (door.x - center.x));
|
||||
if (distance >= DOOR_PULL_RANGE) continue;
|
||||
|
||||
float t = std::min((distance - DOOR_PULL_RANGE) / -DOOR_PULL_FADE, 1.0f);
|
||||
float ease = (3 - (t + t)) * t * t;
|
||||
Vector doorCamera = ClampedToRoom(door);
|
||||
position.x += (doorCamera.x - position.x) * ease;
|
||||
position.y += (doorCamera.y - position.y) * ease;
|
||||
break;
|
||||
}
|
||||
room->renderScrollOffset = position;
|
||||
playersCenter = center;
|
||||
}
|
||||
|
||||
// The screen shake shared by both cameras: a kick every few frames while the game shakes, each nudged from the
|
||||
// last, fading with the shake's timer, averaged into the game's shake offset.
|
||||
void Camera::shake_update()
|
||||
{
|
||||
if (g_game->screenShakeTimer < 1) shakeOffsets.push(vector_make(0, 0));
|
||||
else
|
||||
{
|
||||
float angle = random_unit() * SHAKE_PI;
|
||||
angle += angle;
|
||||
|
||||
if (g_game->frameCount % SHAKE_KICK_FRAMES == 0)
|
||||
shakeOffsets.push(vector_make(std::cos(angle) * SHAKE_KICK, std::sin(angle) * SHAKE_KICK));
|
||||
else
|
||||
{
|
||||
Vector last = shakeOffsets.back();
|
||||
float cosine = std::cos(angle);
|
||||
float sine = std::sin(angle);
|
||||
shakeOffsets.push(vector_make(cosine + cosine - last.x, sine + sine - last.y));
|
||||
}
|
||||
|
||||
float fade = std::clamp(((float)g_game->screenShakeTimer - 0) / SHAKE_FADE_FRAMES, 0.0f, 1.0f);
|
||||
Vector& newest = shakeOffsets.back();
|
||||
newest.y *= fade;
|
||||
newest.x *= fade;
|
||||
}
|
||||
g_game->screenShakeOffset = shakeOffsets.average(SHAKE_PEAK);
|
||||
}
|
||||
|
||||
// 009446e0 The follow camera: lags after the players' center (or the focus position), faster while far from it.
|
||||
void Camera::update_follow()
|
||||
{
|
||||
Vector center;
|
||||
players_center_position(&g_game->playerManager, ¢er, true);
|
||||
if (isShouldOverride && focusPositions.count > 0) center = focusPositions.back();
|
||||
shake_update();
|
||||
|
||||
Vector target = ClampedToRoom(center);
|
||||
Vector delta = vector_make(target.x - position.x, target.y - position.y);
|
||||
float distanceSquared = delta.y * delta.y + delta.x * delta.x;
|
||||
|
||||
if (distanceSquared > FOLLOW_FAR) followLerp = std::min(followLerp + FOLLOW_LERP_STEP, FOLLOW_LERP_MAX);
|
||||
else if (distanceSquared < FOLLOW_NEAR) followLerp = std::max(followLerp - FOLLOW_LERP_STEP, FOLLOW_LERP_MIN);
|
||||
|
||||
position.x += followLerp * delta.x;
|
||||
position.y += followLerp * delta.y;
|
||||
room->renderScrollOffset = position;
|
||||
}
|
||||
|
||||
// 00943830 Moves the camera by where the players' center (or the focus position) sits on screen, kept within the
|
||||
// room's edges, and scrolls the room there. Level::Init runs it once a floor's first room is loaded.
|
||||
void Camera::position_center()
|
||||
{
|
||||
Vector center;
|
||||
players_center_position(&g_game->playerManager, ¢er, false);
|
||||
if (isShouldOverride && focusPositions.count > 0) center = focusPositions.back();
|
||||
|
||||
Vector offset = to_camera(center);
|
||||
float minX = g_screenWidth - (((float)room->gridWidth + 2) * CELL_ON_SCREEN + room->renderSurfaceTopLeft.x * 2);
|
||||
float minY = g_screenHeight - (room->renderSurfaceTopLeft.y * 2 + ((float)room->gridHeight + 2) * CELL_ON_SCREEN);
|
||||
|
||||
position.x += std::min(std::max(offset.x, minX), 0.0f);
|
||||
position.y += std::min(std::max(offset.y, minY), 0.0f);
|
||||
room->renderScrollOffset = position;
|
||||
}
|
||||
|
||||
// 00944a40 Whether a world position is on screen. Online, it counts as seen when within a screen of any player
|
||||
// (or the focus position), kept within the room.
|
||||
bool Camera::IsPosVisible(Vector worldPosition)
|
||||
{
|
||||
if (!g_manager->netplayManager.is_online())
|
||||
{
|
||||
float left = -position.x * SCREEN_TO_WORLD -
|
||||
((g_screenWidth - PLAYFIELD_WIDTH) * 0.5f + (0 - WORLD_ORIGIN_X) * WORLD_SCALE) / WORLD_SCALE;
|
||||
float top = -position.y * SCREEN_TO_WORLD -
|
||||
((g_screenHeight - PLAYFIELD_HEIGHT) * 0.5f + (0 - WORLD_ORIGIN_Y) * WORLD_SCALE) / WORLD_SCALE;
|
||||
return left < worldPosition.x && worldPosition.x < g_screenWidth * SCREEN_TO_WORLD + left &&
|
||||
top < worldPosition.y && worldPosition.y < g_screenHeight * SCREEN_TO_WORLD + top;
|
||||
}
|
||||
|
||||
Room& current = *g_game->room;
|
||||
float minX = current.topLeftPos.x - CLAMP_MARGIN + NET_VIEW_HALF_WIDTH;
|
||||
float minY = current.topLeftPos.y - CLAMP_MARGIN + NET_VIEW_HALF_HEIGHT;
|
||||
float maxX = current.bottomRightPos.x + CLAMP_MARGIN - NET_VIEW_HALF_WIDTH;
|
||||
float maxY = current.bottomRightPos.y + CLAMP_MARGIN - NET_VIEW_HALF_HEIGHT;
|
||||
|
||||
for (Entity_Player* player : g_game->playerManager.playerList)
|
||||
{
|
||||
Vector focus = isShouldOverride && focusPositions.count > 0 ? focusPositions.back() : player->pos;
|
||||
float x = std::min(std::max(focus.x, minX), maxX);
|
||||
float y = std::min(std::max(focus.y, minY), maxY);
|
||||
float seenX = std::min(std::max(worldPosition.x, x - NET_VIEW_HALF_WIDTH), x + NET_VIEW_HALF_WIDTH);
|
||||
float seenY = std::min(std::max(worldPosition.y, y - NET_VIEW_HALF_HEIGHT), y + NET_VIEW_HALF_HEIGHT);
|
||||
|
||||
if (seenX == worldPosition.x && seenY == worldPosition.y) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 00944d10 Holds the camera on a world position until the next update drops it.
|
||||
void Camera::SetFocusPosition(Vector worldPosition)
|
||||
{
|
||||
if (isShouldOverride) return;
|
||||
focusPositions.push(worldPosition);
|
||||
isShouldOverride = true;
|
||||
}
|
||||
|
||||
// 00944d40 Forgets the smoothing and jumps to a world position, kept within the room.
|
||||
void Camera::SnapToPosition(Vector worldPosition)
|
||||
{
|
||||
rings_reset();
|
||||
isShouldOverride = false;
|
||||
position = ClampedToRoom(worldPosition);
|
||||
room->renderScrollOffset = position;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
#pragma once
|
||||
|
||||
#include "classes.h"
|
||||
#include <vector>
|
||||
|
||||
// How many frames each of the camera's smoothing rings remembers.
|
||||
constexpr int CAMERA_AIM_FRAMES = 60;
|
||||
constexpr int CAMERA_VELOCITY_FRAMES = 90;
|
||||
constexpr int CAMERA_ENEMY_FRAMES = 300;
|
||||
constexpr int CAMERA_SPREAD_FRAMES = 15;
|
||||
constexpr int CAMERA_SHAKE_FRAMES = 4;
|
||||
constexpr int CAMERA_FOCUS_FRAMES = 120;
|
||||
|
||||
// The original's CircularBuffer<Vector>: the last capacity vectors pushed, oldest first, the oldest dropped when full.
|
||||
struct VectorRing
|
||||
{
|
||||
std::vector<Vector> data;
|
||||
int count = 0;
|
||||
int head = 0;
|
||||
|
||||
explicit VectorRing(int capacity) : data(capacity) {}
|
||||
void push(Vector vector);
|
||||
void fill(Vector vector);
|
||||
Vector& back();
|
||||
Vector& at(int index);
|
||||
Vector average(float peakFraction);
|
||||
};
|
||||
|
||||
// The lowest and highest camera positions that keep the room's walls on screen.
|
||||
struct CameraBounds
|
||||
{
|
||||
Vector low{};
|
||||
Vector high{};
|
||||
};
|
||||
|
||||
// Destruction (007ea0c0, which Room::Init runs on the old camera) is the default.
|
||||
// UpdateUltrasmooth 0091e980 is the chat profanity filter and Update 00993a70 is FXLayers::Update (fx_layers.cpp),
|
||||
// both misattributed.
|
||||
// The room's camera (Room::camera): where the room scrolls to keep the players, their aim, their speed and nearby
|
||||
// enemies in view, smoothed over rings of recent frames, with the screen shake. Position is the room's scroll offset.
|
||||
// It snaps to a focus position while one is set (isShouldOverride), and the "active camera off" style follows the
|
||||
// players with a lag instead.
|
||||
class Camera
|
||||
{
|
||||
public:
|
||||
VectorRing aimOffsets{CAMERA_AIM_FRAMES};
|
||||
VectorRing velocityOffsets{CAMERA_VELOCITY_FRAMES};
|
||||
VectorRing enemyOffsets{CAMERA_ENEMY_FRAMES};
|
||||
VectorRing playerSpreads{CAMERA_SPREAD_FRAMES};
|
||||
VectorRing shakeOffsets{CAMERA_SHAKE_FRAMES};
|
||||
VectorRing focusPositions{CAMERA_FOCUS_FRAMES};
|
||||
Vector playersCenter{};
|
||||
Vector position{};
|
||||
Vector screenAnchor{};
|
||||
Room* room = nullptr;
|
||||
float followLerp = 0;
|
||||
bool isShouldOverride = false;
|
||||
|
||||
explicit Camera(Room& owner);
|
||||
void rings_reset();
|
||||
CameraBounds get_clamp_bounds();
|
||||
Vector ClampedToRoom(Vector worldPosition);
|
||||
Vector soft_clamp_position(Vector cameraPosition);
|
||||
Vector get_enemy_focus_offset();
|
||||
Vector to_camera(Vector worldPosition);
|
||||
|
||||
void DoUpdate(bool isSkipFocusBuffer);
|
||||
void update_focus_position(bool isSkipFocusBuffer);
|
||||
void update_follow();
|
||||
void shake_update();
|
||||
void position_center();
|
||||
bool IsPosVisible(Vector worldPosition);
|
||||
void SetFocusPosition(Vector worldPosition);
|
||||
void SnapToPosition(Vector worldPosition);
|
||||
};
|
||||
+4
-5
@@ -1,4 +1,5 @@
|
||||
#include "console.h"
|
||||
#include "entity_pickup.h"
|
||||
#include "font.h"
|
||||
#include "game.h"
|
||||
#include "kage_graphics.h"
|
||||
@@ -7,6 +8,7 @@
|
||||
#include "menu_manager.h"
|
||||
#include "platform.h"
|
||||
#include "render_passes.h"
|
||||
#include "room.h"
|
||||
#include <SDL3/SDL_clipboard.h>
|
||||
#include <SDL3/SDL_keyboard.h>
|
||||
#include <algorithm>
|
||||
@@ -49,7 +51,6 @@ constexpr size_t HISTORY_LOAD_MAX = 64;
|
||||
constexpr int INPUT_HOOK_TRIGGERED = 1;
|
||||
constexpr int ACTION_CONSOLE = 33;
|
||||
constexpr int COLLECTIBLE_GLITCHED_CROWN = 689;
|
||||
constexpr unsigned int ENTITY_PICKUP = 5;
|
||||
constexpr unsigned int PICKUP_COLLECTIBLE = 100;
|
||||
|
||||
constexpr int SLIDE_FRAMES = 14;
|
||||
@@ -420,11 +421,9 @@ bool Console::update_state()
|
||||
|
||||
if (g_game->playerManager.AnyoneHasCollectible(COLLECTIBLE_GLITCHED_CROWN))
|
||||
{
|
||||
EntityList_EL& entities = g_game->room->GetEntities()->_updateEL;
|
||||
for (uint32_t i = 0; i < entities._size; i++)
|
||||
for (Entity* entity : g_game->room->GetEntities()->updateEL)
|
||||
{
|
||||
Entity* entity = entities._data[i];
|
||||
if (entity->_type == ENTITY_PICKUP && entity->_variant == PICKUP_COLLECTIBLE)
|
||||
if (entity->type == ENTITY_PICKUP && entity->variant == PICKUP_COLLECTIBLE)
|
||||
static_cast<Entity_Pickup*>(entity)->update_cycle_collectible(0);
|
||||
}
|
||||
}
|
||||
|
||||
+1525
File diff suppressed because it is too large.
Load diff
+568
@@ -0,0 +1,568 @@
|
||||
#pragma once
|
||||
|
||||
#include "anm2.h"
|
||||
#include "classes.h"
|
||||
#include "seeds.h"
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
// The entity types the base classes tell apart, as Lua's EntityType names them.
|
||||
enum EntityType : int
|
||||
{
|
||||
ENTITY_NULL = 0,
|
||||
ENTITY_PLAYER = 1,
|
||||
ENTITY_TEAR = 2,
|
||||
ENTITY_FAMILIAR = 3,
|
||||
ENTITY_BOMB = 4,
|
||||
ENTITY_PICKUP = 5,
|
||||
ENTITY_SLOT = 6,
|
||||
ENTITY_LASER = 7,
|
||||
ENTITY_KNIFE = 8,
|
||||
ENTITY_PROJECTILE = 9,
|
||||
ENTITY_SHOPKEEPER = 17,
|
||||
ENTITY_LARRYJR = 19,
|
||||
ENTITY_CHUB = 28,
|
||||
ENTITY_FIREPLACE = 33,
|
||||
ENTITY_MRMAW = 35,
|
||||
ENTITY_PIN = 62,
|
||||
ENTITY_GEMINI = 79,
|
||||
ENTITY_BUTTLICKER = 89,
|
||||
ENTITY_HEART = 92,
|
||||
ENTITY_MASK = 93,
|
||||
ENTITY_MASK_OF_INFAMY = 97,
|
||||
ENTITY_HEART_OF_INFAMY = 98,
|
||||
ENTITY_SWINGER = 216,
|
||||
ENTITY_RING_OF_FLIES = 222,
|
||||
ENTITY_GRUB = 239,
|
||||
ENTITY_ROUND_WORM = 244,
|
||||
ENTITY_POOP = 245,
|
||||
ENTITY_URIEL = 271,
|
||||
ENTITY_GABRIEL = 272,
|
||||
ENTITY_MOVABLE_TNT = 292,
|
||||
ENTITY_HUSH = 407,
|
||||
ENTITY_BLOOD_PUPPY = 802,
|
||||
ENTITY_DARK_ESAU = 866,
|
||||
ENTITY_CULTIST = 885,
|
||||
ENTITY_SCOURGE = 909,
|
||||
ENTITY_MOTHER = 912,
|
||||
ENTITY_TURDLET = 918,
|
||||
ENTITY_BEAST = 951,
|
||||
ENTITY_GENERIC_PROP = 960,
|
||||
ENTITY_FROZEN_ENEMY = 963,
|
||||
ENTITY_MINECART = 965,
|
||||
ENTITY_EFFECT = 1000,
|
||||
ENTITY_TEXT = 9001
|
||||
};
|
||||
|
||||
// The types an enemy can have, both ends included.
|
||||
constexpr int ENTITY_FIRST_ENEMY = 10;
|
||||
constexpr int ENTITY_LAST_ENEMY = 997;
|
||||
|
||||
// Lua's EntityFlag: the state and status effects an entity carries.
|
||||
enum EntityFlag : uint64_t
|
||||
{
|
||||
FLAG_NO_STATUS_EFFECTS = 1ull << 0,
|
||||
FLAG_NO_INTERPOLATE = 1ull << 1,
|
||||
FLAG_APPEAR = 1ull << 2,
|
||||
FLAG_RENDER_FLOOR = 1ull << 3,
|
||||
FLAG_NO_TARGET = 1ull << 4,
|
||||
FLAG_FREEZE = 1ull << 5,
|
||||
FLAG_POISON = 1ull << 6,
|
||||
FLAG_SLOW = 1ull << 7,
|
||||
FLAG_CHARM = 1ull << 8,
|
||||
FLAG_CONFUSION = 1ull << 9,
|
||||
FLAG_MIDAS_FREEZE = 1ull << 10,
|
||||
FLAG_FEAR = 1ull << 11,
|
||||
FLAG_BURN = 1ull << 12,
|
||||
FLAG_RENDER_WALL = 1ull << 13,
|
||||
FLAG_INTERPOLATION_UPDATE = 1ull << 14,
|
||||
FLAG_APPLY_GRAVITY = 1ull << 15,
|
||||
FLAG_NO_BLOOD_SPLASH = 1ull << 16,
|
||||
FLAG_NO_REMOVE_ON_TEX_RENDER = 1ull << 17,
|
||||
FLAG_NO_DEATH_TRIGGER = 1ull << 18,
|
||||
FLAG_NO_SPIKE_DAMAGE = 1ull << 19,
|
||||
FLAG_BOSSDEATH_TRIGGERED = 1ull << 20,
|
||||
FLAG_DONT_OVERWRITE = 1ull << 21,
|
||||
FLAG_SPAWN_STICKY_SPIDERS = 1ull << 22,
|
||||
FLAG_SPAWN_BLACK_HP = 1ull << 23,
|
||||
FLAG_SHRINK = 1ull << 24,
|
||||
FLAG_NO_FLASH_ON_DAMAGE = 1ull << 25,
|
||||
FLAG_NO_KNOCKBACK = 1ull << 26,
|
||||
FLAG_SLIPPERY_PHYSICS = 1ull << 27,
|
||||
FLAG_ADD_JAR_FLY = 1ull << 28,
|
||||
FLAG_FRIENDLY = 1ull << 29,
|
||||
FLAG_NO_PHYSICS_KNOCKBACK = 1ull << 30,
|
||||
FLAG_DONT_COUNT_BOSS_HP = 1ull << 31,
|
||||
FLAG_NO_SPRITE_UPDATE = 1ull << 32,
|
||||
FLAG_CONTAGIOUS = 1ull << 33,
|
||||
FLAG_BLEED_OUT = 1ull << 34,
|
||||
FLAG_HIDE_HP_BAR = 1ull << 35,
|
||||
FLAG_NO_DAMAGE_BLINK = 1ull << 36,
|
||||
FLAG_PERSISTENT = 1ull << 37,
|
||||
FLAG_BACKDROP_DETAIL = 1ull << 38,
|
||||
FLAG_AMBUSH = 1ull << 39,
|
||||
FLAG_GLITCH = 1ull << 40,
|
||||
FLAG_SPIN = 1ull << 41,
|
||||
FLAG_NO_REWARD = 1ull << 42,
|
||||
FLAG_REDUCE_GIBS = 1ull << 43,
|
||||
FLAG_TRANSITION_UPDATE = 1ull << 44,
|
||||
FLAG_NO_PLAYER_CONTROL = 1ull << 45,
|
||||
FLAG_NO_QUERY = 1ull << 46,
|
||||
FLAG_KNOCKED_BACK = 1ull << 47,
|
||||
FLAG_APPLY_IMPACT_DAMAGE = 1ull << 48,
|
||||
FLAG_ICE_FROZEN = 1ull << 49,
|
||||
FLAG_ICE = 1ull << 50,
|
||||
FLAG_MAGNETIZED = 1ull << 51,
|
||||
FLAG_BAITED = 1ull << 52,
|
||||
FLAG_KILLSWITCH = 1ull << 53,
|
||||
FLAG_WEAKNESS = 1ull << 54,
|
||||
FLAG_EXTRA_GORE = 1ull << 55,
|
||||
FLAG_BRIMSTONE_MARKED = 1ull << 56,
|
||||
FLAG_HELD = 1ull << 57,
|
||||
FLAG_THROWN = 1ull << 58,
|
||||
FLAG_FRIENDLY_BALL = 1ull << 59
|
||||
};
|
||||
|
||||
// Lua's DamageFlag: what kind of damage a hit deals.
|
||||
enum DamageFlag : uint64_t
|
||||
{
|
||||
DAMAGE_NOKILL = 1ull << 0,
|
||||
DAMAGE_FIRE = 1ull << 1,
|
||||
DAMAGE_EXPLOSION = 1ull << 2,
|
||||
DAMAGE_POOP = 1ull << 9,
|
||||
DAMAGE_POISON_BURN = 1ull << 15
|
||||
};
|
||||
|
||||
// Lua's EntityGridCollisionClass: what of the room's grid an entity collides with.
|
||||
enum GridCollisionClass : int
|
||||
{
|
||||
GRIDCOLL_NONE,
|
||||
GRIDCOLL_WALLS_X,
|
||||
GRIDCOLL_WALLS_Y,
|
||||
GRIDCOLL_WALLS,
|
||||
GRIDCOLL_BULLET,
|
||||
GRIDCOLL_GROUND,
|
||||
GRIDCOLL_NOPITS,
|
||||
GRIDCOLL_PITSONLY
|
||||
};
|
||||
|
||||
// Lua's EntityCollisionClass: which other entities an entity collides with.
|
||||
enum EntityCollisionClass : int
|
||||
{
|
||||
ENTCOLL_NONE,
|
||||
ENTCOLL_PLAYERONLY,
|
||||
ENTCOLL_PLAYEROBJECTS,
|
||||
ENTCOLL_ENEMIES,
|
||||
ENTCOLL_ALL
|
||||
};
|
||||
|
||||
// Lua's SortingLayer: where an entity draws among the others.
|
||||
enum SortingLayer : int
|
||||
{
|
||||
SORTING_BACKGROUND,
|
||||
SORTING_DOOR,
|
||||
SORTING_NORMAL
|
||||
};
|
||||
|
||||
// What EntityRef::flags records of its entity's status.
|
||||
enum EntityRefFlag : uint32_t
|
||||
{
|
||||
ENTITY_REF_CHARMED = 1 << 0,
|
||||
ENTITY_REF_FRIENDLY = 1 << 1,
|
||||
ENTITY_REF_WEAKNESS = 1 << 2
|
||||
};
|
||||
|
||||
// Whether render_position_get snaps the position to whole screen pixels.
|
||||
enum RenderSnap
|
||||
{
|
||||
RENDER_UNSNAPPED,
|
||||
RENDER_SNAPPED
|
||||
};
|
||||
|
||||
// Whether IsActiveEnemy counts a dead entity.
|
||||
enum DeadMode
|
||||
{
|
||||
DEAD_EXCLUDED,
|
||||
DEAD_INCLUDED
|
||||
};
|
||||
|
||||
// Whether CollideWithGrid only predicts the collision (as Interpolate does) or applies it.
|
||||
enum GridCollisionMode
|
||||
{
|
||||
GRID_COLLISION_APPLY,
|
||||
GRID_COLLISION_SIMULATE
|
||||
};
|
||||
|
||||
// A tear, bomb, knife or laser's 128 TearFlags bits (BitSet128).
|
||||
using TearFlags = std::bitset<128>;
|
||||
|
||||
// The drop RNG an entity holds before Init seeds it.
|
||||
constexpr RNG DROP_RNG_DEFAULT = {RNG_SEED_DEFAULT, 5, 9, 7};
|
||||
|
||||
struct Entity;
|
||||
struct lua_State;
|
||||
|
||||
// Reading and clearing (0040c3a0, 00a0fe80) are the pointer's own.
|
||||
// A pointer to an entity that the entity clears when it goes away (REPENTOGON's EntityPtr). It registers itself with
|
||||
// the entity it points to, which nulls every such pointer in ClearReferences.
|
||||
struct EntityPtr
|
||||
{
|
||||
EntityPtr() = default;
|
||||
EntityPtr(const EntityPtr& other) { Set(other.entity); }
|
||||
EntityPtr& operator=(const EntityPtr& other)
|
||||
{
|
||||
Set(other.entity);
|
||||
return *this;
|
||||
}
|
||||
EntityPtr& operator=(Entity* target)
|
||||
{
|
||||
Set(target);
|
||||
return *this;
|
||||
}
|
||||
~EntityPtr() { Set(nullptr); }
|
||||
|
||||
void Set(Entity* target);
|
||||
void forget() { entity = nullptr; }
|
||||
Entity* get() const { return entity; }
|
||||
Entity* operator->() const { return entity; }
|
||||
operator Entity*() const { return entity; }
|
||||
|
||||
private:
|
||||
Entity* entity = nullptr;
|
||||
};
|
||||
|
||||
// Construction without an entity and copies (00435c70, 00499960) are the defaults.
|
||||
// A snapshot of an entity as a damage or status source: what it was, where, and its charm and friendship.
|
||||
struct EntityRef
|
||||
{
|
||||
Vector position{};
|
||||
Vector velocity{};
|
||||
Entity* entity = nullptr;
|
||||
int spawnerType = 0;
|
||||
int type = 0;
|
||||
int variant = 0;
|
||||
uint32_t flags = 0;
|
||||
uint32_t spawnerVariant = 0;
|
||||
|
||||
EntityRef() = default;
|
||||
explicit EntityRef(Entity* source);
|
||||
// 004bc670
|
||||
bool IsCharmed() const { return flags & ENTITY_REF_CHARMED; }
|
||||
// 004a2910
|
||||
bool IsFriendly() const { return flags & ENTITY_REF_FRIENDLY; }
|
||||
};
|
||||
|
||||
// A hit TakeDamage queued for the next Update.
|
||||
struct DamageEvent
|
||||
{
|
||||
EntityRef source;
|
||||
float damage = 0;
|
||||
uint64_t damageFlags = 0;
|
||||
};
|
||||
|
||||
// A timed color SetColor laid over an entity. The lowest priority shows, fading toward the next one when isFadeout.
|
||||
struct ColorParams
|
||||
{
|
||||
ColorMod color = COLOR_DEFAULT;
|
||||
int duration = 0;
|
||||
int priority = 0;
|
||||
int remaining = 0;
|
||||
bool isFadeout = false;
|
||||
bool isShared = false;
|
||||
};
|
||||
|
||||
// 006a8290 Construction is the default.
|
||||
// The base of every entity (Lua's Entity): its type, place and motion, collision, sprite and color, health and
|
||||
// damage, status effects, and the parent, child, target and spawner it links to.
|
||||
// Field accessors (00417260, 00417270, 00417290, 004172d0, 004172f0, 00417310, 00417320, 00417330, 00417360, 00417370,
|
||||
// 00417380, 00417420, 00417460, 00417470, 00417480, 004174a0, 004174b0, 004288f0, 00428910, 0042a260, 0042d9b0,
|
||||
// 00431430, 00431440, 00431520, 00431560, 00435ce0, 00435d10, 00435d20, 00435d60, 00435dd0, 00440eb0, 00444c60,
|
||||
// 0049cb50, 004aad30, 004b7080, 004e47a0, 00505b60, 00505b70, 00592250, 005a6ff0, 005b1570, 005b1580, 005b1590,
|
||||
// 00665a80, 006ef400, 007536f0, 0085dca0, 0085dd40, 00871f90) are the public fields.
|
||||
// The parent, child, target and spawner setters (006a92a0, 006a92e0, 006a9320, 006a9360) are EntityPtr assignments.
|
||||
struct Entity
|
||||
{
|
||||
ANM2 sprite;
|
||||
std::vector<ColorParams> colorParams;
|
||||
std::vector<DamageEvent> damageEvents;
|
||||
std::vector<EntityPtr*> referrers;
|
||||
std::vector<Vector> collisionPoints;
|
||||
ColorMod color = COLOR_DEFAULT;
|
||||
ColorMod splatColor = COLOR_DEFAULT;
|
||||
EntityRef baitedSource;
|
||||
EntityRef bleedSource;
|
||||
EntityRef charmSource;
|
||||
EntityRef magnetizedSource;
|
||||
EntityPtr child;
|
||||
EntityPtr hitEffect;
|
||||
EntityPtr magnetizedEffect;
|
||||
EntityPtr minecart;
|
||||
EntityPtr parent;
|
||||
EntityPtr spawnerEntity;
|
||||
EntityPtr target;
|
||||
RNG dropRNG = DROP_RNG_DEFAULT;
|
||||
EntityConfig_Entity* config = nullptr;
|
||||
uint64_t flags = 0;
|
||||
uint64_t pendingDamageFlags = 0;
|
||||
|
||||
Vector gridCollisionNormal{};
|
||||
Vector gridCollisionVelocity{};
|
||||
Vector holdPosition{};
|
||||
Vector knockbackDirection{};
|
||||
Vector pausePosition{};
|
||||
Vector pos{};
|
||||
Vector posOffset{};
|
||||
Vector preInterpolatePos{};
|
||||
Vector prevPosition{};
|
||||
Vector prevVelocity{};
|
||||
Vector renderPosition{};
|
||||
Vector shadowOffset{};
|
||||
Vector sizeMulti{};
|
||||
Vector targetPosition{};
|
||||
Vector velocity{};
|
||||
|
||||
float baseFriction = 0;
|
||||
float bleedDamageAccumulator = 0;
|
||||
float burnTickDamage = 0;
|
||||
float collisionDamage = 0;
|
||||
float friction = 0;
|
||||
float health = 0;
|
||||
float mass = 0;
|
||||
float maxHitPoints = 0;
|
||||
float pendingDamage = 0;
|
||||
float poisonTickDamage = 0;
|
||||
float prevUpdateTime = 0;
|
||||
float renderDepthOffset = 0;
|
||||
float scoreMultiplier = 1;
|
||||
float shadowSize = 0;
|
||||
float shrinkStatus1 = 0;
|
||||
float shrinkStatus2 = 0;
|
||||
float size = 0;
|
||||
float slowingAmount = 0;
|
||||
float speedMultiplier = 0;
|
||||
float updateTime = 0;
|
||||
|
||||
int baitedCountdown = 0;
|
||||
int bleedingCountdown = 0;
|
||||
int bossStatusEffectCooldown = 0;
|
||||
int brimstoneMarkCountdown = 0;
|
||||
int burnCountdown = 0;
|
||||
int burnDamageTimer = 0;
|
||||
int charmedCountdown = 0;
|
||||
int confusionCountdown = 0;
|
||||
int damageCountdown = 0;
|
||||
int entityCollisionClass = ENTCOLL_NONE;
|
||||
int entityGridCollisionClass = GRIDCOLL_NONE;
|
||||
int fearCountdown = 0;
|
||||
int fireDamageCountdown = 0;
|
||||
int freezeCountdown = 0;
|
||||
int holdCountdown = 0;
|
||||
int iceCountdown = 0;
|
||||
int knockbackCountdown = 0;
|
||||
int magnetizedCountdown = 0;
|
||||
int midasFreezeCountdown = 0;
|
||||
int pauseTimer = 0;
|
||||
int pitfallState = 0;
|
||||
int pitfallTimer = 0;
|
||||
int poisonCountdown = 0;
|
||||
int poisonDamageTimer = 0;
|
||||
int renderZOffset = 0;
|
||||
int shrinkCountdown = 0;
|
||||
int slowingCountdown = 0;
|
||||
int sortingLayer = SORTING_BACKGROUND;
|
||||
int spawnFrame = 0;
|
||||
int spawnGridIndex = 0;
|
||||
int spawnerType = 0;
|
||||
int subtype = 0;
|
||||
int type = 0;
|
||||
int variant = 0;
|
||||
int weaknessCountdown = 0;
|
||||
int dataRef = -2;
|
||||
uint32_t collisionIndex = 0;
|
||||
uint32_t index = 0;
|
||||
uint32_t initSeed = 0;
|
||||
uint32_t spawnerVariant = 0;
|
||||
|
||||
bool isCollidesWithEntity = false;
|
||||
bool isCollidesWithGrid = false;
|
||||
bool isDead = false;
|
||||
bool isExists = false;
|
||||
bool isInterpolating = false;
|
||||
bool isInvincible = false;
|
||||
bool isKillOnTouch = false;
|
||||
bool isRemovedByFactory = false;
|
||||
bool isUnknown176 = false;
|
||||
bool isValid = false;
|
||||
bool isVisible = false;
|
||||
|
||||
Entity() = default;
|
||||
Entity(const Entity&) = delete;
|
||||
Entity& operator=(const Entity&) = delete;
|
||||
|
||||
virtual ~Entity();
|
||||
virtual void Init(int type, int variant, int subType, uint32_t initSeed);
|
||||
virtual void PreUpdate();
|
||||
virtual void Update();
|
||||
virtual void Interpolate();
|
||||
virtual void Render(const Vector& offset);
|
||||
virtual bool RenderShadowLayer(const Vector& offset);
|
||||
virtual void PostRender();
|
||||
virtual bool TakeDamage(float damage, uint64_t damageFlags, const EntityRef& source, int damageCountdown);
|
||||
virtual void Kill(const EntityRef& source);
|
||||
virtual void Remove();
|
||||
virtual void TriggerGlowingHourglass() {}
|
||||
virtual void hourglass_rewind_clear() {}
|
||||
virtual int GetRenderZ();
|
||||
virtual bool CanOverwrite();
|
||||
virtual void SetColor(const ColorMod& newColor, int duration, int priority, bool isFadeout, bool isShared);
|
||||
virtual void SetCollisionDamage(float damage);
|
||||
virtual void ClearReferences();
|
||||
virtual bool CanShutDoors() { return false; }
|
||||
virtual bool IsBoss() { return false; }
|
||||
virtual bool IsValidTarget(Entity* other);
|
||||
// 005ccc10 Most entities cannot be thrown.
|
||||
virtual bool TryThrow(const EntityRef&, const Vector&, float) { return false; }
|
||||
virtual Vector GetForwardVector();
|
||||
virtual bool HandleCollision(Entity* collider, bool isLow) = 0;
|
||||
virtual void ResetColor();
|
||||
virtual void LoadEntityConfig();
|
||||
|
||||
// 00417220 Whether it is of the type, and of the variant and subtype unless those are -1.
|
||||
bool IsType(int entityType, int entityVariant, int entitySubType) const
|
||||
{
|
||||
return type == entityType && (entityVariant == -1 || variant == entityVariant) &&
|
||||
(entitySubType == -1 || subtype == entitySubType);
|
||||
}
|
||||
// 004173b0
|
||||
bool is_player() const { return type == ENTITY_PLAYER; }
|
||||
// 004173c0
|
||||
bool is_bomb() const { return type == ENTITY_BOMB; }
|
||||
// 0042a250
|
||||
bool IsFamiliar() const { return type == ENTITY_FAMILIAR; }
|
||||
// 00431530
|
||||
bool IsTear() const { return type == ENTITY_TEAR; }
|
||||
// 00431540
|
||||
bool IsProjectile() const { return type == ENTITY_PROJECTILE; }
|
||||
// 00431550
|
||||
bool is_pickup() const { return type == ENTITY_PICKUP; }
|
||||
// 00435da0
|
||||
bool is_slot() const { return type == ENTITY_SLOT; }
|
||||
// 004567b0
|
||||
bool IsFriendly() const { return flags & FLAG_FRIENDLY; }
|
||||
// 004173e0, 005cd460 Sets flags.
|
||||
void AddEntityFlags(uint64_t added) { flags |= added; }
|
||||
// 00417400
|
||||
void ClearEntityFlags(uint64_t cleared) { flags &= ~cleared; }
|
||||
// 00417430
|
||||
bool HasEntityFlags(uint64_t tested) const { return flags & tested; }
|
||||
// 006a9c30
|
||||
bool HasFullHealth() const { return maxHitPoints <= health; }
|
||||
// 006ad340 Whether the damage queued this frame kills it.
|
||||
bool HasMortalDamage() const { return health <= pendingDamage; }
|
||||
// 00499da0
|
||||
Entity_Player* ToPlayer();
|
||||
// 00435e40
|
||||
Entity_Tear* ToTear();
|
||||
|
||||
static bool is_enemy_type(int entityType);
|
||||
Entity* to_npc_or_coop_player();
|
||||
void AddVelocity(const Vector& added, bool isIgnoreSpeedMultiplier);
|
||||
void AddVelocity_divided(const Vector& added, bool isIgnoreSpeedMultiplier);
|
||||
void AddHealth(float amount);
|
||||
int FrameCount();
|
||||
int update_ticks_get();
|
||||
bool IsFrame(int frequency, int offset);
|
||||
int GetIntervalTicks(float interval, float offset);
|
||||
int get_velocity_direction();
|
||||
void SetSize(float newSize, Vector newSizeMulti, int gridCollisionPoints);
|
||||
void GetCollisionCapsule(Capsule& outCapsule, const Vector& offset);
|
||||
|
||||
Entity* GetLastParent();
|
||||
Entity* GetLastChild();
|
||||
Entity* GetLastSpawner();
|
||||
Entity* GetPlayerAncestor();
|
||||
Entity* GetStatusEffectTarget();
|
||||
float GetRootParent();
|
||||
bool IsDescendantOf(Entity* ancestor);
|
||||
bool HasCommonParentWithEntity(Entity* other);
|
||||
bool is_same_segmented_body(Entity* other);
|
||||
bool DoesEntityShareStatus();
|
||||
void CopyStatusEffects();
|
||||
uint32_t GetHitListIndex();
|
||||
int CountRelatedEntities(int relatedType, int relatedVariant, std::vector<Entity*>* related);
|
||||
|
||||
bool IsEnemy();
|
||||
bool IsFlying();
|
||||
bool IsVulnerableEnemy(Entity* source);
|
||||
bool IsActiveEnemy(DeadMode mode);
|
||||
bool IsHostileTo(Entity* other);
|
||||
bool IsDamageSourceFriendly(const EntityRef& source);
|
||||
bool is_valid_boss_enemy();
|
||||
bool is_valid_target();
|
||||
bool CanDevolve();
|
||||
bool IsPlayerInRadius(const Vector& center, float radius);
|
||||
int GetBossID();
|
||||
|
||||
void AddFreeze(const EntityRef& source, int duration, bool isIgnoreBossCooldown);
|
||||
void AddPoison(const EntityRef& source, int duration, float damage, bool isIgnoreBossCooldown);
|
||||
void AddSlowing(const EntityRef& source, int duration, float amount, ColorMod slowColor, bool isIgnoreBossCooldown);
|
||||
void AddCharmed(const EntityRef& source, int duration, bool isIgnoreBossCooldown, bool isAddEnemyKillScore);
|
||||
void AddConfusion(const EntityRef& source, int duration, bool isIgnoreBossCooldown);
|
||||
void AddMidasFreeze(const EntityRef& source, int duration, bool isIgnoreBossCooldown);
|
||||
void AddFear(const EntityRef& source, int duration, bool isIgnoreBossCooldown);
|
||||
Entity* AddFear(int duration, int unknown1, int unknown2);
|
||||
void AddBurn(const EntityRef& source, int duration, float damage, bool isIgnoreBossCooldown);
|
||||
void AddBleeding(const EntityRef& source, int duration);
|
||||
void AddShrink(const EntityRef& source, int duration, bool isIgnoreBossCooldown);
|
||||
void AddMagnetized(const EntityRef& source, int duration);
|
||||
void AddBaited(const EntityRef& source, int duration);
|
||||
void AddWeakness(const EntityRef& source, int duration);
|
||||
void AddBrimstoneMark(const EntityRef& source, int duration);
|
||||
void AddIce(const EntityRef& source, int duration);
|
||||
void RemoveStatusEffects();
|
||||
int apply_second_hand_duration(int duration, const EntityRef& source);
|
||||
|
||||
void CollideWithGrid(GridCollisionMode mode);
|
||||
void PlayerCollideWithGrid(GridCollisionMode mode);
|
||||
bool is_grid_collision_at(const Vector& offset);
|
||||
float collision_mass_get(Entity* other);
|
||||
void push_apart_capsule(Entity* other);
|
||||
bool push_apart_circle(Entity* other);
|
||||
void collide_with_entity(Entity* other);
|
||||
static bool ForceCollide(Entity* first, Entity* second, bool isLow);
|
||||
|
||||
void BloodExplode();
|
||||
Entity_Effect* MakeGroundPoof(const Vector& position, const ColorMod& poofColor, float poofSize);
|
||||
Entity_Effect* MakeGroundPoofAtSelf(const ColorMod& poofColor, float poofSize);
|
||||
Entity_Effect* MakeBloodPoof(const Vector& position, const ColorMod& poofColor, float scale);
|
||||
Entity_Effect* MakeBloodPoofAtPos(const ColorMod& poofColor, float scale);
|
||||
Entity_NPC* GiveMinecart(const Vector& position, const Vector& cartVelocity);
|
||||
void convert_shot_for_enemy_owner(Entity* shot);
|
||||
int get_water_splash_variant();
|
||||
void* GetDebugShape(bool isUnknown);
|
||||
void* GetData(void* outRef);
|
||||
|
||||
Vector GetNullOffset(std::string_view nullLayerName);
|
||||
void GetNullCapsule(Capsule& outCapsule, std::string_view nullLayerName);
|
||||
void SetSpriteFrame(std::string_view animation, int frame);
|
||||
void SetSpriteOverlayFrame(std::string_view animation, int frame);
|
||||
|
||||
void KillWithSource();
|
||||
static void ReleaseLuaRef(Entity* entity);
|
||||
static void RemoveWithPoof(Entity* entity);
|
||||
static void DestroyRockGridAt(const Vector& position, GridEntityDesc* desc, Entity* source, int backdropType);
|
||||
static int IsVulnerableEnemy_lua(lua_State* state);
|
||||
|
||||
private:
|
||||
void data_release();
|
||||
void knockback_update();
|
||||
void color_params_update();
|
||||
void status_effects_update();
|
||||
void damage_events_update();
|
||||
void status_damage_update();
|
||||
};
|
||||
|
||||
Vector render_position_get(const Vector& world, RenderSnap snap);
|
||||
int render_z_get(float depth);
|
||||
@@ -0,0 +1,50 @@
|
||||
#include "entity_bomb.h"
|
||||
#include "log.h"
|
||||
|
||||
constexpr int BOMB_ROCKET = 19;
|
||||
constexpr int BOMB_ROCKET_GIGA = 20;
|
||||
|
||||
// 00452c40 Lights the fuse for the given frames.
|
||||
void Entity_Bomb::SetExplosionCountdown(int countdown)
|
||||
{
|
||||
explosionCountdown = countdown;
|
||||
explosionCountdown2 = countdown;
|
||||
}
|
||||
|
||||
// 006a2030 Whether it is a rocket, small or giga.
|
||||
bool Entity_Bomb::IsRocket()
|
||||
{
|
||||
return variant == BOMB_ROCKET || variant == BOMB_ROCKET_GIGA;
|
||||
}
|
||||
|
||||
// The rest of Entity_Bomb is not reconstructed yet.
|
||||
|
||||
// 006a2050
|
||||
void Entity_Bomb::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Bomb::Init 006a2050");
|
||||
}
|
||||
|
||||
// 006a24d0
|
||||
void Entity_Bomb::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_Bomb::Update 006a24d0");
|
||||
}
|
||||
|
||||
// 006a5a60
|
||||
void Entity_Bomb::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Bomb::Render 006a5a60");
|
||||
}
|
||||
|
||||
// 006a5f00
|
||||
bool Entity_Bomb::HandleCollision(Entity*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Bomb::HandleCollision 006a5f00");
|
||||
}
|
||||
|
||||
// 006a6f10
|
||||
void Entity_Bomb::update_sparks()
|
||||
{
|
||||
reconstruction_missing("Entity_Bomb::update_sparks 006a6f10");
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include "anm2.h"
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
// The costume layers a bomb draws its holder's item looks with.
|
||||
constexpr int BOMB_COSTUME_LAYERS = 5;
|
||||
|
||||
// Construction and destruction (006a1f30) are the defaults.
|
||||
// Field accessors (004316a0, 005cd560, 0060cdc0) are the public fields.
|
||||
// A bomb (Lua's EntityBomb): its fuse, the explosion it deals, the tear effects it carries, its fall and bounce, and
|
||||
// the costume layers its holder's items add.
|
||||
struct Entity_Bomb : Entity
|
||||
{
|
||||
std::array<ANM2, BOMB_COSTUME_LAYERS> bombCostumesSprites;
|
||||
std::vector<uint32_t> hitList;
|
||||
TearFlags tearFlags;
|
||||
EntityPtr stickyTarget;
|
||||
float explosionDamage = 0;
|
||||
float fallAcceleration = 0;
|
||||
float fallSpeed = 0;
|
||||
float radiusMultiplier = 0;
|
||||
float rocketAngle = 0;
|
||||
float rocketSpeed = 0;
|
||||
float scale = 0;
|
||||
int bombIndex = 0;
|
||||
int bounceCount = 0;
|
||||
int explosionCountdown = 0;
|
||||
int explosionCountdown2 = 0;
|
||||
int scatterTimer = 0;
|
||||
int updateDelay = 0;
|
||||
short collisionCooldown = 0;
|
||||
short parentCollisionCooldown = 0;
|
||||
bool isFetus = false;
|
||||
bool isHasCostumes = false;
|
||||
bool isLoadCostumes = false;
|
||||
bool isPrismTouched = false;
|
||||
bool isSkipNextUpdate = false;
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Render(const Vector& offset) override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
|
||||
void SetExplosionCountdown(int countdown);
|
||||
bool IsRocket();
|
||||
void update_sparks();
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "entity_dummy.h"
|
||||
#include "log.h"
|
||||
|
||||
constexpr float DUMMY_FRICTION = 0.965f;
|
||||
|
||||
// Collides with nothing, refusing the collision: its slot shares the body of GridEntity::Hurt, which returns false.
|
||||
bool Entity_Dummy::HandleCollision(Entity*, bool)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 006a7f20 Starts as any entity.
|
||||
void Entity_Dummy::Init(int entityType, int entityVariant, int entitySubType, uint32_t seed)
|
||||
{
|
||||
Entity::Init(entityType, entityVariant, entitySubType, seed);
|
||||
}
|
||||
|
||||
// 006a7f30 Moves as any entity, slowing down, and goes away once dead.
|
||||
void Entity_Dummy::Update()
|
||||
{
|
||||
Entity::Update();
|
||||
velocity = vector_make(velocity.x * DUMMY_FRICTION, velocity.y * DUMMY_FRICTION);
|
||||
if (isDead) Remove();
|
||||
}
|
||||
|
||||
// The rest of Entity_Dummy is not reconstructed yet.
|
||||
|
||||
// 006a7f80
|
||||
void Entity_Dummy::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Dummy::Render 006a7f80");
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
|
||||
// Construction and destruction (006a7ee0) are the defaults.
|
||||
// A dummy entity (Lua's EntityType ENTITY_DUMMY), which collides with nothing.
|
||||
struct Entity_Dummy : Entity
|
||||
{
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Render(const Vector& offset) override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
};
|
||||
@@ -0,0 +1,144 @@
|
||||
#include "entity_effect.h"
|
||||
#include "log.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
||||
// The creep variants the players leave (holy water trail, black, red, white, holy water, green, Lemon Mishap, Lemon
|
||||
// Party, 204, Black Powder, milk, Black Powder's pentagram).
|
||||
constexpr std::array<int, 12> PLAYER_CREEPS = {54, 45, 46, 44, 37, 53, 32, 78, 204, 92, 90, 93};
|
||||
|
||||
// 0060c400 Only a boss spawn pentagram holds the doors shut.
|
||||
bool Entity_Effect::CanShutDoors()
|
||||
{
|
||||
return variant == EFFECT_SPAWN_PENTAGRAM;
|
||||
}
|
||||
|
||||
// 005ccc20 Collides with nothing it reacts to, letting the collision through.
|
||||
bool Entity_Effect::HandleCollision(Entity*, bool)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 00435e90 Sets how long it lasts, from now.
|
||||
void Entity_Effect::SetTimeout(int frames)
|
||||
{
|
||||
timeout = frames;
|
||||
lifespan = frames;
|
||||
}
|
||||
|
||||
// 00435ef0 Sets the radius it grows between.
|
||||
void Entity_Effect::SetRadii(float newMinRadius, float newMaxRadius)
|
||||
{
|
||||
minRadius = newMinRadius;
|
||||
maxRadius = newMaxRadius;
|
||||
}
|
||||
|
||||
// 005cd950 Whether two indices differ, the filter of the rift's pull.
|
||||
bool Entity_Effect::rift_attract_filter(int first, int second)
|
||||
{
|
||||
return first != second;
|
||||
}
|
||||
|
||||
// 0060ac20 Whether the variant is creep or fire the players leave, which hurts only enemies.
|
||||
bool Entity_Effect::IsPlayerCreep(int effectVariant)
|
||||
{
|
||||
return std::find(PLAYER_CREEPS.begin(), PLAYER_CREEPS.end(), effectVariant) != PLAYER_CREEPS.end();
|
||||
}
|
||||
|
||||
// The rest of Entity_Effect is not reconstructed yet.
|
||||
|
||||
// 005cdb20
|
||||
void Entity_Effect::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::Init 005cdb20");
|
||||
}
|
||||
|
||||
// 005d4380
|
||||
void Entity_Effect::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::Update 005d4380");
|
||||
}
|
||||
|
||||
// 005d2520
|
||||
void Entity_Effect::Interpolate()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::Interpolate 005d2520");
|
||||
}
|
||||
|
||||
// 00607620
|
||||
void Entity_Effect::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::Render 00607620");
|
||||
}
|
||||
|
||||
// 005d2420
|
||||
void Entity_Effect::Remove()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::Remove 005d2420");
|
||||
}
|
||||
|
||||
// 0060c370
|
||||
void Entity_Effect::TriggerGlowingHourglass()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::guard_check_icall 0060c370");
|
||||
}
|
||||
|
||||
// 0060abb0
|
||||
void Entity_Effect::ClearReferences()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::ClearReferences 0060abb0");
|
||||
}
|
||||
|
||||
// 00435290
|
||||
void Entity_Effect::render_player_target(const Vector&, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::render_player_target 00435290");
|
||||
}
|
||||
|
||||
// 004564b0
|
||||
void Entity_Effect::FollowParent(Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::FollowParent 004564b0");
|
||||
}
|
||||
|
||||
// 005d2a70
|
||||
void Entity_Effect::update_mr_me()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::update_mr_me 005d2a70");
|
||||
}
|
||||
|
||||
// 005d4010
|
||||
void Entity_Effect::update_wave_chain()
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::update_wave_chain 005d4010");
|
||||
}
|
||||
|
||||
// 006073f0
|
||||
void Entity_Effect::moonlight_timer_callback(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::moonlight_timer_callback 006073f0");
|
||||
}
|
||||
|
||||
// 0060af00
|
||||
Entity_Effect* Entity_Effect::CreateTimer(void*, uint32_t, uint32_t, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::CreateTimer 0060af00");
|
||||
}
|
||||
|
||||
// 0060b0d0
|
||||
void Entity_Effect::update_variant178_shooter(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::update_variant178_shooter 0060b0d0");
|
||||
}
|
||||
|
||||
// 0060b7a0
|
||||
Entity_Effect* Entity_Effect::CreateLootPreview(void*, const Vector&, Entity*, Entity_Effect*)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::CreateLootPreview 0060b7a0");
|
||||
}
|
||||
|
||||
// 0060bae0
|
||||
void Entity_Effect::setup_loot_preview(void*)
|
||||
{
|
||||
reconstruction_missing("Entity_Effect::setup_loot_preview 0060bae0");
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
// The effect variant that spawns a boss, which counts as the boss until it does.
|
||||
constexpr int EFFECT_SPAWN_PENTAGRAM = 203;
|
||||
|
||||
// Construction and destruction (005cd9f0, 005cd960) are the defaults, the extra data shared with its other holders.
|
||||
// Field accessors (00435e60, 00435eb0, 004d7770, 005784c0, 0060ce20) are the public fields.
|
||||
// An effect (Lua's EntityEffect): a visual or a hazard such as creep, a poof or a light beam, with its timeout, its
|
||||
// fall, the per-variant data it keeps and the extra data some variants share.
|
||||
struct Entity_Effect : Entity
|
||||
{
|
||||
// The base of the extra data some variants keep (MrMeData, PickupGhostData, SpriteTrailData).
|
||||
struct ExtraData
|
||||
{
|
||||
virtual ~ExtraData() = default;
|
||||
};
|
||||
|
||||
std::shared_ptr<ExtraData> extraData;
|
||||
std::array<uint32_t, 4> varData{};
|
||||
std::vector<uint32_t> hitList;
|
||||
Vector parentOffset{};
|
||||
float fallingAcceleration = 0;
|
||||
float fallingSpeed = 0;
|
||||
float height = 0;
|
||||
float maxRadius = 0;
|
||||
float minRadius = 0;
|
||||
float rotation = 0;
|
||||
float scale = 0;
|
||||
int damageSource = 0;
|
||||
int lifespan = 0;
|
||||
int spawnSubtype = 0;
|
||||
int spawnType = 0;
|
||||
int spawnVariant = 0;
|
||||
int state = 0;
|
||||
int timeout = 0;
|
||||
bool isFollowing = false;
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Interpolate() override;
|
||||
void Render(const Vector& offset) override;
|
||||
void Remove() override;
|
||||
void TriggerGlowingHourglass() override;
|
||||
void ClearReferences() override;
|
||||
bool CanShutDoors() override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
|
||||
void render_player_target(const Vector& offset, int segmentMode);
|
||||
void SetTimeout(int frames);
|
||||
void SetRadii(float newMinRadius, float newMaxRadius);
|
||||
void FollowParent(Entity* parent);
|
||||
static bool rift_attract_filter(int first, int second);
|
||||
void update_mr_me();
|
||||
void update_wave_chain();
|
||||
static void moonlight_timer_callback(int);
|
||||
static bool IsPlayerCreep(int effectVariant);
|
||||
static Entity_Effect* CreateTimer(void* fn, uint32_t delay, uint32_t times, bool isPersistent);
|
||||
void update_variant178_shooter(bool isPositionOnly);
|
||||
static Entity_Effect* CreateLootPreview(void* lootlist, const Vector& pos, Entity* owner, Entity_Effect* effect);
|
||||
void setup_loot_preview(void* lootQueue);
|
||||
};
|
||||
@@ -0,0 +1,753 @@
|
||||
#include "entity_familiar.h"
|
||||
#include "log.h"
|
||||
|
||||
// The variants the familiar code tells apart by number, and the Lost Soul's state while it is dead.
|
||||
constexpr int FAMILIAR_ISAACS_HEART = 62;
|
||||
constexpr int FAMILIAR_PUNCHING_BAG = 67;
|
||||
constexpr int FAMILIAR_MILK = 100;
|
||||
constexpr int FAMILIAR_LOST_SOUL = 211;
|
||||
constexpr int LOST_SOUL_DEAD = 2;
|
||||
constexpr int FAMILIAR_VANISHING_TWIN = 242;
|
||||
// A formation mode of none, which asks for a new place.
|
||||
constexpr uint8_t FORMATION_NONE = 0xff;
|
||||
|
||||
// 00651890 Rewinds with the Glowing Hourglass: a dead Lost Soul comes back, and it remembers the rewind for its next
|
||||
// room.
|
||||
void Entity_Familiar::TriggerGlowingHourglass()
|
||||
{
|
||||
if (variant == FAMILIAR_LOST_SOUL && state == LOST_SOUL_DEAD)
|
||||
{
|
||||
state = 0;
|
||||
Update();
|
||||
}
|
||||
isHourglassRewound = true;
|
||||
}
|
||||
|
||||
// 006518c0 Forgets a Glowing Hourglass rewind.
|
||||
void Entity_Familiar::hourglass_rewind_clear()
|
||||
{
|
||||
isHourglassRewound = false;
|
||||
}
|
||||
|
||||
// 0060dab0 Only a visible Vanishing Twin that took a boss's form holds the doors shut.
|
||||
bool Entity_Familiar::CanShutDoors()
|
||||
{
|
||||
return variant == FAMILIAR_VANISHING_TWIN && coins != 0 && isVisible;
|
||||
}
|
||||
|
||||
// 0060d8c0 Whether enemies can hurt it: only the familiars that take hits.
|
||||
bool Entity_Familiar::CanBeDamagedByEnemy()
|
||||
{
|
||||
return variant == FAMILIAR_ISAACS_HEART || variant == FAMILIAR_PUNCHING_BAG || variant == FAMILIAR_LOST_SOUL ||
|
||||
variant == FAMILIAR_MILK;
|
||||
}
|
||||
|
||||
// 00612820 Leaves its orbit, the rest of the orbit closing the gap.
|
||||
void Entity_Familiar::RemoveFromOrbit()
|
||||
{
|
||||
if (orbitLayer < 0) return;
|
||||
|
||||
RecalculateOrbitOffset(orbitLayer, false);
|
||||
orbitLayer = -1;
|
||||
}
|
||||
|
||||
// 0062aaa0 Counts hearts it collected.
|
||||
void Entity_Familiar::AddHearts(int amount)
|
||||
{
|
||||
hearts = hearts + amount;
|
||||
}
|
||||
|
||||
// 00630440 Counts keys it collected.
|
||||
void Entity_Familiar::AddKeys(int amount)
|
||||
{
|
||||
keys = keys + amount;
|
||||
}
|
||||
|
||||
// 006348d0 Drops its place in the following line, to be given a new one.
|
||||
void Entity_Familiar::reset_follow_target()
|
||||
{
|
||||
formationTargetOffset = {};
|
||||
formationOffset = formationTargetOffset;
|
||||
formationAngle = 0;
|
||||
formationMode = FORMATION_NONE;
|
||||
}
|
||||
|
||||
// The rest of Entity_Familiar is not reconstructed yet.
|
||||
|
||||
// 0060de70
|
||||
void Entity_Familiar::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Init 0060de70");
|
||||
}
|
||||
|
||||
// 0061da10
|
||||
void Entity_Familiar::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Update 0061da10");
|
||||
}
|
||||
|
||||
// 00624a80
|
||||
void Entity_Familiar::Interpolate()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Interpolate 00624a80");
|
||||
}
|
||||
|
||||
// 00624e10
|
||||
void Entity_Familiar::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Render 00624e10");
|
||||
}
|
||||
|
||||
// 00624dd0
|
||||
bool Entity_Familiar::RenderShadowLayer(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::RenderShadowLayer 00624dd0");
|
||||
}
|
||||
|
||||
// 0062cdc0
|
||||
bool Entity_Familiar::TakeDamage(float, uint64_t, const EntityRef&, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::TakeDamage 0062cdc0");
|
||||
}
|
||||
|
||||
// 00610540
|
||||
void Entity_Familiar::Kill(const EntityRef&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Kill 00610540");
|
||||
}
|
||||
|
||||
// 00610470
|
||||
void Entity_Familiar::Remove()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Remove 00610470");
|
||||
}
|
||||
|
||||
// 006121d0
|
||||
void Entity_Familiar::ClearReferences()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ClearReferences 006121d0");
|
||||
}
|
||||
|
||||
// 0063c0a0
|
||||
bool Entity_Familiar::TryThrow(const EntityRef&, const Vector&, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::TryThrow 0063c0a0");
|
||||
}
|
||||
|
||||
// 006261f0
|
||||
bool Entity_Familiar::HandleCollision(Entity*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::HandleCollision 006261f0");
|
||||
}
|
||||
|
||||
// 00431be0
|
||||
void Entity_Familiar::ai_umbilical_baby(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_umbilical_baby 00431be0");
|
||||
}
|
||||
|
||||
// 004357e0
|
||||
void Entity_Familiar::set_extra_data(void*, void*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::set_extra_data 004357e0");
|
||||
}
|
||||
|
||||
// 00436330
|
||||
void Entity_Familiar::WispInit()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::WispInit 00436330");
|
||||
}
|
||||
|
||||
// 00436fd0
|
||||
uint32_t Entity_Familiar::wisp_kill()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::wisp_kill 00436fd0");
|
||||
}
|
||||
|
||||
// 004386f0
|
||||
Entity_Tear* Entity_Familiar::fire_wisp_projectile(Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::fire_wisp_projectile 004386f0");
|
||||
}
|
||||
|
||||
// 0043a5e0
|
||||
uint32_t Entity_Familiar::wisp_take_damage(float*, uint32_t*, int*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::wisp_take_damage 0043a5e0");
|
||||
}
|
||||
|
||||
// 0043aa90
|
||||
void Entity_Familiar::ai_wisp()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_wisp 0043aa90");
|
||||
}
|
||||
|
||||
// 0043db20
|
||||
void Entity_Familiar::ai_mr_me_wisp()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_mr_me_wisp 0043db20");
|
||||
}
|
||||
|
||||
// 0043e4a0
|
||||
void Entity_Familiar::ai_mega_blast_wisp()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_mega_blast_wisp 0043e4a0");
|
||||
}
|
||||
|
||||
// 0043eb10
|
||||
int Entity_Familiar::GetRandomWisp(RNG*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::GetRandomWisp 0043eb10");
|
||||
}
|
||||
|
||||
// 005ae490
|
||||
void Entity_Familiar::ai_buddy_inbox()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_buddy_inbox 005ae490");
|
||||
}
|
||||
|
||||
// 0060d180
|
||||
KColor* Entity_Familiar::GetPlayerSlot(KColor*, Entity_Player*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::GetPlayerSlot 0060d180");
|
||||
}
|
||||
|
||||
// 0060d8e0
|
||||
bool Entity_Familiar::CanBlockProjectiles()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::CanBlockProjectiles 0060d8e0");
|
||||
}
|
||||
|
||||
// 0060dc40
|
||||
float Entity_Familiar::apply_tear_modifiers()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::apply_tear_modifiers 0060dc40");
|
||||
}
|
||||
|
||||
// 0060ddd0
|
||||
void Entity_Familiar::set_locust_config_index(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::set_locust_config_index 0060ddd0");
|
||||
}
|
||||
|
||||
// 00612330
|
||||
Entity* Entity_Familiar::get_orbit_parent()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::get_orbit_parent 00612330");
|
||||
}
|
||||
|
||||
// 00612440
|
||||
int Entity_Familiar::RecalculateOrbitOffset(int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::RecalculateOrbitOffset 00612440");
|
||||
}
|
||||
|
||||
// 006127b0
|
||||
void Entity_Familiar::AddToOrbit(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::AddToOrbit 006127b0");
|
||||
}
|
||||
|
||||
// 00612850
|
||||
Vector Entity_Familiar::GetOrbitDistance(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::GetOrbitDistance 00612850");
|
||||
}
|
||||
|
||||
// 00612890
|
||||
bool Entity_Familiar::is_detached_from_follow()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::is_detached_from_follow 00612890");
|
||||
}
|
||||
|
||||
// 00612970
|
||||
int Entity_Familiar::GetFollowerPriority()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::GetFollowerPriority 00612970");
|
||||
}
|
||||
|
||||
// 00612af0
|
||||
bool Entity_Familiar::IsLilithBirthrightIncubus()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::IsLilithBirthrightIncubus 00612af0");
|
||||
}
|
||||
|
||||
// 00612b50
|
||||
Entity* Entity_Familiar::get_incubus_umbilical_whip()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::get_incubus_umbilical_whip 00612b50");
|
||||
}
|
||||
|
||||
// 00612bb0
|
||||
void Entity_Familiar::FollowParent()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::FollowParent 00612bb0");
|
||||
}
|
||||
|
||||
// 00613910
|
||||
void Entity_Familiar::FollowPosition(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::FollowPosition 00613910");
|
||||
}
|
||||
|
||||
// 006139b0
|
||||
Vector Entity_Familiar::GetOrbitPosition(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::GetOrbitPosition 006139b0");
|
||||
}
|
||||
|
||||
// 00613c20
|
||||
Entity_Laser* Entity_Familiar::fire_robo_baby_laser(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::fire_robo_baby_laser 00613c20");
|
||||
}
|
||||
|
||||
// 00613df0
|
||||
void Entity_Familiar::PlayFloatAnim(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::PlayFloatAnim 00613df0");
|
||||
}
|
||||
|
||||
// 00613fe0
|
||||
void Entity_Familiar::AddToDelayed()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::AddToDelayed 00613fe0");
|
||||
}
|
||||
|
||||
// 006141e0
|
||||
void Entity_Familiar::RemoveFromDelayed()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::RemoveFromDelayed 006141e0");
|
||||
}
|
||||
|
||||
// 006142e0
|
||||
void Entity_Familiar::PlayChargeAnim(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::PlayChargeAnim 006142e0");
|
||||
}
|
||||
|
||||
// 00614500
|
||||
void Entity_Familiar::PlayShootAnim(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::PlayShootAnim 00614500");
|
||||
}
|
||||
|
||||
// 00614b10
|
||||
void Entity_Familiar::Shoot()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::Shoot 00614b10");
|
||||
}
|
||||
|
||||
// 00615d80
|
||||
void Entity_Familiar::ai_blue_fly()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_blue_fly 00615d80");
|
||||
}
|
||||
|
||||
// 00616db0
|
||||
void Entity_Familiar::ai_walker()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_walker 00616db0");
|
||||
}
|
||||
|
||||
// 006174c0
|
||||
void Entity_Familiar::ai_charger()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_charger 006174c0");
|
||||
}
|
||||
|
||||
// 00619270
|
||||
void Entity_Familiar::ai_auto_shooter()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_auto_shooter 00619270");
|
||||
}
|
||||
|
||||
// 0061a240
|
||||
void Entity_Familiar::ai_blue_babys_only_friend()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_blue_babys_only_friend 0061a240");
|
||||
}
|
||||
|
||||
// 0061a4e0
|
||||
void Entity_Familiar::ai_pickup_sack()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_pickup_sack 0061a4e0");
|
||||
}
|
||||
|
||||
// 0061b8c0
|
||||
void Entity_Familiar::ai_flying_bird()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_flying_bird 0061b8c0");
|
||||
}
|
||||
|
||||
// 0061bd50
|
||||
void Entity_Familiar::ai_daddy_longlegs()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_daddy_longlegs 0061bd50");
|
||||
}
|
||||
|
||||
// 0061c150
|
||||
void Entity_Familiar::ai_orbital_variant_50()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_orbital_variant_50 0061c150");
|
||||
}
|
||||
|
||||
// 0061d6b0
|
||||
void Entity_Familiar::ai_key_full()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_key_full 0061d6b0");
|
||||
}
|
||||
|
||||
// 0062a8f0
|
||||
bool Entity_Familiar::CanPlayerFire()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::CanPlayerFire 0062a8f0");
|
||||
}
|
||||
|
||||
// 0062a930
|
||||
void Entity_Familiar::AddCoins(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::AddCoins 0062a930");
|
||||
}
|
||||
|
||||
// 0062aab0
|
||||
void Entity_Familiar::TriggerRoomClear()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::TriggerRoomClear 0062aab0");
|
||||
}
|
||||
|
||||
// 0062b360
|
||||
void Entity_Familiar::level_start()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::level_start 0062b360");
|
||||
}
|
||||
|
||||
// 0062bb70
|
||||
void Entity_Familiar::room_enter()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::room_enter 0062bb70");
|
||||
}
|
||||
|
||||
// 0062c8d0
|
||||
void Entity_Familiar::farting_baby_fart()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::farting_baby_fart 0062c8d0");
|
||||
}
|
||||
|
||||
// 0062d290
|
||||
void Entity_Familiar::mongo_baby_pick_next_mimic()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::mongo_baby_pick_next_mimic 0062d290");
|
||||
}
|
||||
|
||||
// 0062d7e0
|
||||
void Entity_Familiar::RemoveFromFollowers()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::RemoveFromFollowers 0062d7e0");
|
||||
}
|
||||
|
||||
// 0062db20
|
||||
void Entity_Familiar::AddToFollowers()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::AddToFollowers 0062db20");
|
||||
}
|
||||
|
||||
// 0062e020
|
||||
void Entity_Familiar::set_player(Entity_Player*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::set_player 0062e020");
|
||||
}
|
||||
|
||||
// 0062e120
|
||||
void Entity_Familiar::ai_samsons_chains()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_samsons_chains 0062e120");
|
||||
}
|
||||
|
||||
// 0062e620
|
||||
void Entity_Familiar::update_weapon(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::update_weapon 0062e620");
|
||||
}
|
||||
|
||||
// 0062ee30
|
||||
void Entity_Familiar::ai_lil_gurdy()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_lil_gurdy 0062ee30");
|
||||
}
|
||||
|
||||
// 00630450
|
||||
void Entity_Familiar::store_backup(void*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::store_backup 00630450");
|
||||
}
|
||||
|
||||
// 00631050
|
||||
void Entity_Familiar::MoveDelayed(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::MoveDelayed 00631050");
|
||||
}
|
||||
|
||||
// 006312f0
|
||||
void Entity_Familiar::MoveDiagonally(float)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::MoveDiagonally 006312f0");
|
||||
}
|
||||
|
||||
// 00631850
|
||||
void Entity_Familiar::move_to_parent_offset()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::move_to_parent_offset 00631850");
|
||||
}
|
||||
|
||||
// 00631b20
|
||||
void Entity_Familiar::delirium_morph()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::delirium_morph 00631b20");
|
||||
}
|
||||
|
||||
// 006322f0
|
||||
void Entity_Familiar::init_lil_harbinger_sprite()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::init_lil_harbinger_sprite 006322f0");
|
||||
}
|
||||
|
||||
// 006324d0
|
||||
void Entity_Familiar::render_charge_indicator(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::render_charge_indicator 006324d0");
|
||||
}
|
||||
|
||||
// 00632820
|
||||
void Entity_Familiar::ai_lil_monstro()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_lil_monstro 00632820");
|
||||
}
|
||||
|
||||
// 00632d90
|
||||
void Entity_Familiar::ai_variant_111()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_variant_111 00632d90");
|
||||
}
|
||||
|
||||
// 00633500
|
||||
void Entity_Familiar::update_angry_fly()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::update_angry_fly 00633500");
|
||||
}
|
||||
|
||||
// 00634000
|
||||
bool Entity_Familiar::TryFireTear(Entity_Tear*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::TryFireTear 00634000");
|
||||
}
|
||||
|
||||
// 006341a0
|
||||
uint8_t Entity_Familiar::apply_baby_bender(Entity_Tear*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::apply_baby_bender 006341a0");
|
||||
}
|
||||
|
||||
// 00634260
|
||||
Vector Entity_Familiar::UpdateFollowPosition()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::UpdateFollowPosition 00634260");
|
||||
}
|
||||
|
||||
// 00634a40
|
||||
void Entity_Familiar::ResolveOrbitConflict()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ResolveOrbitConflict 00634a40");
|
||||
}
|
||||
|
||||
// 00634b10
|
||||
void Entity_Familiar::ai_lil_spewer()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_lil_spewer 00634b10");
|
||||
}
|
||||
|
||||
// 006378c0
|
||||
void Entity_Familiar::ai_lil_harbingers()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_lil_harbingers 006378c0");
|
||||
}
|
||||
|
||||
// 00638c10
|
||||
Entity_Laser* Entity_Familiar::FireBrimstone(const Vector&, uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::FireBrimstone 00638c10");
|
||||
}
|
||||
|
||||
// 00639000
|
||||
Entity* Entity_Familiar::ThrowDip(int, const Vector&, Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ThrowDip 00639000");
|
||||
}
|
||||
|
||||
// 00639750
|
||||
Entity_Tear* Entity_Familiar::FireProjectile(const Vector&, uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::FireProjectile 00639750");
|
||||
}
|
||||
|
||||
// 0063aef0
|
||||
Entity_Laser* Entity_Familiar::sprinkler_shoot_laser(float, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::sprinkler_shoot_laser 0063aef0");
|
||||
}
|
||||
|
||||
// 0063b340
|
||||
void Entity_Familiar::update_idle_anim_by_size()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::update_idle_anim_by_size 0063b340");
|
||||
}
|
||||
|
||||
// 0063b8b0
|
||||
void Entity_Familiar::RemoveFromPlayer(uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::RemoveFromPlayer 0063b8b0");
|
||||
}
|
||||
|
||||
// 0063c1c0
|
||||
void Entity_Familiar::ai_minisaac()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_minisaac 0063c1c0");
|
||||
}
|
||||
|
||||
// 0063ce20
|
||||
void Entity_Familiar::minisaac_fire()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::minisaac_fire 0063ce20");
|
||||
}
|
||||
|
||||
// 0063dd60
|
||||
void Entity_Familiar::minisaac_find_target()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::minisaac_find_target 0063dd60");
|
||||
}
|
||||
|
||||
// 0063f9f0
|
||||
void Entity_Familiar::ai_blood_oath()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_blood_oath 0063f9f0");
|
||||
}
|
||||
|
||||
// 006402f0
|
||||
void Entity_Familiar::paschal_candle_sync_effects()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::paschal_candle_sync_effects 006402f0");
|
||||
}
|
||||
|
||||
// 00640ca0
|
||||
void Entity_Familiar::ai_boiled_baby()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_boiled_baby 00640ca0");
|
||||
}
|
||||
|
||||
// 006414c0
|
||||
void Entity_Familiar::zhl_misfit_006414c0()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::zhl_misfit_006414c0 006414c0");
|
||||
}
|
||||
|
||||
// 006424d0
|
||||
void Entity_Familiar::ai_bird_cage()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_bird_cage 006424d0");
|
||||
}
|
||||
|
||||
// 006431d0
|
||||
void Entity_Familiar::ai_bot_fly()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_bot_fly 006431d0");
|
||||
}
|
||||
|
||||
// 006437a0
|
||||
void Entity_Familiar::ai_stitches()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_stitches 006437a0");
|
||||
}
|
||||
|
||||
// 006444d0
|
||||
Entity* Entity_Familiar::aim_reflected_projectile()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::aim_reflected_projectile 006444d0");
|
||||
}
|
||||
|
||||
// 00644e80
|
||||
void Entity_Familiar::ai_shadow_intruder_damocles(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_shadow_intruder_damocles 00644e80");
|
||||
}
|
||||
|
||||
// 006470c0
|
||||
void* Entity_Familiar::get_item_config_entry()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::get_item_config_entry 006470c0");
|
||||
}
|
||||
|
||||
// 00647170
|
||||
uint8_t Entity_Familiar::abyss_locust_eat()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::abyss_locust_eat 00647170");
|
||||
}
|
||||
|
||||
// 0064a2d0
|
||||
uint8_t Entity_Familiar::break_grid_ahead()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::break_grid_ahead 0064a2d0");
|
||||
}
|
||||
|
||||
// 0064a830
|
||||
void Entity_Familiar::load_config_graphics()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::load_config_graphics 0064a830");
|
||||
}
|
||||
|
||||
// 0064b6c0
|
||||
void Entity_Familiar::render_abyss_locust_sprite(ANM2*, float*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::render_abyss_locust_sprite 0064b6c0");
|
||||
}
|
||||
|
||||
// 0064b920
|
||||
void Entity_Familiar::siren_charm(Entity*, Entity_Player*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::siren_charm 0064b920");
|
||||
}
|
||||
|
||||
// 0064bab0
|
||||
void Entity_Familiar::RemoveFromPlayer()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::RemoveFromPlayer 0064bab0");
|
||||
}
|
||||
|
||||
// 0064ca30
|
||||
void Entity_Familiar::UpdateDirtColor(uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::UpdateDirtColor 0064ca30");
|
||||
}
|
||||
|
||||
// 0064d1d0
|
||||
void Entity_Familiar::update_star_of_bethlehem_speed(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::update_star_of_bethlehem_speed 0064d1d0");
|
||||
}
|
||||
|
||||
// 0064e0c0
|
||||
void Entity_Familiar::ai_blood_clot(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::ai_blood_clot 0064e0c0");
|
||||
}
|
||||
|
||||
// 00650220
|
||||
void Entity_Familiar::predict_player_movement()
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::predict_player_movement 00650220");
|
||||
}
|
||||
|
||||
// 009615e0
|
||||
uint8_t Entity_Familiar::multidimensional_baby_copy_knife(Entity_Knife*, Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Familiar::multidimensional_baby_copy_knife 009615e0");
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include "anm2.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
// Construction and destruction (0060d3d0, 0060d200) are the defaults, but for the pathfinder's owner the constructor
|
||||
// sets. PathFinder::Init's reset waits for PathFinder's takeover.
|
||||
// Field accessors (004361f0, 00505cf0, 0060d0e0, 0060d100) are the public fields.
|
||||
// A familiar (Lua's EntityFamiliar): its player, its place in the following line or an orbit, the consumables it
|
||||
// collects, its weapon, and the extra data some variants keep.
|
||||
struct Entity_Familiar : Entity
|
||||
{
|
||||
// The base of the extra data some variants keep (AbyssLocustData, IsaacsBodyData, UmbilicalBabyData).
|
||||
struct ExtraData
|
||||
{
|
||||
virtual ~ExtraData() = default;
|
||||
};
|
||||
|
||||
ANM2 chargeBarSprite;
|
||||
NPCAI_Pathfinder pathfinder{};
|
||||
std::unique_ptr<ExtraData> extraData;
|
||||
std::vector<uint32_t> hitList;
|
||||
ColorMod dirtColor = COLOR_DEFAULT;
|
||||
EntityPtr linkedEntity;
|
||||
EntityPtr sirenHelper;
|
||||
Entity_Player* player = nullptr;
|
||||
Entity_Player* sirenOriginalPlayer = nullptr;
|
||||
ItemConfig_Item* item = nullptr;
|
||||
Weapon* weapon = nullptr;
|
||||
Vector formationOffset{};
|
||||
Vector formationTargetOffset{};
|
||||
Vector orbitDistance{};
|
||||
float formationAngle = 0;
|
||||
float orbitAngleOffset = 0;
|
||||
float orbitSpeed = 0;
|
||||
int appearTimer = 0;
|
||||
int chargeLevel = 0;
|
||||
int coins = 0;
|
||||
int counter = 0;
|
||||
int fireCooldown = 0;
|
||||
int headFrameDelay = 0;
|
||||
int hearts = 0;
|
||||
int keys = 0;
|
||||
int lastDirection = 0;
|
||||
int moveDelayNum = 0;
|
||||
int moveDirection = 0;
|
||||
int orbitLayer = 0;
|
||||
int roomClearCount = 0;
|
||||
int shootDirection = 0;
|
||||
int sirenCharmFrames = 0;
|
||||
int state = 0;
|
||||
int wispCollectibleType = 0;
|
||||
uint8_t formationMode = 0;
|
||||
bool isDelayed = false;
|
||||
bool isFollower = false;
|
||||
bool isHourglassRewound = false;
|
||||
bool isLilDelirium = false;
|
||||
bool isNotCountedAsFollower = false;
|
||||
bool isSubtype55555 = false;
|
||||
|
||||
Entity_Familiar() { pathfinder._entity = this; }
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Interpolate() override;
|
||||
void Render(const Vector& offset) override;
|
||||
bool RenderShadowLayer(const Vector& offset) override;
|
||||
bool TakeDamage(float damage, uint64_t damageFlags, const EntityRef& source, int damageCountdown) override;
|
||||
void Kill(const EntityRef& source) override;
|
||||
void Remove() override;
|
||||
void TriggerGlowingHourglass() override;
|
||||
void hourglass_rewind_clear() override;
|
||||
void ClearReferences() override;
|
||||
bool CanShutDoors() override;
|
||||
bool TryThrow(const EntityRef& source, const Vector& direction, float force) override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
|
||||
void ai_umbilical_baby(bool isInterpolated);
|
||||
static void set_extra_data(void* extraDataPtr, void* extraData);
|
||||
void WispInit();
|
||||
uint32_t wisp_kill();
|
||||
Entity_Tear* fire_wisp_projectile(Vector velocity);
|
||||
uint32_t wisp_take_damage(float*, uint32_t*, int*);
|
||||
void ai_wisp();
|
||||
void ai_mr_me_wisp();
|
||||
void ai_mega_blast_wisp();
|
||||
static int GetRandomWisp(RNG* rng);
|
||||
void ai_buddy_inbox();
|
||||
KColor* GetPlayerSlot(KColor* outColor, Entity_Player* player);
|
||||
bool CanBeDamagedByEnemy();
|
||||
bool CanBlockProjectiles();
|
||||
float apply_tear_modifiers();
|
||||
void set_locust_config_index(int);
|
||||
Entity* get_orbit_parent();
|
||||
int RecalculateOrbitOffset(int layer, bool isAdd);
|
||||
void AddToOrbit(int orbitLayer);
|
||||
void RemoveFromOrbit();
|
||||
static Vector GetOrbitDistance(int layer);
|
||||
bool is_detached_from_follow();
|
||||
int GetFollowerPriority();
|
||||
bool IsLilithBirthrightIncubus();
|
||||
Entity* get_incubus_umbilical_whip();
|
||||
void FollowParent();
|
||||
void FollowPosition(const Vector& position);
|
||||
Vector GetOrbitPosition(const Vector& offset);
|
||||
Entity_Laser* fire_robo_baby_laser(const Vector& direction);
|
||||
void PlayFloatAnim(int direction);
|
||||
void AddToDelayed();
|
||||
void RemoveFromDelayed();
|
||||
void PlayChargeAnim(int direction);
|
||||
void PlayShootAnim(int direction);
|
||||
void Shoot();
|
||||
void ai_blue_fly();
|
||||
void ai_walker();
|
||||
void ai_charger();
|
||||
void ai_auto_shooter();
|
||||
void ai_blue_babys_only_friend();
|
||||
void ai_pickup_sack();
|
||||
void ai_flying_bird();
|
||||
void ai_daddy_longlegs();
|
||||
void ai_orbital_variant_50();
|
||||
void ai_key_full();
|
||||
bool CanPlayerFire();
|
||||
void AddCoins(int count);
|
||||
void AddHearts(int amount);
|
||||
void TriggerRoomClear();
|
||||
void level_start();
|
||||
void room_enter();
|
||||
void farting_baby_fart();
|
||||
void mongo_baby_pick_next_mimic();
|
||||
void RemoveFromFollowers();
|
||||
void AddToFollowers();
|
||||
void set_player(Entity_Player* player);
|
||||
void ai_samsons_chains();
|
||||
void update_weapon(bool isInterpolated);
|
||||
void ai_lil_gurdy();
|
||||
void AddKeys(int amount);
|
||||
void store_backup(void* backup);
|
||||
void MoveDelayed(int numFrames);
|
||||
void MoveDiagonally(float speed);
|
||||
void move_to_parent_offset();
|
||||
void delirium_morph();
|
||||
void init_lil_harbinger_sprite();
|
||||
void render_charge_indicator(const Vector& renderPos);
|
||||
void ai_lil_monstro();
|
||||
void ai_variant_111();
|
||||
void update_angry_fly();
|
||||
bool TryFireTear(Entity_Tear* tear);
|
||||
uint8_t apply_baby_bender(Entity_Tear* tear);
|
||||
Vector UpdateFollowPosition();
|
||||
void reset_follow_target();
|
||||
void ResolveOrbitConflict();
|
||||
void ai_lil_spewer();
|
||||
void ai_lil_harbingers();
|
||||
Entity_Laser* FireBrimstone(const Vector& aimDirection, uint8_t unk);
|
||||
static Entity* ThrowDip(int subType, const Vector& position, Entity* spawner);
|
||||
Entity_Tear* FireProjectile(const Vector& aimDirection, uint8_t unk);
|
||||
Entity_Laser* sprinkler_shoot_laser(float angle, float distance);
|
||||
void update_idle_anim_by_size();
|
||||
void RemoveFromPlayer(uint8_t unusedRemoveFamiliar);
|
||||
void ai_minisaac();
|
||||
void minisaac_fire();
|
||||
static void minisaac_find_target();
|
||||
void ai_blood_oath();
|
||||
void paschal_candle_sync_effects();
|
||||
void ai_boiled_baby();
|
||||
void zhl_misfit_006414c0();
|
||||
void ai_bird_cage();
|
||||
void ai_bot_fly();
|
||||
void ai_stitches();
|
||||
Entity* aim_reflected_projectile();
|
||||
void ai_shadow_intruder_damocles(bool isInterpolating);
|
||||
void* get_item_config_entry();
|
||||
uint8_t abyss_locust_eat();
|
||||
uint8_t break_grid_ahead();
|
||||
void load_config_graphics();
|
||||
void render_abyss_locust_sprite(ANM2*, float*);
|
||||
void siren_charm(Entity* siren, Entity_Player* player);
|
||||
void RemoveFromPlayer();
|
||||
void UpdateDirtColor(uint8_t immediate);
|
||||
void update_star_of_bethlehem_speed(bool isForce);
|
||||
void ai_blood_clot(bool isPostMove);
|
||||
void predict_player_movement();
|
||||
static uint8_t multidimensional_baby_copy_knife(Entity_Knife* knife, Entity* unused);
|
||||
};
|
||||
@@ -0,0 +1,150 @@
|
||||
#include "entity_knife.h"
|
||||
#include "log.h"
|
||||
|
||||
// 009665e0 Sorts by its own depth, ignoring the sorting layer.
|
||||
int Entity_Knife::GetRenderZ()
|
||||
{
|
||||
return render_z_get(knifeDepthOffset + pos.y);
|
||||
}
|
||||
|
||||
// 009666c0 The first knife of its chain of knives.
|
||||
Entity* Entity_Knife::GetRootParent()
|
||||
{
|
||||
Entity* root = this;
|
||||
while (root->parent && root->parent->type == ENTITY_KNIFE) root = root->parent;
|
||||
return root;
|
||||
}
|
||||
|
||||
// The rest of Entity_Knife is not reconstructed yet.
|
||||
|
||||
// 00960c10
|
||||
void Entity_Knife::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::Init 00960c10");
|
||||
}
|
||||
|
||||
// 00961b00
|
||||
void Entity_Knife::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::Update 00961b00");
|
||||
}
|
||||
|
||||
// 00967db0
|
||||
void Entity_Knife::Interpolate()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::Interpolate 00967db0");
|
||||
}
|
||||
|
||||
// 00965d30
|
||||
void Entity_Knife::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::Render 00965d30");
|
||||
}
|
||||
|
||||
// 009611d0
|
||||
void Entity_Knife::ClearReferences()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::ClearReferences 009611d0");
|
||||
}
|
||||
|
||||
// 009666f0
|
||||
bool Entity_Knife::HandleCollision(Entity*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::HandleCollision 009666f0");
|
||||
}
|
||||
|
||||
// 00960a20
|
||||
int Entity_Knife::GetBaseVariant()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::GetBaseVariant 00960a20");
|
||||
}
|
||||
|
||||
// 009612e0
|
||||
void* Entity_Knife::GetHitEntities()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::GetHitEntities 009612e0");
|
||||
}
|
||||
|
||||
// 00961320
|
||||
void Entity_Knife::InitHomingPath(Vector, Entity*, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::InitHomingPath 00961320");
|
||||
}
|
||||
|
||||
// 009614d0
|
||||
void Entity_Knife::copy_parent_state(Entity_Knife*)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::copy_parent_state 009614d0");
|
||||
}
|
||||
|
||||
// 00961870
|
||||
uint32_t Entity_Knife::spawn_child_knife()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::spawn_child_knife 00961870");
|
||||
}
|
||||
|
||||
// 00966650
|
||||
Entity_Player* Entity_Knife::GetPlayer()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::GetPlayer 00966650");
|
||||
}
|
||||
|
||||
// 00966ef0
|
||||
void Entity_Knife::Shoot(float, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::Shoot 00966ef0");
|
||||
}
|
||||
|
||||
// 00967180
|
||||
void Entity_Knife::UpdateHomingPath()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::UpdateHomingPath 00967180");
|
||||
}
|
||||
|
||||
// 00967650
|
||||
void Entity_Knife::update_target(float*)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::update_target 00967650");
|
||||
}
|
||||
|
||||
// 00967a70
|
||||
void Entity_Knife::apply_wiggle(float*)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::apply_wiggle 00967a70");
|
||||
}
|
||||
|
||||
// 00967d20
|
||||
void Entity_Knife::screen_wrap()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::screen_wrap 00967d20");
|
||||
}
|
||||
|
||||
// 00967fc0
|
||||
void Entity_Knife::Reset()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::Reset 00967fc0");
|
||||
}
|
||||
|
||||
// 009680d0
|
||||
void Entity_Knife::SetAttackAnimation()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::SetAttackAnimation 009680d0");
|
||||
}
|
||||
|
||||
// 00968430
|
||||
void Entity_Knife::SpinAttack(short, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::SpinAttack 00968430");
|
||||
}
|
||||
|
||||
// 00968660
|
||||
uint8_t Entity_Knife::drain_notched_axe(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::drain_notched_axe 00968660");
|
||||
}
|
||||
|
||||
// 009688d0
|
||||
void Entity_Knife::UpdateSwingHits()
|
||||
{
|
||||
reconstruction_missing("Entity_Knife::UpdateSwingHits 009688d0");
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
// Construction and destruction (00960b50, 00960a70) are the defaults. The homing path waits for HomingLaser's
|
||||
// takeover.
|
||||
// Field accessors (004d7790, 004d77a0, 0060cf10, 0060cfb0, 0085de90, 0085deb0, 0085dec0) are the public fields.
|
||||
// A knife (Lua's EntityKnife): Mom's Knife and the swung weapons (bones, clubs, swords), with the tear effects they
|
||||
// carry, their charge and flight, and the path a homing knife follows.
|
||||
struct Entity_Knife : Entity
|
||||
{
|
||||
std::unique_ptr<HomingLaser> homingLaser;
|
||||
std::vector<uint32_t> hitList;
|
||||
TearFlags tearFlags;
|
||||
TearFlags usedTearFlags;
|
||||
Vector anchorPosition{};
|
||||
Vector initPosition{};
|
||||
float basePosOffsetY = 0;
|
||||
float charge = 0;
|
||||
float displayRotation = 0;
|
||||
float fallingSpeed = 0;
|
||||
float height = 0;
|
||||
float knifeDepthOffset = 0;
|
||||
float knifeDistance = 0;
|
||||
float knifeVelocity = 0;
|
||||
float maxDistance = 0;
|
||||
float pathFollowSpeed = 0;
|
||||
float pathOffset = 0;
|
||||
float pathProgress = 0;
|
||||
float rotation = 0;
|
||||
float rotationOffset = 0;
|
||||
float scale = 0;
|
||||
int pathSegment = 0;
|
||||
bool isDeadEyeHit = false;
|
||||
bool isFlying = false;
|
||||
bool isMultidimensionalApplied = false;
|
||||
bool isPrimaryClub = false;
|
||||
bool isPrismApplied = false;
|
||||
bool isSpinAttack = false;
|
||||
bool isSwinging = false;
|
||||
bool isUsingParentHitList = false;
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Interpolate() override;
|
||||
void Render(const Vector& offset) override;
|
||||
int GetRenderZ() override;
|
||||
void ClearReferences() override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
|
||||
int GetBaseVariant();
|
||||
void* GetHitEntities();
|
||||
void InitHomingPath(Vector direction, Entity* source, float pathOffset);
|
||||
void copy_parent_state(Entity_Knife* source);
|
||||
uint32_t spawn_child_knife();
|
||||
Entity_Player* GetPlayer();
|
||||
Entity* GetRootParent();
|
||||
void Shoot(float charge, float range);
|
||||
void UpdateHomingPath();
|
||||
void update_target(float* outAngle);
|
||||
void apply_wiggle(float*);
|
||||
void screen_wrap();
|
||||
void Reset();
|
||||
void SetAttackAnimation();
|
||||
void SpinAttack(short remainingSpins, int startFrame);
|
||||
uint8_t drain_notched_axe(int charge);
|
||||
void UpdateSwingHits();
|
||||
};
|
||||
@@ -0,0 +1,230 @@
|
||||
#include "entity_laser.h"
|
||||
#include "log.h"
|
||||
|
||||
// The laser subtypes that draw a ring.
|
||||
constexpr int LASER_SUBTYPE_RING_FIRST = 1;
|
||||
constexpr int LASER_SUBTYPE_RING_LAST = 3;
|
||||
|
||||
// 0096ced0 Sorts by its depth, ignoring the sorting layer.
|
||||
int Entity_Laser::GetRenderZ()
|
||||
{
|
||||
return render_z_get(renderDepthOffset + pos.y);
|
||||
}
|
||||
|
||||
// 0097e7a0 Whether EntityFactory may reuse it: never before its first update.
|
||||
bool Entity_Laser::CanOverwrite()
|
||||
{
|
||||
return !HasEntityFlags(FLAG_DONT_OVERWRITE) && !isFirstUpdate;
|
||||
}
|
||||
|
||||
// 005ccc20 Collides with nothing it reacts to, letting the collision through.
|
||||
bool Entity_Laser::HandleCollision(Entity*, bool)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 00435f50 Whether it is a ring laser (Tech X and the like).
|
||||
bool Entity_Laser::IsCircleLaser()
|
||||
{
|
||||
return subtype >= LASER_SUBTYPE_RING_FIRST && subtype <= LASER_SUBTYPE_RING_LAST;
|
||||
}
|
||||
|
||||
// The rest of Entity_Laser is not reconstructed yet.
|
||||
|
||||
// 0096f590
|
||||
void Entity_Laser::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::Init 0096f590");
|
||||
}
|
||||
|
||||
// 00977cc0
|
||||
void Entity_Laser::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::Update 00977cc0");
|
||||
}
|
||||
|
||||
// 0097e6f0
|
||||
void Entity_Laser::Interpolate()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::Interpolate 0097e6f0");
|
||||
}
|
||||
|
||||
// 009785d0
|
||||
void Entity_Laser::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::Render 009785d0");
|
||||
}
|
||||
|
||||
// 0097ca90
|
||||
bool Entity_Laser::RenderShadowLayer(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::RenderShadowLayer 0097ca90");
|
||||
}
|
||||
|
||||
// 0097eb50
|
||||
void Entity_Laser::PostRender()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::PostRender 0097eb50");
|
||||
}
|
||||
|
||||
// 0097ea30
|
||||
void Entity_Laser::Remove()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::Remove 0097ea30");
|
||||
}
|
||||
|
||||
// 0097e800
|
||||
void Entity_Laser::ClearReferences()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::ClearReferences 0097e800");
|
||||
}
|
||||
|
||||
// 0096ce30
|
||||
bool Entity_Laser::is_thick_variant()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::is_thick_variant 0096ce30");
|
||||
}
|
||||
|
||||
// 0096cf80
|
||||
bool Entity_Laser::CanDamageEntity(Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::CanDamageEntity 0096cf80");
|
||||
}
|
||||
|
||||
// 0096d3f0
|
||||
void Entity_Laser::impact_tear_flag_effects(const Vector&, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::impact_tear_flag_effects 0096d3f0");
|
||||
}
|
||||
|
||||
// 0096ee00
|
||||
ColorMod* Entity_Laser::get_tear_spawn_color(const ColorMod&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::get_tear_spawn_color 0096ee00");
|
||||
}
|
||||
|
||||
// 0096f070
|
||||
void Entity_Laser::copy_from_parent(Entity_Laser*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::copy_from_parent 0096f070");
|
||||
}
|
||||
|
||||
// 0096f470
|
||||
void Entity_Laser::RotateToAngle(float, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::RotateToAngle 0096f470");
|
||||
}
|
||||
|
||||
// 0096f4e0
|
||||
void Entity_Laser::ClearLaserSamples()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::ClearLaserSamples 0096f4e0");
|
||||
}
|
||||
|
||||
// 0096f880
|
||||
void Entity_Laser::PlayInitSound()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::PlayInitSound 0096f880");
|
||||
}
|
||||
|
||||
// 0096fc70
|
||||
Vector Entity_Laser::calc_end_point(const Vector&, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::calc_end_point 0096fc70");
|
||||
}
|
||||
|
||||
// 009704a0
|
||||
void Entity_Laser::update_first_frame()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::update_first_frame 009704a0");
|
||||
}
|
||||
|
||||
// 00970cb0
|
||||
void Entity_Laser::find_nearest_grid_hit(int, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::find_nearest_grid_hit 00970cb0");
|
||||
}
|
||||
|
||||
// 00971590
|
||||
uint8_t Entity_Laser::damage_grid_entity(int, int, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::damage_grid_entity 00971590");
|
||||
}
|
||||
|
||||
// 00971810
|
||||
void Entity_Laser::update_line_hits()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::update_line_hits 00971810");
|
||||
}
|
||||
|
||||
// 009737b0
|
||||
void Entity_Laser::update_endpoint_and_hits()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::update_endpoint_and_hits 009737b0");
|
||||
}
|
||||
|
||||
// 00973a50
|
||||
void Entity_Laser::refresh_tear_params()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::refresh_tear_params 00973a50");
|
||||
}
|
||||
|
||||
// 00973c60
|
||||
void Entity_Laser::update_laser()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::update_laser 00973c60");
|
||||
}
|
||||
|
||||
// 0097baa0
|
||||
void Entity_Laser::UpdateHits()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::UpdateHits 0097baa0");
|
||||
}
|
||||
|
||||
// 0097e3b0
|
||||
void* Entity_Laser::GetSamples()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::GetSamples 0097e3b0");
|
||||
}
|
||||
|
||||
// 0097e3c0
|
||||
void Entity_Laser::damage_entity(Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::damage_entity 0097e3c0");
|
||||
}
|
||||
|
||||
// 0097e6e0
|
||||
void* Entity_Laser::GetNonOptimizedSamples()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::GetNonOptimizedSamples 0097e6e0");
|
||||
}
|
||||
|
||||
// 0097f820
|
||||
void Entity_Laser::spawn_impact_effect(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::spawn_impact_effect 0097f820");
|
||||
}
|
||||
|
||||
// 0097fc10
|
||||
void Entity_Laser::ResetSpriteScale()
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::ResetSpriteScale 0097fc10");
|
||||
}
|
||||
|
||||
// 0097fe50
|
||||
void Entity_Laser::set_scale(float)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::set_scale 0097fe50");
|
||||
}
|
||||
|
||||
// 0097fe60
|
||||
void Entity_Laser::update_sample_points(char)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::update_sample_points 0097fe60");
|
||||
}
|
||||
|
||||
// 0099efc0
|
||||
void Entity_Laser::update_wiggle_path(void*, float, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Laser::update_wiggle_path 0099efc0");
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
// Construction and destruction (0096ccf0, 0096cb60, 0096cd20) are the defaults. The homing path waits for
|
||||
// HomingLaser's takeover.
|
||||
// Field accessors (00435f20, 00435f30, 00456850, 004aaed0, 005cd580, 005cd590, 0060cea0, 0060ceb0, 007e9230,
|
||||
// 007e9240) are the public fields.
|
||||
// A laser (Lua's EntityLaser): a beam from its parent at an angle, its length, timeout and tear effects, the curve a
|
||||
// homing one follows, and the lasers it splits into.
|
||||
struct Entity_Laser : Entity
|
||||
{
|
||||
std::array<EntityPtr, 4> prismLasers;
|
||||
std::array<EntityPtr, 2> multidimensionalLasers;
|
||||
std::array<EntityPtr, 2> subLasers;
|
||||
std::unique_ptr<HomingLaser> homingLaser;
|
||||
std::vector<uint32_t> hitList;
|
||||
TearFlags activeTearFlags;
|
||||
TearFlags heldTearFlags;
|
||||
TearFlags tearFlags;
|
||||
EntityPtr childLaser;
|
||||
EntityPtr continuumLaser;
|
||||
EntityPtr parentLaser;
|
||||
EntityPtr tearWaitEffect;
|
||||
Entity* bounceLaser = nullptr;
|
||||
Vector endPoint{};
|
||||
Vector impactDirection{};
|
||||
Vector impactPosition{};
|
||||
Vector parentOffset{};
|
||||
float angleDegrees = 0;
|
||||
float blackHpDropChance = 0;
|
||||
float curveStrength = 0;
|
||||
float damageMultiplier = 0;
|
||||
float impactDistance = 0;
|
||||
float laserLength = 0;
|
||||
float lastAngleDegrees = 0;
|
||||
float maxDistance = 0;
|
||||
float radius = 0;
|
||||
float rotationDegrees = 0;
|
||||
float rotationSpd = 0;
|
||||
float scale = 0;
|
||||
float startAngleDegrees = 0;
|
||||
float subLaserAngle = 0;
|
||||
float subLaserDistance = 0;
|
||||
int chainedLasers = 0;
|
||||
int timeout = 0;
|
||||
int waitFrames = 0;
|
||||
uint32_t homingType = 0;
|
||||
uint32_t rotationDelay = 0;
|
||||
bool isActiveRotating = false;
|
||||
bool isDisableFollowParent = false;
|
||||
bool isDisableInitSound = false;
|
||||
bool isFirstUpdate = false;
|
||||
bool isGridHit = false;
|
||||
bool isMultidimensionalTouched = false;
|
||||
bool isOneHit = false;
|
||||
bool isPrismTouched = false;
|
||||
bool isSampleLaser = false;
|
||||
bool isShrink = false;
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Interpolate() override;
|
||||
void Render(const Vector& offset) override;
|
||||
bool RenderShadowLayer(const Vector& offset) override;
|
||||
void PostRender() override;
|
||||
void Remove() override;
|
||||
int GetRenderZ() override;
|
||||
bool CanOverwrite() override;
|
||||
void ClearReferences() override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
|
||||
bool IsCircleLaser();
|
||||
bool is_thick_variant();
|
||||
bool CanDamageEntity(Entity* entity);
|
||||
void impact_tear_flag_effects(const Vector& position, const Vector& direction);
|
||||
ColorMod* get_tear_spawn_color(const ColorMod& outColor);
|
||||
void copy_from_parent(Entity_Laser* parent, bool isCopySpawnData);
|
||||
void RotateToAngle(float angle, float speed);
|
||||
void ClearLaserSamples();
|
||||
void PlayInitSound();
|
||||
Vector calc_end_point(const Vector& start, const Vector& direction);
|
||||
void update_first_frame();
|
||||
void find_nearest_grid_hit(int unusedFlag, const Vector& offset);
|
||||
uint8_t damage_grid_entity(int gridIndex, int unused, const Vector& direction);
|
||||
void update_line_hits();
|
||||
void update_endpoint_and_hits();
|
||||
void refresh_tear_params();
|
||||
void update_laser();
|
||||
void UpdateHits();
|
||||
void* GetSamples();
|
||||
void damage_entity(Entity*);
|
||||
void* GetNonOptimizedSamples();
|
||||
void spawn_impact_effect(int unused);
|
||||
void ResetSpriteScale();
|
||||
void set_scale(float scale);
|
||||
void update_sample_points(char);
|
||||
static void update_wiggle_path(void* samples, float amplitude, float phase);
|
||||
};
|
||||
@@ -0,0 +1,721 @@
|
||||
#include "entity_list.h"
|
||||
#include "entity_effect.h"
|
||||
#include "entity_npc.h"
|
||||
#include "entity_player.h"
|
||||
#include "entity_projectile.h"
|
||||
#include "entity_tear.h"
|
||||
#include "game.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
|
||||
constexpr const char* SHADOW_PNG = "gfx/shadow.png";
|
||||
constexpr int FAMILIAR_WISP = 206;
|
||||
constexpr int FAMILIAR_CUBE_BABY = 239;
|
||||
constexpr int BOMB_ROCKET = 19;
|
||||
constexpr int BOMB_ROCKET_GIGA = 20;
|
||||
constexpr int ENTITY_ULTRA_GREED = 406;
|
||||
constexpr int ENTITY_BUMBINO = 916;
|
||||
constexpr int KNIFE_MAIN = 0;
|
||||
// The boss bar flashes for this many frames when the bosses' health changes.
|
||||
constexpr int BOSS_BAR_FLASH_FRAMES = 8;
|
||||
// The render bands sort_by_render_z first partitions the list into: background, doors, and the rest.
|
||||
constexpr uint32_t RENDER_Z_DOOR_START = 5000;
|
||||
constexpr uint32_t RENDER_Z_NORMAL_START = 10000;
|
||||
// The swaps a frame's sort may make: a sixteenth of the original's fixed render list capacity, plus one.
|
||||
constexpr int RENDER_LIST_CAPACITY = 0x4000;
|
||||
constexpr int RENDER_SORT_SWAP_BUDGET = (RENDER_LIST_CAPACITY >> 4) + 1;
|
||||
|
||||
// Formats a message for KAGE_LogMessage, whose declaration takes nothing to format with.
|
||||
[[gnu::format(printf, 2, 3)]] static void log_format(uint32_t level, const char* format, ...)
|
||||
{
|
||||
char message[256];
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
std::vsnprintf(message, sizeof(message), format, args);
|
||||
va_end(args);
|
||||
KAGE_LogMessage(level, (uint8_t*)message);
|
||||
}
|
||||
|
||||
static bool is_unit_size(const Entity& entity)
|
||||
{
|
||||
return entity.sizeMulti.x == 1 && entity.sizeMulti.y == 1;
|
||||
}
|
||||
|
||||
// Pushes one entity off another: as circles when neither is stretched, as capsules otherwise.
|
||||
static void entity_push_apart(Entity& pusher, Entity& other)
|
||||
{
|
||||
if (is_unit_size(pusher) && is_unit_size(other)) pusher.push_apart_circle(&other);
|
||||
else pusher.push_apart_capsule(&other);
|
||||
}
|
||||
|
||||
// 00417670 Drops every occurrence of the entity.
|
||||
void EntityList_EL::remove(Entity* entity)
|
||||
{
|
||||
std::erase(*this, entity);
|
||||
}
|
||||
|
||||
// 0085e0c0 The entity at the index, the last one for an index past the end.
|
||||
// The original read before the list when it was empty: nothing is returned then.
|
||||
Entity* EntityList_EL::Get(uint32_t index)
|
||||
{
|
||||
if (empty()) return nullptr;
|
||||
return (*this)[std::min<size_t>(index, size() - 1)];
|
||||
}
|
||||
|
||||
// Sizes the grid to cover width by height in cells of size, owned by the list whose collision pairs it marks.
|
||||
void CellSpace::layout(EntityList& list, float width, float height, float size)
|
||||
{
|
||||
owner = &list;
|
||||
cellSize = size;
|
||||
rows = (int)(height / size + 0.5f);
|
||||
columns = (int)(width / size + 0.5f);
|
||||
cells.assign((size_t)(rows * columns), Cell{});
|
||||
}
|
||||
|
||||
// 0041baf0 Empties every cell.
|
||||
void CellSpace::clear()
|
||||
{
|
||||
for (Cell& cell : cells) cell.count = 0;
|
||||
}
|
||||
|
||||
// The cell at the column and row, counted through the grid in rows, or null past either end.
|
||||
CellSpace::Cell* CellSpace::cell_get(int column, int row)
|
||||
{
|
||||
int index = columns * row + column;
|
||||
return index >= 0 && index < (int)cells.size() ? &cells[index] : nullptr;
|
||||
}
|
||||
|
||||
// 0041bb50 Lists the entity in every cell its collision box covers, turned with its sprite when stretched.
|
||||
void CellSpace::insert(Entity& entity)
|
||||
{
|
||||
float halfWidth = entity.sizeMulti.x * entity.size;
|
||||
float halfHeight = entity.sizeMulti.y * entity.size;
|
||||
if (!is_unit_size(entity) && entity.sprite.rotation != 0)
|
||||
{
|
||||
float angle = entity.sprite.rotation * 0.017453292f;
|
||||
float cosine = std::cos(angle);
|
||||
float sine = std::sin(angle);
|
||||
float turnedHeight = std::fabs(halfHeight * cosine) + std::fabs(halfWidth * sine);
|
||||
halfWidth = std::fabs(halfHeight * sine) + std::fabs(halfWidth * cosine);
|
||||
halfHeight = turnedHeight;
|
||||
}
|
||||
|
||||
float left = entity.pos.x - halfWidth;
|
||||
float right = halfWidth + entity.pos.x;
|
||||
float top = entity.pos.y - halfHeight;
|
||||
float bottom = halfHeight + entity.pos.y;
|
||||
if (right <= left || bottom <= top)
|
||||
log_format(LOG_ASSERT,
|
||||
"Entity Teleport Detected! Type: %d, Variant: %d, Subtype: %d; Pos: %f, %f; Size: %f, %f\n",
|
||||
entity.type, entity.variant, entity.subtype, entity.pos.x, entity.pos.y, halfWidth, halfHeight);
|
||||
|
||||
int firstRow = (int)(top / cellSize);
|
||||
int lastRow = (int)(bottom / cellSize);
|
||||
if (lastRow < firstRow) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"CellSpace::insert: y1 > y2\n");
|
||||
int firstColumn = (int)(left / cellSize);
|
||||
int lastColumn = (int)(right / cellSize);
|
||||
if (lastColumn < firstColumn) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"CellSpace::insert: x1 > x2\n");
|
||||
|
||||
for (int row = firstRow; row <= lastRow; row++)
|
||||
{
|
||||
for (int column = firstColumn; column <= lastColumn; column++)
|
||||
{
|
||||
Cell* cell = cell_get(column, row);
|
||||
if (cell && cell->count < CELL_CAPACITY) cell->entities[cell->count++] = &entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0041bdf0 Pushes the entities in the cells under the entity's box off it, each pair once a frame.
|
||||
void CellSpace::collide_entity(Entity& entity)
|
||||
{
|
||||
if (entity.entityCollisionClass == ENTCOLL_NONE) return;
|
||||
|
||||
float halfWidth = entity.size * entity.sizeMulti.x;
|
||||
float halfHeight = entity.size * entity.sizeMulti.y;
|
||||
int lastRow = (int)((halfHeight + entity.pos.y) / cellSize);
|
||||
int lastColumn = (int)((halfWidth + entity.pos.x) / cellSize);
|
||||
for (int row = (int)((entity.pos.y - halfHeight) / cellSize); row <= lastRow; row++)
|
||||
{
|
||||
for (int column = (int)((entity.pos.x - halfWidth) / cellSize); column <= lastColumn; column++)
|
||||
{
|
||||
Cell* cell = cell_get(column, row);
|
||||
for (int i = 0; cell && i < cell->count; i++)
|
||||
{
|
||||
Entity& other = *cell->entities[i];
|
||||
if (&other == &entity || !owner->is_pair_new(other, entity)) continue;
|
||||
entity_push_apart(other, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0041c070 Pushes this partition's entities off the other's that share their cells, each pair once a frame.
|
||||
void CellSpace::collide(CellSpace& other)
|
||||
{
|
||||
if (cells.size() != other.cells.size())
|
||||
KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"CellSpace::collide - cell counts don't match!\n");
|
||||
|
||||
for (size_t c = 0; c < std::min(cells.size(), other.cells.size()); c++)
|
||||
{
|
||||
for (int i = 0; i < cells[c].count; i++)
|
||||
{
|
||||
for (int j = 0; j < other.cells[c].count; j++)
|
||||
{
|
||||
Entity& first = *cells[c].entities[i];
|
||||
Entity& second = *other.cells[c].entities[j];
|
||||
if (&first != &second && owner->is_pair_new(first, second)) entity_push_apart(first, second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0041c2a0 Pushes the entities sharing each cell off each other, each pair once a frame.
|
||||
void CellSpace::collide_self()
|
||||
{
|
||||
for (Cell& cell : cells)
|
||||
{
|
||||
for (int i = 0; i < cell.count; i++)
|
||||
{
|
||||
for (int j = i + 1; j < cell.count; j++)
|
||||
{
|
||||
Entity& first = *cell.entities[i];
|
||||
Entity& second = *cell.entities[j];
|
||||
if (&first != &second && owner->is_pair_new(first, second)) entity_push_apart(first, second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0041c490 Adds the entities listed in the cells under a box to the result, each once.
|
||||
void CellSpace::query_box(EntityList_EL& result, const Vector& position, const Vector& extent)
|
||||
{
|
||||
if (owner->collisionPairStride == 0) return;
|
||||
|
||||
std::vector<bool> isSeen((size_t)owner->collisionPairStride);
|
||||
int lastRow = (int)((extent.y + position.y) / cellSize);
|
||||
int firstColumn = (int)((position.x - extent.x) / cellSize);
|
||||
int lastColumn = (int)((extent.x + position.x) / cellSize);
|
||||
for (int row = (int)((position.y - extent.y) / cellSize); row <= lastRow; row++)
|
||||
{
|
||||
for (int column = firstColumn; column <= lastColumn; column++)
|
||||
{
|
||||
Cell* cell = cell_get(column, row);
|
||||
for (int i = 0; cell && i < cell->count; i++)
|
||||
{
|
||||
Entity* entity = cell->entities[i];
|
||||
if (isSeen[entity->collisionIndex]) continue;
|
||||
result.push_back(entity);
|
||||
isSeen[entity->collisionIndex] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Whether the pair has not collided yet this frame, marking it as collided.
|
||||
bool EntityList::is_pair_new(Entity& first, Entity& second)
|
||||
{
|
||||
uint32_t high = std::max(first.collisionIndex, second.collisionIndex);
|
||||
uint32_t low = std::min(first.collisionIndex, second.collisionIndex);
|
||||
size_t pair = (size_t)high * (size_t)collisionPairStride + low;
|
||||
if (pair >= collisionPairs.size() || collisionPairs[pair]) return false;
|
||||
|
||||
collisionPairs[pair] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
EntityList::EntityList()
|
||||
{
|
||||
for (CellSpace& partition : partitions)
|
||||
partition.layout(*this, PARTITION_WIDTH, PARTITION_HEIGHT, PARTITION_CELL_SIZE);
|
||||
shadowImage = Manager::LoadImage(SHADOW_PNG);
|
||||
Reset();
|
||||
}
|
||||
|
||||
// 00418230 Removes every entity but the persistent ones, and starts the lists over with those.
|
||||
void EntityList::Reset()
|
||||
{
|
||||
updateEL.clear();
|
||||
renderEL.clear();
|
||||
effectEL.clear();
|
||||
for (Entity* entity : mainEL)
|
||||
{
|
||||
if (entity->HasEntityFlags(FLAG_PERSISTENT))
|
||||
{
|
||||
updateEL.push_back(entity);
|
||||
renderEL.push_back(entity);
|
||||
continue;
|
||||
}
|
||||
entity->ClearReferences();
|
||||
entity->isValid = false;
|
||||
entity->Remove();
|
||||
}
|
||||
mainEL.assign(updateEL.begin(), updateEL.end());
|
||||
wispEL.clear();
|
||||
for (Entity* entity : persistentEL)
|
||||
{
|
||||
updateEL.push_back(entity);
|
||||
renderEL.push_back(entity);
|
||||
}
|
||||
for (Entity* entity : updateEL)
|
||||
if (entity->type == ENTITY_FAMILIAR && entity->variant == FAMILIAR_WISP) wispEL.push_back(entity);
|
||||
|
||||
renderCursor = 0;
|
||||
renderMode = RENDER_NULL;
|
||||
pendingEnemyCount = 0;
|
||||
enemyCount = 0;
|
||||
pendingBossCount = 0;
|
||||
bossCount = 0;
|
||||
bossMaxHealth = 0;
|
||||
enemyDamageInflicted = 0;
|
||||
isAnyBaited = false;
|
||||
typeCache.clear();
|
||||
}
|
||||
|
||||
// 00418500 Adds a new entity to its lists, the render list in depth order, counting the enemies that shut the doors.
|
||||
// One already listed moves to the end of the update list.
|
||||
void EntityList::AddEntity(Entity* entity)
|
||||
{
|
||||
if (!entity->isValid)
|
||||
{
|
||||
bool isPersistent = entity->type == ENTITY_PLAYER || entity->type == ENTITY_FAMILIAR ||
|
||||
(entity->type == ENTITY_KNIFE && entity->subtype == KNIFE_MAIN);
|
||||
(isPersistent ? persistentEL : mainEL).push_back(entity);
|
||||
if (entity->CanShutDoors() && entity->type != ENTITY_DARK_ESAU)
|
||||
{
|
||||
pendingEnemyCount++;
|
||||
if (entity->IsBoss()) pendingBossCount++;
|
||||
}
|
||||
entity->isValid = true;
|
||||
|
||||
size_t at = 0;
|
||||
while (at < renderEL.size() && entity->GetRenderZ() > renderEL[at]->GetRenderZ()) at++;
|
||||
renderEL.insert(renderEL.begin() + (long)at, entity);
|
||||
if (entity->type == ENTITY_FAMILIAR && entity->variant == FAMILIAR_WISP) wispEL.push_back(entity);
|
||||
}
|
||||
else
|
||||
updateEL.remove(entity);
|
||||
|
||||
if (!entity->HasEntityFlags(FLAG_RENDER_FLOOR)) updateEL.push_back(entity);
|
||||
invalidate_type_cache(entity->type, entity->variant, entity->subtype);
|
||||
}
|
||||
|
||||
// 0041b4f0 Moves an entity to the persistent list, unless that list is nearly full.
|
||||
void EntityList::AddPersistentEntity(Entity* entity)
|
||||
{
|
||||
if (persistentEL.size() + PERSISTENT_RESERVE >= PERSISTENT_CAPACITY)
|
||||
{
|
||||
KAGE_LogMessage(LOG_INFO, (uint8_t*)"[warn] Can't add more persistent entities, persistent list is full!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
mainEL.remove(entity);
|
||||
bool isListed = std::find(persistentEL.begin(), persistentEL.end(), entity) != persistentEL.end();
|
||||
if (!isListed) persistentEL.push_back(entity);
|
||||
}
|
||||
|
||||
// 004186c0 One frame of the room's entities: pre-updates and updates (only those that update in transitions during
|
||||
// one), the players' in-between updates without interpolation, the enemy and boss counts and the boss bar, the
|
||||
// removal of the entities that stopped existing, then the collisions and the draw order.
|
||||
// Netplay's per-entity checksums are left out: netplay is offline.
|
||||
void EntityList::Update(UpdateMode mode)
|
||||
{
|
||||
typeCache.clear();
|
||||
UpdateTally tally;
|
||||
if (updateEL.empty()) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"EntityList: e_update is empty!\n");
|
||||
else entities_update(mode, tally);
|
||||
|
||||
for (Entity_Player* player : g_game->playerManager.extraPlayers) player->Update();
|
||||
if (!g_manager->optionsConfig.render.isInterpolationEnabled) players_update(mode);
|
||||
|
||||
enemyCount = pendingEnemyCount + tally.activeEnemies;
|
||||
pendingEnemyCount = 0;
|
||||
bossCount = pendingBossCount + tally.bosses;
|
||||
pendingBossCount = 0;
|
||||
isAnyBaited = tally.isAnyBaited;
|
||||
boss_bar_update(tally);
|
||||
enemyDamageInflicted = tally.damageInflicted;
|
||||
for (Entity* entity : renderEL)
|
||||
{
|
||||
if (entity->isExists && entity->HasEntityFlags(FLAG_RENDER_FLOOR | FLAG_RENDER_WALL))
|
||||
reconstruction_missing("EntityList::Update 004186c0: drawing entities into the floor and wall surfaces");
|
||||
}
|
||||
|
||||
if (tally.isAnyRemoved) removed_drop();
|
||||
if (mode == UPDATE_NORMAL) rebuild_sublists();
|
||||
sort_by_render_z();
|
||||
}
|
||||
|
||||
// Whether the entity sits this update out: drawn into the floor or walls and gone, or still during a transition.
|
||||
static bool is_update_skipped(Entity& entity, UpdateMode mode)
|
||||
{
|
||||
bool isDrawnAway = entity.HasEntityFlags(FLAG_RENDER_FLOOR) && !entity.HasEntityFlags(FLAG_NO_REMOVE_ON_TEX_RENDER);
|
||||
return isDrawnAway || (mode == UPDATE_TRANSITION && !entity.HasEntityFlags(FLAG_TRANSITION_UPDATE));
|
||||
}
|
||||
|
||||
// The damage an enemy has taken so far, which the frame's total compares before and after its update.
|
||||
static float damage_taken_get(Entity& entity)
|
||||
{
|
||||
if (!Entity::is_enemy_type(entity.type)) return 0;
|
||||
if (entity.type == ENTITY_PLAYER) reconstruction_missing("EntityList::Update 004186c0: a versus player's damage");
|
||||
return static_cast<Entity_NPC&>(entity).totalDamageTaken;
|
||||
}
|
||||
|
||||
// Pre-updates then updates the entities listed at the start of the frame, tallying the door-holding enemies, the
|
||||
// bosses and their health, the damage the enemies took, and whether any is baited or stopped existing.
|
||||
void EntityList::entities_update(UpdateMode mode, UpdateTally& tally)
|
||||
{
|
||||
Entity* last = updateEL.back();
|
||||
for (size_t i = 0;; i++)
|
||||
{
|
||||
Entity* entity = updateEL[i];
|
||||
if (entity->isExists && !is_update_skipped(*entity, mode)) entity->PreUpdate();
|
||||
if (entity == last || i + 1 >= updateEL.size()) break;
|
||||
}
|
||||
|
||||
for (size_t i = 0;; i++)
|
||||
{
|
||||
Entity* entity = updateEL[i];
|
||||
float damageBefore = damage_taken_get(*entity);
|
||||
|
||||
if (entity->isExists && !is_update_skipped(*entity, mode)) entity->Update();
|
||||
if (entity->isExists && entity->type != ENTITY_DARK_ESAU)
|
||||
{
|
||||
if (entity->CanShutDoors())
|
||||
{
|
||||
tally.activeEnemies++;
|
||||
if (entity->IsBoss() && !entity->HasEntityFlags(FLAG_BOSSDEATH_TRIGGERED))
|
||||
{
|
||||
bool isCounted = !entity->HasEntityFlags(FLAG_DONT_COUNT_BOSS_HP);
|
||||
if (isCounted) tally.bosses++;
|
||||
if (isCounted && entity->FrameCount() > 0)
|
||||
{
|
||||
tally.bossHealth += std::max(entity->health, 0.0f);
|
||||
tally.bossMaxHealth = entity->maxHitPoints + tally.bossMaxHealth;
|
||||
}
|
||||
}
|
||||
if (entity->type == ENTITY_EFFECT && entity->variant == EFFECT_SPAWN_PENTAGRAM)
|
||||
{
|
||||
Entity_Effect& pentagram = static_cast<Entity_Effect&>(*entity);
|
||||
EntityConfig_Entity* spawned = g_manager->entityConfig.GetEntity(
|
||||
pentagram.spawnType, pentagram.spawnVariant, pentagram.spawnSubtype);
|
||||
if (spawned && spawned->isBoss) tally.bosses++;
|
||||
}
|
||||
}
|
||||
|
||||
bool isDamageCounted = (entity->CanShutDoors() || entity->type == ENTITY_FROZEN_ENEMY) &&
|
||||
(Entity::is_enemy_type(entity->type) || entity->type == ENTITY_FROZEN_ENEMY) &&
|
||||
!entity->IsFriendly();
|
||||
bool isTrailingSegment = entity->type == ENTITY_PIN && entity->parent && entity->GetLastParent() != entity;
|
||||
if (isDamageCounted && !isTrailingSegment)
|
||||
{
|
||||
float damageAfter = std::min(damage_taken_get(*entity), entity->maxHitPoints);
|
||||
tally.damageInflicted += std::max(damageAfter - damageBefore, 0.0f);
|
||||
}
|
||||
}
|
||||
if (!entity->isExists) tally.isAnyRemoved = true;
|
||||
if (entity->HasEntityFlags(FLAG_BAITED)) tally.isAnyBaited = true;
|
||||
if (entity == last || i + 1 >= updateEL.size()) break;
|
||||
}
|
||||
}
|
||||
|
||||
// Updates the players and extra players a second time, flagged as the in-between frame, when the options turn
|
||||
// interpolation off.
|
||||
void EntityList::players_update(UpdateMode mode)
|
||||
{
|
||||
std::vector<Entity_Player*>& players = g_game->playerManager.playerList;
|
||||
for (size_t i = 0; i < players.size(); i++)
|
||||
{
|
||||
Entity_Player* player = players[i];
|
||||
if (mode == UPDATE_TRANSITION && !player->HasEntityFlags(FLAG_TRANSITION_UPDATE)) continue;
|
||||
|
||||
player->AddEntityFlags(FLAG_INTERPOLATION_UPDATE);
|
||||
player->Update();
|
||||
player->PlayerCollideWithGrid(GRID_COLLISION_APPLY);
|
||||
player->ClearEntityFlags(FLAG_INTERPOLATION_UPDATE);
|
||||
}
|
||||
for (Entity_Player* player : g_game->playerManager.extraPlayers)
|
||||
{
|
||||
player->AddEntityFlags(FLAG_INTERPOLATION_UPDATE);
|
||||
player->Update();
|
||||
player->ClearEntityFlags(FLAG_INTERPOLATION_UPDATE);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the boss bar to the bosses' share of health left, against the most health they have had, flashing it on a
|
||||
// change. Without bosses the bar hides.
|
||||
void EntityList::boss_bar_update(const UpdateTally& tally)
|
||||
{
|
||||
HUD& hud = g_game->hud;
|
||||
float fill = BOSS_BAR_HIDDEN;
|
||||
|
||||
if (tally.bosses < 1)
|
||||
{
|
||||
bossMaxHealth = 0;
|
||||
if (hud.bossHPBarFill > BOSS_BAR_HIDDEN) hud.bossHPBarDamageFlash = BOSS_BAR_FLASH_FRAMES;
|
||||
}
|
||||
else
|
||||
{
|
||||
bossMaxHealth = std::max(tally.bossMaxHealth, bossMaxHealth);
|
||||
fill = tally.bossHealth / bossMaxHealth;
|
||||
if (fill < hud.bossHPBarFill) hud.bossHPBarDamageFlash = BOSS_BAR_FLASH_FRAMES;
|
||||
}
|
||||
if (hud.bossHPBarFill < fill && hud.bossHPBarFill != BOSS_BAR_HIDDEN)
|
||||
{
|
||||
hud.bossHPBarDamageFlash = FLASH_OFF;
|
||||
hud.bossHPBarHealFlash = BOSS_BAR_FLASH_FRAMES;
|
||||
}
|
||||
hud.bossHPBarFill = fill;
|
||||
}
|
||||
|
||||
// Drops the entities that stopped existing from every list, unlinking them, and frees a removed player.
|
||||
void EntityList::removed_drop()
|
||||
{
|
||||
auto isGone = [](Entity* entity) { return !entity->isExists; };
|
||||
|
||||
std::erase_if(updateEL, isGone);
|
||||
std::erase_if(renderEL, isGone);
|
||||
std::erase_if(wispEL, isGone);
|
||||
std::erase_if(mainEL,
|
||||
[](Entity* entity)
|
||||
{
|
||||
if (entity->isExists) return false;
|
||||
entity->ClearReferences();
|
||||
entity->isValid = false;
|
||||
return true;
|
||||
});
|
||||
std::erase_if(persistentEL,
|
||||
[](Entity* entity)
|
||||
{
|
||||
if (entity->isExists) return false;
|
||||
bool wasValid = entity->isValid;
|
||||
entity->ClearReferences();
|
||||
entity->isValid = false;
|
||||
if (entity->type == ENTITY_PLAYER && wasValid) delete entity;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// 00419e70 Sorts the colliding entities into the partitions, collides the partitions that touch, pushes twins apart,
|
||||
// then collides everything but lasers with the grid.
|
||||
void EntityList::rebuild_sublists()
|
||||
{
|
||||
effectEL.clear();
|
||||
for (CellSpace& partition : partitions) partition.clear();
|
||||
|
||||
bool isShieldPresent = false;
|
||||
uint32_t indexCount = 0;
|
||||
for (Entity* entity : updateEL)
|
||||
{
|
||||
entity->isCollidesWithEntity = false;
|
||||
if (entity->entityCollisionClass == ENTCOLL_NONE) continue;
|
||||
|
||||
int type = entity->type;
|
||||
bool isIndexed = true;
|
||||
if (type == ENTITY_FAMILIAR && entity->variant == FAMILIAR_CUBE_BABY)
|
||||
{
|
||||
partitions[PARTITION_ENEMIES].insert(*entity);
|
||||
partitions[PARTITION_ENEMY_TARGETS].insert(*entity);
|
||||
}
|
||||
else if (type == ENTITY_FAMILIAR)
|
||||
partitions[PARTITION_FAMILIARS].insert(*entity);
|
||||
else if (type == ENTITY_PROJECTILE)
|
||||
{
|
||||
uint64_t projectileFlags = static_cast<Entity_Projectile*>(entity)->projectileFlags;
|
||||
partitions[PARTITION_PROJECTILES].insert(*entity);
|
||||
if (projectileFlags & PROJECTILE_SHIELDED) isShieldPresent = true;
|
||||
if (projectileFlags & PROJECTILE_HIT_ENEMIES) partitions[PARTITION_ENEMY_HITTERS].insert(*entity);
|
||||
}
|
||||
else if (type == ENTITY_TEAR || type == ENTITY_KNIFE)
|
||||
{
|
||||
bool isShieldTear = type == ENTITY_TEAR && static_cast<Entity_Tear*>(entity)->tearFlags[TEAR_SHIELDED];
|
||||
if (isShieldTear) isShieldPresent = true;
|
||||
partitions[PARTITION_SHOTS].insert(*entity);
|
||||
}
|
||||
else if (Entity::is_enemy_type(type) || type == ENTITY_BOMB)
|
||||
{
|
||||
partitions[PARTITION_ENEMIES].insert(*entity);
|
||||
bool isRocketVariant = entity->variant == BOMB_ROCKET || entity->variant == BOMB_ROCKET_GIGA;
|
||||
bool isRocket = type == ENTITY_BOMB && isRocketVariant;
|
||||
bool isPickupTaker = type == ENTITY_ULTRA_GREED || type == ENTITY_BUMBINO || isRocket;
|
||||
if (isPickupTaker) partitions[PARTITION_PICKUP_TAKERS].insert(*entity);
|
||||
bool isTargetable = entity->IsFriendly() || type == ENTITY_POOP || type == ENTITY_FROZEN_ENEMY ||
|
||||
entity->HasEntityFlags(FLAG_BAITED) || type == ENTITY_BLOOD_PUPPY ||
|
||||
type == ENTITY_DARK_ESAU;
|
||||
if (isTargetable) partitions[PARTITION_ENEMY_TARGETS].insert(*entity);
|
||||
}
|
||||
else if (type == ENTITY_PICKUP || type == ENTITY_SLOT)
|
||||
partitions[PARTITION_PICKUPS].insert(*entity);
|
||||
else
|
||||
isIndexed = type == ENTITY_PLAYER;
|
||||
|
||||
if (isIndexed) entity->collisionIndex = indexCount++;
|
||||
if (type == ENTITY_EFFECT) effectEL.push_back(entity);
|
||||
}
|
||||
|
||||
collisionPairs.assign((size_t)indexCount * indexCount, false);
|
||||
collisionPairStride = (int)indexCount;
|
||||
|
||||
std::vector<Entity_Player*>& players = g_game->playerManager.playerList;
|
||||
bool isVersus = g_game->deathmatchManager.is_active();
|
||||
auto playersCollide = [&players](CellSpace& partition)
|
||||
{
|
||||
for (Entity_Player* player : players) partition.collide_entity(*player);
|
||||
};
|
||||
|
||||
CellSpace& familiars = partitions[PARTITION_FAMILIARS];
|
||||
CellSpace& shots = partitions[PARTITION_SHOTS];
|
||||
CellSpace& enemies = partitions[PARTITION_ENEMIES];
|
||||
CellSpace& projectiles = partitions[PARTITION_PROJECTILES];
|
||||
CellSpace& pickups = partitions[PARTITION_PICKUPS];
|
||||
if (isVersus)
|
||||
{
|
||||
familiars.collide(shots);
|
||||
shots.collide(shots);
|
||||
}
|
||||
familiars.collide(projectiles);
|
||||
familiars.collide(enemies);
|
||||
playersCollide(familiars);
|
||||
shots.collide(enemies);
|
||||
enemies.collide_self();
|
||||
playersCollide(enemies);
|
||||
playersCollide(projectiles);
|
||||
playersCollide(pickups);
|
||||
if (isVersus) playersCollide(shots);
|
||||
pickups.collide_self();
|
||||
pickups.collide(partitions[PARTITION_PICKUP_TAKERS]);
|
||||
partitions[PARTITION_ENEMY_HITTERS].collide(enemies);
|
||||
if (isShieldPresent) projectiles.collide(shots);
|
||||
partitions[PARTITION_ENEMY_TARGETS].collide(projectiles);
|
||||
partitions[PARTITION_ENEMY_TARGETS].collide(enemies);
|
||||
twins_push_apart();
|
||||
|
||||
for (Entity* entity : updateEL)
|
||||
{
|
||||
if (entity->type == ENTITY_LASER) continue;
|
||||
if (entity->type == ENTITY_PLAYER) entity->PlayerCollideWithGrid(GRID_COLLISION_APPLY);
|
||||
else entity->CollideWithGrid(GRID_COLLISION_APPLY);
|
||||
}
|
||||
}
|
||||
|
||||
// Pushes each pair of twin players apart once, the order alternating every frame.
|
||||
void EntityList::twins_push_apart()
|
||||
{
|
||||
for (Entity_Player* player : g_game->playerManager.playerList)
|
||||
{
|
||||
Entity_Player* twin = static_cast<Entity_Player*>(player->twinPlayer.get());
|
||||
if (!twin) continue;
|
||||
if (twin->playerIndex != -1 && player->playerIndex > twin->playerIndex && twin != player) continue;
|
||||
|
||||
bool isEvenFrame = (g_game->frameCount & 1) == 0;
|
||||
entity_push_apart(isEvenFrame ? *player : *twin, isEvenFrame ? *twin : *player);
|
||||
entity_push_apart(isEvenFrame ? *twin : *player, isEvenFrame ? *player : *twin);
|
||||
}
|
||||
}
|
||||
|
||||
// 00419750 Puts the render list back in draw order: one pass moves the normal layer behind the rest, another the
|
||||
// door layer behind the background, then an insertion sort runs with a swap budget, its direction alternating every
|
||||
// frame.
|
||||
void EntityList::sort_by_render_z()
|
||||
{
|
||||
if (renderEL.empty()) return;
|
||||
|
||||
std::vector<uint32_t> depths(renderEL.size());
|
||||
auto swap = [&](int a, int b)
|
||||
{
|
||||
std::swap(renderEL[a], renderEL[b]);
|
||||
std::swap(depths[a], depths[b]);
|
||||
};
|
||||
|
||||
int low = 0;
|
||||
int high = (int)renderEL.size() - 1;
|
||||
for (; low < high; high--)
|
||||
{
|
||||
depths[high] = (uint32_t)renderEL[high]->GetRenderZ();
|
||||
if (depths[high] >= RENDER_Z_NORMAL_START) continue;
|
||||
for (; low < high; low++)
|
||||
{
|
||||
depths[low] = (uint32_t)renderEL[low]->GetRenderZ();
|
||||
if (depths[low] < RENDER_Z_NORMAL_START) continue;
|
||||
swap(low, high);
|
||||
break;
|
||||
}
|
||||
}
|
||||
depths[low] = (uint32_t)renderEL[low]->GetRenderZ();
|
||||
|
||||
int count = (int)renderEL.size();
|
||||
int doorHigh = count - 1 <= high ? high : high + 1;
|
||||
for (low = 0; low < doorHigh; doorHigh--)
|
||||
{
|
||||
if (depths[doorHigh] >= RENDER_Z_DOOR_START) continue;
|
||||
for (; low < doorHigh; low++)
|
||||
{
|
||||
if (depths[low] < RENDER_Z_DOOR_START) continue;
|
||||
swap(low, doorHigh);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int budget = RENDER_SORT_SWAP_BUDGET;
|
||||
if ((g_game->frameCount & 1) == 0)
|
||||
{
|
||||
for (int i = 1; i < count && budget > 0; i++)
|
||||
{
|
||||
for (int j = i; j > 0 && depths[j - 1] > depths[j]; j--, budget--) swap(j, j - 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (int i = count - 1; i > 0 && budget > 0; i--)
|
||||
{
|
||||
for (int j = i; j < count && depths[j - 1] > depths[j]; j++, budget--) swap(j, j - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 004199d0 Draws the render list from the cursor up to a depth, as the room's render pass asks: normally, or only
|
||||
// what shows above, through or mirrored in its water.
|
||||
void EntityList::render_up_to(uint32_t maxDepth, const Vector& offset)
|
||||
{
|
||||
for (; renderCursor < renderEL.size(); renderCursor++)
|
||||
{
|
||||
Entity* entity = renderEL[renderCursor];
|
||||
if ((uint32_t)entity->GetRenderZ() >= maxDepth) return;
|
||||
if (renderMode == RENDER_SKIP) continue;
|
||||
if (renderMode >= RENDER_WATER_ABOVE && renderMode <= RENDER_WATER_REFLECT)
|
||||
reconstruction_missing("EntityList::render_up_to 004199d0: the water passes (get_water_splash_variant)");
|
||||
entity->Render(offset);
|
||||
}
|
||||
}
|
||||
|
||||
// 0041b570 Forgets the cached queries an entity of the type, variant and subtype now belongs to.
|
||||
void EntityList::invalidate_type_cache(int type, int variant, int subType)
|
||||
{
|
||||
typeCache.erase({type, variant, subType});
|
||||
typeCache.erase({type, variant, -1});
|
||||
typeCache.erase({type, -1, -1});
|
||||
}
|
||||
|
||||
// 0041b7b0 (0041b690) How many entities updating match the type, variant and subtype (negatives match any), spawned
|
||||
// by the spawner when one is given. With a spawner a type of 0 matches any too.
|
||||
int EntityList::CountEntities(Entity* spawner, int type, int variant, int subType)
|
||||
{
|
||||
return (int)std::count_if(updateEL.begin(), updateEL.end(),
|
||||
[&](Entity* entity)
|
||||
{
|
||||
bool isTypeMatch = entity->type == type || (spawner && type == 0);
|
||||
return isTypeMatch && (variant < 0 || entity->variant == variant) &&
|
||||
(subType < 0 || entity->subtype == subType) &&
|
||||
(!spawner || entity->spawnerEntity.get() == spawner);
|
||||
});
|
||||
}
|
||||
|
||||
// 00431640 Whether a sorted hit list holds the entity's hit index.
|
||||
bool EntityList::HitListContains(const std::vector<uint32_t>& hitList, Entity& entity)
|
||||
{
|
||||
return std::binary_search(hitList.begin(), hitList.end(), entity.GetHitListIndex());
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include "kage_graphics.h"
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
// A partition's grid: cells of CELL_SIZE over the room's widest area, each holding up to CELL_CAPACITY entities.
|
||||
constexpr float PARTITION_WIDTH = 1200;
|
||||
constexpr float PARTITION_HEIGHT = 720;
|
||||
constexpr float PARTITION_CELL_SIZE = 80;
|
||||
constexpr int CELL_CAPACITY = 40;
|
||||
// The persistent list refuses new entities this close to its capacity.
|
||||
constexpr size_t PERSISTENT_CAPACITY = 0x100;
|
||||
constexpr size_t PERSISTENT_RESERVE = 50;
|
||||
|
||||
// The partitions EntityList sorts colliding entities into, by what they collide with.
|
||||
enum Partition : int
|
||||
{
|
||||
PARTITION_FAMILIARS,
|
||||
PARTITION_SHOTS,
|
||||
PARTITION_ENEMIES,
|
||||
PARTITION_PROJECTILES,
|
||||
PARTITION_PICKUPS,
|
||||
PARTITION_ENEMY_HITTERS,
|
||||
PARTITION_PICKUP_TAKERS,
|
||||
PARTITION_ENEMY_TARGETS,
|
||||
PARTITION_COUNT
|
||||
};
|
||||
|
||||
// How the room draws its entities (Lua's RenderMode): normally, or in one of its water's passes.
|
||||
enum RenderMode : int
|
||||
{
|
||||
RENDER_NULL,
|
||||
RENDER_NORMAL,
|
||||
RENDER_SKIP,
|
||||
RENDER_WATER_ABOVE,
|
||||
RENDER_WATER_REFRACT,
|
||||
RENDER_WATER_REFLECT
|
||||
};
|
||||
|
||||
// Whether EntityList::Update runs during a room transition, when only some entities update.
|
||||
enum UpdateMode
|
||||
{
|
||||
UPDATE_NORMAL,
|
||||
UPDATE_TRANSITION
|
||||
};
|
||||
|
||||
// Construction from another list, push_back, sizing and copying (00417510, 00417630, 00417540, 004176f0, 006b8320)
|
||||
// are std::vector's.
|
||||
// A list of entities (Lua's EntityList): one of EntityList's own, or a query's result.
|
||||
struct EntityList_EL : std::vector<Entity*>
|
||||
{
|
||||
void remove(Entity* entity);
|
||||
Entity* Get(uint32_t index);
|
||||
};
|
||||
|
||||
struct EntityList;
|
||||
|
||||
// What one frame's updates counted, which EntityList::Update applies once every update ran.
|
||||
struct UpdateTally
|
||||
{
|
||||
float bossHealth = 0;
|
||||
float bossMaxHealth = 0;
|
||||
float damageInflicted = 0;
|
||||
int activeEnemies = 0;
|
||||
int bosses = 0;
|
||||
bool isAnyBaited = false;
|
||||
bool isAnyRemoved = false;
|
||||
};
|
||||
|
||||
// 0041b9f0 Construction lays the grid out.
|
||||
// One of EntityList's partitions: a grid of cells over the room, each listing the colliding entities whose box covers
|
||||
// it, so that only entities sharing a cell are tested against each other.
|
||||
struct CellSpace
|
||||
{
|
||||
// A cell's entities, the ones past CELL_CAPACITY dropped.
|
||||
struct Cell
|
||||
{
|
||||
std::array<Entity*, CELL_CAPACITY> entities{};
|
||||
int count = 0;
|
||||
};
|
||||
|
||||
std::vector<Cell> cells;
|
||||
EntityList* owner = nullptr;
|
||||
float cellSize = PARTITION_CELL_SIZE;
|
||||
int columns = 0;
|
||||
int rows = 0;
|
||||
|
||||
void layout(EntityList& list, float width, float height, float size);
|
||||
void clear();
|
||||
void insert(Entity& entity);
|
||||
void collide_entity(Entity& entity);
|
||||
void collide(CellSpace& other);
|
||||
void collide_self();
|
||||
void query_box(EntityList_EL& result, const Vector& position, const Vector& extent);
|
||||
Cell* cell_get(int column, int row);
|
||||
};
|
||||
|
||||
// Construction (00417930, which Room's constructor ran) lays out the partitions, loads the shadow image and resets.
|
||||
// The entities of a room (Room::entityList): every one spawned there, which of them update and draw in what order,
|
||||
// the partitions their collisions run through, and the counts of enemies and bosses the doors and the boss bar read.
|
||||
// Persistent entities (players, familiars, the main knife) survive Reset. Its queries cache results by type until an
|
||||
// entity of that type is added.
|
||||
struct EntityList
|
||||
{
|
||||
std::array<CellSpace, PARTITION_COUNT> partitions;
|
||||
EntityList_EL effectEL;
|
||||
EntityList_EL mainEL;
|
||||
EntityList_EL persistentEL;
|
||||
EntityList_EL renderEL;
|
||||
EntityList_EL updateEL;
|
||||
EntityList_EL wispEL;
|
||||
std::map<std::array<int, 3>, EntityList_EL> typeCache;
|
||||
std::vector<bool> collisionPairs;
|
||||
KAGE::Graphics::ImagePtr shadowImage;
|
||||
float bossMaxHealth = 0;
|
||||
float enemyDamageInflicted = 0;
|
||||
int bossCount = 0;
|
||||
int collisionPairStride = 0;
|
||||
int enemyCount = 0;
|
||||
int pendingBossCount = 0;
|
||||
int pendingEnemyCount = 0;
|
||||
RenderMode renderMode = RENDER_NULL;
|
||||
uint32_t renderCursor = 0;
|
||||
bool isAnyBaited = false;
|
||||
|
||||
EntityList();
|
||||
EntityList(const EntityList&) = delete;
|
||||
EntityList& operator=(const EntityList&) = delete;
|
||||
|
||||
void Reset();
|
||||
void AddEntity(Entity* entity);
|
||||
void AddPersistentEntity(Entity* entity);
|
||||
void Update(UpdateMode mode);
|
||||
void rebuild_sublists();
|
||||
void sort_by_render_z();
|
||||
void render_up_to(uint32_t maxDepth, const Vector& offset);
|
||||
void invalidate_type_cache(int type, int variant, int subType);
|
||||
int CountEntities(Entity* spawner, int type, int variant, int subType);
|
||||
static bool HitListContains(const std::vector<uint32_t>& hitList, Entity& entity);
|
||||
bool is_pair_new(Entity& first, Entity& second);
|
||||
|
||||
private:
|
||||
void entities_update(UpdateMode mode, UpdateTally& tally);
|
||||
void players_update(UpdateMode mode);
|
||||
void boss_bar_update(const UpdateTally& tally);
|
||||
void removed_drop();
|
||||
void twins_push_apart();
|
||||
};
|
||||
@@ -0,0 +1,536 @@
|
||||
#include "entity_npc.h"
|
||||
#include "game.h"
|
||||
#include "room.h"
|
||||
#include "log.h"
|
||||
|
||||
constexpr int ENTITY_EXORCIST = 832;
|
||||
|
||||
// 006c4ac0 Remembers where it was, and keeps the Exorcist's room in its state while it lives.
|
||||
void Entity_NPC::PreUpdate()
|
||||
{
|
||||
prevPosition = pos;
|
||||
prevVelocity = velocity;
|
||||
if (type == ENTITY_EXORCIST && variant == 0 && !isDead) g_game->room->isExorcistActive = true;
|
||||
}
|
||||
|
||||
// 006b8f00 Removes it, and the Dark Esau with it if it is the one that holds him.
|
||||
void Entity_NPC::Remove()
|
||||
{
|
||||
if (type == ENTITY_DARK_ESAU && variant == 0 && child) child->Remove();
|
||||
Entity::Remove();
|
||||
}
|
||||
|
||||
// 006b8450 Whether it holds the doors shut: one that can, unless it became friendly.
|
||||
bool Entity_NPC::CanShutDoors()
|
||||
{
|
||||
return isCanShutDoors && !IsFriendly();
|
||||
}
|
||||
|
||||
// 006b8470
|
||||
bool Entity_NPC::IsBoss()
|
||||
{
|
||||
return isBoss;
|
||||
}
|
||||
|
||||
// 006a8240 Forgets where its pathfinder was taking it.
|
||||
void Entity_NPC::ResetPathFinderTarget()
|
||||
{
|
||||
pathfinder._movementTarget = {};
|
||||
pathfinder._moveDirection = {};
|
||||
}
|
||||
|
||||
// 006d6610 Scales it, shrinking included.
|
||||
void Entity_NPC::SetScale(float newScale)
|
||||
{
|
||||
scale = newScale;
|
||||
float spriteScale = newScale * shrinkStatus1;
|
||||
sprite.scale = vector_make(spriteScale, spriteScale);
|
||||
}
|
||||
|
||||
// The rest of Entity_NPC is not reconstructed yet.
|
||||
|
||||
// 006b8b20
|
||||
void Entity_NPC::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Init 006b8b20");
|
||||
}
|
||||
|
||||
// 006c4b30
|
||||
void Entity_NPC::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Update 006c4b30");
|
||||
}
|
||||
|
||||
// 006d2b50
|
||||
void Entity_NPC::Interpolate()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Interpolate 006d2b50");
|
||||
}
|
||||
|
||||
// 006d2e50
|
||||
void Entity_NPC::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Render 006d2e50");
|
||||
}
|
||||
|
||||
// 006d4840
|
||||
bool Entity_NPC::RenderShadowLayer(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::RenderShadowLayer 006d4840");
|
||||
}
|
||||
|
||||
// 006d60a0
|
||||
bool Entity_NPC::TakeDamage(float, uint64_t, const EntityRef&, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::TakeDamage 006d60a0");
|
||||
}
|
||||
|
||||
// 006be6f0
|
||||
void Entity_NPC::Kill(const EntityRef&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Kill 006be6f0");
|
||||
}
|
||||
|
||||
// 006b8f30
|
||||
void Entity_NPC::ClearReferences()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ClearReferences 006b8f30");
|
||||
}
|
||||
|
||||
// 006d9440
|
||||
bool Entity_NPC::TryThrow(const EntityRef&, const Vector&, float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::TryThrow 006d9440");
|
||||
}
|
||||
|
||||
// 006d48a0
|
||||
Vector Entity_NPC::GetForwardVector()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::GetForwardVector 006d48a0");
|
||||
}
|
||||
|
||||
// 006cd410
|
||||
bool Entity_NPC::HandleCollision(Entity*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::HandleCollision 006cd410");
|
||||
}
|
||||
|
||||
// 006c1100
|
||||
void Entity_NPC::ResetColor()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ResetColor 006c1100");
|
||||
}
|
||||
|
||||
// 006bb790
|
||||
void Entity_NPC::LoadEntityConfig()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::LoadEntityConfig 006bb790");
|
||||
}
|
||||
|
||||
// 00447770
|
||||
Entity_NPC* Entity_NPC::ParentNPC()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ParentNPC 00447770");
|
||||
}
|
||||
|
||||
// 004567e0
|
||||
Entity_NPC* Entity_NPC::ChildNPC()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ChildNPC 004567e0");
|
||||
}
|
||||
|
||||
// 004b92e0
|
||||
void Entity_NPC::Hornfel_UpdateAI()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Hornfel_UpdateAI 004b92e0");
|
||||
}
|
||||
|
||||
// 004bb0e0
|
||||
void Entity_NPC::Hornfel_UpdateFrame()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Hornfel_UpdateFrame 004bb0e0");
|
||||
}
|
||||
|
||||
// 004cde30
|
||||
void Entity_NPC::update_physics()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::update_physics 004cde30");
|
||||
}
|
||||
|
||||
// 004ce120
|
||||
void Entity_NPC::apply_velocity(char)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::apply_velocity 004ce120");
|
||||
}
|
||||
|
||||
// 004ce6d0
|
||||
void Entity_NPC::update_move_direction_anim()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::update_move_direction_anim 004ce6d0");
|
||||
}
|
||||
|
||||
// 004cf030
|
||||
void Entity_NPC::SetMinecartPosVel(const Vector&, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::SetMinecartPosVel 004cf030");
|
||||
}
|
||||
|
||||
// 004cf120
|
||||
void Entity_NPC::MinecartUpdateChild(Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::MinecartUpdateChild 004cf120");
|
||||
}
|
||||
|
||||
// 004e8fa0
|
||||
void Entity_NPC::UpdateCordChain(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::UpdateCordChain 004e8fa0");
|
||||
}
|
||||
|
||||
// 004e9b10
|
||||
void Entity_NPC::render_overlay(const Vector&, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::render_overlay 004e9b10");
|
||||
}
|
||||
|
||||
// 00548f30
|
||||
int Entity_NPC::FindTargetPit(const Vector&, const Vector&, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::FindTargetPit 00548f30");
|
||||
}
|
||||
|
||||
// 0055cef0
|
||||
Entity_NPC* Entity_NPC::ThrowStrider(const Vector&, Entity*, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ThrowStrider 0055cef0");
|
||||
}
|
||||
|
||||
// 00565680
|
||||
void Entity_NPC::render_v1_layer_frames()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::render_v1_layer_frames 00565680");
|
||||
}
|
||||
|
||||
// 0059bed0
|
||||
void Entity_NPC::RenderSegmentLink(const Vector&, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::RenderSegmentLink 0059bed0");
|
||||
}
|
||||
|
||||
// 0059e390
|
||||
void Entity_NPC::CreateBling()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::CreateBling 0059e390");
|
||||
}
|
||||
|
||||
// 0059e4c0
|
||||
void Entity_NPC::CreateGoldParticles(uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::CreateGoldParticles 0059e4c0");
|
||||
}
|
||||
|
||||
// 0060d140
|
||||
void Entity_NPC::set_entity_ptr_f54(Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::set_entity_ptr_f54 0060d140");
|
||||
}
|
||||
|
||||
// 006b5e20
|
||||
void Entity_NPC::hold_set(int, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::hold_set 006b5e20");
|
||||
}
|
||||
|
||||
// 006b64d0
|
||||
Entity_Effect* Entity_NPC::MakeSplat(float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::MakeSplat 006b64d0");
|
||||
}
|
||||
|
||||
// 006b6830
|
||||
Entity_Effect* Entity_NPC::MakeBloodCloud(const Vector&, const ColorMod&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::MakeBloodCloud 006b6830");
|
||||
}
|
||||
|
||||
// 006b9910
|
||||
bool Entity_NPC::TryForceTarget(Entity*, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::TryForceTarget 006b9910");
|
||||
}
|
||||
|
||||
// 006b99e0
|
||||
float Entity_NPC::compute_speed_multiplier()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::compute_speed_multiplier 006b99e0");
|
||||
}
|
||||
|
||||
// 006baf40
|
||||
void Entity_NPC::load_graphics(uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::load_graphics 006baf40");
|
||||
}
|
||||
|
||||
// 006be760
|
||||
void Entity_NPC::KillUnique()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::KillUnique 006be760");
|
||||
}
|
||||
|
||||
// 006be840
|
||||
Entity* Entity_NPC::GetPlayerTarget()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::GetPlayerTarget 006be840");
|
||||
}
|
||||
|
||||
// 006bec40
|
||||
Vector Entity_NPC::CalcTargetPosition(float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::CalcTargetPosition 006bec40");
|
||||
}
|
||||
|
||||
// 006c04b0
|
||||
void Entity_NPC::UpdateDirtColor(uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::UpdateDirtColor 006c04b0");
|
||||
}
|
||||
|
||||
// 006c07e0
|
||||
uint8_t Entity_NPC::Redirect(int*, int*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Redirect 006c07e0");
|
||||
}
|
||||
|
||||
// 006c0f30
|
||||
void Entity_NPC::Morph(int, int, int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::Morph 006c0f30");
|
||||
}
|
||||
|
||||
// 006c1ac0
|
||||
void* Entity_NPC::shopkeeper_get_loot(void*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::shopkeeper_get_loot 006c1ac0");
|
||||
}
|
||||
|
||||
// 006c2750
|
||||
Entity_NPC* Entity_NPC::ThrowSpider(const Vector&, Entity*, Vector, bool, float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ThrowSpider 006c2750");
|
||||
}
|
||||
|
||||
// 006ca930
|
||||
void Entity_NPC::update_frozen()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::update_frozen 006ca930");
|
||||
}
|
||||
|
||||
// 006cb2a0
|
||||
void Entity_NPC::fire_projectile_from_params(Entity_Projectile*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::fire_projectile_from_params 006cb2a0");
|
||||
}
|
||||
|
||||
// 006d0300
|
||||
void Entity_NPC::SetBossColorIdx(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::SetBossColorIdx 006d0300");
|
||||
}
|
||||
|
||||
// 006d03e0
|
||||
void Entity_NPC::MakeChampion(uint32_t, int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::MakeChampion 006d03e0");
|
||||
}
|
||||
|
||||
// 006d0c20
|
||||
void Entity_NPC::SetRef_bec(Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::SetRef_bec 006d0c20");
|
||||
}
|
||||
|
||||
// 006d0c60
|
||||
void* Entity_NPC::QueryNPCsType(void*, int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::QueryNPCsType 006d0c60");
|
||||
}
|
||||
|
||||
// 006d0dd0
|
||||
EntityList* Entity_NPC::QueryNPCsGroup(EntityList*, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::QueryNPCsGroup 006d0dd0");
|
||||
}
|
||||
|
||||
// 006d1580
|
||||
void* Entity_NPC::fireplace_get_loot(void*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::fireplace_get_loot 006d1580");
|
||||
}
|
||||
|
||||
// 006d4a00
|
||||
bool Entity_NPC::CanBeDamagedFromVelocity(Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::CanBeDamagedFromVelocity 006d4a00");
|
||||
}
|
||||
|
||||
// 006d4db0
|
||||
bool Entity_NPC::CanReroll()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::CanReroll 006d4db0");
|
||||
}
|
||||
|
||||
// 006d4e00
|
||||
void Entity_NPC::PlayDeathEffects()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::PlayDeathEffects 006d4e00");
|
||||
}
|
||||
|
||||
// 006d5400
|
||||
void Entity_NPC::trigger_kill_item_effects()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::trigger_kill_item_effects 006d5400");
|
||||
}
|
||||
|
||||
// 006d6ba0
|
||||
void Entity_NPC::PlaySound(int, float, int, uint8_t, float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::PlaySound 006d6ba0");
|
||||
}
|
||||
|
||||
// 006d6c20
|
||||
int Entity_NPC::GetAliveEnemyCount()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::GetAliveEnemyCount 006d6c20");
|
||||
}
|
||||
|
||||
// 006d6d20
|
||||
uint32_t Entity_NPC::on_player_damaged()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::on_player_damaged 006d6d20");
|
||||
}
|
||||
|
||||
// 006d6d80
|
||||
void Entity_NPC::room_enter()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::room_enter 006d6d80");
|
||||
}
|
||||
|
||||
// 006d7010
|
||||
void Entity_NPC::spawn_damage_numbers()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::spawn_damage_numbers 006d7010");
|
||||
}
|
||||
|
||||
// 006d7230
|
||||
void Entity_NPC::update_damage_history()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::update_damage_history 006d7230");
|
||||
}
|
||||
|
||||
// 006d7520
|
||||
void Entity_NPC::update_blood_guide_gibs(float*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::update_blood_guide_gibs 006d7520");
|
||||
}
|
||||
|
||||
// 006d81c0
|
||||
void Entity_NPC::ClearDequeRefs()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ClearDequeRefs 006d81c0");
|
||||
}
|
||||
|
||||
// 006d8260
|
||||
bool Entity_NPC::IsControllerActionPressed(int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::IsControllerActionPressed 006d8260");
|
||||
}
|
||||
|
||||
// 006d8290
|
||||
bool Entity_NPC::IsControllerActionTriggered(int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::IsControllerActionTriggered 006d8290");
|
||||
}
|
||||
|
||||
// 006d82d0
|
||||
Vector Entity_NPC::GetControllerInput(float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::GetControllerInput 006d82d0");
|
||||
}
|
||||
|
||||
// 006d85a0
|
||||
Vector Entity_NPC::GetControllerMovementInput(float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::GetControllerMovementInput 006d85a0");
|
||||
}
|
||||
|
||||
// 006d88b0
|
||||
void Entity_NPC::TransferControl(Entity_NPC*)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::TransferControl 006d88b0");
|
||||
}
|
||||
|
||||
// 006d8b20
|
||||
void Entity_NPC::SpawnControlTarget(int, float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::SpawnControlTarget 006d8b20");
|
||||
}
|
||||
|
||||
// 006d8cf0
|
||||
void Entity_NPC::ClearChild()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ClearChild 006d8cf0");
|
||||
}
|
||||
|
||||
// 006d8d30
|
||||
Vector Entity_NPC::GetAimTargetPosition()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::GetAimTargetPosition 006d8d30");
|
||||
}
|
||||
|
||||
// 006d8d80
|
||||
bool Entity_NPC::is_controller_input_idle()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::is_controller_input_idle 006d8d80");
|
||||
}
|
||||
|
||||
// 006d8e40
|
||||
void Entity_NPC::UpdateChargeBar(float, float, float, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::UpdateChargeBar 006d8e40");
|
||||
}
|
||||
|
||||
// 006d9050
|
||||
void Entity_NPC::UpdateControllerMovement(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::UpdateControllerMovement 006d9050");
|
||||
}
|
||||
|
||||
// 006d90e0
|
||||
void Entity_NPC::UpdateChildEffectPosition(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::UpdateChildEffectPosition 006d90e0");
|
||||
}
|
||||
|
||||
// 006d97e0
|
||||
uint8_t Entity_NPC::split(float, const EntityRef&, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::split 006d97e0");
|
||||
}
|
||||
|
||||
// 006da530
|
||||
void Entity_NPC::UpdatePickupGhosts()
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::UpdatePickupGhosts 006da530");
|
||||
}
|
||||
|
||||
// 0096ce90
|
||||
void Entity_NPC::SetAimAngle(float)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::SetAimAngle 0096ce90");
|
||||
}
|
||||
|
||||
// 009a8b90
|
||||
void Entity_NPC::render_debug(float*, int)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::render_debug 009a8b90");
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include "anm2.h"
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
|
||||
// Construction and destruction (006b88e0, 006b8590) are the defaults, but for the pathfinder's owner the constructor
|
||||
// sets. PathFinder::Init's reset waits for PathFinder's takeover.
|
||||
// Field accessors (004567a0, 006a8230, 006b8480, 007e92b0) are the public fields.
|
||||
// An enemy or other non-player character (Lua's EntityNPC): its AI state and counters, pathfinder, champion and boss
|
||||
// colors, shields, Delirium's forms, and the player controlling it with Siren or a friendly ball.
|
||||
struct Entity_NPC : Entity
|
||||
{
|
||||
ANM2 chargeBarSprite;
|
||||
ANM2 statusEffectSprite;
|
||||
NPCAI_Pathfinder pathfinder{};
|
||||
std::deque<EntityPtr> entityDeque;
|
||||
std::deque<Vector> vectorDeque1;
|
||||
std::deque<Vector> vectorDeque2;
|
||||
std::vector<DamageEvent> killDamageEvents;
|
||||
std::vector<uint32_t> hitList;
|
||||
std::vector<uint32_t> secondaryHitList;
|
||||
ColorMod dirtColor = COLOR_DEFAULT;
|
||||
ColorMod floorColor = COLOR_DEFAULT;
|
||||
EntityPtr entityRef;
|
||||
EntityPtr forcedTarget;
|
||||
Entity* collisionEntity = nullptr;
|
||||
Entity* deliriumEntity = nullptr;
|
||||
Entity_Effect* pickupGhostsEntity = nullptr;
|
||||
Entity_Player* sirenPlayerEntity = nullptr;
|
||||
void* aimTargetEffect = nullptr;
|
||||
uint64_t killDamageFlags = 0;
|
||||
Vector confusionTargetPos{};
|
||||
Vector controllerMovement{};
|
||||
Vector forwardVector{};
|
||||
Vector v1{};
|
||||
Vector v2{};
|
||||
float aiFloat = 0;
|
||||
float championSpeed = 0;
|
||||
float flickerAlpha = 0;
|
||||
float hitPointsMulti = 0;
|
||||
float killDamage = 0;
|
||||
float scale = 0;
|
||||
float scaleMulti = 0;
|
||||
float shieldStrength = 0;
|
||||
float totalDamageTaken = 0;
|
||||
int aiCallPhase = 0;
|
||||
int aiCounter = 0;
|
||||
int appearFrames = 0;
|
||||
int bosscoloridx = 0;
|
||||
int championColorIdx = 0;
|
||||
int championTimer = 0;
|
||||
int collisionResult = 0;
|
||||
int controllerID = 0;
|
||||
int decoyTargetTimer = 0;
|
||||
int flickerState = 0;
|
||||
int flickerTimer = 0;
|
||||
int forcedTargetTimer = 0;
|
||||
int groupIdx = 0;
|
||||
int i1 = 0;
|
||||
int i2 = 0;
|
||||
int lastGridIndex = 0;
|
||||
int projectileCooldown = 0;
|
||||
int projectileDelay = 0;
|
||||
int savedState = 0;
|
||||
int shieldFrames = 0;
|
||||
int state = 0;
|
||||
int stateFrame = 0;
|
||||
uint32_t aiCallFlags = 0;
|
||||
uint32_t deliriumAttackID = 0;
|
||||
uint32_t deliriumBossType = 0;
|
||||
uint32_t deliriumBossVariant = 0;
|
||||
uint32_t deliriumCycleID = 0;
|
||||
uint32_t deliriumCycleIDHigh = 0;
|
||||
short championRegenCount = 0;
|
||||
uint16_t championRegenTimer = 0;
|
||||
uint16_t deliriumTransformationTimer = 0;
|
||||
uint8_t deliriumAttackAngle = 0;
|
||||
uint8_t deliriumRemainingAttacks = 0;
|
||||
uint8_t deliriumState = 0;
|
||||
bool isBestiaryEncountered = false;
|
||||
bool isBoss = false;
|
||||
bool isCanShutDoors = false;
|
||||
bool isChampion = false;
|
||||
bool isCollisionIsLow = false;
|
||||
bool isUnreachableOnce = false;
|
||||
|
||||
Entity_NPC() { pathfinder._entity = this; }
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void PreUpdate() override;
|
||||
void Update() override;
|
||||
void Interpolate() override;
|
||||
void Render(const Vector& offset) override;
|
||||
bool RenderShadowLayer(const Vector& offset) override;
|
||||
bool TakeDamage(float damage, uint64_t damageFlags, const EntityRef& source, int damageCountdown) override;
|
||||
void Kill(const EntityRef& source) override;
|
||||
void Remove() override;
|
||||
void ClearReferences() override;
|
||||
bool CanShutDoors() override;
|
||||
bool IsBoss() override;
|
||||
bool TryThrow(const EntityRef& source, const Vector& direction, float force) override;
|
||||
Vector GetForwardVector() override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
void ResetColor() override;
|
||||
void LoadEntityConfig() override;
|
||||
|
||||
Entity_NPC* ParentNPC();
|
||||
Entity_NPC* ChildNPC();
|
||||
void Hornfel_UpdateAI();
|
||||
void Hornfel_UpdateFrame();
|
||||
void update_physics();
|
||||
void apply_velocity(char);
|
||||
void update_move_direction_anim();
|
||||
void SetMinecartPosVel(const Vector& pos, const Vector& vel);
|
||||
void MinecartUpdateChild(Entity* child);
|
||||
void UpdateCordChain(bool isHalfScale);
|
||||
void render_overlay(const Vector& offset, bool isShadow);
|
||||
static int FindTargetPit(const Vector& pos1, const Vector& pos2, uint32_t pitIndex);
|
||||
static Entity_NPC* ThrowStrider(const Vector& pos, Entity* spawner, const Vector& targetPos);
|
||||
void render_v1_layer_frames();
|
||||
void RenderSegmentLink(const Vector& offset, bool isShadow);
|
||||
void CreateBling();
|
||||
void CreateGoldParticles(uint32_t count);
|
||||
void set_entity_ptr_f54(Entity* entity);
|
||||
void ResetPathFinderTarget();
|
||||
void hold_set(int countdown, const Vector& position);
|
||||
Entity_Effect* MakeSplat(float size);
|
||||
Entity_Effect* MakeBloodCloud(const Vector& pos, const ColorMod& color);
|
||||
bool TryForceTarget(Entity* target, int duration);
|
||||
float compute_speed_multiplier();
|
||||
void load_graphics(uint8_t);
|
||||
void KillUnique();
|
||||
Entity* GetPlayerTarget();
|
||||
Vector CalcTargetPosition(float distanceLimit);
|
||||
void UpdateDirtColor(uint8_t immediate);
|
||||
static uint8_t Redirect(int* entityType, int* variant);
|
||||
void Morph(int entityType, int variant, int subType, int championid);
|
||||
void* shopkeeper_get_loot(void* outLoot, bool isShouldAdvance);
|
||||
static Entity_NPC* ThrowSpider(const Vector& position, Entity* spawner, Vector targetPos, bool isBig,
|
||||
float yOffset);
|
||||
void update_frozen();
|
||||
void fire_projectile_from_params(Entity_Projectile* projectile);
|
||||
void SetBossColorIdx(int bossColorIdx, int unused);
|
||||
void MakeChampion(uint32_t seed, int championColor, bool isInit);
|
||||
void SetRef_bec(Entity* entity);
|
||||
static void* QueryNPCsType(void* outList, int type, int variant);
|
||||
static EntityList* QueryNPCsGroup(EntityList* outList, int groupIdx);
|
||||
void* fireplace_get_loot(void* outLoot, bool isShouldAdvance);
|
||||
bool CanBeDamagedFromVelocity(Vector velocity);
|
||||
bool CanReroll();
|
||||
void PlayDeathEffects();
|
||||
void trigger_kill_item_effects();
|
||||
void SetScale(float newScale);
|
||||
void PlaySound(int id, float volume, int framedelay, uint8_t loop, float pitch);
|
||||
int GetAliveEnemyCount();
|
||||
uint32_t on_player_damaged();
|
||||
void room_enter();
|
||||
void spawn_damage_numbers();
|
||||
void update_damage_history();
|
||||
void update_blood_guide_gibs(float* nullFrame);
|
||||
void ClearDequeRefs();
|
||||
bool IsControllerActionPressed(int action);
|
||||
bool IsControllerActionTriggered(int buttonAction);
|
||||
Vector GetControllerInput(float deadzone);
|
||||
Vector GetControllerMovementInput(float deadzone);
|
||||
void TransferControl(Entity_NPC* target);
|
||||
void SpawnControlTarget(int inputMode, float rotation);
|
||||
void ClearChild();
|
||||
Vector GetAimTargetPosition();
|
||||
bool is_controller_input_idle();
|
||||
void UpdateChargeBar(float start, float end, float value, bool isHideWhenFull);
|
||||
void UpdateControllerMovement(bool isForceUpdate);
|
||||
void UpdateChildEffectPosition(bool isPredictMovement);
|
||||
uint8_t split(float damage, const EntityRef& source, bool isPlaySound);
|
||||
void UpdatePickupGhosts();
|
||||
void SetAimAngle(float angle);
|
||||
static void render_debug(float*, int);
|
||||
};
|
||||
@@ -0,0 +1,239 @@
|
||||
#include "entity_pickup.h"
|
||||
#include "entity_effect.h"
|
||||
#include "log.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
||||
// The chest variants (chest, locked, red, bomb, eternal, spiked, mimic, mom's, old, wooden, mega, haunted).
|
||||
constexpr std::array<int, 12> CHESTS = {50, 60, 360, 51, 53, 52, 54, 390, 55, 56, 57, 58};
|
||||
|
||||
// 006ee110 Removes it with the ghost that shows its contents.
|
||||
void Entity_Pickup::Remove()
|
||||
{
|
||||
if (pickupGhost) pickupGhost->Remove();
|
||||
Entity::Remove();
|
||||
}
|
||||
|
||||
// 005b1930 Whether a shop sells it.
|
||||
bool Entity_Pickup::IsShopItem()
|
||||
{
|
||||
return price != 0;
|
||||
}
|
||||
|
||||
// 006ee340 Whether the pickup variant is a chest.
|
||||
bool Entity_Pickup::IsChest(int pickupVariant)
|
||||
{
|
||||
return std::find(CHESTS.begin(), CHESTS.end(), pickupVariant) != CHESTS.end();
|
||||
}
|
||||
|
||||
// The rest of Entity_Pickup is not reconstructed yet.
|
||||
|
||||
// 006e02f0
|
||||
void Entity_Pickup::Init(int, int, int, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::Init 006e02f0");
|
||||
}
|
||||
|
||||
// 006e3940
|
||||
void Entity_Pickup::Update()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::Update 006e3940");
|
||||
}
|
||||
|
||||
// 006e38d0
|
||||
void Entity_Pickup::Interpolate()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::Interpolate 006e38d0");
|
||||
}
|
||||
|
||||
// 006e69b0
|
||||
void Entity_Pickup::Render(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::Render 006e69b0");
|
||||
}
|
||||
|
||||
// 006edda0
|
||||
bool Entity_Pickup::TakeDamage(float, uint64_t, const EntityRef&, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::TakeDamage 006edda0");
|
||||
}
|
||||
|
||||
// 006ee130
|
||||
void Entity_Pickup::ClearReferences()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::ClearReferences 006ee130");
|
||||
}
|
||||
|
||||
// 006e3800
|
||||
bool Entity_Pickup::TryThrow(const EntityRef&, const Vector&, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::TryThrow 006e3800");
|
||||
}
|
||||
|
||||
// 006e8ae0
|
||||
bool Entity_Pickup::HandleCollision(Entity*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::HandleCollision 006e8ae0");
|
||||
}
|
||||
|
||||
// 005832c0
|
||||
void Entity_Pickup::GetLootList(const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::GetLootList 005832c0");
|
||||
}
|
||||
|
||||
// 005b19b0
|
||||
Vector Entity_Pickup::GetRandomPickupVelocity(const Vector&, RNG*, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::GetRandomPickupVelocity 005b19b0");
|
||||
}
|
||||
|
||||
// 006e1640
|
||||
bool Entity_Pickup::TryFlip(Entity_Player*, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::TryFlip 006e1640");
|
||||
}
|
||||
|
||||
// 006e17c0
|
||||
void Entity_Pickup::UpdateLootPreview()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::UpdateLootPreview 006e17c0");
|
||||
}
|
||||
|
||||
// 006e1a80
|
||||
void Entity_Pickup::SetAlternatePedestal(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::SetAlternatePedestal 006e1a80");
|
||||
}
|
||||
|
||||
// 006e1d70
|
||||
int Entity_Pickup::GetAlternatePedestal()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::GetAlternatePedestal 006e1d70");
|
||||
}
|
||||
|
||||
// 006e1e60
|
||||
void Entity_Pickup::SetForceBlind(uint8_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::SetForceBlind 006e1e60");
|
||||
}
|
||||
|
||||
// 006e21f0
|
||||
void Entity_Pickup::UpdateSprite(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::UpdateSprite 006e21f0");
|
||||
}
|
||||
|
||||
// 006e2570
|
||||
void Entity_Pickup::update_price_sprite(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::update_price_sprite 006e2570");
|
||||
}
|
||||
|
||||
// 006e3020
|
||||
void Entity_Pickup::AppearFast()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::AppearFast 006e3020");
|
||||
}
|
||||
|
||||
// 006e6e40
|
||||
bool Entity_Pickup::TryOpenChest(Entity_Player*)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::TryOpenChest 006e6e40");
|
||||
}
|
||||
|
||||
// 006e7be0
|
||||
void Entity_Pickup::PlayDropSound()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::PlayDropSound 006e7be0");
|
||||
}
|
||||
|
||||
// 006e7dc0
|
||||
void Entity_Pickup::PlayPickupSound()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::PlayPickupSound 006e7dc0");
|
||||
}
|
||||
|
||||
// 006e8380
|
||||
int Entity_Pickup::GetCoinValue()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::GetCoinValue 006e8380");
|
||||
}
|
||||
|
||||
// 006e83a0
|
||||
uint32_t Entity_Pickup::can_player_buy(Entity_Player*)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::can_player_buy 006e83a0");
|
||||
}
|
||||
|
||||
// 006e84d0
|
||||
void Entity_Pickup::CollectTrinket(Entity_Player*, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::CollectTrinket 006e84d0");
|
||||
}
|
||||
|
||||
// 006ed580
|
||||
uint8_t Entity_Pickup::empty_pedestal()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::empty_pedestal 006ed580");
|
||||
}
|
||||
|
||||
// 006ed690
|
||||
void Entity_Pickup::update_magnet_attraction()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::update_magnet_attraction 006ed690");
|
||||
}
|
||||
|
||||
// 006edfa0
|
||||
void Entity_Pickup::update_cycle_collectible(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::update_cycle_collectible 006edfa0");
|
||||
}
|
||||
|
||||
// 006ee200
|
||||
bool Entity_Pickup::CanReroll()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::CanReroll 006ee200");
|
||||
}
|
||||
|
||||
// 006ee240
|
||||
bool Entity_Pickup::CanRerollVariant(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::CanRerollVariant 006ee240");
|
||||
}
|
||||
|
||||
// 006ee390
|
||||
bool Entity_Pickup::CanBePickedUp(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::CanBePickedUp 006ee390");
|
||||
}
|
||||
|
||||
// 006ee3f0
|
||||
bool Entity_Pickup::CanJeraDuplicate()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::CanJeraDuplicate 006ee3f0");
|
||||
}
|
||||
|
||||
// 006ee750
|
||||
void Entity_Pickup::RemoveOtherOptions()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::RemoveOtherOptions 006ee750");
|
||||
}
|
||||
|
||||
// 006eea30
|
||||
void Entity_Pickup::MakeShopItem(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::MakeShopItem 006eea30");
|
||||
}
|
||||
|
||||
// 006eed30
|
||||
int Entity_Pickup::AssignOptionsIndex()
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::AssignOptionsIndex 006eed30");
|
||||
}
|
||||
|
||||
// 007ef420
|
||||
void Entity_Pickup::RestoreState(Room*, Entity_Pickup*, void*)
|
||||
{
|
||||
reconstruction_missing("Entity_Pickup::RestoreState 007ef420");
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
#pragma once
|
||||
|
||||
#include "entity.h"
|
||||
#include "anm2.h"
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
// The most items a glitched pedestal cycles through.
|
||||
constexpr int CYCLE_COLLECTIBLE_LIMIT = 8;
|
||||
|
||||
// Construction and destruction (006e0130, 006e0010) are the defaults.
|
||||
// Field accessors (00431740, 005b1940, 005b1980, 007e9390, 007e93a0, 007e93b0, 007e93c0, 0085e440) are the public
|
||||
// fields.
|
||||
// A pickup (Lua's EntityPickup): coins, hearts, keys, chests, cards, items on pedestals and the like, with the price
|
||||
// a shop sets, its timeout, and the items a glitched pedestal cycles through.
|
||||
struct Entity_Pickup : Entity
|
||||
{
|
||||
ANM2 altPedestalANM2;
|
||||
ANM2 priceANM2;
|
||||
std::array<Entity_Pickup*, 2> megaChestCollectible{};
|
||||
std::array<uint32_t, CYCLE_COLLECTIBLE_LIMIT> cycleCollectibleList{};
|
||||
std::shared_ptr<EntitySaveState> flipSaveState;
|
||||
ColorMod colorMod = COLOR_DEFAULT;
|
||||
EntityPtr unkEntityRef;
|
||||
Entity_Effect* pickupGhost = nullptr;
|
||||
int charge = 0;
|
||||
int chestReCloseTimer = 0;
|
||||
int collisionCooldown = 0;
|
||||
int coopDuplicateIndex = 0;
|
||||
int dropDelay = 0;
|
||||
int gridRepositionState = 0;
|
||||
int invisibleFrames = 0;
|
||||
int itemPoolType = 0;
|
||||
int optionsPickupIndex = 0;
|
||||
int price = 0;
|
||||
int shopItemId = 0;
|
||||
int timeout = 0;
|
||||
int varData = 0;
|
||||
int wait = 0;
|
||||
uint32_t cycleCollectibleCount = 0;
|
||||
uint32_t state = 0;
|
||||
bool isAutoUpdatePrice = false;
|
||||
bool isForceBlind = false;
|
||||
bool isPayToPlay = false;
|
||||
bool isTouched = false;
|
||||
|
||||
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
||||
void Update() override;
|
||||
void Interpolate() override;
|
||||
void Render(const Vector& offset) override;
|
||||
bool TakeDamage(float damage, uint64_t damageFlags, const EntityRef& source, int damageCountdown) override;
|
||||
void Remove() override;
|
||||
void ClearReferences() override;
|
||||
bool TryThrow(const EntityRef& source, const Vector& direction, float force) override;
|
||||
bool HandleCollision(Entity* collider, bool isLow) override;
|
||||
|
||||
void GetLootList(const Vector& renderOffset);
|
||||
bool IsShopItem();
|
||||
static Vector GetRandomPickupVelocity(const Vector& position, RNG* rng, uint32_t ePickupVelType);
|
||||
bool TryFlip(Entity_Player* unusedPlayer, uint32_t unusedSeed);
|
||||
void UpdateLootPreview();
|
||||
void SetAlternatePedestal(int pedestalType);
|
||||
int GetAlternatePedestal();
|
||||
void SetForceBlind(uint8_t setBlind);
|
||||
void UpdateSprite(bool isIgnoreBlind);
|
||||
void update_price_sprite(int price);
|
||||
void AppearFast();
|
||||
bool TryOpenChest(Entity_Player* player);
|
||||
void PlayDropSound();
|
||||
void PlayPickupSound();
|
||||
int GetCoinValue();
|
||||
uint32_t can_player_buy(Entity_Player*);
|
||||
void CollectTrinket(Entity_Player*, uint32_t);
|
||||
uint8_t empty_pedestal();
|
||||
void update_magnet_attraction();
|
||||
void update_cycle_collectible(bool isForce);
|
||||
bool CanReroll();
|
||||
static bool CanRerollVariant(int variant, int subType);
|
||||
static bool IsChest(int pickupVariant);
|
||||
bool CanBePickedUp(bool ignorePrice);
|
||||
bool CanJeraDuplicate();
|
||||
static void RemoveOtherOptions();
|
||||
void MakeShopItem(int shopId);
|
||||
int AssignOptionsIndex();
|
||||
static void RestoreState(Room* room, Entity_Pickup* entity, void* saveState);
|
||||
};
|
||||
File diff suppressed because it is too large.
Load diff
+1219
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,565 @@
|
||||
#include "entity_player.h"
|
||||
#include "game.h"
|
||||
#include "key_configs.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "menu_manager.h"
|
||||
#include "room.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
constexpr float BODY_TURN_RATE = 0.3f;
|
||||
constexpr float DEGREES_PER_RADIAN = 57.295776f;
|
||||
constexpr float FLYING_OFFSET_Y = -4;
|
||||
constexpr float HELD_OFFSET_SCALE = 0.65f;
|
||||
constexpr float MOVE_SPEED_BASE = 0.75f;
|
||||
constexpr float MOVE_SPEED_SCALE = 0.25f;
|
||||
constexpr float SLIPPERY_FRAMES = 60;
|
||||
constexpr float WALK_FAST_SPEED = 6;
|
||||
constexpr float WALK_FASTEST_SPEED = 10;
|
||||
constexpr float WALK_SLOW_SPEED = 2.3f;
|
||||
constexpr int DAMAGE_BLINK_PERIOD = 6;
|
||||
constexpr int DAMAGE_BLINK_HIDDEN = 3;
|
||||
constexpr float EMOTE_HEIGHT = 52;
|
||||
constexpr float EMOTE_MOVING_SPEED = 0.1f;
|
||||
constexpr float GRAVITY_PULL = 0.225f;
|
||||
constexpr int MARS_TAP_FRAMES_MAX = 10000;
|
||||
|
||||
// The room render passes the player draws its overlays in: the room itself and the water's surface.
|
||||
static bool is_overlay_pass()
|
||||
{
|
||||
RenderMode mode = g_game->room->entityList.renderMode;
|
||||
return mode == RENDER_NORMAL || mode == RENDER_WATER_ABOVE;
|
||||
}
|
||||
|
||||
// 00a15640's mapping, as the walk speed scales the animation: a value from one range to another, clamped.
|
||||
static float range_map(float value, float inMin, float inMax, float outMin, float outMax)
|
||||
{
|
||||
float t = std::clamp((value - inMin) / (inMax - inMin), 0.0f, 1.0f);
|
||||
return (outMax - outMin) * t + outMin;
|
||||
}
|
||||
|
||||
// How far an action is pushed on a controller, or on any device for -1, as the input manager reads it offline.
|
||||
static float action_value(ButtonAction action, int controllerIndex)
|
||||
{
|
||||
KAGE::Input::Manager& input = KAGE::Input::manager;
|
||||
float value = 0;
|
||||
|
||||
for (int i = 0; i < input.get_device_count(); i++)
|
||||
{
|
||||
std::shared_ptr<KAGE::Input::InputDevice> device = input.get_device(i);
|
||||
if (!device || !device->isConnected || (controllerIndex != -1 && device->id != controllerIndex)) continue;
|
||||
for (int button : g_manager->keyConfigs.binding_get(*device, action))
|
||||
if (button != KAGE::Input::BUTTON_NONE) value = std::max(value, device->button_value(button));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// The axis a vector mostly points along, as a unit vector (Vector::ToCardinal).
|
||||
static Vector vector_cardinal(Vector v)
|
||||
{
|
||||
if (std::fabs(v.x) <= std::fabs(v.y)) return vector_make(0, v.y < 0 ? -1 : 1);
|
||||
return vector_make(v.x < 0 ? -1 : 1, 0);
|
||||
}
|
||||
|
||||
// Flips horizontal input in the mirrored Downpour and Dross rooms.
|
||||
static bool is_mirror_world()
|
||||
{
|
||||
Game& game = *g_game;
|
||||
bool isAltStage = game.stageType == STAGETYPE_REPENTANCE || game.stageType == STAGETYPE_REPENTANCE_B;
|
||||
if (game.currentDimensionIdx != 1 || !isAltStage) return false;
|
||||
return game.stage == 2 || (game.stage == 1 && (game.GetCurses() & CURSE_OF_LABYRINTH));
|
||||
}
|
||||
|
||||
// Snaps input to the axis it mostly points along, keeping its strength, under the axis aligned controls seed.
|
||||
static Vector axis_snap(Vector input)
|
||||
{
|
||||
Vector axis = vector_cardinal(input);
|
||||
float length = std::sqrt(input.x * input.x + input.y * input.y);
|
||||
return vector_make(axis.x * length, axis.y * length);
|
||||
}
|
||||
|
||||
// 00779360 The movement input: the move actions' values, reversed by the deathmatch's confusion and the reversed
|
||||
// controls seed, snapped by the axis aligned seed and mirrored in the mirror world. Esau, owned players and Tainted
|
||||
// Lazarus's hologram stand still while drop is held.
|
||||
Vector Entity_Player::GetMovementJoystick()
|
||||
{
|
||||
Game& game = *g_game;
|
||||
Entity_Player* twin = twin_get();
|
||||
bool isFollower = playerType == PLAYER_ESAU || (parent && parent->is_player()) ||
|
||||
((playerType == PLAYER_LAZARUS_B || playerType == PLAYER_LAZARUS2_B) && twin &&
|
||||
twin->playerIndex != -1 && twin->playerIndex < playerIndex && twin != this);
|
||||
if (isFollower && isControlsEnabled && controlsCooldown < 1 && action_value(ACTION_DROP, controllerIndex) > 0)
|
||||
return {};
|
||||
|
||||
Vector input = vector_make(action_value(ACTION_RIGHT, controllerIndex) - action_value(ACTION_LEFT, controllerIndex),
|
||||
action_value(ACTION_DOWN, controllerIndex) - action_value(ACTION_UP, controllerIndex));
|
||||
if (game.deathmatchManager.is_active() && HasEntityFlags(FLAG_CONFUSION)) input = vector_make(-input.x, -input.y);
|
||||
if (game.seedEffects.HasSeedEffect(SEED_CONTROLS_REVERSED)) input = vector_make(-input.x, -input.y);
|
||||
if (game.seedEffects.HasSeedEffect(SEED_AXIS_ALIGNED_CONTROLS)) input = axis_snap(input);
|
||||
if (is_mirror_world()) input.x = -input.x;
|
||||
return input;
|
||||
}
|
||||
|
||||
// 00779620 The shooting input: the shoot actions' values, or the movement under the seeds that shoot with it, reversed
|
||||
// by the reversed controls seed, snapped by the axis aligned seed and mirrored in the mirror world.
|
||||
Vector Entity_Player::GetShootingJoystick()
|
||||
{
|
||||
Game& game = *g_game;
|
||||
Vector input{};
|
||||
|
||||
if (game.seedEffects.HasSeedEffect(SEED_SHOOT_IN_MOVEMENT_DIRECTION)) input = GetMovementJoystick();
|
||||
else if (game.seedEffects.HasSeedEffect(SEED_SHOOT_OPPOSITE_MOVEMENT_DIRECTION))
|
||||
{
|
||||
Vector movement = GetMovementJoystick();
|
||||
input = vector_make(-movement.x, -movement.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
input = vector_make(
|
||||
action_value(ACTION_SHOOT_RIGHT, controllerIndex) - action_value(ACTION_SHOOT_LEFT, controllerIndex),
|
||||
action_value(ACTION_SHOOT_DOWN, controllerIndex) - action_value(ACTION_SHOOT_UP, controllerIndex));
|
||||
if (game.seedEffects.HasSeedEffect(SEED_CONTROLS_REVERSED)) input = vector_make(-input.x, -input.y);
|
||||
}
|
||||
if (game.seedEffects.HasSeedEffect(SEED_AXIS_ALIGNED_CONTROLS)) input = axis_snap(input);
|
||||
if (is_mirror_world()) input.x = -input.x;
|
||||
return input;
|
||||
}
|
||||
|
||||
// 00779900 The direction the body walks: the weapon's aim while it fires, Montezuma's Revenge's blast, or the last
|
||||
// movement.
|
||||
Vector Entity_Player::GetBodyMoveDirection()
|
||||
{
|
||||
if (weapons[0] || weapons[1])
|
||||
reconstruction_missing("Entity_Player::GetBodyMoveDirection 00779900 (the weapon's aim)");
|
||||
if (HasCollectible(COLLECTIBLE_MONTEZUMAS_REVENGE) && (montezumaLaser || montezumaChargeTimer > 0))
|
||||
reconstruction_missing("Entity_Player::GetBodyMoveDirection 00779900 (Montezuma's Revenge)");
|
||||
return recentMovementVector;
|
||||
}
|
||||
|
||||
// 00782630 How far a flying player floats above its shadow, except in the Beast's room.
|
||||
Vector Entity_Player::GetFlyingOffset()
|
||||
{
|
||||
if (g_game->room->roomType == ROOM_DUNGEON || !canFly) return {};
|
||||
return vector_make(0, FLYING_OFFSET_Y);
|
||||
}
|
||||
|
||||
// 007ab110 Whether no extra or item animation is playing.
|
||||
bool Entity_Player::IsExtraAnimationFinished()
|
||||
{
|
||||
return !isPlayingExtraAnimation && !isPlayingItemAnimation;
|
||||
}
|
||||
|
||||
// 007bf490 Whether the body holds something over its head: picking up, lifting, hiding or using an item.
|
||||
bool Entity_Player::IsHoldingItem()
|
||||
{
|
||||
const std::string& animation = bodySprite.animState.animData ? bodySprite.GetAnimation() : std::string();
|
||||
for (std::string_view held : {"Pickup", "Pickup_Online", "LiftItem", "HideItem", "UseItem"})
|
||||
if (animation == held) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// 0078b350 Whether the player has no head: Guillotine, Scissors and Decap Attack's effects, or the Intruder.
|
||||
bool Entity_Player::IsHeadless()
|
||||
{
|
||||
return HasCollectible(COLLECTIBLE_GUILLOTINE) || temporaryEffects.HasCollectibleEffect(COLLECTIBLE_SCISSORS) ||
|
||||
temporaryEffects.HasCollectibleEffect(COLLECTIBLE_GUILLOTINE) ||
|
||||
temporaryEffects.HasNullEffect(NULLITEM_INTRUDER) ||
|
||||
temporaryEffects.HasCollectibleEffect(COLLECTIBLE_DECAP_ATTACK);
|
||||
}
|
||||
|
||||
// 007db700 Whether this is Tainted Lazarus's hologram: the inactive form, following its twin.
|
||||
bool Entity_Player::IsHologram()
|
||||
{
|
||||
Entity_Player* twin = twin_get();
|
||||
bool isLazarus = playerType == PLAYER_LAZARUS_B || playerType == PLAYER_LAZARUS2_B;
|
||||
return isExists && isLazarus && twin && twin->playerIndex != -1 && playerIndex > twin->playerIndex && twin != this;
|
||||
}
|
||||
|
||||
// 007c32c0 Whether enemies cannot see the player: Faded Polaroid's trinket effect, Camo Undies, or Tainted Forgotten.
|
||||
bool Entity_Player::IsInvisible()
|
||||
{
|
||||
return temporaryEffects.HasTrinketEffect(TRINKET_FADED_POLAROID) ||
|
||||
temporaryEffects.HasCollectibleEffect(COLLECTIBLE_CAMO_UNDIES) || playerType == PLAYER_THEFORGOTTEN_B;
|
||||
}
|
||||
|
||||
// 007cb580 Whether the whole sprite draws as one, as during an extra or item animation, unless an item is held out of
|
||||
// view or Mega Mush is on.
|
||||
bool Entity_Player::IsFullSpriteRendering()
|
||||
{
|
||||
if (temporaryEffects.HasCollectibleEffect(COLLECTIBLE_MEGA_MUSH) || IsExtraAnimationFinished()) return false;
|
||||
return !IsHoldingItem() || IsHeldItemVisible();
|
||||
}
|
||||
|
||||
// 00779b40 Moves the player by its input: speed and friction from its speed stat, a slippery floor's drift and the
|
||||
// facing it walks in. The items that change walking stop the game until reached.
|
||||
void Entity_Player::update_body_animations()
|
||||
{
|
||||
if (heightVelocity < 0 || posOffset.y < 0) return;
|
||||
if (target)
|
||||
{
|
||||
velocity = vector_make(target->pos.x - pos.x, target->pos.y - pos.y);
|
||||
return;
|
||||
}
|
||||
|
||||
lastVelocity = velocity;
|
||||
Vector input{};
|
||||
if (isControlsEnabled && controlsCooldown < 1)
|
||||
{
|
||||
input = GetMovementJoystick();
|
||||
if (HasEntityFlags(FLAG_APPLY_GRAVITY) && !canFly) input.y = 0;
|
||||
float length = std::sqrt(input.x * input.x + input.y * input.y);
|
||||
if (length > 1) input = vector_make(input.x / length, input.y / length);
|
||||
}
|
||||
if ((playerType == PLAYER_THEFORGOTTEN_B && !isCoopGhost) || suplexState != 0 || isDarkArtsBlastPending)
|
||||
reconstruction_missing(
|
||||
"Entity_Player::update_body_animations 00779b40 (Tainted Forgotten, suplexes and Dark Arts)");
|
||||
if (playerType == PLAYER_JACOB || playerType == PLAYER_ESAU || playerType == PLAYER_LAZARUS_B ||
|
||||
playerType == PLAYER_LAZARUS2_B || playerType == PLAYER_EVE_B)
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (twins and Tainted Eve)");
|
||||
if (temporaryEffects.HasNullEffect(NULLITEM_REVERSE_CHARIOT) || ponyCharge > 0)
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (the Chariot and pony dashes)");
|
||||
reverseChariotMoveCooldown = 0;
|
||||
|
||||
movementVector = input;
|
||||
if (input.x != 0 || input.y != 0) recentMovementVector = input;
|
||||
Vector walkInput = walk_direction_update(input);
|
||||
walk_velocity_update(walkInput);
|
||||
if (temporaryEffects.HasNullEffect(NULLITEM_SPIN_TO_WIN))
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (Spin to Win)");
|
||||
if (!HasEntityFlags(FLAG_INTERPOLATION_UPDATE) && walking_items_has())
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (the items that change walking)");
|
||||
if (HasCollectible(COLLECTIBLE_JUPITER))
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (Jupiter)");
|
||||
jupiterCharge = 0;
|
||||
if (HasCollectible(COLLECTIBLE_MARS) && isControlsEnabled)
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (Mars)");
|
||||
marsTapFrames = std::min(marsTapFrames + 1, MARS_TAP_FRAMES_MAX);
|
||||
if (HasTrinket(TRINKET_DUCT_TAPE) && GetTrinketMultiplier(TRINKET_DUCT_TAPE) >= 2)
|
||||
reconstruction_missing("Entity_Player::update_body_animations 00779b40 (golden Duct Tape)");
|
||||
ductTapeMode = 0;
|
||||
}
|
||||
|
||||
// The direction the player walks in and the body angle turning towards it, and the input scaled by the speed stat.
|
||||
Vector Entity_Player::walk_direction_update(Vector input)
|
||||
{
|
||||
float scale = moveSpeed * MOVE_SPEED_SCALE + MOVE_SPEED_BASE;
|
||||
Vector scaled = vector_make(input.x * scale, input.y * scale);
|
||||
|
||||
moveDirection = DIRECTION_NONE;
|
||||
if (std::fabs(scaled.x) <= std::fabs(scaled.y))
|
||||
{
|
||||
if (scaled.y < 0) moveDirection = DIRECTION_UP;
|
||||
else if (scaled.y > 0) moveDirection = DIRECTION_DOWN;
|
||||
}
|
||||
else moveDirection = scaled.x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
||||
if (suplexState == 1) moveDirection = (Direction)get_velocity_direction();
|
||||
if (moveDirection != DIRECTION_NONE)
|
||||
bodyAngle = angle_lerp(bodyAngle, std::atan2(scaled.y, scaled.x) * DEGREES_PER_RADIAN, BODY_TURN_RATE);
|
||||
return scaled;
|
||||
}
|
||||
|
||||
// Turns the walk input into velocity: the part across the input fades, the input accelerates up to the speed stat,
|
||||
// a slippery floor keeps the momentum, and gravity pulls in side-scrolling rooms. A thrown player keeps its speed.
|
||||
void Entity_Player::walk_velocity_update(Vector walkInput)
|
||||
{
|
||||
Vector before = velocity;
|
||||
float slippery = (float)slipperyTimer / SLIPPERY_FRAMES;
|
||||
float drag = 0;
|
||||
|
||||
if (HasEntityFlags(FLAG_SLOW)) slippery = 0;
|
||||
bool isGrounded = !HasEntityFlags(FLAG_APPLY_GRAVITY) || canFly;
|
||||
if ((walkInput.x != 0 || walkInput.y != 0) && isGrounded)
|
||||
{
|
||||
float along = before.y * walkInput.y + before.x * walkInput.x;
|
||||
Vector kept = vector_make(walkInput.x * along, walkInput.y * along);
|
||||
float keep = std::sqrt(slippery * 0.19999999f + 0.8f);
|
||||
velocity = vector_make((before.x - kept.x) * keep + kept.x, (before.y - kept.y) * keep + kept.y);
|
||||
before = velocity;
|
||||
}
|
||||
|
||||
float push = std::max(0.0f, (slippery * 0.7f - 0.2f) * (before.x * walkInput.x + before.y * walkInput.y));
|
||||
float accel = (push / moveSpeed + 3) * 0.4f;
|
||||
if (HasEntityFlags(FLAG_THROWN)) drag = 1;
|
||||
else if (suplexState < 2) drag = slippery * 0.185f + 0.775f;
|
||||
else drag = slippery * 0.51f + 0.45f;
|
||||
|
||||
float maxSpeed = moveSpeed * 4.41f;
|
||||
accel = (accel * 0.25f - accel) * slippery + accel;
|
||||
Vector moved = vector_make(walkInput.x * 0.5f * accel + before.x, walkInput.y * 0.5f * accel + velocity.y);
|
||||
velocity.y = moved.y;
|
||||
if (slippery > 0 && moved.x * moved.x + moved.y * moved.y > maxSpeed * maxSpeed)
|
||||
{
|
||||
float speed = std::sqrt(before.x * before.x + before.y * before.y);
|
||||
float length = std::sqrt(moved.x * moved.x + moved.y * moved.y);
|
||||
if (length > 0)
|
||||
{
|
||||
moved.x *= speed / length;
|
||||
velocity.y = speed / length * moved.y;
|
||||
}
|
||||
}
|
||||
|
||||
float damping = std::sqrt(drag);
|
||||
velocity.x = moved.x * damping;
|
||||
if (isGrounded) velocity.y *= damping;
|
||||
else velocity.y += GRAVITY_PULL;
|
||||
}
|
||||
|
||||
// Whether one of the effects whose costume animates with the walk is on: Gamekid, My Little Unicorn, Unicorn Stump,
|
||||
// Taurus, Book of Shadows and Holy Mantle.
|
||||
bool Entity_Player::walking_items_has()
|
||||
{
|
||||
for (int collectible : {COLLECTIBLE_GAMEKID, COLLECTIBLE_MY_LITTLE_UNICORN, COLLECTIBLE_UNICORN_STUMP,
|
||||
COLLECTIBLE_TAURUS, COLLECTIBLE_BOOK_OF_SHADOWS, COLLECTIBLE_HOLY_MANTLE})
|
||||
if (temporaryEffects.HasCollectibleEffect(collectible)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Plays the walk animation the body moves in, or stands still on the idle frame, at a speed following the velocity.
|
||||
void Entity_Player::walk_animation_update()
|
||||
{
|
||||
if (HasEntityFlags(FLAG_INTERPOLATION_UPDATE) || (!IsExtraAnimationFinished() && !IsHoldingItem())) return;
|
||||
if (queuedItem.item) FlushQueueItem();
|
||||
|
||||
Vector direction = GetBodyMoveDirection();
|
||||
bool isPlayer = variant == PLAYER_VARIANT_PLAYER && !isCoopGhost;
|
||||
if (direction.x != 0 || direction.y != 0)
|
||||
{
|
||||
bool isVertical = std::fabs(direction.x) <= std::fabs(direction.y);
|
||||
float axis = isVertical ? direction.y : direction.x;
|
||||
std::string_view animation =
|
||||
isVertical ? (axis > 0 ? "WalkDown" : "WalkUp") : (axis > 0 ? "WalkRight" : "WalkLeft");
|
||||
if (isPlayer) sprite.Play(animation);
|
||||
}
|
||||
else if (isPlayer)
|
||||
{
|
||||
if (!canFly || playerType == PLAYER_THEFORGOTTEN_B) sprite.SetFrame("WalkDown", 0);
|
||||
else sprite.Play("WalkDown");
|
||||
}
|
||||
|
||||
float speed = 1;
|
||||
if (sprite.IsPlaying())
|
||||
{
|
||||
float length = std::sqrt(velocity.x * velocity.x + velocity.y * velocity.y);
|
||||
if (length < WALK_SLOW_SPEED) speed = range_map(length, 1, WALK_SLOW_SPEED, 0.5f, 1);
|
||||
if (length > WALK_FAST_SPEED) speed = range_map(length, WALK_FAST_SPEED, WALK_FASTEST_SPEED, 1, 2);
|
||||
if (slipperyTimer > 0) reconstruction_missing("Entity_Player::Update 00782af0 (walking on a slippery floor)");
|
||||
}
|
||||
sprite.playbackSpeed = speed;
|
||||
}
|
||||
|
||||
// Turns the head to where the player walks, as update_shooting does when nothing is shot, and shows it.
|
||||
void Entity_Player::head_animation_update()
|
||||
{
|
||||
if (headDirectionTime < 0 && (movementVector.x != 0 || movementVector.y != 0))
|
||||
{
|
||||
if (std::fabs(movementVector.x) <= std::fabs(movementVector.y))
|
||||
{
|
||||
headAnim = movementVector.y >= 0 ? "HeadDown" : "HeadUp";
|
||||
headDirection = movementVector.y >= 0 ? DIRECTION_DOWN : DIRECTION_UP;
|
||||
}
|
||||
else
|
||||
{
|
||||
headAnim = movementVector.x >= 0 ? "HeadRight" : "HeadLeft";
|
||||
headDirection = movementVector.x >= 0 ? DIRECTION_RIGHT : DIRECTION_LEFT;
|
||||
}
|
||||
}
|
||||
if (fireBlockCooldown < 1) fireDirection = DIRECTION_NONE;
|
||||
if (!HasEntityFlags(FLAG_INTERPOLATION_UPDATE))
|
||||
{
|
||||
if (blinkTime > -1) blinkTime--;
|
||||
if (headDirectionTime > -1) headDirectionTime--;
|
||||
}
|
||||
if (variant == PLAYER_VARIANT_PLAYER && IsExtraAnimationFinished()) sprite.SetOverlayFrame(headAnim, 0);
|
||||
}
|
||||
|
||||
// 00782af0 The player's frame. Only the frame of a plain character is reconstructed: the base entity moves it, it walks
|
||||
// by its input, its head turns where it walks and its body animates. Items, effects, held and queued items, extra
|
||||
// animations and the shooting, bomb, item, pocket and drop actions stop the game until reached.
|
||||
void Entity_Player::Update()
|
||||
{
|
||||
if (!is_evaluation_plain() || isPlayingExtraAnimation || isPlayingItemAnimation || heldEntity || queuedItem.item)
|
||||
reconstruction_missing("Entity_Player::Update 00782af0 (items, effects and extra animations)");
|
||||
for (ButtonAction action : {ACTION_SHOOT_LEFT, ACTION_SHOOT_RIGHT, ACTION_SHOOT_UP, ACTION_SHOOT_DOWN, ACTION_BOMB,
|
||||
ACTION_ITEM, ACTION_PILL_CARD, ACTION_DROP})
|
||||
if (isControlsEnabled && action_value(action, controllerIndex) > 0)
|
||||
reconstruction_missing(
|
||||
"Entity_Player::update_shooting 0077b020 (shooting, bombs, items, pockets and drop)");
|
||||
|
||||
Entity::Update();
|
||||
update_body_animations();
|
||||
head_animation_update();
|
||||
walk_animation_update();
|
||||
}
|
||||
|
||||
// 0078ca00 Draws the player at its place, lifted by its flight and its offset: blinking while hurt, the held entity
|
||||
// in front or behind, its after-images, then its overlays (the co-op indicator, charge bars and status effect) in the
|
||||
// room's pass. Netplay's shadows and colors are offline.
|
||||
void Entity_Player::Render(const Vector& offset)
|
||||
{
|
||||
if (variant == PLAYER_VARIANT_EXTRA || target)
|
||||
{
|
||||
if (target && variant != PLAYER_VARIANT_EXTRA)
|
||||
reconstruction_missing("Entity_Player::Render 0078ca00 (a player following a target)");
|
||||
return;
|
||||
}
|
||||
|
||||
Vector renderOffset = offset;
|
||||
if (!HasEntityFlags(FLAG_HELD))
|
||||
renderOffset =
|
||||
vector_make(offset.x + posOffset.x * HELD_OFFSET_SCALE, offset.y + posOffset.y * HELD_OFFSET_SCALE);
|
||||
if (canFly)
|
||||
{
|
||||
Vector flying = GetFlyingOffset();
|
||||
renderOffset = vector_make(renderOffset.x + flying.x, renderOffset.y + flying.y);
|
||||
}
|
||||
if (!isVisible) return;
|
||||
if (damageCooldown > 0 && damageCooldown % DAMAGE_BLINK_PERIOD < DAMAGE_BLINK_HIDDEN &&
|
||||
IsExtraAnimationFinished() && g_game->challenge != CHALLENGE_GUARDIAN && !HasEntityFlags(FLAG_NO_DAMAGE_BLINK))
|
||||
return;
|
||||
if (heldEntity) reconstruction_missing("Entity_Player::Render 0078ca00 (the held entity)");
|
||||
|
||||
render_pass(renderOffset, RENDER_PASS_MAIN);
|
||||
if (!is_overlay_pass()) return;
|
||||
|
||||
if (playerHUD) reconstruction_missing("Entity_Player::Render 0078ca00 (the player's HUD bubble)");
|
||||
if (g_game->playerManager.playerList.size() > 1 && g_game->roomTransition.mode == TRANSITION_NONE)
|
||||
reconstruction_missing("Entity_Player::Render 0078ca00 (the co-op player indicator)");
|
||||
if (!isDead)
|
||||
{
|
||||
render_charge_bars(renderPosition);
|
||||
if (statusEffectSprite.isLoaded && statusEffectSprite.animState.animData &&
|
||||
statusEffectSprite.animState.isPlaying)
|
||||
reconstruction_missing("Entity_Player::Render 0078ca00 (the status effect sprite)");
|
||||
}
|
||||
if (g_game->hallucinationTimer > 0)
|
||||
reconstruction_missing("Entity_Player::Render 0078ca00 (the hallucination overlay)");
|
||||
if (g_game->deathmatchManager.is_active())
|
||||
reconstruction_missing("Entity_Player::Render 0078ca00 (the deathmatch overlay)");
|
||||
}
|
||||
|
||||
// 0078b640 Draws the player's body: the glow, body, head and top layers of its sprite and costumes at its snapped
|
||||
// position, or the whole sprite during extra animations. Co-op babies and ghosts draw as plain entities, Tainted
|
||||
// Lazarus's hologram in a shimmer, and the twin behind Tainted Lazarus as its backup.
|
||||
void Entity_Player::render_pass(const Vector& offset, RenderPass pass)
|
||||
{
|
||||
if (g_game->room->entityList.renderMode == RENDER_WATER_REFLECT && variant == PLAYER_VARIANT_PLAYER &&
|
||||
!isCoopGhost && (playerType == PLAYER_LAZARUS_B || playerType == PLAYER_LAZARUS2_B) && backupPlayer && isValid)
|
||||
reconstruction_missing("Entity_Player::render_pass 0078b640 (Tainted Lazarus's reflection)");
|
||||
if (variant == PLAYER_VARIANT_COOP_BABY || isCoopGhost)
|
||||
{
|
||||
Entity::Render(offset);
|
||||
return;
|
||||
}
|
||||
if (IsHologram()) reconstruction_missing("Entity_Player::render_pass 0078b640 (Tainted Lazarus's hologram)");
|
||||
if (IsHoldingItem() && bodySprite.animState.animData)
|
||||
if (const NullFrame* held = bodySprite.animState.GetNullFrameById(0);
|
||||
held && held->isVisible && playerType == PLAYER_LILITH_B)
|
||||
reconstruction_missing("Entity_Player::render_pass 0078b640 (Tainted Lilith's held item)");
|
||||
if (IsFullSpriteRendering()) reconstruction_missing("Entity_Player::render_pass 0078b640 (the whole sprite)");
|
||||
|
||||
renderPosition = vector_add(render_position_get(pos, RENDER_SNAPPED), offset);
|
||||
bool isHeaded = !IsHeadless();
|
||||
if (isHeaded)
|
||||
{
|
||||
RenderGlow(renderPosition);
|
||||
render_back(renderPosition);
|
||||
}
|
||||
RenderBody(renderPosition);
|
||||
if (isHeaded) RenderHead(renderPosition);
|
||||
RenderTop(renderPosition);
|
||||
(void)pass;
|
||||
bool isMoving = velocity.x * velocity.x + velocity.y * velocity.y > EMOTE_MOVING_SPEED;
|
||||
if (!emotes.isActive || emotes.emote != EMOTE_TYPING || !isMoving)
|
||||
emotes.Render(vector_make(renderPosition.x, renderPosition.y - bodyScale.y * EMOTE_HEIGHT));
|
||||
}
|
||||
|
||||
// The sprite a costume layer draws with: a worn costume's, or the player's own.
|
||||
ANM2& Entity_Player::layer_sprite(int layer)
|
||||
{
|
||||
int index = playerCostumeMap[layer].index;
|
||||
return index < 0 ? sprite : costumeSpriteDescs[index].sprite;
|
||||
}
|
||||
|
||||
// The layer of that sprite a player layer draws.
|
||||
int Entity_Player::layer_id(int layer)
|
||||
{
|
||||
return playerCostumeMap[layer].index < 0 ? layer : playerCostumeMap[layer].layerId;
|
||||
}
|
||||
|
||||
// 0078dc60 Draws the glow layer under the player.
|
||||
void Entity_Player::RenderGlow(const Vector& position)
|
||||
{
|
||||
if (!isVisible || IsFullSpriteRendering()) return;
|
||||
layer_sprite(PLAYER_LAYER_GLOW).RenderLayer(layer_id(PLAYER_LAYER_GLOW), SpriteDraw{position, {}, {}});
|
||||
}
|
||||
|
||||
// 0078e130 Draws the back layer behind the body, a costume's where one covers it.
|
||||
void Entity_Player::render_back(const Vector& position)
|
||||
{
|
||||
if (!isVisible || IsFullSpriteRendering()) return;
|
||||
layer_sprite(PLAYER_LAYER_BACK).RenderLayer(layer_id(PLAYER_LAYER_BACK), SpriteDraw{position, {}, {}});
|
||||
}
|
||||
|
||||
// 0078dde0 Draws the body layers, the costumes' where they cover them, and the blood gush of a headless player.
|
||||
// Flying costumes cover the body only while flying.
|
||||
void Entity_Player::RenderBody(const Vector& position)
|
||||
{
|
||||
if (!isVisible || IsFullSpriteRendering()) return;
|
||||
|
||||
bool isBodyRendered = false;
|
||||
for (int layer = PLAYER_LAYER_BODY; layer <= PLAYER_LAYER_BODY1; layer++)
|
||||
{
|
||||
int index = playerCostumeMap[layer].index;
|
||||
if (index < 0)
|
||||
{
|
||||
sprite.RenderLayer(layer, SpriteDraw{position, {}, {}});
|
||||
isBodyRendered = true;
|
||||
continue;
|
||||
}
|
||||
if (canFly && !costumeSpriteDescs[index].isFlying) continue;
|
||||
reconstruction_missing("Entity_Player::RenderBody 0078dde0 (body costumes)");
|
||||
}
|
||||
if (isBodyRendered && IsHeadless()) reconstruction_missing("Entity_Player::RenderBody 0078dde0 (the blood gush)");
|
||||
}
|
||||
|
||||
// 0078dff0 Draws the head layers, the costumes' where they cover them, and the crowns of Dark Prince's Crown and Crown
|
||||
// of Light.
|
||||
void Entity_Player::RenderHead(const Vector& position)
|
||||
{
|
||||
if (!isVisible || IsFullSpriteRendering()) return;
|
||||
|
||||
for (int layer = PLAYER_LAYER_HEAD; layer <= PLAYER_LAYER_EXTRA - 1; layer++)
|
||||
layer_sprite(layer).RenderLayer(layer_id(layer), SpriteDraw{position, {}, {}});
|
||||
for (auto [collectible, crown] : {std::pair{COLLECTIBLE_DARK_PRINCES_CROWN, &darkPrincesCrownSprite},
|
||||
std::pair{COLLECTIBLE_CROWN_OF_LIGHT, &crownOfLightSprite}})
|
||||
{
|
||||
if (!HasCollectible(collectible) || !crown->isLoaded) continue;
|
||||
AnimationState& first = crown->isOverlayRenderFirst ? crown->overlayAnimState : crown->animState;
|
||||
AnimationState& second = crown->isOverlayRenderFirst ? crown->animState : crown->overlayAnimState;
|
||||
first.Render(SpriteDraw{position, {}, {}}, *crown);
|
||||
second.Render(SpriteDraw{position, {}, {}}, *crown);
|
||||
}
|
||||
}
|
||||
|
||||
// 0078e190 Draws the top layer over the head.
|
||||
void Entity_Player::RenderTop(const Vector& position)
|
||||
{
|
||||
if (!isVisible || IsFullSpriteRendering()) return;
|
||||
layer_sprite(PLAYER_LAYER_TOP0).RenderLayer(layer_id(PLAYER_LAYER_TOP0), SpriteDraw{position, {}, {}});
|
||||
}
|
||||
|
||||
// 0078dc20 Draws the shadow, which My Shadow's player has none of.
|
||||
bool Entity_Player::RenderShadowLayer(const Vector& offset)
|
||||
{
|
||||
if (HasCollectible(COLLECTIBLE_MY_SHADOW)) return true;
|
||||
return Entity::RenderShadowLayer(offset);
|
||||
}
|
||||
|
||||
// 0075ea40 Draws the charge bars over the player when the options show them: the weapons' charge, the crafting bag and
|
||||
// the charging items. Only the hidden case is reconstructed: shown bars stop the game until reached.
|
||||
void Entity_Player::render_charge_bars(Vector)
|
||||
{
|
||||
if (!g_manager->optionsConfig.isChargeBarsEnabled) return;
|
||||
reconstruction_missing("Entity_Player::render_charge_bars 0075ea40 (the charge bars)");
|
||||
}
|
||||
@@ -0,0 +1,736 @@
|
||||
#include "entity_player.h"
|
||||
#include "game.h"
|
||||
#include "manager.h"
|
||||
|
||||
constexpr int CONSUMABLE_MAX = 99;
|
||||
constexpr int DEEP_POCKETS_COIN_MAX = 999;
|
||||
constexpr int BLUEBABY_B_POOP_CAP = 24;
|
||||
constexpr int COINS_UNLOCK_THRESHOLD = 55;
|
||||
constexpr int GREED_GULLET_COINS_PER_HEART = 25;
|
||||
constexpr int HEART_LIMIT_DEFAULT = 24;
|
||||
constexpr int HEART_LIMIT_DEATHMATCH = 160;
|
||||
constexpr int HEART_LIMIT_FORGOTTEN = 12;
|
||||
constexpr int HEART_LIMIT_FORGOTTEN_SOUL = 6;
|
||||
constexpr int HEART_LIMIT_ESAU_SOUL = 4;
|
||||
constexpr int MAX_HEARTS_UNLOCK = 14;
|
||||
constexpr int SOUL_HEARTS_UNLOCK = 8;
|
||||
constexpr int BLACK_HEART_BITS = 32;
|
||||
// The game state bit set once the coins reach 99, which the original keeps one below Lua's STATE_MAX_COINS_OBTAINED.
|
||||
constexpr uint64_t GAME_STATE_MAX_COINS_BIT = 1ull << 43;
|
||||
|
||||
// Which consumables ConsumableCountChanged and SyncConsumables copy between players.
|
||||
enum ConsumableMask : uint32_t
|
||||
{
|
||||
CONSUMABLE_COINS = 0x1,
|
||||
CONSUMABLE_KEYS = 0x2,
|
||||
CONSUMABLE_BOMBS = 0x4,
|
||||
CONSUMABLE_GOLDEN_KEY = 0x8,
|
||||
CONSUMABLE_GOLDEN_BOMB = 0x10,
|
||||
CONSUMABLE_SOUL_CHARGE = 0x20,
|
||||
CONSUMABLE_GIGA_BOMBS = 0x40,
|
||||
CONSUMABLE_POOP_MANA = 0x80,
|
||||
CONSUMABLE_BLOOD_CHARGE = 0x100
|
||||
};
|
||||
|
||||
// 007dd380 A heart amount as the deathmatch counts it, eight times the run's.
|
||||
int scale_for_hard_difficulty(int value)
|
||||
{
|
||||
return g_game->deathmatchManager.is_active() ? value * 8 : value;
|
||||
}
|
||||
|
||||
// Asks the HUD to redraw the players' corners on the next frame but one, unless a full redraw is pending.
|
||||
static void hud_refresh_players()
|
||||
{
|
||||
HUD& hud = g_game->hud;
|
||||
|
||||
if (hud.hudRefreshType == HUD_REFRESH_FULL) return;
|
||||
hud.hudRefreshType = HUD_REFRESH_PLAYER;
|
||||
hud.hudRefreshCountdown = 2;
|
||||
}
|
||||
|
||||
// The player whose health a Jacob's Esau ghost (The Soul of Tainted Forgotten) stands for: its twin.
|
||||
Entity_Player* Entity_Player::health_owner()
|
||||
{
|
||||
Entity_Player* player = this;
|
||||
while (player->playerType == PLAYER_THESOUL_B && player->twin_get()) player = player->twin_get();
|
||||
return player;
|
||||
}
|
||||
|
||||
// 007cafe0 How the character counts its health.
|
||||
HealthType Entity_Player::GetHealthType()
|
||||
{
|
||||
switch (playerType)
|
||||
{
|
||||
case PLAYER_BLUEBABY:
|
||||
case PLAYER_BLACKJUDAS:
|
||||
case PLAYER_THESOUL:
|
||||
case PLAYER_JUDAS_B:
|
||||
case PLAYER_BLUEBABY_B:
|
||||
case PLAYER_THEFORGOTTEN_B:
|
||||
case PLAYER_BETHANY_B:
|
||||
return HEALTH_SOUL;
|
||||
case PLAYER_THELOST:
|
||||
case PLAYER_THELOST_B:
|
||||
case PLAYER_THESOUL_B:
|
||||
return HEALTH_NO_HEALTH;
|
||||
case PLAYER_KEEPER:
|
||||
case PLAYER_KEEPER_B:
|
||||
return HEALTH_COIN;
|
||||
case PLAYER_THEFORGOTTEN:
|
||||
return HEALTH_BONE;
|
||||
default:
|
||||
return HEALTH_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
// 007cae60 The most half hearts the player can hold: 24, 12 for The Forgotten and The Soul and co-op babies, more with
|
||||
// Magdalene's Birthright, Keeper's coin hearts from Greed's Gullet, less two per broken heart. With isKeeperBypass the
|
||||
// broken hearts and Keeper's own limits are ignored. Forgotten's and Esau's soul forms hold less.
|
||||
int Entity_Player::GetHeartLimit(bool isKeeperBypass)
|
||||
{
|
||||
if (g_game->deathmatchManager.is_active()) return HEART_LIMIT_DEATHMATCH;
|
||||
if (variant == PLAYER_VARIANT_PLAYER)
|
||||
{
|
||||
if (playerType == PLAYER_THEFORGOTTEN && temporaryEffects.HasNullEffect(NULLITEM_SOUL_FORGOTTEN))
|
||||
return HEART_LIMIT_FORGOTTEN_SOUL;
|
||||
if (playerType == PLAYER_ESAU && temporaryEffects.HasNullEffect(NULLITEM_SOUL_JACOB))
|
||||
return HEART_LIMIT_ESAU_SOUL;
|
||||
}
|
||||
|
||||
bool isSmall =
|
||||
variant == PLAYER_VARIANT_COOP_BABY || playerType == PLAYER_THEFORGOTTEN || playerType == PLAYER_THESOUL;
|
||||
int limit = isSmall ? HEART_LIMIT_FORGOTTEN : HEART_LIMIT_DEFAULT;
|
||||
if (playerType == PLAYER_MAGDALENE && HasCollectible(COLLECTIBLE_BIRTHRIGHT)) limit += HEART_LIMIT_FORGOTTEN;
|
||||
|
||||
if (playerType == PLAYER_KEEPER || playerType == PLAYER_KEEPER_B)
|
||||
{
|
||||
if (isKeeperBypass) return limit;
|
||||
|
||||
limit = std::min((playerType == PLAYER_KEEPER ? 6 : 4) + GetGreedsGulletHearts() * 2, HEART_LIMIT_DEFAULT);
|
||||
if (playerType == PLAYER_KEEPER && HasCollectible(COLLECTIBLE_BIRTHRIGHT)) limit += 2;
|
||||
if (HasCollectible(COLLECTIBLE_GREEDS_GULLET))
|
||||
limit += (numCoins / GREED_GULLET_COINS_PER_HEART + (numCoins == CONSUMABLE_MAX ? 1 : 0)) * 2;
|
||||
}
|
||||
else if (isKeeperBypass) return limit;
|
||||
return std::max(0, limit - brokenHearts * 2);
|
||||
}
|
||||
|
||||
// 007cb060 The red heart containers the player counts, bone hearts included for the characters that have them.
|
||||
int Entity_Player::GetEffectiveMaxHearts()
|
||||
{
|
||||
HealthType health = GetHealthType();
|
||||
if (health == HEALTH_SOUL || health == HEALTH_NO_HEALTH) return maxHearts;
|
||||
return maxHearts + boneHearts * 2;
|
||||
}
|
||||
|
||||
// 007ce390 The heart containers Greed's Gullet gives Keeper for its coins, plus one per Mother's Kiss.
|
||||
int Entity_Player::GetGreedsGulletHearts()
|
||||
{
|
||||
int hearts = 0;
|
||||
if (HasCollectible(COLLECTIBLE_GREEDS_GULLET))
|
||||
{
|
||||
if (numCoins > CONSUMABLE_MAX) return GetTrinketMultiplier(TRINKET_MOTHERS_KISS) + numCoins / 100 + 3;
|
||||
if (numCoins == CONSUMABLE_MAX) return GetTrinketMultiplier(TRINKET_MOTHERS_KISS) + 4;
|
||||
hearts = std::max(0, numCoins) / GREED_GULLET_COINS_PER_HEART;
|
||||
}
|
||||
return GetTrinketMultiplier(TRINKET_MOTHERS_KISS) + hearts;
|
||||
}
|
||||
|
||||
// 007588a0 Adds heart containers, or takes them away. Soul characters get soul or black hearts instead, The Forgotten
|
||||
// bone hearts. Past the limit the extra is lost, and soul and red hearts are clamped to what is left.
|
||||
void Entity_Player::AddMaxHearts(int amount, bool isIgnoreKeeper)
|
||||
{
|
||||
Entity_Player& owner = *health_owner();
|
||||
HealthType health = owner.GetHealthType();
|
||||
|
||||
if (health == HEALTH_NO_HEALTH) return;
|
||||
if (health == HEALTH_SOUL)
|
||||
{
|
||||
if (owner.HasCollectible(COLLECTIBLE_BIRTHRIGHT) && owner.playerType == PLAYER_BLUEBABY && amount > 0)
|
||||
owner.AddSoulHearts(amount * 2, false);
|
||||
else if (owner.playerType == PLAYER_BLACKJUDAS || owner.playerType == PLAYER_JUDAS_B)
|
||||
owner.AddBlackHearts(amount);
|
||||
else owner.AddSoulHearts(amount, false);
|
||||
return;
|
||||
}
|
||||
if (health == HEALTH_BONE)
|
||||
{
|
||||
owner.AddBoneHearts(amount / 2);
|
||||
return;
|
||||
}
|
||||
|
||||
int limit = owner.GetHeartLimit(isIgnoreKeeper);
|
||||
if (amount < 0) owner.trigger_max_hearts_removed(-amount);
|
||||
if (!isIgnoreKeeper) amount = scale_for_hard_difficulty(amount);
|
||||
if (owner.maxHearts + amount > limit) owner.trigger_max_hearts_removed(owner.maxHearts - limit + amount);
|
||||
owner.maxHearts = std::min(owner.maxHearts + amount, limit);
|
||||
if (owner.maxHearts < 0)
|
||||
{
|
||||
int missing = owner.maxHearts;
|
||||
owner.maxHearts = 0;
|
||||
owner.AddBoneHearts(missing / 2);
|
||||
}
|
||||
|
||||
int effectiveMax = owner.GetEffectiveMaxHearts();
|
||||
if (owner.soulHearts + effectiveMax > limit) owner.soulHearts = std::max(0, limit - effectiveMax);
|
||||
owner.redHearts = std::min(owner.redHearts, effectiveMax);
|
||||
if (owner.maxHearts >= MAX_HEARTS_UNLOCK) g_manager->persistentGameData.TryUnlock(ACHIEVEMENT_MAGDALENE);
|
||||
owner.UpdateBlackHeartMask();
|
||||
owner.update_greeds_gullet();
|
||||
owner.UpdateHeartDependentEffects();
|
||||
owner.ClampGoldenHearts(false);
|
||||
owner.update_bone_hearts();
|
||||
owner.ClampHeartsToLimit(HEART_RED, 0);
|
||||
}
|
||||
|
||||
// 00758a70 Adds red hearts up to the containers, or takes them away. Esau's ghost, The Soul and Tainted Bethany pass
|
||||
// them on, Tainted Magdalene doubles the healing and Keeper rounds it to whole coins. The Have a Heart challenge heals
|
||||
// nothing unless isUnknown is set.
|
||||
void Entity_Player::AddHearts(int hearts, bool isUnknown, bool isUnknown2)
|
||||
{
|
||||
Entity_Player* owner = this;
|
||||
while (true)
|
||||
{
|
||||
if (hearts > 0 && g_game->deathmatchManager.is_active()) hearts *= 8;
|
||||
if (owner->playerType == PLAYER_THESOUL_B && owner->twin_get())
|
||||
{
|
||||
isUnknown2 = false;
|
||||
owner = owner->twin_get();
|
||||
continue;
|
||||
}
|
||||
if (hearts > 0 && !isUnknown && g_game->challenge == CHALLENGE_HAVE_A_HEART) return;
|
||||
if (owner->playerType != PLAYER_THESOUL || !owner->subPlayer) break;
|
||||
|
||||
isUnknown2 = false;
|
||||
isUnknown = false;
|
||||
owner = owner->subPlayer;
|
||||
}
|
||||
if (owner->playerType == PLAYER_BETHANY_B && owner->playerType != PLAYER_THESOUL)
|
||||
{
|
||||
owner->AddBloodCharge(hearts);
|
||||
return;
|
||||
}
|
||||
if (owner->playerType == PLAYER_MAGDALENE_B && !isUnknown && hearts > 0) hearts *= 2;
|
||||
owner->red_hearts_add(hearts, isUnknown2);
|
||||
}
|
||||
|
||||
// Adds red hearts to a player that keeps them, after AddHearts settled who and how many.
|
||||
void Entity_Player::red_hearts_add(int hearts, bool isUnknown2)
|
||||
{
|
||||
HealthType health = GetHealthType();
|
||||
if (health == HEALTH_SOUL || health == HEALTH_NO_HEALTH) return;
|
||||
if (health == HEALTH_COIN) hearts = (hearts + (hearts < 1 ? -1 : 1)) / 2 * 2;
|
||||
|
||||
int oldRedHearts = redHearts;
|
||||
redHearts = std::max(0, std::min(oldRedHearts + hearts, maxHearts + boneHearts * 2));
|
||||
if (hearts > 0)
|
||||
{
|
||||
ClearEntityFlags(FLAG_BLEED_OUT);
|
||||
bleedOutHealth = 0;
|
||||
}
|
||||
if (redHearts != oldRedHearts) UpdateHeartDependentEffects();
|
||||
ClampGoldenHearts(isUnknown2);
|
||||
update_bone_hearts();
|
||||
if (hearts > 0 && oldRedHearts < redHearts) hud_heart_flash();
|
||||
}
|
||||
|
||||
// 00758d00 Adds soul hearts up to the limit, or takes them away. Esau's ghost passes them to its twin and The Forgotten
|
||||
// to The Soul. Alabaster Box's charge eats them first, a Blanket's shield takes two, Keeper gets flies, Bethany soul
|
||||
// charge, and characters without health a single soul heart when given any.
|
||||
void Entity_Player::AddSoulHearts(int amount, bool isUnknown)
|
||||
{
|
||||
Entity_Player* owner = this;
|
||||
Game& game = *g_game;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (owner->playerType == PLAYER_THESOUL_B && owner->twin_get())
|
||||
{
|
||||
isUnknown = false;
|
||||
owner = owner->twin_get();
|
||||
}
|
||||
if (!owner->isUpdatingGreedsGullet && !game.isStartingFromState && !game.isRestoringGlowingHourglassState &&
|
||||
amount > 0)
|
||||
amount = owner->soul_hearts_absorb(amount);
|
||||
|
||||
HealthType health = owner->GetHealthType();
|
||||
if (health == HEALTH_NO_HEALTH)
|
||||
{
|
||||
if (amount > 0) owner->soulHearts = 1;
|
||||
return;
|
||||
}
|
||||
if (health == HEALTH_COIN)
|
||||
{
|
||||
if (amount > 0) owner->AddBlueFlies((amount * 3 + 1) / 2, owner->pos, nullptr);
|
||||
return;
|
||||
}
|
||||
if (owner->playerType != PLAYER_THEFORGOTTEN) break;
|
||||
|
||||
owner = owner->subPlayer;
|
||||
if (!owner) return;
|
||||
isUnknown = false;
|
||||
}
|
||||
owner->soul_hearts_add(amount, isUnknown);
|
||||
}
|
||||
|
||||
// Fills Alabaster Box charges and lets a Blanket shield take two from soul hearts about to be added, returning what is
|
||||
// left.
|
||||
int Entity_Player::soul_hearts_absorb(int amount)
|
||||
{
|
||||
if (temporaryEffects.HasNullEffect(NULLITEM_SPIRIT_SHACKLES_DISABLED))
|
||||
{
|
||||
temporaryEffects.RemoveNullEffect(NULLITEM_SPIRIT_SHACKLES_DISABLED, -1);
|
||||
amount = std::max(0, amount - 2);
|
||||
if (amount <= 0) return amount;
|
||||
}
|
||||
for (int slot = 0; slot < ACTIVE_SLOT_COUNT; slot++)
|
||||
{
|
||||
ActiveItemDesc& active = activeItems[slot];
|
||||
if (active.item != COLLECTIBLE_ALABASTER_BOX) continue;
|
||||
|
||||
int charge = std::max(0, std::min(active.charge + amount, GetActiveMaxCharge(slot)));
|
||||
if (charge == active.charge) continue;
|
||||
int before = active.charge;
|
||||
SetActiveCharge(charge, slot);
|
||||
amount += before - charge;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
// Adds soul hearts to a player that keeps them, after AddSoulHearts settled who and how many.
|
||||
void Entity_Player::soul_hearts_add(int amount, bool isUnknown)
|
||||
{
|
||||
if (playerType == PLAYER_BETHANY)
|
||||
{
|
||||
AddSoulCharge(amount);
|
||||
return;
|
||||
}
|
||||
if (GetHealthType() == HEALTH_SOUL && amount < 0) trigger_max_hearts_removed(-amount);
|
||||
if (g_game->deathmatchManager.is_active())
|
||||
{
|
||||
ClampHeartsToLimit(HEART_SOUL, amount);
|
||||
return;
|
||||
}
|
||||
|
||||
int oldSoulHearts = soulHearts;
|
||||
soulHearts = std::max(0, soulHearts + amount);
|
||||
int limit = GetHeartLimit(false);
|
||||
int containers = maxHearts + boneHearts * 2;
|
||||
if (containers + soulHearts > limit) soulHearts = limit - containers;
|
||||
if (soulHearts >= SOUL_HEARTS_UNLOCK) g_manager->persistentGameData.TryUnlock(ACHIEVEMENT_LAZARUS);
|
||||
UpdateBlackHeartMask();
|
||||
ClampGoldenHearts(isUnknown);
|
||||
update_bone_hearts();
|
||||
if (amount < 1 || soulHearts < oldSoulHearts) return;
|
||||
|
||||
for (PlayerHUD& hud : g_game->hud.playerHUD)
|
||||
if (hud.player == this)
|
||||
{
|
||||
hud.soulHeartFlashCountdown = HUD_HEART_FLASH_FRAMES;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Flashes the player's red hearts on the HUD after healing.
|
||||
void Entity_Player::hud_heart_flash()
|
||||
{
|
||||
for (PlayerHUD& hud : g_game->hud.playerHUD)
|
||||
if (hud.player == this)
|
||||
{
|
||||
hud.redHeartFlashCountdown = HUD_HEART_FLASH_FRAMES;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 00758f90 Adds black hearts as soul hearts marked black, or flies for Keeper. Near the limit it turns the existing
|
||||
// soul hearts black from the last one back instead. Golden hearts left without a heart to sit on break.
|
||||
void Entity_Player::AddBlackHearts(int amount)
|
||||
{
|
||||
Entity_Player* owner = health_owner();
|
||||
while (owner->GetHealthType() != HEALTH_NO_HEALTH && owner->playerType == PLAYER_THEFORGOTTEN)
|
||||
{
|
||||
owner = owner->subPlayer;
|
||||
if (!owner) return;
|
||||
while (owner->playerType == PLAYER_THESOUL_B && owner->twin_get()) owner = owner->twin_get();
|
||||
}
|
||||
if (owner->GetHealthType() == HEALTH_NO_HEALTH) return;
|
||||
owner->black_hearts_add(amount);
|
||||
}
|
||||
|
||||
// Marks the soul hearts about to be added black, or turns soul hearts black when the limit leaves no room.
|
||||
void Entity_Player::black_hearts_add(int amount)
|
||||
{
|
||||
if (GetHealthType() == HEALTH_COIN)
|
||||
{
|
||||
AddBlueFlies((amount * 4 + 1) / 2, pos, nullptr);
|
||||
return;
|
||||
}
|
||||
if (g_game->deathmatchManager.is_active())
|
||||
{
|
||||
ClampHeartsToLimit(HEART_BLACK, amount);
|
||||
return;
|
||||
}
|
||||
|
||||
int roundedSoul = soulHearts + (soulHearts & 1);
|
||||
int oddAdjust = 0;
|
||||
int extra = amount & 1;
|
||||
if ((soulHearts & 1) && extra)
|
||||
{
|
||||
oddAdjust = -1;
|
||||
extra = 0;
|
||||
}
|
||||
if (roundedSoul + maxHearts + boneHearts * 2 < GetHeartLimit(false) - 1)
|
||||
{
|
||||
for (int heart = (oddAdjust + roundedSoul) / 2; heart < (extra + roundedSoul + amount) / 2; heart++)
|
||||
blackHearts |= 1 << heart;
|
||||
}
|
||||
else
|
||||
{
|
||||
int marked = 0;
|
||||
int slot = roundedSoul - 1;
|
||||
int lower = roundedSoul;
|
||||
while (slot > 0)
|
||||
{
|
||||
lower -= 2;
|
||||
if (marked >= amount) break;
|
||||
bool isRedundant = slot <= soulHearts && slot >= 1 && slot % 2 == 1 && (blackHearts & (1 << (lower / 2)));
|
||||
if (!isRedundant)
|
||||
{
|
||||
marked += 2;
|
||||
blackHearts |= 1 << (slot / 2);
|
||||
}
|
||||
slot -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
AddSoulHearts(amount, false);
|
||||
if (!g_game->deathmatchManager.is_active() && !isDead && goldenHearts > 0)
|
||||
{
|
||||
int holders = (std::min(redHearts, maxHearts) + 1) / 2 + (soulHearts + 1) / 2 + boneHearts;
|
||||
if (holders < goldenHearts)
|
||||
{
|
||||
BreakGoldenHearts(goldenHearts - holders);
|
||||
goldenHearts = holders;
|
||||
}
|
||||
}
|
||||
update_bone_hearts();
|
||||
}
|
||||
|
||||
// 007d2a40 Adds broken hearts, at most half the heart limit, then lets AddMaxHearts drop what no longer fits.
|
||||
// Heartbreak's damage follows the count.
|
||||
void Entity_Player::AddBrokenHearts(int amount)
|
||||
{
|
||||
Entity_Player& owner = *health_owner();
|
||||
|
||||
owner.brokenHearts = std::min(std::max(0, owner.brokenHearts + amount), owner.GetHeartLimit(true) / 2);
|
||||
owner.AddMaxHearts(0, false);
|
||||
if (owner.HasCollectible(COLLECTIBLE_HEARTBREAK))
|
||||
{
|
||||
owner.cacheFlags |= CACHE_DAMAGE;
|
||||
owner.EvaluateItems();
|
||||
}
|
||||
}
|
||||
|
||||
// 007592a0 Moves the black heart bits down with the soul hearts that were lost, keeping as many black hearts as fit.
|
||||
void Entity_Player::UpdateBlackHeartMask()
|
||||
{
|
||||
if (g_game->deathmatchManager.is_active()) return;
|
||||
if (soulHearts == 0)
|
||||
{
|
||||
blackHearts = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t lost = 0;
|
||||
int moved = 0;
|
||||
for (int heart = (soulHearts + 1) / 2; heart < BLACK_HEART_BITS; heart++)
|
||||
if (blackHearts & (1u << heart))
|
||||
{
|
||||
lost |= 1u << heart;
|
||||
moved++;
|
||||
}
|
||||
blackHearts &= ~lost;
|
||||
|
||||
int lower = soulHearts;
|
||||
for (int slot = soulHearts; slot > 0 && moved > 0; slot--)
|
||||
{
|
||||
lower--;
|
||||
if (!(slot & 1)) continue;
|
||||
if (soulHearts < slot || !(blackHearts & (1u << (lower / 2))))
|
||||
{
|
||||
moved--;
|
||||
blackHearts |= 1u << (slot >> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 007cacb0 In the deathmatch, trims soul, golden, rotten, bone and black hearts past the limit, then adds what fits of
|
||||
// the hearts just given. Outside it does nothing.
|
||||
void Entity_Player::ClampHeartsToLimit(HeartKind kind, int amount)
|
||||
{
|
||||
if (!g_game->deathmatchManager.is_active()) return;
|
||||
|
||||
int added = amount * 8;
|
||||
int limit = GetHeartLimit(false);
|
||||
int total = maxHearts + soulHearts + blackHearts + goldenHearts + boneHearts + rottenHearts * 2;
|
||||
for (int* hearts : {&soulHearts, &goldenHearts, &rottenHearts, &boneHearts, &blackHearts})
|
||||
{
|
||||
if (total <= limit) break;
|
||||
int trimmed = std::min(*hearts, total - limit);
|
||||
if (trimmed <= 0) continue;
|
||||
*hearts -= trimmed;
|
||||
total -= trimmed;
|
||||
}
|
||||
|
||||
int fits = std::max(0, std::min(added, added - total + limit));
|
||||
switch (kind)
|
||||
{
|
||||
case HEART_SOUL:
|
||||
soulHearts += fits;
|
||||
break;
|
||||
case HEART_BLACK:
|
||||
blackHearts += fits;
|
||||
break;
|
||||
case HEART_GOLDEN:
|
||||
goldenHearts += fits;
|
||||
break;
|
||||
case HEART_BONE:
|
||||
boneHearts += fits;
|
||||
break;
|
||||
case HEART_ROTTEN:
|
||||
rottenHearts += fits;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 007ca7c0 Breaks golden hearts that no longer have a heart to sit on, quietly with isSkipBreak.
|
||||
void Entity_Player::ClampGoldenHearts(bool isSkipBreak)
|
||||
{
|
||||
if (g_game->deathmatchManager.is_active() || isDead || goldenHearts <= 0) return;
|
||||
|
||||
int holders = (std::min(redHearts, maxHearts) + 1) / 2 + (soulHearts + 1) / 2 + boneHearts;
|
||||
if (holders >= goldenHearts) return;
|
||||
if (!isSkipBreak) BreakGoldenHearts(goldenHearts - holders);
|
||||
goldenHearts = holders;
|
||||
}
|
||||
|
||||
// 007cabc0 Drops bone hearts past the limit, then lays the mask of which heart slots hold bones over the slots there
|
||||
// are, filling it from the top for any bone heart it misses.
|
||||
void Entity_Player::update_bone_hearts()
|
||||
{
|
||||
if (g_game->deathmatchManager.is_active()) return;
|
||||
|
||||
boneHearts = std::min(boneHearts, GetHeartLimit(false) / 2 - ((maxHearts + 1 + soulHearts) >> 1));
|
||||
if (boneHearts < 1)
|
||||
{
|
||||
boneHearts = 0;
|
||||
boneHeartsMask = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int slots = (soulHearts + 1) / 2 + boneHearts;
|
||||
uint32_t mask = (uint32_t)boneHeartsMask & (0xffffffffu >> ((32 - slots) & 31));
|
||||
int left = boneHearts;
|
||||
for (int slot = 0; slot < slots; slot++)
|
||||
if ((mask & (1u << slot)) && --left < 0) mask &= ~(1u << slot);
|
||||
boneHeartsMask = (int)mask;
|
||||
for (int slot = slots - 1; slot >= 0 && left > 0; slot--)
|
||||
if (!(mask & (1u << slot)))
|
||||
{
|
||||
left--;
|
||||
boneHeartsMask |= 1 << slot;
|
||||
mask = (uint32_t)boneHeartsMask;
|
||||
}
|
||||
}
|
||||
|
||||
// 007c9ea0 Settles what follows a change of hearts: rotten hearts fit in the red ones, Greed's Gullet, Tainted Eve's
|
||||
// last heart, Whore of Babylon, Crown of Light, Dark Prince's Crown and Vasculitis.
|
||||
void Entity_Player::UpdateHeartDependentEffects()
|
||||
{
|
||||
Game& game = *g_game;
|
||||
bool isDeathmatch = game.deathmatchManager.is_active();
|
||||
|
||||
if (!isDeathmatch)
|
||||
{
|
||||
rottenHearts = std::min(rottenHearts, (redHearts + 1) / 2);
|
||||
redHearts = std::max(redHearts, rottenHearts * 2);
|
||||
}
|
||||
update_greeds_gullet();
|
||||
if (!isDead && playerType == PLAYER_EVE_B &&
|
||||
boneHearts + goldenHearts + soulHearts + eternalHearts + redHearts == 1)
|
||||
reconstruction_missing("Entity_Player::UpdateHeartDependentEffects 007c9ea0 (Tainted Eve's last heart)");
|
||||
|
||||
int lowRed = isDeathmatch ? 16 : 1;
|
||||
if (!isDead && redHearts <= lowRed)
|
||||
if (HasCollectible(COLLECTIBLE_WHORE_OF_BABYLON) &&
|
||||
!temporaryEffects.HasCollectibleEffect(COLLECTIBLE_WHORE_OF_BABYLON))
|
||||
reconstruction_missing("Entity_Player::UpdateHeartDependentEffects 007c9ea0 (Whore of Babylon)");
|
||||
if (!isDead && playerType == PLAYER_EVE && redHearts > lowRed)
|
||||
reconstruction_missing("Entity_Player::UpdateHeartDependentEffects 007c9ea0 (Eve's Whore of Babylon)");
|
||||
|
||||
if (HasCollectible(COLLECTIBLE_CROWN_OF_LIGHT) || HasCollectible(COLLECTIBLE_DARK_PRINCES_CROWN))
|
||||
reconstruction_missing("Entity_Player::UpdateHeartDependentEffects 007c9ea0 (the crowns)");
|
||||
if (HasCollectible(COLLECTIBLE_VASCULITIS) || temporaryEffects.HasCollectibleEffect(COLLECTIBLE_VASCULITIS))
|
||||
{
|
||||
cacheFlags |= CACHE_DAMAGE;
|
||||
EvaluateItems();
|
||||
}
|
||||
}
|
||||
|
||||
// 007ce420 Keeps Greed's Gullet's heart containers in step with the coins: hearts lost pay back coins (and break a
|
||||
// Mother's Kiss), hearts gained or lost change the containers, and what did not fit waits as overflow.
|
||||
void Entity_Player::update_greeds_gullet()
|
||||
{
|
||||
Game& game = *g_game;
|
||||
if (game.isRestoringGlowingHourglassState || game.isStartingFromState) return;
|
||||
|
||||
Entity_Player& owner = playerType == PLAYER_THESOUL && subPlayer ? *subPlayer : *this;
|
||||
if (owner.isUpdatingGreedsGullet) return;
|
||||
owner.isUpdatingGreedsGullet = true;
|
||||
isUpdatingGreedsGullet = true;
|
||||
|
||||
int before = greedsGulletHearts;
|
||||
switch (owner.GetHealthType())
|
||||
{
|
||||
case HEALTH_DEFAULT:
|
||||
case HEALTH_COIN:
|
||||
greedsGulletHearts =
|
||||
(short)std::min<int>(greedsGulletHearts, (owner.maxHearts >> 1) + greedsGulletOverflow);
|
||||
break;
|
||||
case HEALTH_SOUL:
|
||||
greedsGulletHearts =
|
||||
(short)std::min<int>(greedsGulletHearts, ((owner.soulHearts + 1) >> 1) + greedsGulletOverflow);
|
||||
break;
|
||||
case HEALTH_BONE:
|
||||
greedsGulletHearts = (short)std::min<int>(greedsGulletHearts, owner.boneHearts + greedsGulletOverflow);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (greedsGulletHearts < before)
|
||||
{
|
||||
if (HasTrinket(TRINKET_MOTHERS_KISS))
|
||||
{
|
||||
TryRemoveTrinket(TRINKET_MOTHERS_KISS);
|
||||
before--;
|
||||
}
|
||||
while (greedsGulletHearts < before)
|
||||
{
|
||||
before--;
|
||||
AddCoins(before < 3 ? -25 : before == 3 ? -24 : before == 4 ? -100 : -101);
|
||||
}
|
||||
}
|
||||
|
||||
int target = GetGreedsGulletHearts();
|
||||
int current = greedsGulletHearts;
|
||||
if (target != current || greedsGulletOverflow > 0)
|
||||
reconstruction_missing("Entity_Player::update_greeds_gullet 007ce420 (Greed's Gullet hearts changing)");
|
||||
owner.isUpdatingGreedsGullet = false;
|
||||
isUpdatingGreedsGullet = false;
|
||||
}
|
||||
|
||||
// 00759400 Adds coins, up to 99 (999 with Deep Pockets). Keeper heals with them first and keeps the rest.
|
||||
void Entity_Player::AddCoins(int amount)
|
||||
{
|
||||
int coins = amount;
|
||||
if (amount > 0 && GetHealthType() == HEALTH_COIN)
|
||||
{
|
||||
int oldRedHearts = redHearts;
|
||||
AddHearts(amount * 2, false, false);
|
||||
coins = std::max(0, amount - (redHearts - oldRedHearts) / 2);
|
||||
if (oldRedHearts < redHearts) AddImmaculateConceptionCounter(1);
|
||||
}
|
||||
|
||||
bool isDeepPockets = g_game->playerManager.FirstCollectibleOwner(COLLECTIBLE_DEEP_POCKETS, LAZARUS_SHARE_CHECK);
|
||||
numCoins = std::max(0, std::min(numCoins + coins, isDeepPockets ? DEEP_POCKETS_COIN_MAX : CONSUMABLE_MAX));
|
||||
ConsumableCountChanged(CONSUMABLE_COINS);
|
||||
hud_refresh_players();
|
||||
}
|
||||
|
||||
// 00759500 Adds bombs, up to 99. Tainted Blue Baby gets blue flies for bombs instead.
|
||||
void Entity_Player::AddBombs(int amount)
|
||||
{
|
||||
if (playerType == PLAYER_BLUEBABY_B && amount > 0)
|
||||
{
|
||||
AddBlueFlies(std::min(amount, BLUEBABY_B_POOP_CAP), pos, nullptr);
|
||||
return;
|
||||
}
|
||||
numBombs = std::max(0, std::min(numBombs + amount, CONSUMABLE_MAX));
|
||||
ConsumableCountChanged(CONSUMABLE_BOMBS);
|
||||
hud_refresh_players();
|
||||
}
|
||||
|
||||
// 007595b0 Adds keys, up to 99.
|
||||
void Entity_Player::AddKeys(int amount)
|
||||
{
|
||||
numKeys = std::max(0, std::min(numKeys + amount, CONSUMABLE_MAX));
|
||||
ConsumableCountChanged(CONSUMABLE_KEYS);
|
||||
hud_refresh_players();
|
||||
}
|
||||
|
||||
// 007597e0 Shares the changed consumables with every player, as the run keeps one purse. Coins unlock their
|
||||
// achievements. The deathmatch keeps each player's own.
|
||||
void Entity_Player::ConsumableCountChanged(int bitflags)
|
||||
{
|
||||
if (playerIndex < 0) return;
|
||||
|
||||
Game& game = *g_game;
|
||||
if (game.deathmatchManager.is_active())
|
||||
{
|
||||
SyncConsumables(this, (uint32_t)bitflags);
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerManager& players = game.playerManager;
|
||||
for (size_t i = 0; i < players.playerList.size(); i++)
|
||||
SyncConsumables(players.GetPlayer((int)i), (uint32_t)bitflags);
|
||||
if (!(bitflags & CONSUMABLE_COINS)) return;
|
||||
|
||||
if (numCoins > COINS_UNLOCK_THRESHOLD - 1) g_manager->persistentGameData.TryUnlock(ACHIEVEMENT_CAIN);
|
||||
if (numCoins > CONSUMABLE_MAX - 1) game.gameStateFlags |= GAME_STATE_MAX_COINS_BIT;
|
||||
if (numCoins < 1 && (game.gameStateFlags & GAME_STATE_MAX_COINS_BIT) && !game.isRestoringGlowingHourglassState &&
|
||||
!game.isStartingFromState && !hasCurseMistEffect)
|
||||
g_manager->persistentGameData.TryUnlock(ACHIEVEMENT_GOLDEN_RAZOR);
|
||||
}
|
||||
|
||||
// 007596a0 Copies the consumables a mask names to another player, and settles what depends on them there.
|
||||
void Entity_Player::SyncConsumables(Entity_Player* target, uint32_t mask)
|
||||
{
|
||||
if (mask & CONSUMABLE_COINS)
|
||||
{
|
||||
target->numCoins = numCoins;
|
||||
if (target->isValid)
|
||||
{
|
||||
if (target->HasCollectible(COLLECTIBLE_MONEY_EQUALS_POWER))
|
||||
{
|
||||
target->cacheFlags |= CACHE_DAMAGE;
|
||||
target->EvaluateItems();
|
||||
}
|
||||
target->update_greeds_gullet();
|
||||
}
|
||||
}
|
||||
if (mask & CONSUMABLE_KEYS) target->numKeys = numKeys;
|
||||
if (mask & CONSUMABLE_BOMBS)
|
||||
{
|
||||
target->numBombs = numBombs;
|
||||
target->numGigaBombs = std::min(numBombs, target->numGigaBombs);
|
||||
}
|
||||
if (mask & CONSUMABLE_GOLDEN_KEY) target->hasGoldenKey = hasGoldenKey;
|
||||
if (mask & CONSUMABLE_GOLDEN_BOMB) target->hasGoldenBomb = hasGoldenBomb;
|
||||
if (mask & CONSUMABLE_GIGA_BOMBS) target->numGigaBombs = std::min(numBombs, numGigaBombs);
|
||||
if (mask & CONSUMABLE_SOUL_CHARGE)
|
||||
{
|
||||
int before = target->effectiveSoulCharge;
|
||||
target->effectiveSoulCharge = effectiveSoulCharge;
|
||||
if (target->isValid) target->apply_soul_charge_to_actives(before);
|
||||
}
|
||||
if (mask & CONSUMABLE_BLOOD_CHARGE)
|
||||
{
|
||||
int before = target->effectiveBloodCharge;
|
||||
target->effectiveBloodCharge = effectiveBloodCharge;
|
||||
if (target->isValid) target->blood_charge_changed(before);
|
||||
}
|
||||
if (mask & CONSUMABLE_POOP_MANA) target->poopMana = poopMana;
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
#include "entity_player.h"
|
||||
#include "game.h"
|
||||
#include "room.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "platform.h"
|
||||
|
||||
constexpr int ROOM_TRINKET_ROLL_SHIFT = 13;
|
||||
constexpr int RAINBOW_WORM_FRAMES = 90;
|
||||
constexpr uint32_t DAILY_RAINBOW_TRINKETS = 28;
|
||||
constexpr int ERROR_TRINKET_RANGE = 189;
|
||||
constexpr uint32_t GRANTED_FIRE_MIND = 0x8;
|
||||
constexpr uint32_t GRANTED_SCORPIO = 0x10;
|
||||
constexpr uint32_t GRANTED_BALL_OF_TAR = 0x20;
|
||||
constexpr uint32_t GRANTED_SACRED_HEART = 0x40;
|
||||
constexpr int G_FUEL_SLOT = 143;
|
||||
constexpr int G_FUEL_COLLECTIBLE_COUNT = 6;
|
||||
constexpr int G_FUEL_STACKS = 8;
|
||||
constexpr uint32_t G_FUEL_RNG_SHIFT = 8;
|
||||
constexpr uint32_t USED_DIAPER_RNG_SHIFT = 4;
|
||||
constexpr uint32_t USED_DIAPER_CHANCE = 33;
|
||||
constexpr uint32_t SEEDED_VARIANT_RNG_SHIFT = 15;
|
||||
|
||||
// The trinkets Rainbow Worm cycles through, and that daily 28 doubles.
|
||||
constexpr std::array<int, 10> RAINBOW_WORM_TRINKETS = {9, 11, 65, 27, 10, 12, 26, 66, 96, 144};
|
||||
// The collectibles G FUEL! grants one of by the start seed.
|
||||
constexpr std::array<int, G_FUEL_COLLECTIBLE_COUNT> G_FUEL_COLLECTIBLES = {
|
||||
COLLECTIBLE_SCORPIO, COLLECTIBLE_SPOON_BENDER, COLLECTIBLE_PLAYDOUGH_COOKIE,
|
||||
COLLECTIBLE_FIRE_MIND, COLLECTIBLE_URANUS, COLLECTIBLE_CRICKETS_BODY};
|
||||
|
||||
// The familiars Cambion and Immaculate Conception grant, with the flag each sets once given.
|
||||
struct ConceptionFamiliar
|
||||
{
|
||||
int collectible = 0;
|
||||
uint32_t flag = 0;
|
||||
};
|
||||
|
||||
constexpr std::array<ConceptionFamiliar, 13> CONCEPTION_FAMILIARS = {{{COLLECTIBLE_LEECH, 0x1},
|
||||
{COLLECTIBLE_DARK_BUM, 0x2},
|
||||
{COLLECTIBLE_DEMON_BABY, 0x4},
|
||||
{COLLECTIBLE_INCUBUS, 0x8},
|
||||
{COLLECTIBLE_LIL_BRIMSTONE, 0x10},
|
||||
{COLLECTIBLE_SUCCUBUS, 0x20},
|
||||
{COLLECTIBLE_GUARDIAN_ANGEL, 0x40},
|
||||
{COLLECTIBLE_HOLY_WATER, 0x80},
|
||||
{COLLECTIBLE_RELIC, 0x100},
|
||||
{COLLECTIBLE_SWORN_PROTECTOR, 0x200},
|
||||
{COLLECTIBLE_SERAPHIM, 0x400},
|
||||
{COLLECTIBLE_LIL_ABADDON, 0x800},
|
||||
{COLLECTIBLE_TWISTED_PAIR, 0x1000}}};
|
||||
|
||||
// The player whose items a co-op baby uses: its owner, or the first player.
|
||||
static Entity_Player* item_owner_get(Entity_Player* player)
|
||||
{
|
||||
while (player->variant == PLAYER_VARIANT_COOP_BABY)
|
||||
{
|
||||
Entity_Player* parentPlayer = player->parent ? player->parent->ToPlayer() : nullptr;
|
||||
if (!parentPlayer) parentPlayer = g_game->GetPlayer(0);
|
||||
if (!parentPlayer) break;
|
||||
player = parentPlayer;
|
||||
}
|
||||
return player;
|
||||
}
|
||||
|
||||
// Whether a player's item counts while it is a co-op ghost or under Curse of the Mist: only quest items do.
|
||||
static bool is_quest_item(ItemConfig_Item* item)
|
||||
{
|
||||
return item && item->HasTags(TAG_QUEST);
|
||||
}
|
||||
|
||||
// 007706e0 Whether the player has a collectible: owned, or lent by a trinket, a seed, a character, a temporary effect,
|
||||
// a wisp, Modeling Clay, a $3 Bill, Metronome or a conception. ITEM_CHECK_OWNED only looks at what it owns.
|
||||
// Co-op babies ask their owner. Negative ids are procedural items.
|
||||
bool Entity_Player::HasCollectible(int collectibleType, ItemCheck check)
|
||||
{
|
||||
ItemConfig_Item* item = g_manager->itemConfig.GetCollectible(collectibleType);
|
||||
if (!item) return false;
|
||||
|
||||
Entity_Player& owner = *item_owner_get(this);
|
||||
Game& game = *g_game;
|
||||
if (owner.isCoopGhost && !game.deathmatchManager.is_active() && !is_quest_item(item)) return false;
|
||||
if (collectibleType < 0)
|
||||
{
|
||||
auto found = owner.proceduralItems.find(collectibleType);
|
||||
return found != owner.proceduralItems.end() && found->second > 0;
|
||||
}
|
||||
if (check == ITEM_CHECK_MODIFIED)
|
||||
if (std::optional<bool> lent = owner.collectible_lent(collectibleType, *item)) return *lent;
|
||||
return owner.collectibleCounts[collectibleType] > 0;
|
||||
}
|
||||
|
||||
// Whether something other than owning it decides that the player has a collectible, as HasCollectible checks after
|
||||
// the ownerless cases: Mysterious Paper's photos, trinkets, seeds, characters, Curse of the Mist (which takes it away),
|
||||
// and the effects, wisps and items that lend one. Empty when only the owned count decides.
|
||||
std::optional<bool> Entity_Player::collectible_lent(int collectibleType, ItemConfig_Item& item)
|
||||
{
|
||||
Game& game = *g_game;
|
||||
|
||||
if ((collectibleType == COLLECTIBLE_POLAROID || collectibleType == COLLECTIBLE_NEGATIVE) &&
|
||||
HasTrinket(TRINKET_MYSTERIOUS_PAPER))
|
||||
{
|
||||
int phase = game.frameCount % 4;
|
||||
bool isBoth = GetTrinketMultiplier(TRINKET_MYSTERIOUS_PAPER) >= 2 && phase <= 1;
|
||||
int shown = phase == 0 ? COLLECTIBLE_POLAROID : COLLECTIBLE_NEGATIVE;
|
||||
if (isBoth || ((phase == 0 || phase == 1) && collectibleType == shown)) return true;
|
||||
}
|
||||
|
||||
switch (collectibleType)
|
||||
{
|
||||
case COLLECTIBLE_HOLY_MANTLE:
|
||||
if (playerType == PLAYER_THELOST ||
|
||||
(temporaryEffects.HasNullEffect(NULLITEM_LOST_CURSE) && playerType != PLAYER_THELOST_B))
|
||||
if (is_run_unlocked(ACHIEVEMENT_LOST_HOLDS_HOLY_MANTLE)) return true;
|
||||
break;
|
||||
case COLLECTIBLE_SKATOLE:
|
||||
if (HasTrinket(TRINKET_USED_DIAPER))
|
||||
{
|
||||
RoomDescriptor* room = game.room->descriptor;
|
||||
RNG roomRng = rng_make(room ? room->decorationSeed : 0, USED_DIAPER_RNG_SHIFT);
|
||||
if (roomRng.RandomInt(100) < USED_DIAPER_CHANCE || game.deathmatchManager.is_active()) return true;
|
||||
}
|
||||
break;
|
||||
case COLLECTIBLE_BOOK_OF_BELIAL_PASSIVE:
|
||||
if ((playerType == PLAYER_JUDAS || playerType == PLAYER_BLACKJUDAS) &&
|
||||
HasCollectible(COLLECTIBLE_BIRTHRIGHT))
|
||||
return true;
|
||||
break;
|
||||
case COLLECTIBLE_SCORPIO:
|
||||
if (grantedCollectibleFlags & GRANTED_SCORPIO) return true;
|
||||
break;
|
||||
case COLLECTIBLE_FIRE_MIND:
|
||||
if (grantedCollectibleFlags & GRANTED_FIRE_MIND) return true;
|
||||
break;
|
||||
case COLLECTIBLE_BALL_OF_TAR:
|
||||
if (grantedCollectibleFlags & GRANTED_BALL_OF_TAR) return true;
|
||||
break;
|
||||
case COLLECTIBLE_SACRED_HEART:
|
||||
if (grantedCollectibleFlags & GRANTED_SACRED_HEART) return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int seededVariant = get_seeded_variant();
|
||||
if (collectibleType == COLLECTIBLE_SOY_MILK && seededVariant == 1) return true;
|
||||
if (collectibleType == COLLECTIBLE_MUTANT_SPIDER && seededVariant == 2) return true;
|
||||
if (g_fuel_count() > G_FUEL_STACKS)
|
||||
{
|
||||
RNG fuelRng =
|
||||
rng_make(std::max(1u, (uint32_t)g_fuel_count() + game.seedEffects.GetStartSeed()), G_FUEL_RNG_SHIFT);
|
||||
if (collectibleType == G_FUEL_COLLECTIBLES[fuelRng.RandomInt(G_FUEL_COLLECTIBLE_COUNT)]) return true;
|
||||
}
|
||||
if (IsInnateCollectible(collectibleType)) return true;
|
||||
if (collectibleType == COLLECTIBLE_BRIMSTONE && temporaryEffects.HasCollectibleEffect(COLLECTIBLE_BRIMSTONE))
|
||||
return true;
|
||||
if (isValid && item.HasTags(TAG_LAZ_SHARED) && backupPlayer && backupPlayer->HasCollectible(collectibleType))
|
||||
return true;
|
||||
if (hasCurseMistEffect && !is_quest_item(&item) && collectibleType != COLLECTIBLE_SCHOOLBAG) return false;
|
||||
|
||||
auto wisp = itemWispsList.find(collectibleType);
|
||||
if (wisp != itemWispsList.end() && wisp->second > 0) return true;
|
||||
if (modelingClayEffect != 0 && modelingClayEffect == collectibleType) return true;
|
||||
if (extra_collectible_count(collectibleType) > 0) return true;
|
||||
if (item.is_mom_item() && temporaryEffects.HasCollectibleEffect(collectibleType)) return true;
|
||||
if (GetActiveItemSlot(collectibleType) >= 0) return true;
|
||||
if (collectibleType != COLLECTIBLE_3_DOLLAR_BILL && HasCollectible(COLLECTIBLE_3_DOLLAR_BILL) &&
|
||||
collectibleType == threeDollarBillItem)
|
||||
return true;
|
||||
if (temporaryEffects.HasCollectibleEffect(COLLECTIBLE_METRONOME) && collectibleType == metronomeCollectibleId)
|
||||
return true;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// The count a slot of extraCollectibleCounts holds for an id, or 0 past the end.
|
||||
int Entity_Player::extra_collectible_count(int collectibleId)
|
||||
{
|
||||
return collectibleId >= 0 && collectibleId < (int)extraCollectibleCounts.size()
|
||||
? extraCollectibleCounts[collectibleId]
|
||||
: 0;
|
||||
}
|
||||
|
||||
// 00770ca0 How many copies of a collectible the player has: owned and active ones, then (unless only true items count)
|
||||
// those Zodiac, the conceptions, its character, granted flags, seeds, Brimstone's effect, its Lazarus twin, wisps and
|
||||
// lending items add. Co-op babies count their owner's. Actives are counted by slot, never as owned.
|
||||
// The original reads a missing collectible's tags for co-op ghosts. Here a missing one counts as no quest item.
|
||||
int Entity_Player::GetCollectibleNum(int collectibleId, ItemCheck check)
|
||||
{
|
||||
if (collectibleId < 0 || collectibleId >= (int)collectibleCounts.size()) return 0;
|
||||
if (variant == PLAYER_VARIANT_COOP_BABY)
|
||||
if (Entity_Player* owner = GetMainPlayer()) return owner->GetCollectibleNum(collectibleId, check);
|
||||
|
||||
ItemConfig_Item* item = g_manager->itemConfig.GetCollectible(collectibleId);
|
||||
int count = item && item->type == ITEM_ACTIVE ? 0 : collectibleCounts[collectibleId];
|
||||
if (isCoopGhost && !is_quest_item(item)) return 0;
|
||||
for (ActiveItemDesc& active : activeItems)
|
||||
if (active.item != 0 && active.item == collectibleId) count++;
|
||||
if (check == ITEM_CHECK_OWNED) return count;
|
||||
|
||||
if (hasCurseMistEffect && !is_quest_item(item) && collectibleId != COLLECTIBLE_SCHOOLBAG) count = 0;
|
||||
count += conception_count(collectibleId);
|
||||
if (IsInnateCollectible(collectibleId)) count++;
|
||||
if (is_granted(collectibleId)) count++;
|
||||
|
||||
int seededVariant = get_seeded_variant();
|
||||
if (collectibleId == COLLECTIBLE_SOY_MILK && seededVariant == 1) count++;
|
||||
else if (collectibleId == COLLECTIBLE_MUTANT_SPIDER && seededVariant == 2) count += 3;
|
||||
else if (collectibleId == COLLECTIBLE_BRIMSTONE)
|
||||
{
|
||||
TemporaryEffect* effect =
|
||||
temporaryEffects.isDisabled ? nullptr : temporaryEffects.GetCollectibleEffect(COLLECTIBLE_BRIMSTONE);
|
||||
count += effect ? effect->count : 0;
|
||||
}
|
||||
if (isValid && item && item->HasTags(TAG_LAZ_SHARED) && backupPlayer)
|
||||
count += backupPlayer->GetCollectibleNum(collectibleId);
|
||||
if (hasCurseMistEffect) return count;
|
||||
|
||||
auto wisp = itemWispsList.find(collectibleId);
|
||||
if (wisp != itemWispsList.end()) count += wisp->second;
|
||||
if (modelingClayEffect != 0 && modelingClayEffect == collectibleId) count++;
|
||||
count += extra_collectible_count(collectibleId);
|
||||
if (item && item->is_mom_item()) count += temporaryEffects.GetCollectibleEffectNum(collectibleId);
|
||||
if (collectibleId != COLLECTIBLE_3_DOLLAR_BILL && HasCollectible(COLLECTIBLE_3_DOLLAR_BILL) &&
|
||||
threeDollarBillItem != 0 && collectibleId == threeDollarBillItem)
|
||||
count++;
|
||||
if (temporaryEffects.HasCollectibleEffect(COLLECTIBLE_METRONOME) && metronomeCollectibleId != 0 &&
|
||||
collectibleId == metronomeCollectibleId)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
// The copies Zodiac and the conceptions add to a collectible, as GetCollectibleNum counts them.
|
||||
int Entity_Player::conception_count(int collectibleId)
|
||||
{
|
||||
if (collectibleId == COLLECTIBLE_ZODIAC || collectibleId == COLLECTIBLE_IMMACULATE_CONCEPTION ||
|
||||
collectibleId == COLLECTIBLE_CAMBION_CONCEPTION)
|
||||
return 0;
|
||||
|
||||
int count = HasCollectible(COLLECTIBLE_ZODIAC) && collectibleId == GetZodiacEffect() ? 1 : 0;
|
||||
if (!HasCollectible(COLLECTIBLE_IMMACULATE_CONCEPTION) && !HasCollectible(COLLECTIBLE_CAMBION_CONCEPTION))
|
||||
return count;
|
||||
for (const ConceptionFamiliar& familiar : CONCEPTION_FAMILIARS)
|
||||
if (familiar.collectible == collectibleId && (conceptionFamiliarFlags & familiar.flag)) count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
// Whether the player's character or granted flags give it a copy of a collectible, as GetCollectibleNum counts them.
|
||||
// The original counts Sacred Heart's grant flag towards The Wafer here, and towards Sacred Heart in HasCollectible.
|
||||
bool Entity_Player::is_granted(int collectibleId)
|
||||
{
|
||||
switch (collectibleId)
|
||||
{
|
||||
case COLLECTIBLE_BOOK_OF_BELIAL_PASSIVE:
|
||||
return (playerType == PLAYER_JUDAS || playerType == PLAYER_BLACKJUDAS) &&
|
||||
HasCollectible(COLLECTIBLE_BIRTHRIGHT);
|
||||
case COLLECTIBLE_SCORPIO:
|
||||
return grantedCollectibleFlags & GRANTED_SCORPIO;
|
||||
case COLLECTIBLE_FIRE_MIND:
|
||||
return grantedCollectibleFlags & GRANTED_FIRE_MIND;
|
||||
case COLLECTIBLE_BALL_OF_TAR:
|
||||
return grantedCollectibleFlags & GRANTED_BALL_OF_TAR;
|
||||
case COLLECTIBLE_WAFER:
|
||||
return grantedCollectibleFlags & GRANTED_SACRED_HEART;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 00771200 Whether the player's character starts with a collectible for good: Cain's Lucky Foot, Eve's two, Samson's
|
||||
// Bloody Lust, Lazarus's Anemic once unlocked, The Lost's Holy Mantle once unlocked, Lilith's two, Bethany's book.
|
||||
// Netplay's per-player save data is offline: the local one decides.
|
||||
bool Entity_Player::IsInnateCollectible(int collectibleId)
|
||||
{
|
||||
switch (playerType)
|
||||
{
|
||||
case PLAYER_LILITH:
|
||||
return collectibleId == COLLECTIBLE_INCUBUS || collectibleId == COLLECTIBLE_CAMBION_CONCEPTION;
|
||||
case PLAYER_THELOST:
|
||||
return collectibleId == COLLECTIBLE_HOLY_MANTLE && is_run_unlocked(ACHIEVEMENT_LOST_HOLDS_HOLY_MANTLE);
|
||||
case PLAYER_CAIN:
|
||||
return collectibleId == COLLECTIBLE_LUCKY_FOOT;
|
||||
case PLAYER_EVE:
|
||||
return collectibleId == COLLECTIBLE_WHORE_OF_BABYLON || collectibleId == COLLECTIBLE_DEAD_BIRD;
|
||||
case PLAYER_SAMSON:
|
||||
return collectibleId == COLLECTIBLE_BLOODY_LUST;
|
||||
case PLAYER_LAZARUS:
|
||||
case PLAYER_LAZARUS2:
|
||||
if (collectibleId != COLLECTIBLE_ANEMIC || !is_run_unlocked(ACHIEVEMENT_LAZARUS_HOLDS_ANEMIA)) return false;
|
||||
return playerType == PLAYER_LAZARUS2 || g_game->challenge == 0;
|
||||
case PLAYER_BETHANY:
|
||||
return g_game->challenge != CHALLENGE_BLOODY_MARY && g_game->challenge != CHALLENGE_BAPTISM_BY_FIRE &&
|
||||
collectibleId == COLLECTIBLE_BOOK_OF_VIRTUES;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 00771410 Puts on the costumes of the character's innate collectibles, taking them out of the pools outside
|
||||
// Cantripped, and takes off the costume of every other collectible the player neither has nor has as an effect. Eve
|
||||
// never shows Whore of Babylon's costume until it triggers.
|
||||
void Entity_Player::apply_innate_collectibles()
|
||||
{
|
||||
ItemConfig& items = g_manager->itemConfig;
|
||||
Game& game = *g_game;
|
||||
|
||||
for (int id = 0; id < COLLECTIBLE_VANILLA_COUNT; id++)
|
||||
{
|
||||
if (!IsInnateCollectible(id))
|
||||
{
|
||||
if (!HasCollectible(id) && !temporaryEffects.HasCollectibleEffect(id))
|
||||
if (ItemConfig_Item* item = items.GetCollectible(id)) RemoveCostume(item);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (game.challenge != CHALLENGE_CANTRIPPED)
|
||||
{
|
||||
if (id == COLLECTIBLE_WAIT_WHAT)
|
||||
game.itemPool.RemoveCollectible(COLLECTIBLE_BUTTER_BEAN, REMOVE_ANY, REMOVE_APPLY);
|
||||
if (id < (int)game.itemPool.removedCollectibles.size()) game.itemPool.removedCollectibles[id] = true;
|
||||
}
|
||||
if (id < (int)items.collectibles.size() && items.collectibles[id])
|
||||
AddCostume(items.collectibles[id].get(), false);
|
||||
}
|
||||
if (playerType == PLAYER_EVE) RemoveCostume(items.GetCollectible(COLLECTIBLE_WHORE_OF_BABYLON));
|
||||
}
|
||||
|
||||
// 00771550 Whether the player has a trinket: held or smelted, or lent by the items that copy trinkets. ITEM_CHECK_OWNED
|
||||
// only looks at the held slots, the second one only with Mom's Purse or Belly Button.
|
||||
bool Entity_Player::HasTrinket(uint32_t trinketType, ItemCheck check)
|
||||
{
|
||||
if (check == ITEM_CHECK_MODIFIED) return GetTrinketMultiplier(trinketType) > 0;
|
||||
|
||||
int slots = HasCollectible(COLLECTIBLE_MOMS_PURSE) || HasCollectible(COLLECTIBLE_BELLY_BUTTON) ? 2 : 1;
|
||||
for (int i = 0; i < slots; i++)
|
||||
if ((trinkets[i] & TRINKET_ID_MASK) == trinketType) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// 007cb6e0 How strongly the player has a trinket: one per held copy (two when golden), one per smelted copy (two when
|
||||
// golden), the queued one, a daily's bonus, Lil Larva for Blue Baby, and what Mysterious Paper, Rainbow Worm, Error,
|
||||
// Missing Poster, Butt Penny's timer and Paper Clip's state lend, plus one for Mom's Box. Co-op babies ask their owner.
|
||||
// Curse of the Mist and co-op ghosts keep only Lil Larva's.
|
||||
int Entity_Player::GetTrinketMultiplier(uint32_t trinketType)
|
||||
{
|
||||
Entity_Player& owner = *item_owner_get(this);
|
||||
Game& game = *g_game;
|
||||
uint32_t id = trinketType & TRINKET_ID_MASK;
|
||||
|
||||
int multiplier = trinketType == TRINKET_LIL_LARVA && owner.playerType == PLAYER_BLUEBABY ? 1 : 0;
|
||||
if (owner.hasCurseMistEffect || owner.isCoopGhost) return multiplier;
|
||||
if (game.dailyChallenge._specialDailyId == DAILY_RAINBOW_TRINKETS &&
|
||||
std::ranges::find(RAINBOW_WORM_TRINKETS, (int)id) != RAINBOW_WORM_TRINKETS.end())
|
||||
multiplier++;
|
||||
|
||||
if (std::optional<int> lent = owner.trinket_lent(id, multiplier)) return *lent;
|
||||
if (id != TRINKET_MYSTERIOUS_PAPER && id != TRINKET_RAINBOW_WORM && id != TRINKET_ERROR)
|
||||
multiplier = owner.trinket_bonus(id, multiplier);
|
||||
|
||||
int slots = owner.HasCollectible(COLLECTIBLE_MOMS_PURSE) || owner.HasCollectible(COLLECTIBLE_BELLY_BUTTON) ? 2 : 1;
|
||||
for (int i = 0; i < slots; i++)
|
||||
if ((owner.trinkets[i] & TRINKET_ID_MASK) == id) multiplier += owner.trinkets[i] & TRINKET_GOLDEN_FLAG ? 2 : 1;
|
||||
ItemConfig_Item* queued = owner.queuedItem.item;
|
||||
if (queued && queued->type == ITEM_TRINKET && (uint32_t)queued->id == id)
|
||||
multiplier += owner.queuedItem.flags & QUEUED_GOLDEN ? 2 : 1;
|
||||
if (id < owner.smeltedTrinkets.size())
|
||||
multiplier += owner.smeltedTrinkets[id].count + owner.smeltedTrinkets[id].goldenCount * 2;
|
||||
if (id < owner.extraTrinketCounts.size() && owner.extraTrinketCounts[id] != 0) multiplier++;
|
||||
if (multiplier > 0 && owner.HasCollectible(COLLECTIBLE_MOMS_BOX)) multiplier++;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
// The whole multiplier when Mysterious Paper shows a trinket as its Missing Page, which GetTrinketMultiplier returns
|
||||
// at once, or empty.
|
||||
std::optional<int> Entity_Player::trinket_lent(uint32_t id, int multiplier)
|
||||
{
|
||||
if (id == TRINKET_MYSTERIOUS_PAPER || id == TRINKET_RAINBOW_WORM || id == TRINKET_ERROR ||
|
||||
id != TRINKET_MISSING_PAGE)
|
||||
return std::nullopt;
|
||||
|
||||
int paper = GetTrinketMultiplier(TRINKET_MYSTERIOUS_PAPER);
|
||||
int phase = g_game->frameCount % 4;
|
||||
if (paper > 0 && (phase == 2 || (paper > 1 && phase == 3))) return paper + multiplier;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// A trinket's multiplier with what Rainbow Worm, Error, Missing Poster, Butt Penny's timer and Paper Clip's state add.
|
||||
// Error never lends Butter in the Pica Run, which also skips the rest.
|
||||
int Entity_Player::trinket_bonus(uint32_t id, int multiplier)
|
||||
{
|
||||
Game& game = *g_game;
|
||||
|
||||
int worm = GetTrinketMultiplier(TRINKET_RAINBOW_WORM);
|
||||
if (worm > 0 && (int)id == RAINBOW_WORM_TRINKETS[(uint32_t)(game.frameCount / RAINBOW_WORM_FRAMES) % 10])
|
||||
multiplier += worm;
|
||||
|
||||
int error = GetTrinketMultiplier(TRINKET_ERROR);
|
||||
if (error > 0)
|
||||
{
|
||||
if (id == TRINKET_BUTTER && game.challenge == CHALLENGE_PICA_RUN) return multiplier;
|
||||
|
||||
RoomDescriptor* room = game.GetRoomByIdx(game.currentRoomIdx);
|
||||
if (room->spawnSeed != 0)
|
||||
{
|
||||
RNG roomRng = rng_make(room->spawnSeed, ROOM_TRINKET_ROLL_SHIFT);
|
||||
if (id == roomRng.RandomInt(ERROR_TRINKET_RANGE) + 1) multiplier += error;
|
||||
}
|
||||
}
|
||||
|
||||
if (id == TRINKET_MISSING_POSTER) return multiplier + temporaryEffects.GetTrinketEffectNum(TRINKET_MISSING_POSTER);
|
||||
if (id == TRINKET_BUTT_PENNY) return multiplier + (coopBabyBuffTimers[COOP_BABY_BUFF_COUNT - 1] > 0 ? 1 : 0);
|
||||
if (id == TRINKET_PAPER_CLIP) return multiplier + (paperClipTimer > 0 ? 1 : 0);
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
// 007911c0 The active slot holding an item, or -1.
|
||||
int Entity_Player::GetActiveItemSlot(int id)
|
||||
{
|
||||
for (int slot = 0; slot < ACTIVE_SLOT_COUNT; slot++)
|
||||
if (activeItems[slot].item == id) return slot;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 007db860 How many G FUEL! stacks the player has under the G FUEL! seed, kept in an unused slot of the extra counts.
|
||||
int Entity_Player::g_fuel_count()
|
||||
{
|
||||
if (!g_game->seedEffects.HasSeedEffect(SEED_G_FUEL)) return 0;
|
||||
return G_FUEL_SLOT < (int)extraCollectibleCounts.size() ? extraCollectibleCounts[G_FUEL_SLOT] : 0;
|
||||
}
|
||||
|
||||
// 007db8d0 Which seeded variant of Soy Milk and Mutant Spider the G FUEL! stacks give: -1 below two, then one per
|
||||
// stack up to seven, then one rolled from the start seed.
|
||||
int Entity_Player::get_seeded_variant()
|
||||
{
|
||||
int stacks = g_fuel_count();
|
||||
if (stacks <= 1) return -1;
|
||||
if (stacks <= G_FUEL_STACKS - 1) return stacks - 2;
|
||||
|
||||
uint32_t startSeed = g_game->seedEffects.GetStartSeed();
|
||||
RNG rng = rng_make(std::max(1u, startSeed + (uint32_t)stacks), SEEDED_VARIANT_RNG_SHIFT);
|
||||
return (int)(rng.Next() & 3) + 2;
|
||||
}
|
||||
|
||||
// 007ce270 The player a co-op baby belongs to: its parent player, or the first player.
|
||||
Entity_Player* Entity_Player::GetMainPlayer()
|
||||
{
|
||||
Entity_Player* owner = parent ? parent->ToPlayer() : nullptr;
|
||||
if (owner) return owner;
|
||||
return variant == PLAYER_VARIANT_COOP_BABY ? g_game->GetPlayer(0) : nullptr;
|
||||
}
|
||||
|
||||
// 00436160 Asks for stats to be evaluated again.
|
||||
void Entity_Player::AddCacheFlags(uint32_t flags)
|
||||
{
|
||||
cacheFlags |= flags;
|
||||
}
|
||||
|
||||
// 005b17c0 The player's generator for a collectible: the first for a negative id, the last past the end.
|
||||
RNG& Entity_Player::GetCollectibleRNG(int id)
|
||||
{
|
||||
if (id < 0) return collectibleRNGs.front();
|
||||
if (id >= (int)collectibleRNGs.size()) log_printf(LOG_ASSERT, "Collectible ID out of bounds!\n");
|
||||
return collectibleRNGs[std::min((size_t)id, collectibleRNGs.size() - 1)];
|
||||
}
|
||||
|
||||
// 0065cf80 The player's generator for a trinket, the last for an id out of range.
|
||||
RNG& Entity_Player::GetTrinketRNG(int id)
|
||||
{
|
||||
if (id < 0 || id >= (int)trinketRNGs.size()) log_printf(LOG_ASSERT, "Trinket ID out of bounds!\n");
|
||||
return trinketRNGs[std::min((size_t)(uint32_t)id, trinketRNGs.size() - 1)];
|
||||
}
|
||||
@@ -0,0 +1,617 @@
|
||||
#include "entity_player.h"
|
||||
#include "log.h"
|
||||
|
||||
bool Entity_Player::TakeDamage(float, uint64_t, const EntityRef&, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0");
|
||||
}
|
||||
bool Entity_Player::TryThrow(const EntityRef&, const Vector&, float)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TryThrow 007d2930");
|
||||
}
|
||||
bool Entity_Player::HandleCollision(Entity*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::HandleCollision 0078e1f0");
|
||||
}
|
||||
void Entity_Player::AddCollectible(int, int, bool, int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddCollectible 0075f0e0");
|
||||
}
|
||||
void Entity_Player::AddActiveCharge(int, int, bool, bool, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddActiveCharge 007915a0");
|
||||
}
|
||||
void Entity_Player::RemoveCollectible(int, bool, int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::RemoveCollectible 0078f840");
|
||||
}
|
||||
Entity_Familiar* Entity_Player::AddWisp(int, Vector, bool, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddWisp 005c93b0");
|
||||
}
|
||||
void Entity_Player::UseActiveItem(int, uint32_t, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::UseActiveItem 005b39d0");
|
||||
}
|
||||
void Entity_Player::trigger_collectible_effect_removed(ItemConfig_Item*, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_collectible_effect_removed 00793970");
|
||||
}
|
||||
int Entity_Player::GetBatteryCharge(int) { reconstruction_missing("Entity_Player::GetBatteryCharge 0042a2f0"); }
|
||||
void Entity_Player::SetMinDamageCooldown(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::SetMinDamageCooldown 004361d0");
|
||||
}
|
||||
int Entity_Player::GetActiveItem(int) { reconstruction_missing("Entity_Player::GetActiveItem 00505c80"); }
|
||||
bool Entity_Player::AreControlsEnabled() { reconstruction_missing("Entity_Player::AreControlsEnabled 00505cc0"); }
|
||||
bool Entity_Player::IsItemQueueEmpty() { reconstruction_missing("Entity_Player::IsItemQueueEmpty 0056ff90"); }
|
||||
void Entity_Player::StopExtraAnimation() { reconstruction_missing("Entity_Player::StopExtraAnimation 0058e230"); }
|
||||
bool Entity_Player::HasWeaponType(int) { reconstruction_missing("Entity_Player::HasWeaponType 005b1780"); }
|
||||
void Entity_Player::moms_bracelet_grab() { reconstruction_missing("Entity_Player::moms_bracelet_grab 005b1a20"); }
|
||||
void Entity_Player::UseRedKey() { reconstruction_missing("Entity_Player::UseRedKey 005b2360"); }
|
||||
void Entity_Player::use_card_hagalaz(RNG*) { reconstruction_missing("Entity_Player::use_card_hagalaz 005b23f0"); }
|
||||
int Entity_Player::reroll_collectibles_on_damage(RNG*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::reroll_collectibles_on_damage 005c88a0");
|
||||
}
|
||||
Entity_Familiar* Entity_Player::AddItemWisp(int, Vector, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddItemWisp 005c96f0");
|
||||
}
|
||||
void Entity_Player::trigger_book_of_belial_passive(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_book_of_belial_passive 005c9930");
|
||||
}
|
||||
void Entity_Player::TriggerBookOfVirtues(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TriggerBookOfVirtues 005ca470");
|
||||
}
|
||||
void Entity_Player::console_spawn(int*, bool) { reconstruction_missing("Entity_Player::console_spawn 005caa70"); }
|
||||
void Entity_Player::update_mini_mush_costume()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::update_mini_mush_costume 005cb480");
|
||||
}
|
||||
void Entity_Player::ResetDamageCooldown() { reconstruction_missing("Entity_Player::ResetDamageCooldown 0060d090"); }
|
||||
Vector Entity_Player::SpriteScale() { reconstruction_missing("Entity_Player::SpriteScale 0060d0a0"); }
|
||||
bool Entity_Player::IsP2Appearing() { reconstruction_missing("Entity_Player::IsP2Appearing 0065cf60"); }
|
||||
ColorMod Entity_Player::get_laser_color_copy()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::get_laser_color_copy 00665c20");
|
||||
}
|
||||
uint32_t Entity_Player::get_grid_collision_at(Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::get_grid_collision_at 006b5fd0");
|
||||
}
|
||||
bool Entity_Player::HasFullHearts() { reconstruction_missing("Entity_Player::HasFullHearts 006dacd0"); }
|
||||
void Entity_Player::set_last_damage(uint64_t, const EntityRef&)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::set_last_damage 006dad80");
|
||||
}
|
||||
void Entity_Player::SetSoulCharge(int) { reconstruction_missing("Entity_Player::SetSoulCharge 006f0020"); }
|
||||
void Entity_Player::SetBloodCharge(int) { reconstruction_missing("Entity_Player::SetBloodCharge 006f0030"); }
|
||||
PocketItem& Entity_Player::GetPocketItem(int) { reconstruction_missing("Entity_Player::GetPocketItem 00753900"); }
|
||||
void Entity_Player::EnableWeaponType(int, bool) { reconstruction_missing("Entity_Player::EnableWeaponType 00753980"); }
|
||||
void Entity_Player::QueueExtraAnimation(std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::QueueExtraAnimation 007539c0");
|
||||
}
|
||||
RNG& Entity_Player::GetPillRNG(int) { reconstruction_missing("Entity_Player::GetPillRNG 00753a00"); }
|
||||
RNG& Entity_Player::GetCardRNG(int) { reconstruction_missing("Entity_Player::GetCardRNG 00753a60"); }
|
||||
uint32_t Entity_Player::IsSubPlayer() { reconstruction_missing("Entity_Player::IsSubPlayer 00753ac0"); }
|
||||
void Entity_Player::release_weapons_and_effects(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::release_weapons_and_effects 00757ac0");
|
||||
}
|
||||
uint32_t Entity_Player::InvalidateCoPlayerItems()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::InvalidateCoPlayerItems 007584b0");
|
||||
}
|
||||
void Entity_Player::cycle_spectate_target() { reconstruction_missing("Entity_Player::cycle_spectate_target 007585b0"); }
|
||||
void Entity_Player::trigger_max_hearts_removed(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_max_hearts_removed 00758850");
|
||||
}
|
||||
void Entity_Player::AddEternalHearts(int) { reconstruction_missing("Entity_Player::AddEternalHearts 00758c20"); }
|
||||
void Entity_Player::RemoveBlackHeart(int) { reconstruction_missing("Entity_Player::RemoveBlackHeart 007591e0"); }
|
||||
bool Entity_Player::IsBlackHeart(int) { reconstruction_missing("Entity_Player::IsBlackHeart 00759220"); }
|
||||
void Entity_Player::AddJarHearts(int) { reconstruction_missing("Entity_Player::AddJarHearts 00759390"); }
|
||||
void Entity_Player::AddGoldenKey() { reconstruction_missing("Entity_Player::AddGoldenKey 00759620"); }
|
||||
void Entity_Player::RemoveGoldenKey() { reconstruction_missing("Entity_Player::RemoveGoldenKey 00759660"); }
|
||||
void Entity_Player::restore_curse_mist_backup(int*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::restore_curse_mist_backup 00759950");
|
||||
}
|
||||
Entity* Entity_Player::AddBlueFlies(int, Vector, Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddBlueFlies 007599d0");
|
||||
}
|
||||
void Entity_Player::RemoveBlueFly() { reconstruction_missing("Entity_Player::RemoveBlueFly 00759b80"); }
|
||||
void Entity_Player::AddLeprosy() { reconstruction_missing("Entity_Player::AddLeprosy 00759b90"); }
|
||||
Entity* Entity_Player::AddBoneOrbital(Vector) { reconstruction_missing("Entity_Player::AddBoneOrbital 00759bc0"); }
|
||||
Entity* Entity_Player::AddSwarmFlyOrbital(Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddSwarmFlyOrbital 00759bf0");
|
||||
}
|
||||
bool Entity_Player::TryUseKey() { reconstruction_missing("Entity_Player::TryUseKey 00759e20"); }
|
||||
void Entity_Player::AddCostume(ItemConfig_Item*, bool) { reconstruction_missing("Entity_Player::AddCostume 0075d1d0"); }
|
||||
void Entity_Player::AddNullCostume(int) { reconstruction_missing("Entity_Player::AddNullCostume 0075d800"); }
|
||||
bool Entity_Player::IsNullItemCostumeVisible(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::IsNullItemCostumeVisible 0075d980");
|
||||
}
|
||||
void Entity_Player::ClearQueueItem() { reconstruction_missing("Entity_Player::ClearQueueItem 0075e190"); }
|
||||
bool Entity_Player::FlushQueueItem() { reconstruction_missing("Entity_Player::FlushQueueItem 0075e1d0"); }
|
||||
void Entity_Player::IncrementPlayerFormCounter(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::IncrementPlayerFormCounter 0075e320");
|
||||
}
|
||||
void Entity_Player::AddPlayerFormCostume(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddPlayerFormCostume 0075e9a0");
|
||||
}
|
||||
void Entity_Player::SetItemState(int) { reconstruction_missing("Entity_Player::SetItemState 0075ea20"); }
|
||||
int Entity_Player::GetCollectibleCount() { reconstruction_missing("Entity_Player::GetCollectibleCount 0075eff0"); }
|
||||
void Entity_Player::RespawnFamiliars() { reconstruction_missing("Entity_Player::RespawnFamiliars 00770600"); }
|
||||
void Entity_Player::GetNPCTarget() { reconstruction_missing("Entity_Player::GetNPCTarget 00770610"); }
|
||||
bool Entity_Player::VoidHasCollectible(int) { reconstruction_missing("Entity_Player::VoidHasCollectible 007711a0"); }
|
||||
bool Entity_Player::HasGoldenTrinket(uint32_t) { reconstruction_missing("Entity_Player::HasGoldenTrinket 00771620"); }
|
||||
bool Entity_Player::TryHoldTrinket(int) { reconstruction_missing("Entity_Player::TryHoldTrinket 007716f0"); }
|
||||
int Entity_Player::GetMaxTrinkets() { reconstruction_missing("Entity_Player::GetMaxTrinkets 007717c0"); }
|
||||
Entity_Pickup* Entity_Player::DropTrinket(Vector, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::DropTrinket 00771800");
|
||||
}
|
||||
void Entity_Player::AddTrinket(int, bool) { reconstruction_missing("Entity_Player::AddTrinket 00771d30"); }
|
||||
bool Entity_Player::TryRemoveTrinket(uint32_t) { reconstruction_missing("Entity_Player::TryRemoveTrinket 00771f60"); }
|
||||
bool Entity_Player::TryRemoveSmeltedTrinket(uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TryRemoveSmeltedTrinket 00772260");
|
||||
}
|
||||
bool Entity_Player::replace_trinket() { reconstruction_missing("Entity_Player::replace_trinket 00772530"); }
|
||||
void Entity_Player::SetFullHearts() { reconstruction_missing("Entity_Player::SetFullHearts 007791f0"); }
|
||||
Entity* Entity_Player::GetFocusEntity() { reconstruction_missing("Entity_Player::GetFocusEntity 00779320"); }
|
||||
int Entity_Player::GetWeaponModifiers() { reconstruction_missing("Entity_Player::GetWeaponModifiers 00779a20"); }
|
||||
void Entity_Player::update_shooting() { reconstruction_missing("Entity_Player::update_shooting 0077b020"); }
|
||||
TearFlags Entity_Player::GetBombFlags(bool) { reconstruction_missing("Entity_Player::GetBombFlags 00780560"); }
|
||||
TearFlags Entity_Player::check_bomb_tearflags(const TearFlags&)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::check_bomb_tearflags 00780ec0");
|
||||
}
|
||||
void Entity_Player::update_bomb_input() { reconstruction_missing("Entity_Player::update_bomb_input 00780f40"); }
|
||||
void Entity_Player::trigger_fire_item_effects(Vector, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_fire_item_effects 007826d0");
|
||||
}
|
||||
const char* Entity_Player::GetDeathAnimName() { reconstruction_missing("Entity_Player::GetDeathAnimName 007828f0"); }
|
||||
Entity* Entity_Player::GetActiveWeaponEntity()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetActiveWeaponEntity 00782a40");
|
||||
}
|
||||
uint32_t Entity_Player::CanTurnHead() { reconstruction_missing("Entity_Player::CanTurnHead 00782a60"); }
|
||||
float Entity_Player::FireDelay() { reconstruction_missing("Entity_Player::FireDelay 00782a70"); }
|
||||
void Entity_Player::RemoveCollectibleByHistoryIndex(int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::RemoveCollectibleByHistoryIndex 0078fec0");
|
||||
}
|
||||
void Entity_Player::TriggerCollectibleRemoved(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TriggerCollectibleRemoved 0078ff90");
|
||||
}
|
||||
void Entity_Player::ClearTemporaryEffects() { reconstruction_missing("Entity_Player::ClearTemporaryEffects 007907a0"); }
|
||||
int Entity_Player::GetTotalActiveCharge(int) { reconstruction_missing("Entity_Player::GetTotalActiveCharge 007910f0"); }
|
||||
int Entity_Player::GetCollectibleMaxCharge(int, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetCollectibleMaxCharge 007911f0");
|
||||
}
|
||||
int Entity_Player::GetActiveMaxCharge(int) { reconstruction_missing("Entity_Player::GetActiveMaxCharge 00791320"); }
|
||||
void Entity_Player::SetActiveCharge(int, int) { reconstruction_missing("Entity_Player::SetActiveCharge 00791420"); }
|
||||
void Entity_Player::SetActiveVarData(int, int) { reconstruction_missing("Entity_Player::SetActiveVarData 00791510"); }
|
||||
void Entity_Player::ControlActiveItem(int) { reconstruction_missing("Entity_Player::ControlActiveItem 00791a40"); }
|
||||
bool Entity_Player::HasTimedItem() { reconstruction_missing("Entity_Player::HasTimedItem 00793940"); }
|
||||
void Entity_Player::update_effects() { reconstruction_missing("Entity_Player::update_effects 00794e50"); }
|
||||
void Entity_Player::update_ladder() { reconstruction_missing("Entity_Player::update_ladder 0079f3c0"); }
|
||||
void Entity_Player::trigger_npc_death(Entity*) { reconstruction_missing("Entity_Player::trigger_npc_death 007a0080"); }
|
||||
Entity_Bomb* Entity_Player::FireBomb(Vector, Vector, Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::FireBomb 007a0970");
|
||||
}
|
||||
bool Entity_Player::TriggerDeath(bool) { reconstruction_missing("Entity_Player::TriggerDeath 007a1090"); }
|
||||
void Entity_Player::Revive() { reconstruction_missing("Entity_Player::Revive 007a2220"); }
|
||||
void Entity_Player::ReviveFromTrinket(uint32_t) { reconstruction_missing("Entity_Player::ReviveFromTrinket 007a3430"); }
|
||||
void Entity_Player::remove_twin() { reconstruction_missing("Entity_Player::remove_twin 007a37c0"); }
|
||||
void Entity_Player::AddPocketItem(int, uint32_t) { reconstruction_missing("Entity_Player::AddPocketItem 007a3af0"); }
|
||||
void Entity_Player::AddCard(int) { reconstruction_missing("Entity_Player::AddCard 007a3c10"); }
|
||||
void Entity_Player::AddPill(int) { reconstruction_missing("Entity_Player::AddPill 007a3c30"); }
|
||||
int Entity_Player::GetCard(int) { reconstruction_missing("Entity_Player::GetCard 007a3c50"); }
|
||||
int Entity_Player::GetPill(int) { reconstruction_missing("Entity_Player::GetPill 007a3c80"); }
|
||||
void Entity_Player::SetCard(int, int) { reconstruction_missing("Entity_Player::SetCard 007a3cb0"); }
|
||||
void Entity_Player::SetPill(int, int) { reconstruction_missing("Entity_Player::SetPill 007a3cf0"); }
|
||||
void Entity_Player::pocket_use_input() { reconstruction_missing("Entity_Player::pocket_use_input 007a3d30"); }
|
||||
void Entity_Player::pockets_rotate() { reconstruction_missing("Entity_Player::pockets_rotate 007a42b0"); }
|
||||
void Entity_Player::SwapActiveItems() { reconstruction_missing("Entity_Player::SwapActiveItems 007a4760"); }
|
||||
void Entity_Player::RemovePocketItem(int) { reconstruction_missing("Entity_Player::RemovePocketItem 007a4850"); }
|
||||
void Entity_Player::DropPocketItem(int, Vector) { reconstruction_missing("Entity_Player::DropPocketItem 007a48f0"); }
|
||||
void Entity_Player::ShootCandle(Vector) { reconstruction_missing("Entity_Player::ShootCandle 007a6300"); }
|
||||
int Entity_Player::GetTrinket(uint32_t) { reconstruction_missing("Entity_Player::GetTrinket 007a6430"); }
|
||||
void Entity_Player::room_exit(bool) { reconstruction_missing("Entity_Player::room_exit 007a6680"); }
|
||||
void Entity_Player::room_enter() { reconstruction_missing("Entity_Player::room_enter 007a6c50"); }
|
||||
void Entity_Player::TriggerNewRoom_TemporaryEffects()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TriggerNewRoom_TemporaryEffects 007a8350");
|
||||
}
|
||||
void Entity_Player::TriggerRoomClear() { reconstruction_missing("Entity_Player::TriggerRoomClear 007a8fd0"); }
|
||||
bool Entity_Player::HasPlayerForm(int) { reconstruction_missing("Entity_Player::HasPlayerForm 007aa7c0"); }
|
||||
bool Entity_Player::CanAddCollectible(int) { reconstruction_missing("Entity_Player::CanAddCollectible 007aa800"); }
|
||||
void Entity_Player::AnimatePickup(ANM2*, bool, std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AnimatePickup 007ab130");
|
||||
}
|
||||
void Entity_Player::AnimateCollectible(int, std::string_view, std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AnimateCollectible 007ab380");
|
||||
}
|
||||
void Entity_Player::AnimateTrinket(int, std::string_view, std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AnimateTrinket 007ab550");
|
||||
}
|
||||
void Entity_Player::AnimateCard(int, std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AnimateCard 007ab6b0");
|
||||
}
|
||||
void Entity_Player::AnimatePill(int, std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AnimatePill 007abb00");
|
||||
}
|
||||
void Entity_Player::AnimateTrapdoor() { reconstruction_missing("Entity_Player::AnimateTrapdoor 007abc00"); }
|
||||
void Entity_Player::AnimateLightTravel() { reconstruction_missing("Entity_Player::AnimateLightTravel 007abc10"); }
|
||||
void Entity_Player::AnimatePitfallIn(bool) { reconstruction_missing("Entity_Player::AnimatePitfallIn 007abc20"); }
|
||||
void Entity_Player::AnimatePitfallOut() { reconstruction_missing("Entity_Player::AnimatePitfallOut 007abc90"); }
|
||||
void Entity_Player::AnimateAppear() { reconstruction_missing("Entity_Player::AnimateAppear 007abcb0"); }
|
||||
void Entity_Player::AnimateTeleport(bool) { reconstruction_missing("Entity_Player::AnimateTeleport 007abcc0"); }
|
||||
void Entity_Player::AnimateHappy() { reconstruction_missing("Entity_Player::AnimateHappy 007abd30"); }
|
||||
void Entity_Player::AnimateSad() { reconstruction_missing("Entity_Player::AnimateSad 007abd90"); }
|
||||
void Entity_Player::AddPrettyFly() { reconstruction_missing("Entity_Player::AddPrettyFly 007abdf0"); }
|
||||
void Entity_Player::PlayExtraAnimation(std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::PlayExtraAnimation 007abe20");
|
||||
}
|
||||
void Entity_Player::active_used_post(int, bool, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::active_used_post 007abf80");
|
||||
}
|
||||
void Entity_Player::DischargeActiveItem(uint32_t, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::DischargeActiveItem 007ac7e0");
|
||||
}
|
||||
void Entity_Player::TryRemoveTrinketCostume(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TryRemoveTrinketCostume 007ad3a0");
|
||||
}
|
||||
void Entity_Player::TryRemoveNullCostume(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TryRemoveNullCostume 007ad400");
|
||||
}
|
||||
uint32_t Entity_Player::GetMaxPocketItems() { reconstruction_missing("Entity_Player::GetMaxPocketItems 007ad440"); }
|
||||
void Entity_Player::stop_costume_item_anims()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::stop_costume_item_anims 007ad4e0");
|
||||
}
|
||||
void Entity_Player::ClearCollectibleAnim(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::ClearCollectibleAnim 007ad5a0");
|
||||
}
|
||||
bool Entity_Player::IsCollectibleAnimFinished(int, std::string_view)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::IsCollectibleAnimFinished 007ad680");
|
||||
}
|
||||
void Entity_Player::TriggerTrinketAdded(uint32_t, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TriggerTrinketAdded 007ad860");
|
||||
}
|
||||
void Entity_Player::TriggerTrinketRemoved(uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TriggerTrinketRemoved 007adb30");
|
||||
}
|
||||
void Entity_Player::RestoreGameState(GameStatePlayer*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::RestoreGameState 007ae4b0");
|
||||
}
|
||||
bool Entity_Player::try_trigger_astral_projection()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::try_trigger_astral_projection 007afc20");
|
||||
}
|
||||
void Entity_Player::spawn_dark_esau(void*) { reconstruction_missing("Entity_Player::spawn_dark_esau 007b0070"); }
|
||||
void Entity_Player::DonateLuck(int) { reconstruction_missing("Entity_Player::DonateLuck 007b2200"); }
|
||||
void Entity_Player::UseCard(int, uint32_t) { reconstruction_missing("Entity_Player::UseCard 007b2230"); }
|
||||
void Entity_Player::update_footprints() { reconstruction_missing("Entity_Player::update_footprints 007b8cb0"); }
|
||||
void Entity_Player::SetFootprintColor(KColor, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::SetFootprintColor 007b98c0");
|
||||
}
|
||||
bool Entity_Player::is_footstep_triggered(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::is_footstep_triggered 007b9940");
|
||||
}
|
||||
void Entity_Player::update_pitfall() { reconstruction_missing("Entity_Player::update_pitfall 007b9b50"); }
|
||||
void Entity_Player::TryDecreaseGlowingHourglassUses(int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TryDecreaseGlowingHourglassUses 007b9e10");
|
||||
}
|
||||
bool Entity_Player::GetMouseAimTarget(Vector&, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetMouseAimTarget 007b9f60");
|
||||
}
|
||||
void Entity_Player::update_baby_skin_effects()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::update_baby_skin_effects 007ba2b0");
|
||||
}
|
||||
void Entity_Player::coop_baby_death_effect()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::coop_baby_death_effect 007bb5e0");
|
||||
}
|
||||
void Entity_Player::InitBabySkin() { reconstruction_missing("Entity_Player::InitBabySkin 007bf040"); }
|
||||
Entity_Laser* Entity_Player::FireDelayedBrimstone(float, Entity*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::FireDelayedBrimstone 007bf1a0");
|
||||
}
|
||||
bool Entity_Player::CanPickupItem() { reconstruction_missing("Entity_Player::CanPickupItem 007bf3d0"); }
|
||||
bool Entity_Player::IsHeldItemVisible() { reconstruction_missing("Entity_Player::IsHeldItemVisible 007bf5c0"); }
|
||||
void Entity_Player::AddBlueSpider(Vector) { reconstruction_missing("Entity_Player::AddBlueSpider 007bf5f0"); }
|
||||
Entity_Familiar* Entity_Player::ThrowBlueSpider(Vector, Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::ThrowBlueSpider 007bf640");
|
||||
}
|
||||
void Entity_Player::RemoveBlueSpider() { reconstruction_missing("Entity_Player::RemoveBlueSpider 007bf660"); }
|
||||
int Entity_Player::GetExtraLives() { reconstruction_missing("Entity_Player::GetExtraLives 007bf670"); }
|
||||
uint32_t Entity_Player::GetGlitchBabySubType()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetGlitchBabySubType 007c2e90");
|
||||
}
|
||||
bool Entity_Player::HasInvincibility(uint64_t, const EntityRef&)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::HasInvincibility 007c3100");
|
||||
}
|
||||
bool Entity_Player::HasPoisonImmunity() { reconstruction_missing("Entity_Player::HasPoisonImmunity 007c3320"); }
|
||||
bool Entity_Player::CanCrushRocks() { reconstruction_missing("Entity_Player::CanCrushRocks 007c3380"); }
|
||||
bool Entity_Player::CanPickRedHearts() { reconstruction_missing("Entity_Player::CanPickRedHearts 007c3410"); }
|
||||
bool Entity_Player::CanPickSoulHearts() { reconstruction_missing("Entity_Player::CanPickSoulHearts 007c3460"); }
|
||||
bool Entity_Player::CanPickBlackHearts() { reconstruction_missing("Entity_Player::CanPickBlackHearts 007c3550"); }
|
||||
void Entity_Player::RemoveSkinCostume() { reconstruction_missing("Entity_Player::RemoveSkinCostume 007c3620"); }
|
||||
void Entity_Player::ResetItemState() { reconstruction_missing("Entity_Player::ResetItemState 007c36b0"); }
|
||||
void Entity_Player::SetShootingCooldown(int) { reconstruction_missing("Entity_Player::SetShootingCooldown 007c37f0"); }
|
||||
bool Entity_Player::NeedsCharge(int) { reconstruction_missing("Entity_Player::NeedsCharge 007c3810"); }
|
||||
bool Entity_Player::FullCharge(int, bool, bool) { reconstruction_missing("Entity_Player::FullCharge 007c38c0"); }
|
||||
void Entity_Player::add_random_stat_up(RNG*) { reconstruction_missing("Entity_Player::add_random_stat_up 007c3980"); }
|
||||
void Entity_Player::preload_item_sounds() { reconstruction_missing("Entity_Player::preload_item_sounds 007c3a60"); }
|
||||
bool Entity_Player::CanUsePill(int) { reconstruction_missing("Entity_Player::CanUsePill 007c40e0"); }
|
||||
void Entity_Player::UsePill(int, int, uint32_t) { reconstruction_missing("Entity_Player::UsePill 007c4180"); }
|
||||
void Entity_Player::AddDeadEyeCharge() { reconstruction_missing("Entity_Player::AddDeadEyeCharge 007c78b0"); }
|
||||
void Entity_Player::ClearDeadEyeCharge() { reconstruction_missing("Entity_Player::ClearDeadEyeCharge 007c78e0"); }
|
||||
int Entity_Player::GetZodiacEffect() { reconstruction_missing("Entity_Player::GetZodiacEffect 007c7960"); }
|
||||
void Entity_Player::update_purity_glow() { reconstruction_missing("Entity_Player::update_purity_glow 007c7c60"); }
|
||||
void Entity_Player::trigger_immaculate_conception(bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_immaculate_conception 007c7d70");
|
||||
}
|
||||
void Entity_Player::AddImmaculateConceptionCounter(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddImmaculateConceptionCounter 007c8050");
|
||||
}
|
||||
void Entity_Player::dash_impact() { reconstruction_missing("Entity_Player::dash_impact 007c8240"); }
|
||||
void Entity_Player::spawn_locusts() { reconstruction_missing("Entity_Player::spawn_locusts 007c8830"); }
|
||||
Entity_Laser* Entity_Player::SpawnMawOfVoid(int) { reconstruction_missing("Entity_Player::SpawnMawOfVoid 007c8dc0"); }
|
||||
void Entity_Player::AddGoldenBomb() { reconstruction_missing("Entity_Player::AddGoldenBomb 007c8f80"); }
|
||||
void Entity_Player::RemoveGoldenBomb() { reconstruction_missing("Entity_Player::RemoveGoldenBomb 007c8fc0"); }
|
||||
void Entity_Player::AddDollarBillEffect() { reconstruction_missing("Entity_Player::AddDollarBillEffect 007c9000"); }
|
||||
int Entity_Player::GetCambionPregnancyLevel()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetCambionPregnancyLevel 007c90b0");
|
||||
}
|
||||
Entity* Entity_Player::ShootRedCandle(Vector) { reconstruction_missing("Entity_Player::ShootRedCandle 007c9130"); }
|
||||
Entity* Entity_Player::ShootBlueCandle(Vector) { reconstruction_missing("Entity_Player::ShootBlueCandle 007c9350"); }
|
||||
void Entity_Player::DoZitEffect(Vector) { reconstruction_missing("Entity_Player::DoZitEffect 007c9590"); }
|
||||
void Entity_Player::apply_victory_lap_penalty(uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::apply_victory_lap_penalty 007c97f0");
|
||||
}
|
||||
float Entity_Player::get_voice_pitch() { reconstruction_missing("Entity_Player::get_voice_pitch 007c9ad0"); }
|
||||
void Entity_Player::AddJarFlies(int) { reconstruction_missing("Entity_Player::AddJarFlies 007c9bb0"); }
|
||||
bool Entity_Player::IsPosInSpotLight(Vector) { reconstruction_missing("Entity_Player::IsPosInSpotLight 007c9c00"); }
|
||||
void Entity_Player::AddGoldenHearts(int, bool) { reconstruction_missing("Entity_Player::AddGoldenHearts 007c9d10"); }
|
||||
bool Entity_Player::CanPickGoldenHearts() { reconstruction_missing("Entity_Player::CanPickGoldenHearts 007c9e30"); }
|
||||
void Entity_Player::BreakGoldenHearts(int) { reconstruction_missing("Entity_Player::BreakGoldenHearts 007ca2d0"); }
|
||||
void Entity_Player::AddBoneHearts(int) { reconstruction_missing("Entity_Player::AddBoneHearts 007ca840"); }
|
||||
bool Entity_Player::CanPickBoneHearts() { reconstruction_missing("Entity_Player::CanPickBoneHearts 007caa00"); }
|
||||
bool Entity_Player::IsBoneHeart(int) { reconstruction_missing("Entity_Player::IsBoneHeart 007caaa0"); }
|
||||
bool Entity_Player::TryPreventDeath() { reconstruction_missing("Entity_Player::TryPreventDeath 007caad0"); }
|
||||
void Entity_Player::apply_coop_baby_spawn_bonus()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::apply_coop_baby_spawn_bonus 007cb090");
|
||||
}
|
||||
bool Entity_Player::WillPlayerRevive() { reconstruction_missing("Entity_Player::WillPlayerRevive 007cbb60"); }
|
||||
float Entity_Player::GetGreedDonationBreakChance()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetGreedDonationBreakChance 007cbb70");
|
||||
}
|
||||
float Entity_Player::GetGreedDonationJamChance(PersistentGameData&)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetGreedDonationJamChance 007cbb90");
|
||||
}
|
||||
void Entity_Player::hallowed_ground_add(int) { reconstruction_missing("Entity_Player::hallowed_ground_add 007cbc60"); }
|
||||
void Entity_Player::resolve_tainted_soul() { reconstruction_missing("Entity_Player::resolve_tainted_soul 007cbcb0"); }
|
||||
void Entity_Player::init_forgotten_twin() { reconstruction_missing("Entity_Player::init_forgotten_twin 007cbcd0"); }
|
||||
Entity* Entity_Player::spawn_forgotten_body()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::spawn_forgotten_body 007cbef0");
|
||||
}
|
||||
bool Entity_Player::SwapForgottenForm(bool, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::SwapForgottenForm 007cc200");
|
||||
}
|
||||
bool Entity_Player::CanRerollCollectible(int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::CanRerollCollectible 007ce2a0");
|
||||
}
|
||||
void Entity_Player::ChangePlayerType(int, bool) { reconstruction_missing("Entity_Player::ChangePlayerType 007ce6e0"); }
|
||||
void Entity_Player::player_type_change_prepare(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::player_type_change_prepare 007cf610");
|
||||
}
|
||||
bool Entity_Player::IsLocalPlayer() { reconstruction_missing("Entity_Player::IsLocalPlayer 007cf8c0"); }
|
||||
void Entity_Player::GetGlyphOfBalanceDrop(int*, int*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetGlyphOfBalanceDrop 007d12c0");
|
||||
}
|
||||
Vector Entity_Player::GetEnterPosition() { reconstruction_missing("Entity_Player::GetEnterPosition 007d1620"); }
|
||||
Entity_Familiar* Entity_Player::AddMinisaac(Vector, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddMinisaac 007d1860");
|
||||
}
|
||||
uint32_t Entity_Player::play_hurt_effects() { reconstruction_missing("Entity_Player::play_hurt_effects 007d1c10"); }
|
||||
Entity_Player* Entity_Player::InitTwin(int) { reconstruction_missing("Entity_Player::InitTwin 007d2000"); }
|
||||
bool Entity_Player::TryHoldEntity(Entity*) { reconstruction_missing("Entity_Player::TryHoldEntity 007d2170"); }
|
||||
Entity* Entity_Player::ThrowHeldEntity(Vector) { reconstruction_missing("Entity_Player::ThrowHeldEntity 007d2470"); }
|
||||
void Entity_Player::AddFriendlyDip(int, Vector) { reconstruction_missing("Entity_Player::AddFriendlyDip 007d2a00"); }
|
||||
void Entity_Player::ThrowFriendlyDip(int, Vector, Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::ThrowFriendlyDip 007d2a20");
|
||||
}
|
||||
void Entity_Player::AddSoulCharge(int) { reconstruction_missing("Entity_Player::AddSoulCharge 007d2ad0"); }
|
||||
int Entity_Player::GetEffectiveSoulCharge()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetEffectiveSoulCharge 007d2b50");
|
||||
}
|
||||
void Entity_Player::apply_soul_charge_to_actives(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::apply_soul_charge_to_actives 007d2b70");
|
||||
}
|
||||
void Entity_Player::AddBloodCharge(int) { reconstruction_missing("Entity_Player::AddBloodCharge 007d2d40"); }
|
||||
int Entity_Player::GetEffectiveBloodCharge()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::GetEffectiveBloodCharge 007d2dd0");
|
||||
}
|
||||
void Entity_Player::blood_charge_changed(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::blood_charge_changed 007d2df0");
|
||||
}
|
||||
void Entity_Player::AddRottenHearts(int, bool) { reconstruction_missing("Entity_Player::AddRottenHearts 007d2fc0"); }
|
||||
bool Entity_Player::CanPickRottenHearts() { reconstruction_missing("Entity_Player::CanPickRottenHearts 007d3180"); }
|
||||
void Entity_Player::UpdateBookOfVirtues(bool) { reconstruction_missing("Entity_Player::UpdateBookOfVirtues 007d3200"); }
|
||||
void Entity_Player::trigger_vampire_charm_kill()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_vampire_charm_kill 007d3350");
|
||||
}
|
||||
void Entity_Player::AddUrnSouls(uint32_t) { reconstruction_missing("Entity_Player::AddUrnSouls 007d3480"); }
|
||||
void Entity_Player::AddGigaBombs(int) { reconstruction_missing("Entity_Player::AddGigaBombs 007d34f0"); }
|
||||
bool Entity_Player::try_end_astral_projection()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::try_end_astral_projection 007d35b0");
|
||||
}
|
||||
void Entity_Player::fire_saturnus_tears() { reconstruction_missing("Entity_Player::fire_saturnus_tears 007d3e40"); }
|
||||
int Entity_Player::GetMaxInventorySize() { reconstruction_missing("Entity_Player::GetMaxInventorySize 007d4150"); }
|
||||
bool Entity_Player::CanAddCollectibleToInventory(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::CanAddCollectibleToInventory 007d4170");
|
||||
}
|
||||
void Entity_Player::SetPocketActiveItem(int, int, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::SetPocketActiveItem 007d41d0");
|
||||
}
|
||||
void Entity_Player::get_salvation_scale() { reconstruction_missing("Entity_Player::get_salvation_scale 007d4340"); }
|
||||
void Entity_Player::update_suplex() { reconstruction_missing("Entity_Player::update_suplex 007d4390"); }
|
||||
uint32_t Entity_Player::bag_of_crafting_collect(Entity_Pickup*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::bag_of_crafting_collect 007d5170");
|
||||
}
|
||||
int Entity_Player::GetMaxPoopMana() { reconstruction_missing("Entity_Player::GetMaxPoopMana 007d65c0"); }
|
||||
void Entity_Player::AddPoopMana(int) { reconstruction_missing("Entity_Player::AddPoopMana 007d65e0"); }
|
||||
void Entity_Player::poop_spell_roll() { reconstruction_missing("Entity_Player::poop_spell_roll 007d6670"); }
|
||||
void Entity_Player::UsePoopSpell(uint32_t) { reconstruction_missing("Entity_Player::UsePoopSpell 007d7290"); }
|
||||
void Entity_Player::RecomputeWispCollectibles(Entity_Familiar*)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::RecomputeWispCollectibles 007d7740");
|
||||
}
|
||||
void Entity_Player::trigger_cracked_orb(Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::trigger_cracked_orb 007d7c30");
|
||||
}
|
||||
uint32_t Entity_Player::AddItemCard(uint32_t) { reconstruction_missing("Entity_Player::AddItemCard 007d8240"); }
|
||||
void Entity_Player::spawn_lil_clot_familiars()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::spawn_lil_clot_familiars 007d83f0");
|
||||
}
|
||||
void Entity_Player::creep_contact_add(int, int) { reconstruction_missing("Entity_Player::creep_contact_add 007d8740"); }
|
||||
bool Entity_Player::spawn_ghost_corpse() { reconstruction_missing("Entity_Player::spawn_ghost_corpse 007d87a0"); }
|
||||
void Entity_Player::AddCurseMistEffect() { reconstruction_missing("Entity_Player::AddCurseMistEffect 007d8980"); }
|
||||
void Entity_Player::RemoveCurseMistEffect() { reconstruction_missing("Entity_Player::RemoveCurseMistEffect 007d8d20"); }
|
||||
void Entity_Player::AttachMinecart(Entity_NPC*) { reconstruction_missing("Entity_Player::AttachMinecart 007d9180"); }
|
||||
void Entity_Player::add_samson_berserk_charge(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::add_samson_berserk_charge 007d9200");
|
||||
}
|
||||
void Entity_Player::RevivePlayerGhost() { reconstruction_missing("Entity_Player::RevivePlayerGhost 007d93b0"); }
|
||||
void Entity_Player::MorphToCoopGhost() { reconstruction_missing("Entity_Player::MorphToCoopGhost 007d96f0"); }
|
||||
void Entity_Player::reset_body_sprite() { reconstruction_missing("Entity_Player::reset_body_sprite 007d9b70"); }
|
||||
uint32_t* Entity_Player::CalculateBagOfCraftingOutput(uint32_t*, const char*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::CalculateBagOfCraftingOutput 007d9d00");
|
||||
}
|
||||
void Entity_Player::SpawnClot(Vector, bool) { reconstruction_missing("Entity_Player::SpawnClot 007da810"); }
|
||||
bool Entity_Player::TryForgottenThrow(Vector) { reconstruction_missing("Entity_Player::TryForgottenThrow 007dac80"); }
|
||||
void Entity_Player::ResetPlayer() { reconstruction_missing("Entity_Player::ResetPlayer 007daed0"); }
|
||||
void Entity_Player::remove_wooden_cross_mantles()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::remove_wooden_cross_mantles 007db160");
|
||||
}
|
||||
bool Entity_Player::HasInstantDeathCurse() { reconstruction_missing("Entity_Player::HasInstantDeathCurse 007db6b0"); }
|
||||
void Entity_Player::TriggerEchoChamber(uint32_t, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::TriggerEchoChamber 007db740");
|
||||
}
|
||||
bool Entity_Player::is_evil_charm_immune(EntityRef)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::is_evil_charm_immune 007dba30");
|
||||
}
|
||||
void Entity_Player::add_random_drug_item_effect()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::add_random_drug_item_effect 007dbba0");
|
||||
}
|
||||
void Entity_Player::AddRandomMomItemEffect()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::AddRandomMomItemEffect 007dbc80");
|
||||
}
|
||||
void Entity_Player::ModelingClay_roll(RNG*) { reconstruction_missing("Entity_Player::ModelingClay_roll 007dbd70"); }
|
||||
void Entity_Player::twins_duplicate_familiars(int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::twins_duplicate_familiars 007dbeb0");
|
||||
}
|
||||
const std::string& Entity_Player::GetName() { reconstruction_missing("Entity_Player::GetName 007e9280"); }
|
||||
void Entity_Player::TriggerRoomExit() { reconstruction_missing("Entity_Player::TriggerRoomExit 00832850"); }
|
||||
int Entity_Player::GetActiveSubCharge(int) { reconstruction_missing("Entity_Player::GetActiveSubCharge 00841cb0"); }
|
||||
int Entity_Player::GetPoopSpell(int) { reconstruction_missing("Entity_Player::GetPoopSpell 00841cd0"); }
|
||||
bool Entity_Player::HasFullHeartsAndSoulHearts()
|
||||
{
|
||||
reconstruction_missing("Entity_Player::HasFullHeartsAndSoulHearts 0085e200");
|
||||
}
|
||||
void Entity_Player::AddControlsCooldown(int) { reconstruction_missing("Entity_Player::AddControlsCooldown 0085e260"); }
|
||||
uint64_t Entity_Player::GetLastDamageFlags() { reconstruction_missing("Entity_Player::GetLastDamageFlags 0085e280"); }
|
||||
void Entity_Player::CheckPoopSpellQueue(Vector)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::CheckPoopSpellQueue 0095ffb0");
|
||||
}
|
||||
void Entity_Player::StoreGameState(GameStatePlayer*, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::StoreGameState 007b0be0");
|
||||
}
|
||||
void Entity_Player::PlayCollectibleAnim(int, bool, std::string_view, int)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::PlayCollectibleAnim 00759f50");
|
||||
}
|
||||
void Entity_Player::PlayExtraAnimation(std::string_view, bool)
|
||||
{
|
||||
reconstruction_missing("Entity_Player::PlayExtraAnimation 007abe90");
|
||||
}
|
||||
void History::AddHistoryItem(const HistoryItem&) { reconstruction_missing("History::AddHistoryItem 00721a70"); }
|
||||
bool History::RemoveHistoryItemByIndex(int) { reconstruction_missing("History::RemoveHistoryItemByIndex 00721c00"); }
|
||||
void History::merge(History&) { reconstruction_missing("History::merge 00721c80"); }
|
||||
void History::remove_index_refs(int) { reconstruction_missing("History::remove_index_refs 007220a0"); }
|
||||
Loaded 100 of 146 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user