Curation round 20: player update, costumes and render, Missing No., the last actives and cards, familiars, Pin, the Frail, Wormwood and the Heretic, Dross to Gehenna, effects and the devil room purchase, champion colours, the quit path, save fields, shared vector helpers
This commit is contained in:
1 parent
ee863e70e6
commit
8dbeb1bc4a
168 files changed
+15682
-2399
No files matched your search
@@ -469,333 +469,6 @@ LAB_004a2fed:
|
||||
return;
|
||||
}
|
||||
|
||||
// 004b3af0
|
||||
Entity * NpcHelper::heretic_spawn_afterimage(Entity_NPC *npc)
|
||||
{
|
||||
uint8_t bVar1;
|
||||
Entity *afterimage;
|
||||
uint8_t *afterimageAnimChar;
|
||||
uint32_t uVar2;
|
||||
LayerState *afterimageLayer;
|
||||
LayerState *npcLayer;
|
||||
uint8_t *****animNameData;
|
||||
uint8_t *****animNameChar;
|
||||
bool isLess;
|
||||
uint32_t local_38;
|
||||
uint8_t *****animName [4];
|
||||
uint32_t animNameSize;
|
||||
uint32_t animNameCapacity;
|
||||
uint32_t securityCookie;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint8_t ****local_8;
|
||||
uint32_t flagsHi;
|
||||
void *npcAnimData;
|
||||
|
||||
local_8 = GHIDRA_CAST<uint8_t ****>(0xffffffff);
|
||||
puStack_c = &LAB_00af32ed;
|
||||
local_10 = ExceptionList;
|
||||
securityCookie = __security_cookie ^ GHIDRA_UINT((animName + 10));
|
||||
ExceptionList = &local_10;
|
||||
afterimage = Game::Spawn(g_game,0x389,0,&npc->_pos,&npc->_velocity,GHIDRA_CAST<Entity *>(npc),
|
||||
(npc->_state == 0xb) + 1,npc->_initSeed);
|
||||
flagsHi = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&npc->_flags) + 4));
|
||||
*GHIDRA_CAST<int *>(&afterimage->_flags) = GHIDRA_INT(npc->_flags);
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&afterimage->_flags) + 4)) = flagsHi;
|
||||
FUN_004b6b20((afterimage->_colorParams)._begin,(npc->_colorParams)._begin,(npc->_colorParams)._end
|
||||
,local_38);
|
||||
flagsHi = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&afterimage->_flags) + 4));
|
||||
*GHIDRA_CAST<uint32_t *>(&afterimage->_flags) = GHIDRA_UINT(afterimage->_flags) | 0x11;
|
||||
afterimage->_isInvicible = 1;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&afterimage->_flags) + 4)) = flagsHi;
|
||||
npcAnimData = (npc->_sprite)._animState._animData;
|
||||
if (npcAnimData == (void *)0x0) {
|
||||
animNameCapacity = 0xf;
|
||||
animNameSize = 0;
|
||||
animName[0] = GHIDRA_CAST<uint8_t *****>(0x0);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(animName))))->msvc::string::string(npcAnimData);
|
||||
}
|
||||
local_8 = GHIDRA_CAST<uint8_t ****>(0x0);
|
||||
animNameData = GHIDRA_CAST<uint8_t *****>(animName);
|
||||
if (0xf < animNameCapacity) {
|
||||
animNameData = animName[0];
|
||||
}
|
||||
afterimageAnimChar = (afterimage->_sprite)._animState._animData;
|
||||
if (afterimageAnimChar != GHIDRA_CAST<uint8_t *>(0x0)) {
|
||||
if (0xf < *GHIDRA_CAST<uint32_t *>((afterimageAnimChar + 0x14))) {
|
||||
afterimageAnimChar = *GHIDRA_CAST<uint8_t **>(afterimageAnimChar);
|
||||
}
|
||||
animNameChar = animNameData;
|
||||
do {
|
||||
bVar1 = *afterimageAnimChar;
|
||||
isLess = bVar1 < *GHIDRA_CAST<uint8_t *>(animNameChar);
|
||||
if (bVar1 != *GHIDRA_CAST<uint8_t *>(animNameChar)) {
|
||||
LAB_004b3c27:
|
||||
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_004b3c2c;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = afterimageAnimChar[1];
|
||||
isLess = bVar1 < *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(animNameChar) + 1));
|
||||
if (bVar1 != *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(animNameChar) + 1))) goto LAB_004b3c27;
|
||||
afterimageAnimChar = afterimageAnimChar + 2;
|
||||
animNameChar = GHIDRA_CAST<uint8_t *****>((GHIDRA_INT(animNameChar) + 2));
|
||||
} while (bVar1 != 0);
|
||||
uVar2 = 0;
|
||||
LAB_004b3c2c:
|
||||
if ((uVar2 == 0) &&
|
||||
((*GHIDRA_CAST<char *>((GHIDRA_INT((afterimage->_sprite)._animState._animData) + 0x34)) == '\0' ||
|
||||
((afterimage->_sprite)._animState._isPlaying != 0)))) goto LAB_004b3c68;
|
||||
}
|
||||
bVar1 = ANM2::SetAnimation(&afterimage->_sprite,GHIDRA_CAST<uint8_t *>(animNameData),1);
|
||||
if (bVar1 != 0) {
|
||||
AnimationState::Rewind(&(afterimage->_sprite)._animState);
|
||||
(afterimage->_sprite)._animState._isPlaying = 1;
|
||||
}
|
||||
LAB_004b3c68:
|
||||
local_8 = GHIDRA_CAST<uint8_t ****>(0xffffffff);
|
||||
if (0xf < animNameCapacity) {
|
||||
uVar2 = animNameCapacity + 1;
|
||||
animNameData = animName[0];
|
||||
if (0xfff < uVar2) {
|
||||
animNameData = GHIDRA_CAST<uint8_t *****>(animName[0][-1]);
|
||||
uVar2 = animNameCapacity + 0x24;
|
||||
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(animName[0]) + (-4 - GHIDRA_INT(animNameData))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(animNameData,uVar2);
|
||||
}
|
||||
animNameSize = 0;
|
||||
animNameCapacity = 0xf;
|
||||
animName[0] = GHIDRA_CAST<uint8_t *****>((GHIDRA_UINT(animName[0]) & 0xffffff00));
|
||||
if ((afterimage->_sprite)._animState._animData != (void *)0x0) {
|
||||
AnimationState::SetFrameFloat
|
||||
(&(afterimage->_sprite)._animState,(npc->_sprite)._animState._animFrame);
|
||||
}
|
||||
afterimageLayer = ANM2::GetLayer(&afterimage->_sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
||||
npcLayer = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
||||
(afterimageLayer->_color)._tint[3] = (npcLayer->_color)._tint[3];
|
||||
afterimage->_entityGridCollisionClass = 0;
|
||||
afterimage->_entityCollisionClass = 0;
|
||||
afterimage[2]._preInterpolatePos.x = 1.82169e-44;
|
||||
*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&afterimage[2]._health) + 2)) =
|
||||
*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&npc->_projectileCooldown) + 2));
|
||||
*GHIDRA_CAST<uint16_t *>((afterimage + 1)) = 0;
|
||||
afterimage->_health = 0.0;
|
||||
afterimage->_maxHitPoints = 0.0;
|
||||
(**(code **)(*GHIDRA_CAST<int *>(afterimage) + 0xc))();
|
||||
ExceptionList = local_10;
|
||||
return afterimage;
|
||||
}
|
||||
|
||||
// 004b3ec0
|
||||
int NpcHelper::heretic_count_out_fires()
|
||||
{
|
||||
int *entityIt;
|
||||
int outFireCount;
|
||||
int remaining;
|
||||
int entity;
|
||||
|
||||
outFireCount = 0;
|
||||
remaining = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1264));
|
||||
if (remaining != 0) {
|
||||
entityIt = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(g_game->_room) + 0x125c));
|
||||
do {
|
||||
entity = *entityIt;
|
||||
if (((*GHIDRA_CAST<int *>((entity + 0x28)) == 0x21) && (*GHIDRA_CAST<int *>((entity + 0x2c)) == 3)) &&
|
||||
(*GHIDRA_CAST<float *>((entity + 0x380)) <= 1.5 && *GHIDRA_CAST<float *>((entity + 0x380)) != 1.5)) {
|
||||
outFireCount = outFireCount + 1;
|
||||
}
|
||||
entityIt = entityIt + 1;
|
||||
remaining = remaining + -1;
|
||||
} while (remaining != 0);
|
||||
}
|
||||
return outFireCount;
|
||||
}
|
||||
|
||||
// 004b40d0
|
||||
void NpcHelper::heretic_choose_attack(Entity_NPC *npc)
|
||||
{
|
||||
RNG rng;
|
||||
Entity_NPC *pEVar1;
|
||||
uint32_t uVar2;
|
||||
uint32_t outcomeCount;
|
||||
void *pvVar3;
|
||||
uint32_t *outcomesCursor;
|
||||
float halfHealth;
|
||||
uint64_t uStack_44;
|
||||
uint32_t uStack_3c;
|
||||
uint32_t *local_38;
|
||||
Entity_NPC *npcLocal;
|
||||
void *outcomes;
|
||||
uint32_t *outcomesEnd;
|
||||
uint32_t *outcomesCapacityEnd;
|
||||
uint32_t local_24;
|
||||
uint8_t *puStack_20;
|
||||
void *local_1c;
|
||||
uint8_t *puStack_18;
|
||||
uint32_t local_14;
|
||||
int *weight;
|
||||
|
||||
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
||||
puStack_18 = &LAB_00af332d;
|
||||
local_1c = ExceptionList;
|
||||
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
||||
ExceptionList = &local_1c;
|
||||
outcomes = (void *)0x0;
|
||||
outcomesEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
||||
outcomesCapacityEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
||||
local_14 = 0;
|
||||
npcLocal = npc;
|
||||
local_38 = GHIDRA_CAST<uint32_t *>(heretic_count_out_fires());
|
||||
pvVar3 = (void *)0x0;
|
||||
outcomesCursor = GHIDRA_CAST<uint32_t *>(0x0);
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&npcLocal->_projectileDelay) + 1)) < '\x01') {
|
||||
uStack_44 = CONCAT44(0xe,(uint32_t)uStack_44);
|
||||
uStack_3c = 10;
|
||||
msvc::vector<8byte>::_Emplace_reallocate(0,GHIDRA_INT(&uStack_44) + 4);
|
||||
pvVar3 = outcomes;
|
||||
outcomesCursor = outcomesEnd;
|
||||
}
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&npcLocal->_projectileDelay) + 2)) < '\x01') {
|
||||
uVar2 = 0;
|
||||
outcomeCount = GHIDRA_INT(outcomesCursor) - GHIDRA_INT(pvVar3) >> 3;
|
||||
if (outcomeCount != 0) {
|
||||
do {
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 8)) == 9) {
|
||||
weight = GHIDRA_CAST<int *>((GHIDRA_INT(pvVar3) + uVar2 * 8 + 4));
|
||||
*weight = *weight + 10;
|
||||
if (*weight < 0) {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 8 + 4)) = 0;
|
||||
}
|
||||
goto LAB_004b41d2;
|
||||
}
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < outcomeCount);
|
||||
}
|
||||
uStack_44 = CONCAT44(9,(uint32_t)uStack_44);
|
||||
uStack_3c = 10;
|
||||
if (outcomesCursor == outcomesCapacityEnd) {
|
||||
msvc::vector<8byte>::_Emplace_reallocate(outcomesCursor,GHIDRA_INT(&uStack_44) + 4);
|
||||
pvVar3 = outcomes;
|
||||
outcomesCursor = outcomesEnd;
|
||||
}
|
||||
else {
|
||||
*outcomesCursor = 9;
|
||||
outcomesCursor[1] = 10;
|
||||
outcomesCursor = outcomesCursor + 2;
|
||||
outcomesEnd = outcomesCursor;
|
||||
}
|
||||
}
|
||||
LAB_004b41d2:
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&npcLocal->_projectileDelay) + 3)) < '\x01') {
|
||||
if (GHIDRA_CAST<uint32_t *>(0x2) < local_38) {
|
||||
uVar2 = 0;
|
||||
outcomeCount = GHIDRA_INT(outcomesCursor) - GHIDRA_INT(pvVar3) >> 3;
|
||||
if (outcomeCount != 0) {
|
||||
do {
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 8)) == 7) {
|
||||
weight = GHIDRA_CAST<int *>((GHIDRA_INT(pvVar3) + uVar2 * 8 + 4));
|
||||
*weight = *weight + 10;
|
||||
if (*weight < 0) {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 8 + 4)) = 0;
|
||||
}
|
||||
goto LAB_004b4249;
|
||||
}
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < outcomeCount);
|
||||
}
|
||||
uStack_44 = CONCAT44(7,(uint32_t)uStack_44);
|
||||
uStack_3c = 10;
|
||||
if (outcomesCursor == outcomesCapacityEnd) {
|
||||
msvc::vector<8byte>::_Emplace_reallocate(outcomesCursor,GHIDRA_INT(&uStack_44) + 4);
|
||||
pvVar3 = outcomes;
|
||||
outcomesCursor = outcomesEnd;
|
||||
}
|
||||
else {
|
||||
*outcomesCursor = 7;
|
||||
outcomesCursor[1] = 10;
|
||||
outcomesEnd = outcomesCursor + 2;
|
||||
outcomesCursor = outcomesEnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
LAB_004b4249:
|
||||
uVar2 = 0;
|
||||
outcomeCount = GHIDRA_INT(outcomesCursor) - GHIDRA_INT(pvVar3) >> 3;
|
||||
if (outcomeCount != 0) {
|
||||
do {
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 8)) == 3) {
|
||||
weight = GHIDRA_CAST<int *>((GHIDRA_INT(pvVar3) + uVar2 * 8 + 4));
|
||||
*weight = *weight + 1;
|
||||
if (*weight < 0) {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 8 + 4)) = 0;
|
||||
}
|
||||
goto LAB_004b42a6;
|
||||
}
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < outcomeCount);
|
||||
}
|
||||
uStack_44 = CONCAT44(3,(uint32_t)uStack_44);
|
||||
uStack_3c = 1;
|
||||
if (outcomesCursor == outcomesCapacityEnd) {
|
||||
msvc::vector<8byte>::_Emplace_reallocate(outcomesCursor,GHIDRA_INT(&uStack_44) + 4);
|
||||
}
|
||||
else {
|
||||
*outcomesCursor = 3;
|
||||
outcomesCursor[1] = 1;
|
||||
outcomesEnd = outcomesCursor + 2;
|
||||
}
|
||||
LAB_004b42a6:
|
||||
uVar2 = Random();
|
||||
uStack_44 = 0x900000005;
|
||||
uStack_3c = 7;
|
||||
rng._shift1 = 5;
|
||||
rng._seed = uVar2 | 1;
|
||||
rng._shift2 = 9;
|
||||
rng._shift3 = 7;
|
||||
uVar2 = WeightedOutcomePicker::PickOutcome(GHIDRA_CAST<WeightedOutcomePicker *>(&outcomes),rng);
|
||||
pEVar1 = npcLocal;
|
||||
if (uVar2 == 3) {
|
||||
*GHIDRA_CAST<uint16_t *>((GHIDRA_INT(&npcLocal->_stateFrame) + 2)) = 0;
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint16_t *>(&npcLocal->_stateFrame) = 0xffff;
|
||||
npcLocal->_state = uVar2;
|
||||
if (uVar2 == 7) {
|
||||
Entity_NPC::ClearDequeRefs(npcLocal);
|
||||
if (pEVar1->_child != 0) {
|
||||
local_38 = &pEVar1->_child;
|
||||
msvc::multiset<unsigned_int>::erase(&local_38);
|
||||
}
|
||||
halfHealth = pEVar1->_maxHitPoints * 0.5;
|
||||
pEVar1->_child = 0;
|
||||
*GHIDRA_CAST<char *>(&pEVar1->_projectileCooldown) =
|
||||
(pEVar1->_health <= halfHealth && halfHealth != pEVar1->_health) + '\x05';
|
||||
}
|
||||
*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&pEVar1->_projectileCooldown) + 1)) = 0;
|
||||
}
|
||||
if (outcomes != (void *)0x0) {
|
||||
uVar2 = GHIDRA_INT(outcomesCapacityEnd) - GHIDRA_INT(outcomes) & 0xfffffff8;
|
||||
pvVar3 = outcomes;
|
||||
if (0xfff < uVar2) {
|
||||
pvVar3 = *(void **)(GHIDRA_CAST<char *>(outcomes) + -4);
|
||||
uVar2 = uVar2 + 0x23;
|
||||
if (0x1f < GHIDRA_UINT((GHIDRA_INT(outcomes) + (-4 - GHIDRA_INT(pvVar3))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pvVar3,uVar2);
|
||||
}
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
|
||||
// 004b70c0
|
||||
void NpcHelper::hornfel_spawn_doors()
|
||||
{
|
||||
@@ -7537,24 +7210,6 @@ LAB_005adfbb:
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 005ae140
|
||||
Entity * NpcHelper::wormwood_spawn_splash(Entity_NPC *npc)
|
||||
{
|
||||
uint32_t seed;
|
||||
Entity *splash;
|
||||
int soundId;
|
||||
Manager *manager;
|
||||
|
||||
seed = Random();
|
||||
splash = Game::Spawn(g_game,1000,0x84,&npc->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed);
|
||||
(**(code **)(*GHIDRA_CAST<int *>(splash) + 0xc))();
|
||||
manager = g_manager;
|
||||
soundId = 0x1da;
|
||||
seed_fart_sound_override(&soundId);
|
||||
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,10,0,1.0,0.0);
|
||||
return splash;
|
||||
}
|
||||
|
||||
// 006be7e0
|
||||
uint8_t NpcHelper::is_target_valid(Entity *target)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user