The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63941 lines
2.7 MiB
Plaintext
63941 lines
2.7 MiB
Plaintext
#include "classes.h"
|
|
|
|
// 00417800
|
|
Entity_Player * Entity_Player::GetMainTwin()
|
|
{
|
|
EntityPtr mainTwin;
|
|
|
|
mainTwin = this->_twinPlayer;
|
|
if (((mainTwin == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(mainTwin) + 0x161c)) == -1)) ||
|
|
(this->_playerIndex <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(mainTwin) + 0x161c)))) {
|
|
mainTwin = (EntityPtr)this;
|
|
}
|
|
return GHIDRA_CAST<Entity_Player *>(mainTwin);
|
|
}
|
|
|
|
// 00417820
|
|
EntityPtr Entity_Player::GetOtherTwin()
|
|
{
|
|
return this->_twinPlayer;
|
|
}
|
|
|
|
// 00423950
|
|
int Entity_Player::ControllerIndex()
|
|
{
|
|
return this->_controllerIndex;
|
|
}
|
|
|
|
// 004253b0
|
|
int Entity_Player::GetPlayerType()
|
|
{
|
|
return this->_playerType;
|
|
}
|
|
|
|
// 00428b10
|
|
int Entity_Player::GetHearts()
|
|
{
|
|
return this->_redHearts;
|
|
}
|
|
|
|
// 0042a2f0
|
|
int Entity_Player::GetBatteryCharge(int slot)
|
|
{
|
|
if (GHIDRA_UINT(slot) < 4) {
|
|
return this->_activeDesc[slot]._item;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0042a310
|
|
int Entity_Player::GetMaxHearts()
|
|
{
|
|
return this->_maxHearts;
|
|
}
|
|
|
|
// 0042a320
|
|
byte Entity_Player::IsCoopGhost()
|
|
{
|
|
return this->_isCoopGhost;
|
|
}
|
|
|
|
// 004316d0
|
|
int Entity_Player::GetFireDirection()
|
|
{
|
|
return this->_fireDirection;
|
|
}
|
|
|
|
// 004316e0
|
|
Vector * Entity_Player::GetAimDirection()
|
|
{
|
|
return &this->_aimDirection;
|
|
}
|
|
|
|
// 004316f0
|
|
int Entity_Player::GetNumBlueFlies()
|
|
{
|
|
return this->_numBlueFlies;
|
|
}
|
|
|
|
// 00436160
|
|
void Entity_Player::AddCacheFlags(int flags)
|
|
{
|
|
this->_cacheFlags = this->_cacheFlags | flags;
|
|
return;
|
|
}
|
|
|
|
// 00436170
|
|
int Entity_Player::GetHeadDirection()
|
|
{
|
|
return this->_headDirection;
|
|
}
|
|
|
|
// 00436180
|
|
byte Entity_Player::AreOpposingShootDirectionsPressed()
|
|
{
|
|
return this->_areOpposingShootDirectionsPressed;
|
|
}
|
|
|
|
// 004361a0
|
|
float10 Entity_Player::GetTearPoisonDamage()
|
|
{
|
|
return (float10)this->_meleeDamage;
|
|
}
|
|
|
|
// 004361b0
|
|
int Entity_Player::GetItemState()
|
|
{
|
|
return this->_itemState;
|
|
}
|
|
|
|
// 004361c0
|
|
TemporaryEffects * Entity_Player::GetEffects()
|
|
{
|
|
return &this->_temporaryeffects;
|
|
}
|
|
|
|
// 004361d0
|
|
void Entity_Player::SetMinDamageCooldown(int cooldown)
|
|
{
|
|
int *newCooldown;
|
|
|
|
newCooldown = &cooldown;
|
|
if (cooldown <= this->_damageCooldown) {
|
|
newCooldown = &this->_damageCooldown;
|
|
}
|
|
this->_damageCooldown = *newCooldown;
|
|
return;
|
|
}
|
|
|
|
// 00499dd0
|
|
int Entity_Player::GetNumCoins()
|
|
{
|
|
return this->_numCoins;
|
|
}
|
|
|
|
// 004e4860
|
|
int Entity_Player::GetMovementDirection()
|
|
{
|
|
return this->_moveDirection;
|
|
}
|
|
|
|
// 00505c80
|
|
int Entity_Player::GetActiveItem(int slot)
|
|
{
|
|
if (GHIDRA_UINT(slot) < 4) {
|
|
return this->_activeDesc[slot]._charge;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00505cc0
|
|
byte Entity_Player::AreControlsEnabled()
|
|
{
|
|
if ((this->_isControlsEnabled == 0) || (0 < this->_controlsCooldown)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0056ff90
|
|
bool Entity_Player::IsItemQueueEmpty()
|
|
{
|
|
return (this->_queuedItem)._item == (void *)0x0;
|
|
}
|
|
|
|
// 0058e230
|
|
void Entity_Player::StopExtraAnimation()
|
|
{
|
|
this->_isPlayingExtraAnimation = 0;
|
|
this->_isPlayingItemAnimation = 0;
|
|
return;
|
|
}
|
|
|
|
// 005b1700
|
|
int Entity_Player::GetBoneHearts()
|
|
{
|
|
return this->_boneHearts;
|
|
}
|
|
|
|
// 005b1710
|
|
int Entity_Player::GetRottenHearts()
|
|
{
|
|
return this->_rottenHearts;
|
|
}
|
|
|
|
// 005b1740
|
|
int Entity_Player::GetSoulHearts()
|
|
{
|
|
return this->_soulHearts;
|
|
}
|
|
|
|
// 005b1750
|
|
int Entity_Player::GetBlackHearts()
|
|
{
|
|
return this->_blackHearts;
|
|
}
|
|
|
|
// 005b1760
|
|
int Entity_Player::GetNumKeys()
|
|
{
|
|
return this->_numKeys;
|
|
}
|
|
|
|
// 005b1770
|
|
int Entity_Player::GetGoldenHearts()
|
|
{
|
|
return this->_goldenHearts;
|
|
}
|
|
|
|
// 005b1780
|
|
byte Entity_Player::HasWeaponType(int weaponType)
|
|
{
|
|
if (GHIDRA_UINT(weaponType) < 0x11) {
|
|
return *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this->_weapons) + weaponType + 0x14));
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 005b17c0
|
|
RNG * Entity_Player::GetCollectibleRNG(int id)
|
|
{
|
|
void *rngsEnd;
|
|
uint lastIndex;
|
|
void *rngsBegin;
|
|
|
|
if (id < 0) {
|
|
return (this->_collectibleRNGs)._begin;
|
|
}
|
|
rngsEnd = (this->_collectibleRNGs)._end;
|
|
if (GHIDRA_INT(rngsEnd) - GHIDRA_INT((this->_collectibleRNGs)._begin) >> 4 <= id) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Collectible ID out of bounds!\n"));
|
|
rngsEnd = (this->_collectibleRNGs)._end;
|
|
}
|
|
rngsBegin = (this->_collectibleRNGs)._begin;
|
|
lastIndex = (GHIDRA_INT(rngsEnd) - GHIDRA_INT(rngsBegin) >> 4) - 1;
|
|
if (lastIndex < GHIDRA_UINT(id)) {
|
|
id = lastIndex;
|
|
}
|
|
return GHIDRA_CAST<RNG *>((GHIDRA_INT(rngsBegin) + id * 0x10));
|
|
}
|
|
|
|
// 005b1a20
|
|
void Entity_Player::moms_bracelet_grab()
|
|
{
|
|
ushort uVar1;
|
|
ANM2 other;
|
|
qword qVar2;
|
|
byte bVar3;
|
|
Vector *pVVar4;
|
|
int iVar5;
|
|
EntityList_EL *queryResult;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
byte extraout_CL_01;
|
|
byte extraout_CL_02;
|
|
int gridIndex;
|
|
char *pcVar6;
|
|
int GridIndex;
|
|
uint uVar7;
|
|
undefined1 *entityCount;
|
|
ANM2 *room;
|
|
qword *allocCounter;
|
|
Entity_Effect *entity;
|
|
bool isRockShot;
|
|
float fVar8;
|
|
EntityPtr *pEVar9;
|
|
ANM2 aAStackY_8d98 [128];
|
|
undefined1 in_stack_fffffd7c [244];
|
|
float fVar10;
|
|
float fVar11;
|
|
Vector *pVVar12;
|
|
undefined4 uVar13;
|
|
ANM2 spriteCopy;
|
|
EntityList_EL nearbyEntities;
|
|
Vector local_40;
|
|
Vector local_38;
|
|
Entity_Effect *local_30;
|
|
undefined1 local_2c [16];
|
|
uint local_1c;
|
|
uint local_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Entity_Effect *heldEffect;
|
|
int *rockShot;
|
|
Room *room;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af59cd;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((local_2c + 0x28));
|
|
ExceptionList = &local_10;
|
|
room = g_game->_room;
|
|
if (this->_itemState != 0x25c) {
|
|
fVar8 = 0.0;
|
|
local_38.x = 0.0;
|
|
if (this->_moveDirection != -1) {
|
|
pVVar4 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_40,this->_moveDirection);
|
|
local_38.x = pVVar4->x;
|
|
fVar8 = pVVar4->y;
|
|
}
|
|
local_38.x = local_38.x * 22.0;
|
|
pEVar9 = GHIDRA_CAST<EntityPtr *>((fVar8 * 22.0));
|
|
gridIndex = GHIDRA_INT((((local_38.x + (this->_pos).x) - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((((float)pEVar9 + (this->_pos).y) - 120.0) / 40.0 + 0.5));
|
|
if ((((-1 < gridIndex) && (gridIndex < room->_gridWidth)) && (-1 < iVar5)) &&
|
|
(((iVar5 < room->_gridHeight &&
|
|
(gridIndex = room->_gridWidth * iVar5 + gridIndex, -1 < gridIndex)) &&
|
|
(local_40.y = local_38.x, local_38.y = (float)pEVar9,
|
|
bVar3 = (GHIDRA_CAST<Room *>((room)))->Room::CanPickupGridEntity(gridIndex), bVar3 != 0)))) {
|
|
local_30 = (GHIDRA_CAST<Room *>((room)))->Room::PickupGridEntity(GridIndex);
|
|
if (local_30 != GHIDRA_CAST<Entity_Effect *>(0x0)) {
|
|
pEVar9 = &local_30->_parent;
|
|
if (local_30->_parent != (EntityPtr)0x0) {
|
|
local_38.y = (float)pEVar9;
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
*pEVar9 = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert();
|
|
TryHoldEntity(this,GHIDRA_CAST<Entity *>(local_30));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_30 = GHIDRA_CAST<Entity_Effect *>(0x0);
|
|
pEVar9 = GHIDRA_CAST<EntityPtr *>(local_38.y);
|
|
local_38.x = local_40.y;
|
|
}
|
|
local_38.x = local_38.x + (this->_pos).x;
|
|
local_38.y = (float)pEVar9 + (this->_pos).y;
|
|
local_40.y = (float)&room->_entityList;
|
|
EntityList::QueryRadius(GHIDRA_CAST<EntityList *>(local_40.y),&nearbyEntities,&local_38,22.0,0xffffffff);
|
|
local_8 = 0;
|
|
local_30 = GHIDRA_CAST<Entity_Effect *>(0x0);
|
|
entityCount = GHIDRA_CAST<undefined1 *>(nearbyEntities._size);
|
|
if (GHIDRA_CAST<undefined1 *>(nearbyEntities._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
do {
|
|
entity = *GHIDRA_CAST<Entity_Effect **>(((nearbyEntities._data)->_buf + GHIDRA_INT(local_30) * 4));
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || ((GHIDRA_CAST<Entity *>(entity))->_type != 1)) {
|
|
iVar5 = (GHIDRA_CAST<Entity *>(entity))->_type;
|
|
if (iVar5 - 10U < 0x3de) goto LAB_005b1bf2;
|
|
LAB_005b1f4c:
|
|
bVar3 = TryHoldEntity(this,GHIDRA_CAST<Entity *>(entity));
|
|
if (bVar3 != 0) goto LAB_005b2306;
|
|
entityCount = GHIDRA_CAST<undefined1 *>(nearbyEntities._size);
|
|
}
|
|
else {
|
|
iVar5 = 1;
|
|
LAB_005b1bf2:
|
|
if ((GHIDRA_CAST<Entity *>(entity))->_entityCollisionClass == 0) goto LAB_005b1f4c;
|
|
if (iVar5 == 0x1b) {
|
|
if (((GHIDRA_CAST<Entity *>(entity))->_variant == 0) && ((GHIDRA_CAST<Entity *>(entity))->_subtype == 0)) {
|
|
(GHIDRA_CAST<Entity *>(entity))->_subtype = 99;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) = std::_Allocate(0x30);
|
|
local_1c = 0x2c;
|
|
local_18 = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0))),"gfx/monsters/classic/monster_127_redhost.png",
|
|
0x2d);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&(GHIDRA_CAST<Entity *>(entity))->_sprite),0,GHIDRA_CAST<std_string *>(local_2c));
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
bVar3 = extraout_CL;
|
|
if (0xf < local_18) {
|
|
uVar7 = local_18 + 1;
|
|
pcVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pcVar6 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + -4));
|
|
uVar7 = local_18 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + (-4 - GHIDRA_INT(pcVar6))))) {
|
|
LAB_005b1e76:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar6,uVar7);
|
|
bVar3 = extraout_CL_00;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity *>(entity))->_sprite)))->ANM2::LoadGraphics(bVar3);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(entity) + 0x410)) = 0xf;
|
|
(GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity *>(entity))->_sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>("Bombed"),0);
|
|
uVar7 = Random();
|
|
local_30 = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x88,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar7);
|
|
local_38.y = (float)&(GHIDRA_CAST<Entity *>(local_30))->_sprite;
|
|
local_1c = 0;
|
|
local_18 = 0xf;
|
|
local_2c[0] = '\0';
|
|
local_2c[1] = '\0';
|
|
local_2c[2] = '\0';
|
|
local_2c[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) = std::_Allocate(0x20);
|
|
local_1c = 0x1c;
|
|
local_18 = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0))),"gfx/002.040_thrown tear.anm2",0x1d);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_38.y))))->ANM2::Load(GHIDRA_CAST<std_string *>(local_2c),1);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
if (0xf < local_18) {
|
|
uVar7 = local_18 + 1;
|
|
pcVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pcVar6 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + -4));
|
|
uVar7 = local_18 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + (-4 - GHIDRA_INT(pcVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar6,uVar7);
|
|
}
|
|
LAB_005b2124:
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_38.y))))->ANM2::Play(GHIDRA_CAST<byte *>("Rock1"),0);
|
|
heldEffect = local_30;
|
|
((GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_damageEvents)._capacity = (void *)0x2;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_pendingDamage = 1.26117e-41;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_index = (GHIDRA_CAST<Entity *>(entity))->_initSeed;
|
|
if (local_30->_parent != (EntityPtr)0x0) {
|
|
local_40.y = (float)&local_30->_parent;
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
heldEffect->_parent = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert();
|
|
entity = heldEffect;
|
|
LAB_005b2184:
|
|
TryHoldEntity(this,GHIDRA_CAST<Entity *>(entity));
|
|
goto LAB_005b2306;
|
|
}
|
|
}
|
|
else if (iVar5 == 0xcc) {
|
|
if (((GHIDRA_CAST<Entity *>(entity))->_variant == 0) && ((GHIDRA_CAST<Entity *>(entity))->_subtype == 0)) {
|
|
(GHIDRA_CAST<Entity *>(entity))->_subtype = 99;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) = std::_Allocate(0x40);
|
|
local_1c = 0x36;
|
|
local_18 = 0x3f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0))),
|
|
"gfx/monsters/rebirth/monster_247_flesh mobile host.png",0x37);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&(GHIDRA_CAST<Entity *>(entity))->_sprite),1,GHIDRA_CAST<std_string *>(local_2c));
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
bVar3 = extraout_CL_01;
|
|
if (0xf < local_18) {
|
|
uVar7 = local_18 + 1;
|
|
pcVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pcVar6 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + -4));
|
|
uVar7 = local_18 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + (-4 - GHIDRA_INT(pcVar6)))))
|
|
goto LAB_005b1e76;
|
|
}
|
|
operator_delete(pcVar6,uVar7);
|
|
bVar3 = extraout_CL_02;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity *>(entity))->_sprite)))->ANM2::LoadGraphics(bVar3);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(entity) + 0x410)) = 0xf;
|
|
(GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity *>(entity))->_sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>("Bombed"),0);
|
|
uVar13 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(GHIDRA_CAST<Entity *>(entity))->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&(GHIDRA_CAST<Entity *>(entity))->_flags) = GHIDRA_UINT((GHIDRA_CAST<Entity *>(entity))->_flags) & 0xffffffef;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(GHIDRA_CAST<Entity *>(entity))->_flags) + 4)) = uVar13;
|
|
uVar7 = Random();
|
|
local_30 = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x88,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar7);
|
|
local_38.y = (float)&(GHIDRA_CAST<Entity *>(local_30))->_sprite;
|
|
local_1c = 0;
|
|
local_18 = 0xf;
|
|
local_2c[0] = '\0';
|
|
local_2c[1] = '\0';
|
|
local_2c[2] = '\0';
|
|
local_2c[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) = std::_Allocate(0x20);
|
|
local_1c = 0x1c;
|
|
local_18 = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0))),"gfx/002.040_thrown tear.anm2",0x1d);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_38.y))))->ANM2::Load(GHIDRA_CAST<std_string *>(local_2c),1);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
if (0xf < local_18) {
|
|
uVar7 = local_18 + 1;
|
|
pcVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pcVar6 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + -4));
|
|
uVar7 = local_18 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + (-4 - GHIDRA_INT(pcVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar6,uVar7);
|
|
}
|
|
goto LAB_005b2124;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 == 0xf5) goto LAB_005b2184;
|
|
if (iVar5 == 0x124) {
|
|
entity->Remove();
|
|
uVar7 = Random();
|
|
iVar5 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uVar13)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uVar13)) + 0x1))) = 0;
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(uVar13)) + 0x2))) = 0;
|
|
pVVar12 = &g_vectorZero;
|
|
pVVar4 = &this->_pos;
|
|
fVar11 = 1.90577e-43;
|
|
fVar10 = 1.4013e-42;
|
|
fVar8 = 8.36807e-39;
|
|
local_30 = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x88,pVVar4,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(register0x00000010) + -0x284)))))->ANM2::ANM2(&(GHIDRA_CAST<Entity *>(entity))->_sprite);
|
|
other._championColor._offset[0] = fVar8;
|
|
other._filename._buf[0] = in_stack_fffffd7c[0];
|
|
other._filename._buf[1] = in_stack_fffffd7c[1];
|
|
other._filename._buf[2] = in_stack_fffffd7c[2];
|
|
other._filename._buf[3] = in_stack_fffffd7c[3];
|
|
other._filename._buf[4] = in_stack_fffffd7c[4];
|
|
other._filename._buf[5] = in_stack_fffffd7c[5];
|
|
other._filename._buf[6] = in_stack_fffffd7c[6];
|
|
other._filename._buf[7] = in_stack_fffffd7c[7];
|
|
other._filename._buf[8] = in_stack_fffffd7c[8];
|
|
other._filename._buf[9] = in_stack_fffffd7c[9];
|
|
other._filename._buf[10] = in_stack_fffffd7c[10];
|
|
other._filename._buf[0xb] = in_stack_fffffd7c[0xb];
|
|
other._filename._buf[0xc] = in_stack_fffffd7c[0xc];
|
|
other._filename._buf[0xd] = in_stack_fffffd7c[0xd];
|
|
other._filename._buf[0xe] = in_stack_fffffd7c[0xe];
|
|
other._filename._buf[0xf] = in_stack_fffffd7c[0xf];
|
|
other._filename._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x10)));
|
|
other._filename._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x14)));
|
|
other._animDefaultName._buf[0] = in_stack_fffffd7c[0x18];
|
|
other._animDefaultName._buf[1] = in_stack_fffffd7c[0x19];
|
|
other._animDefaultName._buf[2] = in_stack_fffffd7c[0x1a];
|
|
other._animDefaultName._buf[3] = in_stack_fffffd7c[0x1b];
|
|
other._animDefaultName._buf[4] = in_stack_fffffd7c[0x1c];
|
|
other._animDefaultName._buf[5] = in_stack_fffffd7c[0x1d];
|
|
other._animDefaultName._buf[6] = in_stack_fffffd7c[0x1e];
|
|
other._animDefaultName._buf[7] = in_stack_fffffd7c[0x1f];
|
|
other._animDefaultName._buf[8] = in_stack_fffffd7c[0x20];
|
|
other._animDefaultName._buf[9] = in_stack_fffffd7c[0x21];
|
|
other._animDefaultName._buf[10] = in_stack_fffffd7c[0x22];
|
|
other._animDefaultName._buf[0xb] = in_stack_fffffd7c[0x23];
|
|
other._animDefaultName._buf[0xc] = in_stack_fffffd7c[0x24];
|
|
other._animDefaultName._buf[0xd] = in_stack_fffffd7c[0x25];
|
|
other._animDefaultName._buf[0xe] = in_stack_fffffd7c[0x26];
|
|
other._animDefaultName._buf[0xf] = in_stack_fffffd7c[0x27];
|
|
other._animDefaultName._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x28)));
|
|
other._animDefaultName._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x2c)));
|
|
other._animState._animation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x30)));
|
|
other._animState._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x34)));
|
|
other._animState._layerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x38)));
|
|
other._animState._nullLayerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x3c)));
|
|
other._animState._animFrame = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0x40)));
|
|
other._animState._isPlaying = in_stack_fffffd7c[0x44];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other._animState)) + 0x15))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x45)));
|
|
other._animState._currentlyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x48)));
|
|
other._animState._previouslyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x4c)));
|
|
other._overlayAnimState._animation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x50)));
|
|
other._overlayAnimState._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x54)));
|
|
other._overlayAnimState._layerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x58)));
|
|
other._overlayAnimState._nullLayerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x5c)));
|
|
other._overlayAnimState._animFrame = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0x60)));
|
|
other._overlayAnimState._isPlaying = in_stack_fffffd7c[100];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other._overlayAnimState)) + 0x15))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x65)));
|
|
other._overlayAnimState._currentlyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x68)));
|
|
other._overlayAnimState._previouslyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x6c)));
|
|
other._overlayRenderFirst = in_stack_fffffd7c[0x70];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other)) + 0x71))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x71)));
|
|
other._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x74)));
|
|
other._animCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x78)));
|
|
other._layerState = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x7c)));
|
|
other._layerCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x80)));
|
|
other._nullLayerNames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x84)));
|
|
other._numNullLayers = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x88)));
|
|
other._eventNames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffd7c)) + 0x8c)));
|
|
other._numEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffd7c)) + 0x90)));
|
|
other._offset.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0x94)));
|
|
other._offset.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0x98)));
|
|
other._scale.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0x9c)));
|
|
other._scale.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xa0)));
|
|
other._rotation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xa4)));
|
|
other._color._tint[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xa8)));
|
|
other._color._tint[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xac)));
|
|
other._color._tint[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xb0)));
|
|
other._color._tint[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xb4)));
|
|
other._color._colorize[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xb8)));
|
|
other._color._colorize[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xbc)));
|
|
other._color._colorize[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xc0)));
|
|
other._color._colorize[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xc4)));
|
|
other._color._offset[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xc8)));
|
|
other._color._offset[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xcc)));
|
|
other._color._offset[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xd0)));
|
|
other._championColor._tint[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xd4)));
|
|
other._championColor._tint[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xd8)));
|
|
other._championColor._tint[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xdc)));
|
|
other._championColor._tint[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xe0)));
|
|
other._championColor._colorize[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xe4)));
|
|
other._championColor._colorize[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xe8)));
|
|
other._championColor._colorize[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xec)));
|
|
other._championColor._colorize[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffd7c)) + 0xf0)));
|
|
other._championColor._offset[1] = fVar10;
|
|
other._championColor._offset[2] = fVar11;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(other)) + 0x100))) = pVVar4;
|
|
other._playbackSpeed = (float)pVVar12;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other)) + 0x108))) = (char)uVar13;
|
|
other._loaded = SUB41(uVar13,1);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(other)) + 0x10a))) = SUB42(uVar13,2);
|
|
other._shadowLayerIndex = iVar5;
|
|
other._bitflags = uVar7;
|
|
(GHIDRA_CAST<ANM2 *>((&local_30->_sprite)))->ANM2::operator_assign(other);
|
|
((GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_damageEvents)._capacity = (void *)0xc;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_pendingDamage = 0.0;
|
|
*GHIDRA_CAST<undefined4 *>(&(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_pendingDamageFlags) = 0;
|
|
pEVar9 = &local_30->_parent;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_index = (GHIDRA_CAST<Entity *>(entity))->_initSeed;
|
|
if (*pEVar9 != (EntityPtr)0x0) {
|
|
local_40.y = (float)pEVar9;
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
*pEVar9 = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert();
|
|
TryHoldEntity(this,GHIDRA_CAST<Entity *>(local_30));
|
|
goto LAB_005b2306;
|
|
}
|
|
}
|
|
}
|
|
local_30 = GHIDRA_CAST<Entity_Effect *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_30)) + 0x1))));
|
|
} while (local_30 < entityCount);
|
|
}
|
|
queryResult = EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>(local_40.y),GHIDRA_CAST<EntityList_EL *>((local_2c + 8)),&this->_pos,
|
|
44.0,6);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x0))) = '\x01';
|
|
nearbyEntities._data = queryResult->_data;
|
|
nearbyEntities._capacity = queryResult->_capacity;
|
|
nearbyEntities._size = queryResult->_size;
|
|
local_38.y = (float)nearbyEntities._data;
|
|
if (local_2c[8] == '\0') {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
tracked_alloc(1,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_2c)) + 0xc))),0);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
local_38.y = (float)nearbyEntities._data;
|
|
}
|
|
uVar7 = 0;
|
|
nearbyEntities._data = (void *)local_38.y;
|
|
if (GHIDRA_CAST<undefined1 *>(nearbyEntities._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
do {
|
|
rockShot = *GHIDRA_CAST<int **>(((GHIDRA_CAST<std_string *>(local_38.y))->_buf + uVar7 * 4));
|
|
if (rockShot[10] == 2) {
|
|
isRockShot = rockShot[0xb] == 0x28;
|
|
LAB_005b219a:
|
|
if ((((isRockShot) && (GHIDRA_CAST<Entity_Player *>(rockShot[0xef]) != this)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(rockShot) + 0x173)) == '\0')) && (-75.0 < (float)rockShot[0xd4])) {
|
|
(**(code **)(*rockShot + 0x28))();
|
|
uVar7 = Random();
|
|
local_30 = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x88,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7)
|
|
;
|
|
(GHIDRA_CAST<ANM2 *>((&spriteCopy)))->ANM2::ANM2(GHIDRA_CAST<ANM2 *>((rockShot + 0x12)));
|
|
Isaac::SwapANM2(&local_30->_sprite,&spriteCopy);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
|
(GHIDRA_CAST<ANM2 *>((room)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&spriteCopy._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&spriteCopy._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((spriteCopy._animDefaultName._buf)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&spriteCopy))))->std::string::_Tidy_deallocate();
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
uVar1 = *GHIDRA_CAST<ushort *>((GHIDRA_CAST<char *>(rockShot) + 0x32));
|
|
((GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_damageEvents)._capacity =
|
|
GHIDRA_CAST<undefined1 *>(GHIDRA_UINT(uVar1));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_pendingDamage =
|
|
(float)GHIDRA_UINT(*GHIDRA_CAST<ushort *>((rockShot + 0xc)));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_index = rockShot[0xfb];
|
|
*GHIDRA_CAST<undefined4 *>(&(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_pendingDamageFlags) = 0;
|
|
if (GHIDRA_CAST<undefined1 *>(GHIDRA_UINT(uVar1)) == &DAT_0000000e) {
|
|
*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_30) + 0x410)))->_pendingDamageFlags) =
|
|
GHIDRA_INT((float)rockShot[0xe0]);
|
|
}
|
|
pEVar9 = &local_30->_parent;
|
|
if (local_30->_parent != (EntityPtr)0x0) {
|
|
local_40.y = (float)pEVar9;
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
*pEVar9 = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert();
|
|
TryHoldEntity(this,GHIDRA_CAST<Entity *>(local_30));
|
|
goto LAB_005b2306;
|
|
}
|
|
}
|
|
else if (rockShot[10] == 9) {
|
|
isRockShot = rockShot[0xb] == 8;
|
|
goto LAB_005b219a;
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < GHIDRA_UINT(nearbyEntities._size));
|
|
}
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
FlushQueueItem(this);
|
|
this->_itemState = 0x25c;
|
|
this->_itemStateCooldown = 0;
|
|
LAB_005b2306:
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (nearbyEntities._data != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
uVar7 = (GHIDRA_CAST<ANM2 *>((GHIDRA_INT(nearbyEntities._data) + -0x114)))->_bitflags;
|
|
qVar2 = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar7;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < uVar7));
|
|
free(&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(nearbyEntities._data) + -0x114)))->_bitflags);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 005b2360
|
|
void Entity_Player::UseRedKey()
|
|
{
|
|
int *doorIt;
|
|
uint doorSlot;
|
|
float dy;
|
|
float dx;
|
|
int door;
|
|
|
|
doorSlot = 0;
|
|
doorIt = GHIDRA_CAST<int *>((GHIDRA_INT(g_game->_room) + 0x7744));
|
|
while ((door = *doorIt, door == 0 ||
|
|
(dy = (this->_pos).y - *GHIDRA_CAST<float *>((door + 0x340)),
|
|
dx = (this->_pos).x - *GHIDRA_CAST<float *>((door + 0x33c)), 14400.0 <= dy * dy + dx * dx))) {
|
|
doorSlot = doorSlot + 1;
|
|
doorIt = doorIt + 1;
|
|
if (7 < doorSlot) {
|
|
return;
|
|
}
|
|
}
|
|
if (doorSlot != 0xffffffff) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::MakeRedRoomDoor(g_game->_currentRoomIdx,doorSlot);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 005b23f0
|
|
void Entity_Player::use_card_hagalaz(RNG *rng)
|
|
{
|
|
Entity_Player *npc = this;
|
|
uint uVar1;
|
|
Entity_NPC *npc;
|
|
Entity *spawned;
|
|
int *piVar2;
|
|
uint uVar3;
|
|
void *pvVar4;
|
|
undefined1 *particlesLeft;
|
|
code *pcVar5;
|
|
void *gridX;
|
|
int iVar6;
|
|
float fVar7;
|
|
TypeDescriptor *pTVar8;
|
|
undefined4 uVar9;
|
|
TypeDescriptor *pTVar10;
|
|
undefined4 uVar11;
|
|
EntityRef destroySource2;
|
|
EntityRef destroySource;
|
|
EntityRef damageGridSource;
|
|
EntityRef rockDamageSource;
|
|
Vector particlePos;
|
|
float npcPosY;
|
|
float npcPosX;
|
|
Vector particleVelocity;
|
|
uint entityIndex;
|
|
undefined4 rngShift3;
|
|
uint rngSeed;
|
|
Entity_Player *player;
|
|
void *local_1b8;
|
|
undefined1 *local_1b4;
|
|
int *local_1b0;
|
|
undefined4 local_1ac;
|
|
undefined4 local_1a8;
|
|
undefined4 local_1a4;
|
|
float local_1a0;
|
|
undefined4 local_19c;
|
|
float fStack_198;
|
|
float fStack_194;
|
|
float fStack_190;
|
|
float local_18c;
|
|
undefined4 local_188;
|
|
undefined4 local_184;
|
|
int rockEnemyTable [95];
|
|
Manager *manager;
|
|
EntityRef *sourceRef;
|
|
|
|
rockEnemyTable[0x5e] = __security_cookie ^ GHIDRA_UINT((rockEnemyTable + 0x5f));
|
|
if (rng == GHIDRA_CAST<RNG *>(0x0)) {
|
|
uVar1 = 0;
|
|
}
|
|
else {
|
|
uVar1 = rng->_seed;
|
|
}
|
|
pvVar4 = g_game->_room;
|
|
rngShift3 = 0x19;
|
|
local_1b8 = (void *)0x1;
|
|
rngSeed = uVar1;
|
|
player = npc;
|
|
if (1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0xc)) + -1) {
|
|
do {
|
|
local_1b0 = GHIDRA_CAST<int *>(0x1);
|
|
gridX = local_1b8;
|
|
if (1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x10)) + -1) {
|
|
do {
|
|
if (-1 < GHIDRA_INT(gridX)) {
|
|
if (((GHIDRA_INT(gridX) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0xc))) && (-1 < GHIDRA_INT(local_1b0))) &&
|
|
(GHIDRA_INT(local_1b0) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x10)))) {
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0xc)) * GHIDRA_INT(local_1b0) + GHIDRA_INT(gridX);
|
|
if (-1 < iVar6) {
|
|
piVar2 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar4) + iVar6 * 4 + 0x24));
|
|
if ((piVar2 != GHIDRA_CAST<int *>(0x0)) && (piVar2[1] != 0x10)) {
|
|
if (rng == GHIDRA_CAST<RNG *>(0x0)) {
|
|
LAB_005b2520:
|
|
pcVar5 = *(code **)(*piVar2 + 0x14);
|
|
(GHIDRA_CAST<EntityRef *>((&destroySource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(*pcVar5)(0,&destroySource);
|
|
if (piVar2[1] == 0x16) {
|
|
pcVar5 = *(code **)(*piVar2 + 0x14);
|
|
(GHIDRA_CAST<EntityRef *>((&destroySource2)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
sourceRef = &destroySource2;
|
|
uVar9 = 0;
|
|
goto LAB_005b2568;
|
|
}
|
|
}
|
|
else {
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar5 = (code *)swi(3);
|
|
(*pcVar5)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> 5 ^ uVar1;
|
|
uVar1 = uVar1 << 0x1b ^ uVar1;
|
|
uVar1 = uVar1 >> ((byte)rngShift3 & 0x1f) ^ uVar1;
|
|
if ((uVar1 & 3) == 0) goto LAB_005b2520;
|
|
pcVar5 = *(code **)(*piVar2 + 0x10);
|
|
(GHIDRA_CAST<EntityRef *>((&damageGridSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
sourceRef = &damageGridSource;
|
|
uVar9 = 1;
|
|
LAB_005b2568:
|
|
(*pcVar5)(uVar9,sourceRef);
|
|
}
|
|
gridX = local_1b8;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_1b0 = GHIDRA_CAST<int *>((GHIDRA_INT(local_1b0) + 1));
|
|
pvVar4 = g_game->_room;
|
|
} while (GHIDRA_INT(local_1b0) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x10)) + -1);
|
|
rngSeed = uVar1;
|
|
}
|
|
local_1b8 = (void *)(GHIDRA_INT(gridX) + 1);
|
|
pvVar4 = g_game->_room;
|
|
} while (GHIDRA_INT(local_1b8) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0xc)) + -1);
|
|
}
|
|
rockEnemyTable[0] = 0x335;
|
|
rockEnemyTable[1] = 0;
|
|
rockEnemyTable[2] = 0x17;
|
|
rockEnemyTable[3] = 3;
|
|
rockEnemyTable[4] = 0x35b;
|
|
rockEnemyTable[5] = 0;
|
|
rockEnemyTable[6] = 0x29;
|
|
rockEnemyTable[7] = 3;
|
|
rockEnemyTable[8] = 0x332;
|
|
rockEnemyTable[9] = 0;
|
|
rockEnemyTable[10] = 0x332;
|
|
rockEnemyTable[0xb] = 1;
|
|
rockEnemyTable[0xc] = 0x332;
|
|
rockEnemyTable[0xd] = 2;
|
|
rockEnemyTable[0xe] = 0x12e;
|
|
rockEnemyTable[0xf] = 0;
|
|
rockEnemyTable[0x10] = 0x12e;
|
|
rockEnemyTable[0x11] = 10;
|
|
rockEnemyTable[0x12] = 0x33a;
|
|
rockEnemyTable[0x13] = 0;
|
|
rockEnemyTable[0x14] = 0x2a;
|
|
rockEnemyTable[0x15] = 0;
|
|
rockEnemyTable[0x16] = 0x2a;
|
|
rockEnemyTable[0x17] = 1;
|
|
rockEnemyTable[0x18] = 0x2a;
|
|
rockEnemyTable[0x19] = 2;
|
|
rockEnemyTable[0x1a] = 0xc9;
|
|
rockEnemyTable[0x1b] = 0;
|
|
rockEnemyTable[0x1c] = 0xca;
|
|
rockEnemyTable[0x1d] = 0;
|
|
rockEnemyTable[0x1e] = 0xca;
|
|
rockEnemyTable[0x1f] = 10;
|
|
rockEnemyTable[0x20] = 0xcb;
|
|
rockEnemyTable[0x21] = 0;
|
|
rockEnemyTable[0x22] = 0xeb;
|
|
rockEnemyTable[0x23] = 0;
|
|
rockEnemyTable[0x24] = 0xec;
|
|
rockEnemyTable[0x25] = 0;
|
|
rockEnemyTable[0x26] = 0x324;
|
|
rockEnemyTable[0x27] = 0;
|
|
rockEnemyTable[0x28] = 0x329;
|
|
rockEnemyTable[0x29] = 0;
|
|
rockEnemyTable[0x2a] = 0x2c;
|
|
rockEnemyTable[0x2b] = 0;
|
|
rockEnemyTable[0x2c] = 0x2c;
|
|
rockEnemyTable[0x2d] = 1;
|
|
rockEnemyTable[0x2e] = 0x36d;
|
|
rockEnemyTable[0x2f] = 0;
|
|
rockEnemyTable[0x30] = 0x37d;
|
|
rockEnemyTable[0x31] = 0;
|
|
rockEnemyTable[0x32] = 0x354;
|
|
rockEnemyTable[0x33] = 0;
|
|
rockEnemyTable[0x34] = 0x393;
|
|
rockEnemyTable[0x35] = 1;
|
|
rockEnemyTable[0x36] = 0x1b;
|
|
rockEnemyTable[0x37] = 0;
|
|
rockEnemyTable[0x38] = 0x1b;
|
|
rockEnemyTable[0x39] = 1;
|
|
rockEnemyTable[0x3a] = 0x1b;
|
|
rockEnemyTable[0x3b] = 3;
|
|
rockEnemyTable[0x3c] = 0x1b;
|
|
rockEnemyTable[0x3d] = 1;
|
|
rockEnemyTable[0x3e] = 0xcc;
|
|
rockEnemyTable[0x3f] = 0;
|
|
rockEnemyTable[0x40] = 0xf7;
|
|
rockEnemyTable[0x41] = 0;
|
|
rockEnemyTable[0x42] = 0x29;
|
|
rockEnemyTable[0x43] = 0;
|
|
rockEnemyTable[0x44] = 0x20;
|
|
rockEnemyTable[0x45] = 0;
|
|
rockEnemyTable[0x46] = 0x29;
|
|
rockEnemyTable[0x47] = 2;
|
|
rockEnemyTable[0x48] = 0x348;
|
|
rockEnemyTable[0x49] = 0;
|
|
rockEnemyTable[0x4a] = 0x29;
|
|
rockEnemyTable[0x4b] = 4;
|
|
rockEnemyTable[0x4c] = 0x348;
|
|
rockEnemyTable[0x4d] = 0;
|
|
rockEnemyTable[0x4e] = 0xfe;
|
|
rockEnemyTable[0x4f] = 0;
|
|
rockEnemyTable[0x50] = 0x20;
|
|
rockEnemyTable[0x51] = 0;
|
|
rockEnemyTable[0x52] = 0x11b;
|
|
rockEnemyTable[0x53] = 0;
|
|
local_1b8 = g_game->_room;
|
|
rockEnemyTable[0x54] = 0x20;
|
|
rockEnemyTable[0x55] = 0;
|
|
rockEnemyTable[0x56] = 0xd4;
|
|
rockEnemyTable[0x57] = 0;
|
|
rockEnemyTable[0x58] = 0x11e;
|
|
rockEnemyTable[0x59] = 0;
|
|
rockEnemyTable[0x5a] = 0xd4;
|
|
rockEnemyTable[0x5b] = 3;
|
|
rockEnemyTable[0x5c] = 0x11e;
|
|
rockEnemyTable[0x5d] = 0;
|
|
entityIndex = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1b8) + 0x1264)) != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((entityIndex * 4 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1b8) + 0x125c)))) + 0x28)) - 10U <
|
|
0x3de) {
|
|
if (rng == GHIDRA_CAST<RNG *>(0x0)) {
|
|
LAB_005b29ae:
|
|
npc = (Entity_NPC *)
|
|
__RTDynamicCast(*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1b8) + 0x125c)) + entityIndex * 4))
|
|
,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
|
uVar3 = 0;
|
|
do {
|
|
if ((npc->_type == rockEnemyTable[uVar3 * 2]) &&
|
|
(npc->_variant == rockEnemyTable[uVar3 * 2 + 1])) {
|
|
local_1a8 = 0;
|
|
local_1a4 = 0;
|
|
local_1a0 = 0.0;
|
|
local_19c = 0;
|
|
fStack_198 = g_vectorZero.x;
|
|
fStack_194 = g_vectorZero.y;
|
|
fStack_190 = g_vectorZero.x;
|
|
local_18c = g_vectorZero.y;
|
|
local_188 = 0;
|
|
local_184 = 0;
|
|
npc->Kill(&local_1a8);
|
|
manager = g_manager;
|
|
local_1b0 = GHIDRA_CAST<int *>(0x89);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1b0));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1b0),1.0,2,0,1.0,0.0);
|
|
break;
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < 0x1b);
|
|
piVar2 = rockEnemyTable + 0x37;
|
|
uVar3 = 0;
|
|
LAB_005b2ad0:
|
|
if ((npc->_type != piVar2[-1]) || (npc->_variant != *piVar2)) goto LAB_005b2adc;
|
|
if (npc->_type == 0xd4) {
|
|
npc->_isInvicible = 0;
|
|
}
|
|
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::Morph(rockEnemyTable[uVar3 * 4 + 0x38],rockEnemyTable[uVar3 * 4 + 0x39],0,
|
|
-1);
|
|
manager = g_manager;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player->_config) + 0x5c)) < 1) {
|
|
local_1b0 = GHIDRA_CAST<int *>(0x3f4ccccd);
|
|
}
|
|
else {
|
|
local_1b0 = GHIDRA_CAST<int *>(0x3f800000);
|
|
}
|
|
local_1b4 = GHIDRA_CAST<undefined1 *>(0x1e);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1b4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1b4),(float)local_1b0,2,0,1.0,0.0);
|
|
uVar3 = Random();
|
|
particlesLeft = GHIDRA_CAST<undefined1 *>((uVar3 % 6 + 6));
|
|
if (particlesLeft != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
local_1b4 = particlesLeft;
|
|
do {
|
|
uVar1 = Random();
|
|
fVar7 = (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_1b4 = GHIDRA_CAST<undefined1 *>((fVar7 + fVar7));
|
|
uVar1 = Random();
|
|
local_1b0 = GHIDRA_CAST<int *>(((float)((double)GHIDRA_INT(uVar1) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0));
|
|
particleVelocity.x = cos((float)local_1b4);
|
|
particleVelocity.x = particleVelocity.x * (float)local_1b0;
|
|
particleVelocity.y = sin((float)local_1b4);
|
|
particleVelocity.y = particleVelocity.y * (float)local_1b0;
|
|
uVar1 = Random();
|
|
npcPosX = (npc->_pos).x;
|
|
npcPosY = (npc->_pos).y;
|
|
uVar3 = Random();
|
|
fVar7 = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_1b4 = GHIDRA_CAST<undefined1 *>((fVar7 + fVar7));
|
|
uVar3 = Random();
|
|
local_1b0 = GHIDRA_CAST<int *>(((float)((double)GHIDRA_INT(uVar3) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 20.0));
|
|
fVar7 = cos((float)local_1b4);
|
|
particlePos.x = fVar7 * (float)local_1b0 + npcPosX;
|
|
fVar7 = sin((float)local_1b4);
|
|
uVar11 = 0;
|
|
pTVar10 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
particlePos.y = fVar7 * (float)local_1b0 + npcPosY;
|
|
pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar9 = 0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&particlePos,&particleVelocity,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar1);
|
|
piVar2 = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,uVar9,pTVar8,pTVar10,uVar11));
|
|
local_1b4 = GHIDRA_CAST<undefined1 *>(0x3f800000);
|
|
if (((float)piVar2[0xcf] - (npc->_pos).x) * particleVelocity.y -
|
|
((float)piVar2[0xd0] - (npc->_pos).y) * particleVelocity.x < 0.0) {
|
|
local_1b4 = &DAT_bf800000;
|
|
}
|
|
local_1b0 = piVar2;
|
|
uVar1 = Random();
|
|
piVar2[0x11d] =
|
|
GHIDRA_INT((((float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]
|
|
) * 2.3283064e-10 * 10.0 + 2.0) * (float)local_1b4));
|
|
uVar1 = Random();
|
|
iVar6 = uVar1 % 0xf + 0xf;
|
|
piVar2[0x117] = iVar6;
|
|
piVar2[0x118] = iVar6;
|
|
fVar7 = g_vectorOne.y;
|
|
piVar2[0x39] = GHIDRA_INT(g_vectorOne.x);
|
|
piVar2[0x3a] = GHIDRA_INT(fVar7);
|
|
pcVar5 = *(code **)(*piVar2 + 0x3c);
|
|
uVar1 = Random();
|
|
local_1ac = 0x3f800000;
|
|
local_1a8 = 0x3f800000;
|
|
local_1a4 = 0x3f800000;
|
|
local_18c = 0.0;
|
|
local_188 = 0;
|
|
local_184 = 0;
|
|
local_19c = 0;
|
|
fStack_198 = 0.0;
|
|
fStack_194 = 0.0;
|
|
fStack_190 = 0.0;
|
|
local_1a0 = (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]
|
|
) * 2.3283064e-10 * 0.5 + 0.2;
|
|
(*pcVar5)(&local_1ac,0xffffffff,0xff,0,1);
|
|
(**(code **)(*local_1b0 + 0xc))();
|
|
particlesLeft = particlesLeft + -1;
|
|
} while (particlesLeft != GHIDRA_CAST<undefined1 *>(0x0));
|
|
uVar1 = rngSeed;
|
|
}
|
|
manager = g_manager;
|
|
local_1b4 = GHIDRA_CAST<undefined1 *>(0x89);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1b4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1b4),1.0,2,0,1.0,0.0);
|
|
LAB_005b2f5e:
|
|
manager = g_manager;
|
|
if ((npc->_type == 0x13) &&
|
|
(((npc->_variant == 2 || (npc->_variant == 3)) && (npc->_i2 == 0)))) {
|
|
local_1b4 = GHIDRA_CAST<undefined1 *>(0x89);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1b4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1b4),1.0,2,0,1.0,0.0);
|
|
rockDamageSource._type = 0;
|
|
rockDamageSource._variant = 0;
|
|
rockDamageSource._spawnerType = 0;
|
|
rockDamageSource._spawnerVariant = 0;
|
|
rockDamageSource._position.x = g_vectorZero.x;
|
|
rockDamageSource._position.y = g_vectorZero.y;
|
|
rockDamageSource._velocity.x = g_vectorZero.x;
|
|
rockDamageSource._velocity.y = g_vectorZero.y;
|
|
rockDamageSource._flags = 0;
|
|
rockDamageSource._entity = (void *)0x0;
|
|
npc->TakeDamage(0x42200000,4,0,&rockDamageSource,0x1e);
|
|
}
|
|
goto LAB_005b3058;
|
|
}
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar5 = (code *)swi(3);
|
|
(*pcVar5)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> 5 ^ uVar1;
|
|
uVar1 = uVar1 << 0x1b ^ uVar1;
|
|
uVar1 = uVar1 >> ((byte)rngShift3 & 0x1f) ^ uVar1;
|
|
rngSeed = uVar1;
|
|
if ((uVar1 & 3) == 0) goto LAB_005b29ae;
|
|
}
|
|
LAB_005b3058:
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_1b8) + 0x1264)));
|
|
}
|
|
if (rng == GHIDRA_CAST<RNG *>(0x0)) {
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x14,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
return;
|
|
LAB_005b2adc:
|
|
uVar3 = uVar3 + 1;
|
|
piVar2 = piVar2 + 4;
|
|
if (9 < uVar3) goto LAB_005b2f5e;
|
|
goto LAB_005b2ad0;
|
|
}
|
|
|
|
// 005c88a0
|
|
int Entity_Player::reroll_collectibles_on_damage(RNG *rng, byte isIncludeActives)
|
|
{
|
|
Entity_Player *itemPool = this;
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
char cVar3;
|
|
void *pvVar4;
|
|
ActiveItemDesc *activeDesc;
|
|
ItemConfig_Item *formCostume;
|
|
int iVar5;
|
|
ItemPool *itemPool;
|
|
int *piVar6;
|
|
int iVar7;
|
|
Entity_Player *this_00;
|
|
Entity_Player *heartPlayer;
|
|
uint *d4Seed;
|
|
uint activeSlot;
|
|
void *formsEnd;
|
|
int *historyEntry;
|
|
int heartsTaken;
|
|
uint uVar8;
|
|
void *pvVar9;
|
|
int *activeEntry;
|
|
double dVar10;
|
|
int *removedItemsEnd;
|
|
void *formCounts;
|
|
void *formCountsEnd;
|
|
int rerolledCount;
|
|
int *removedItemsIt;
|
|
float activeChargeRatio;
|
|
int *activeHistoryEntry;
|
|
ItemConfig_Item *local_1c;
|
|
int maxHeartsDelta;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
puStack_c = &LAB_00af5dcd;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
pvVar4 = (GHIDRA_CAST<TemporaryEffects *>((&itemPool->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x139);
|
|
if (pvVar4 != (void *)0x0) {
|
|
std::vector<Vec16>::_Emplace_reallocate(0,pvVar4);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&itemPool->_temporaryeffects)))->TemporaryEffects::ClearEffects(0);
|
|
ClearCostumes(itemPool);
|
|
update_player_skin(itemPool);
|
|
itemPool->_damageModifier = 0;
|
|
itemPool->_fireDelayModifier = 0;
|
|
itemPool->_speedModifier = 0;
|
|
itemPool->_tearRangeModifier = 0;
|
|
itemPool->_shotSpeedModifier = 0;
|
|
itemPool->_luckModifier = 0;
|
|
ResetItemState(itemPool);
|
|
pvVar4 = (itemPool->_collectibleRNGs)._begin;
|
|
maxHeartsDelta = 0;
|
|
d4Seed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar4) + 0x11c0));
|
|
rerolledCount = 0;
|
|
removedItemsEnd = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
activeHistoryEntry = (itemPool->_history)._historyItems._end;
|
|
historyEntry = (itemPool->_history)._historyItems._begin;
|
|
activeChargeRatio = 0.0;
|
|
if (historyEntry != activeHistoryEntry) {
|
|
do {
|
|
if ((char)historyEntry[1] == '\0') {
|
|
uVar8 = historyEntry[2];
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_INT((itemPool->_collectibleCounts)._begin) + uVar8 * 4))) {
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar8)) goto LAB_005c8a2a;
|
|
LAB_005c8a44:
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(uVar8) < 0) {
|
|
if ((GHIDRA_INT(uVar8) < 0) &&
|
|
(pvVar9 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar8) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar9) >> 2)) {
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar9) + ~uVar8 * 4)));
|
|
}
|
|
else {
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_005c8a2a:
|
|
pvVar9 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar9) >> 2 <= GHIDRA_INT(uVar8))
|
|
goto LAB_005c8a44;
|
|
local_1c = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar9) + uVar8 * 4));
|
|
}
|
|
activeSlot = 0xffffffff;
|
|
if (local_1c->type == 3) {
|
|
activeSlot = 0;
|
|
activeDesc = itemPool->_activeDesc;
|
|
do {
|
|
if (activeDesc->_item == local_1c->id) {
|
|
if ((GHIDRA_INT(activeSlot) < 0) || ((isIncludeActives != 0 && (GHIDRA_INT(activeSlot) < 2))))
|
|
goto LAB_005c8a89;
|
|
goto LAB_005c8c08;
|
|
}
|
|
activeSlot = activeSlot + 1;
|
|
activeDesc = activeDesc + 1;
|
|
} while (activeSlot < 4);
|
|
activeSlot = 0xffffffff;
|
|
}
|
|
LAB_005c8a89:
|
|
bVar2 = CanRerollCollectible(itemPool,uVar8,0);
|
|
if ((((bVar2 == 0) || (*historyEntry < 0)) ||
|
|
((uVar8 == 0x248 && (isIncludeActives == 0)))) ||
|
|
((itemPool->_playerType == 0x1e && (*historyEntry <= *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((itemPool)) + 0x1f14)))))))) {
|
|
LAB_005c8c08:
|
|
if (local_1c->addCostumeOnPickup != 0) {
|
|
AddCostume(itemPool,local_1c,0);
|
|
}
|
|
}
|
|
else {
|
|
if (-1 < GHIDRA_INT(activeSlot)) {
|
|
if (local_1c->maxCharges < 1) {
|
|
activeChargeRatio = 1.0;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(activeSlot) < 4) {
|
|
iVar5 = itemPool->_activeDesc[activeSlot]._charge;
|
|
}
|
|
else {
|
|
iVar5 = 0;
|
|
}
|
|
activeChargeRatio = (float)iVar5 / (float)local_1c->maxCharges;
|
|
}
|
|
itemPool->_activeDesc[activeSlot]._item = 0;
|
|
uVar8 = historyEntry[2];
|
|
}
|
|
piVar6 = GHIDRA_CAST<int *>((GHIDRA_INT((itemPool->_collectibleCounts)._begin) + uVar8 * 4));
|
|
*piVar6 = *piVar6 + -1;
|
|
maxHeartsDelta = maxHeartsDelta - local_1c->addMaxhearts;
|
|
TriggerCollectibleRemoved(itemPool,historyEntry[2]);
|
|
pvVar9 = (itemPool->_collectibleCounts)._begin;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar9) + historyEntry[2] * 4)) < 1) {
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar9) + historyEntry[2] * 4)) = 0;
|
|
do {
|
|
if ((((-1 < GHIDRA_INT(uVar8)) &&
|
|
(pvVar9 = (g_manager->_itemConfig)._playerForms._begin,
|
|
GHIDRA_INT(uVar8) < GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) - GHIDRA_INT(pvVar9) >> 2
|
|
)) && (iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar9) + uVar8 * 4)), iVar5 != 0)) &&
|
|
((*GHIDRA_CAST<int *>((iVar5 + 8)) != 0 || *GHIDRA_CAST<int *>((iVar5 + 0xc)) != 0 &&
|
|
(cVar3 = ItemConfig::collectible_has_tags(*GHIDRA_CAST<int *>((iVar5 + 8))), cVar3 != '\0')))
|
|
) {
|
|
IncrementPlayerFormCounter(itemPool,uVar8,-1);
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < 0x10);
|
|
if (removedItemsEnd == GHIDRA_CAST<int *>(0x0)) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(0,historyEntry + 2);
|
|
}
|
|
else {
|
|
*removedItemsEnd = historyEntry[2];
|
|
removedItemsEnd = removedItemsEnd + 1;
|
|
}
|
|
}
|
|
rerolledCount = rerolledCount + 1;
|
|
historyEntry[2] = 0;
|
|
if (local_1c->type == 3) {
|
|
activeHistoryEntry = historyEntry;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
historyEntry = historyEntry + 7;
|
|
} while (historyEntry != (itemPool->_history)._historyItems._end);
|
|
}
|
|
removedItemsIt = GHIDRA_CAST<int *>(0x0);
|
|
bVar2 = HasCollectible(itemPool,0x102,0);
|
|
if (bVar2 != 0) {
|
|
uVar8 = Random();
|
|
itemPool->_speedModifier = itemPool->_speedModifier + (uVar8 % 3 - 1);
|
|
uVar8 = Random();
|
|
itemPool->_fireDelayModifier = itemPool->_fireDelayModifier + (uVar8 % 3 - 1);
|
|
uVar8 = Random();
|
|
itemPool->_damageModifier = itemPool->_damageModifier + (uVar8 % 3 - 1);
|
|
uVar8 = Random();
|
|
itemPool->_tearRangeModifier = itemPool->_tearRangeModifier + (uVar8 % 3 - 1);
|
|
uVar8 = Random();
|
|
itemPool->_shotSpeedModifier = itemPool->_shotSpeedModifier + (uVar8 % 3 - 1);
|
|
uVar8 = Random();
|
|
itemPool->_luckModifier = itemPool->_luckModifier + (uVar8 % 3 - 1);
|
|
}
|
|
uVar8 = 0;
|
|
do {
|
|
if (((itemPool->_hasCurseMistEffect == 0) && (itemPool->_isCoopGhost == 0)) &&
|
|
((2 < itemPool->_playerForms[uVar8] &&
|
|
(((pvVar9 = (g_manager->_itemConfig)._playerForms._begin,
|
|
GHIDRA_INT(uVar8) < GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) - GHIDRA_INT(pvVar9) >> 2 &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar9) + uVar8 * 4)), iVar5 != 0)) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((iVar5 + 0x28)), iVar5 != -1)))))) {
|
|
if ((iVar5 < 0) ||
|
|
(pvVar9 = (g_manager->_itemConfig)._nullItems._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar9) >> 2 <= iVar5)) {
|
|
formCostume = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
formCostume = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar9) + iVar5 * 4));
|
|
}
|
|
AddCostume(itemPool,formCostume,0);
|
|
}
|
|
game = g_game;
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < 0x10);
|
|
if (removedItemsEnd != GHIDRA_CAST<int *>(0x0)) {
|
|
do {
|
|
(GHIDRA_CAST<ItemPool *>((&game->_itemPool)))->ItemPool::ResetCollectible(*removedItemsIt);
|
|
removedItemsIt = removedItemsIt + 1;
|
|
} while (removedItemsIt != removedItemsEnd);
|
|
}
|
|
uVar8 = GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._playerForms._begin) >> 2;
|
|
formCounts = (void *)0x0;
|
|
formCountsEnd = (void *)0x0;
|
|
if (uVar8 != 0) {
|
|
if (0x3fffffff < uVar8) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
formCounts = std::_Allocate(uVar8 * 4);
|
|
formCountsEnd = (void *)(GHIDRA_INT(formCounts) + uVar8 * 4);
|
|
memset(formCounts,0,uVar8 * 4);
|
|
}
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
(itemPool->_history)._isLocked = 1;
|
|
historyEntry = (itemPool->_history)._historyItems._begin;
|
|
piVar6 = (itemPool->_history)._historyItems._end;
|
|
if (historyEntry != piVar6) {
|
|
activeEntry = activeHistoryEntry;
|
|
do {
|
|
if (((char)historyEntry[1] == '\0') && (historyEntry[2] == 0)) {
|
|
_isIncludeActives = GHIDRA_CAST<int *>(0x0);
|
|
do {
|
|
game = g_game;
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(historyEntry[2]);
|
|
if (local_1c != GHIDRA_CAST<ItemConfig_Item *>(0x0)) goto LAB_005c8f47;
|
|
uVar8 = *d4Seed;
|
|
if (activeEntry == historyEntry) {
|
|
if (uVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar8 = *d4Seed;
|
|
if (uVar8 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
iVar5 = (*pcVar1)();
|
|
return iVar5;
|
|
}
|
|
}
|
|
uVar8 = uVar8 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x11c4)) & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x11c8)) & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x11cc)) & 0x1f) ^ uVar8;
|
|
*d4Seed = uVar8;
|
|
iVar5 = ItemPool::GetCollectible(&game->_itemPool,historyEntry[6],uVar8,0xc,0,0);
|
|
historyEntry[2] = iVar5;
|
|
activeEntry = (itemPool->_history)._historyItems._end;
|
|
activeHistoryEntry = activeEntry;
|
|
}
|
|
else {
|
|
itemPool = &g_game->_itemPool;
|
|
if (uVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar8 = *d4Seed;
|
|
if (uVar8 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
iVar5 = (*pcVar1)();
|
|
return iVar5;
|
|
}
|
|
}
|
|
uVar8 = uVar8 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x11c4)) & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x11c8)) & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x11cc)) & 0x1f) ^ uVar8;
|
|
*d4Seed = uVar8;
|
|
iVar5 = ItemPool::GetCollectible(itemPool,historyEntry[6],uVar8,6,0,0);
|
|
historyEntry[2] = iVar5;
|
|
}
|
|
if ((itemPool->_playerType == 0x1e) && (historyEntry[2] == 0x26b)) {
|
|
historyEntry[2] = 0;
|
|
}
|
|
_isIncludeActives = GHIDRA_CAST<int *>((GHIDRA_INT(_isIncludeActives) + 1));
|
|
} while (GHIDRA_INT(_isIncludeActives) < 10);
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(historyEntry[2]);
|
|
if (local_1c == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
historyEntry[2] = 0x19;
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(0x19);
|
|
}
|
|
LAB_005c8f47:
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(local_1c)) goto LAB_005c8f8c;
|
|
LAB_005c8fa6:
|
|
_isIncludeActives = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(local_1c) < 0) {
|
|
if ((GHIDRA_INT(local_1c) < 0) &&
|
|
(pvVar9 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~GHIDRA_UINT(local_1c)) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar9) >> 2)) {
|
|
_isIncludeActives = GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar9) + ~GHIDRA_UINT(local_1c) * 4)));
|
|
}
|
|
else {
|
|
_isIncludeActives = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_005c8f8c:
|
|
pvVar9 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar9) >> 2 <= GHIDRA_INT(local_1c))
|
|
goto LAB_005c8fa6;
|
|
_isIncludeActives = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar9) + GHIDRA_INT(local_1c) * 4));
|
|
}
|
|
if (*_isIncludeActives == 3) {
|
|
dVar10 = ceil((double)((float)_isIncludeActives[0x1d] * activeChargeRatio));
|
|
iVar5 = GHIDRA_INT(dVar10);
|
|
}
|
|
else {
|
|
iVar5 = 0;
|
|
}
|
|
AddCollectible(itemPool,GHIDRA_INT(local_1c),iVar5,0,0,0,0);
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
formsEnd = (g_manager->_itemConfig)._playerForms._end;
|
|
pvVar9 = (g_manager->_itemConfig)._playerForms._begin;
|
|
if (GHIDRA_INT(formsEnd) - GHIDRA_INT(pvVar9) >> 2 != 0) {
|
|
do {
|
|
if ((((-1 < GHIDRA_INT(local_1c)) && (GHIDRA_INT(local_1c) < GHIDRA_INT(formsEnd) - GHIDRA_INT(pvVar9) >> 2)) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar9) + GHIDRA_INT(local_1c) * 4)), iVar5 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar5 + 8)) != 0 || *GHIDRA_CAST<int *>((iVar5 + 0xc)) != 0)) {
|
|
cVar3 = ItemConfig::collectible_has_tags(*GHIDRA_CAST<undefined4 *>((iVar5 + 8)));
|
|
manager = g_manager;
|
|
if (cVar3 != '\0') {
|
|
piVar6 = GHIDRA_CAST<int *>((GHIDRA_INT(formCounts) + GHIDRA_INT(local_1c) * 4));
|
|
*piVar6 = *piVar6 + 1;
|
|
formsEnd = (manager->_itemConfig)._playerForms._end;
|
|
}
|
|
}
|
|
local_1c = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(local_1c) + 1));
|
|
pvVar9 = (g_manager->_itemConfig)._playerForms._begin;
|
|
} while (local_1c < GHIDRA_UINT((GHIDRA_INT(formsEnd) - GHIDRA_INT(pvVar9) >> 2)));
|
|
activeEntry = activeHistoryEntry;
|
|
}
|
|
maxHeartsDelta = maxHeartsDelta + _isIncludeActives[0x16];
|
|
piVar6 = (itemPool->_history)._historyItems._end;
|
|
}
|
|
historyEntry = historyEntry + 7;
|
|
} while (historyEntry != piVar6);
|
|
}
|
|
(itemPool->_history)._isLocked = 0;
|
|
if (maxHeartsDelta < 0) {
|
|
heartPlayer = itemPool;
|
|
do {
|
|
iVar5 = maxHeartsDelta;
|
|
if (-1 < maxHeartsDelta) break;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((heartPlayer)) + 0x1950))));
|
|
if (0 < iVar5) {
|
|
iVar7 = -maxHeartsDelta;
|
|
if (iVar5 < -maxHeartsDelta) {
|
|
iVar7 = iVar5;
|
|
}
|
|
maxHeartsDelta = maxHeartsDelta + iVar7;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((heartPlayer)) + 0x1950)))) = iVar5 - iVar7;
|
|
}
|
|
heartPlayer = GHIDRA_CAST<Entity_Player *>(heartPlayer->_subPlayer);
|
|
iVar5 = maxHeartsDelta;
|
|
} while (heartPlayer != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
heartPlayer = itemPool;
|
|
maxHeartsDelta = iVar5;
|
|
do {
|
|
if (-1 < iVar5) break;
|
|
iVar7 = heartPlayer->_maxHearts;
|
|
if (0 < iVar7) {
|
|
heartsTaken = -iVar5;
|
|
if (iVar7 < -iVar5) {
|
|
heartsTaken = iVar7;
|
|
}
|
|
AddMaxHearts(heartPlayer,-heartsTaken,0);
|
|
iVar5 = maxHeartsDelta + heartsTaken;
|
|
if (heartPlayer->_redHearts < 1) {
|
|
iVar7 = GetHealthType(heartPlayer);
|
|
if ((iVar7 == 3) || (heartPlayer->_playerType == 0x12)) {
|
|
AddMaxHearts(heartPlayer,2,0);
|
|
AddHearts(heartPlayer,2,1,0);
|
|
}
|
|
else if (heartPlayer->_soulHearts < 1) {
|
|
AddSoulHearts(this_00,2,0);
|
|
}
|
|
}
|
|
maxHeartsDelta = iVar5;
|
|
}
|
|
heartPlayer = GHIDRA_CAST<Entity_Player *>(heartPlayer->_subPlayer);
|
|
} while (heartPlayer != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
else if (0 < maxHeartsDelta) {
|
|
AddMaxHearts(itemPool,maxHeartsDelta,0);
|
|
}
|
|
uVar8 = 0;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._playerForms._begin) >> 2 != 0) {
|
|
do {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(formCounts) + uVar8 * 4));
|
|
if (0 < iVar5) {
|
|
IncrementPlayerFormCounter(itemPool,uVar8,iVar5);
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT((GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._playerForms._begin) >> 2)));
|
|
}
|
|
itemPool->_cacheFlags = itemPool->_cacheFlags | 0xffff;
|
|
EvaluateItems(itemPool);
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
if (formCounts != (void *)0x0) {
|
|
uVar8 = GHIDRA_INT(formCountsEnd) - GHIDRA_INT(formCounts) & 0xfffffffc;
|
|
pvVar4 = formCounts;
|
|
if (0xfff < uVar8) {
|
|
pvVar4 = *(void **)(GHIDRA_CAST<char *>(formCounts) + -4);
|
|
uVar8 = uVar8 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(formCounts) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,uVar8);
|
|
}
|
|
ExceptionList = local_10;
|
|
return rerolledCount;
|
|
}
|
|
|
|
// 005c96f0
|
|
Entity_Familiar * Entity_Player::AddItemWisp(uint param_1, Vector *param_2, char param_3)
|
|
{
|
|
code *pcVar1;
|
|
byte isBookOfVirtuesHeld;
|
|
void *pvVar2;
|
|
void *otherWispConfig;
|
|
Entity_Familiar *wisp;
|
|
Entity_Player *in_ECX;
|
|
int iVar3;
|
|
uint otherLayer;
|
|
uint uVar4;
|
|
int iVar5;
|
|
uint *rngSeed;
|
|
uint orbitLayer;
|
|
int layerStats [10];
|
|
Game *game;
|
|
|
|
layerStats[9] = __security_cookie ^ GHIDRA_UINT((layerStats + 10));
|
|
iVar5 = 0x2c8;
|
|
isBookOfVirtuesHeld = HasCollectible(in_ECX,0x248,0);
|
|
if (isBookOfVirtuesHeld != 0) {
|
|
iVar5 = 0x10012;
|
|
}
|
|
pvVar2 = ItemConfig::get_wisp_config(iVar5);
|
|
orbitLayer = GHIDRA_UINT(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar2) + 0x18c)));
|
|
if (-1 < *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar2) + 0x18c))) {
|
|
uVar4 = 0;
|
|
layerStats[6] = 0;
|
|
layerStats[7] = 0;
|
|
layerStats[8] = 0;
|
|
pvVar2 = g_game->_room;
|
|
layerStats[0] = 0;
|
|
layerStats[1] = 0;
|
|
layerStats[2] = 0;
|
|
layerStats[3] = 9999;
|
|
layerStats[4] = 9999;
|
|
layerStats[5] = 9999;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1264)) != 0) {
|
|
do {
|
|
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x125c)) + uVar4 * 4));
|
|
if ((((iVar5 != 0) && (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 3)) &&
|
|
((iVar3 = *GHIDRA_CAST<int *>((iVar5 + 0x2c)), iVar3 == 0xce || (iVar3 == 0xed)))) &&
|
|
(*GHIDRA_CAST<Entity_Player **>((iVar5 + 0x410)) == in_ECX)) {
|
|
if (iVar3 == 0xed) {
|
|
iVar3 = *GHIDRA_CAST<int *>((iVar5 + 0xf20));
|
|
}
|
|
else if (iVar3 == 0xce) {
|
|
iVar3 = *GHIDRA_CAST<int *>((iVar5 + 0x30));
|
|
}
|
|
else {
|
|
iVar3 = 0x248;
|
|
}
|
|
otherWispConfig = ItemConfig::get_wisp_config(iVar3);
|
|
iVar3 = *GHIDRA_CAST<int *>((iVar5 + 0xd70));
|
|
otherLayer = iVar3 - 7;
|
|
if ((otherLayer < 3) && (-1 < GHIDRA_INT(otherLayer))) {
|
|
if ((*GHIDRA_CAST<int *>((iVar5 + 0x2c)) == 0xce) ||
|
|
(GHIDRA_INT(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(otherWispConfig) + 0x18e))) < layerStats[iVar3 + -4])) {
|
|
layerStats[iVar3 + -4] = GHIDRA_INT(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(otherWispConfig) + 0x18e)));
|
|
layerStats[otherLayer] = iVar5;
|
|
}
|
|
layerStats[iVar3 + -1] = layerStats[iVar3 + -1] + 1;
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar2) + 0x1264)));
|
|
}
|
|
if (param_3 != '\0') {
|
|
uVar4 = 0;
|
|
do {
|
|
if (layerStats[orbitLayer + 6] < *GHIDRA_CAST<int *>((&DAT_00b62c90 + orbitLayer * 4))) break;
|
|
orbitLayer = (orbitLayer + 1) % 3;
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < 3);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((&DAT_00b62c90 + orbitLayer * 4)) <= layerStats[orbitLayer + 6]) &&
|
|
(GHIDRA_CAST<int *>(layerStats[orbitLayer]) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(layerStats[orbitLayer]) + 0x28))();
|
|
}
|
|
}
|
|
pvVar2 = (in_ECX->_collectibleRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar2) + 0x2c80));
|
|
uVar4 = *rngSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *rngSeed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
wisp = GHIDRA_CAST<Entity_Familiar *>((*pcVar1)());
|
|
return wisp;
|
|
}
|
|
}
|
|
game = g_game;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar2) + 0x2c84)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar2) + 0x2c88)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar2) + 0x2c8c)) & 0x1f) ^ uVar4;
|
|
*rngSeed = uVar4;
|
|
wisp = (Entity_Familiar *)
|
|
(GHIDRA_CAST<Game *>((game)))->Game::Spawn(3,0xed,param_2,&g_vectorZero,GHIDRA_CAST<Entity *>(in_ECX),param_1,uVar4);
|
|
if ((param_3 != '\0') && (-1 < GHIDRA_INT(orbitLayer))) {
|
|
(GHIDRA_CAST<Entity_Familiar *>((wisp)))->Entity_Familiar::AddToOrbit(orbitLayer + 7);
|
|
}
|
|
wisp->Update();
|
|
return wisp;
|
|
}
|
|
|
|
// 005c9930
|
|
void Entity_Player::trigger_book_of_belial_passive(int activeId, int charges)
|
|
{
|
|
Entity_Player *effectSprite = this;
|
|
void *pvVar1;
|
|
byte bVar2;
|
|
uint uVar3;
|
|
Entity *tmpEntity;
|
|
uint uVar4;
|
|
LayerState *sparkLayer;
|
|
int iVar5;
|
|
Game *game;
|
|
float fVar6;
|
|
float sparkScaleX;
|
|
float sparkScaleY;
|
|
float fVar7;
|
|
int nullEffect [3];
|
|
undefined4 local_7c;
|
|
Vector sparkPos;
|
|
Vector sparkVelocity;
|
|
Entity_Player *player;
|
|
Entity *local_64;
|
|
code *local_60;
|
|
ItemConfig_Item *local_5c;
|
|
undefined4 local_58;
|
|
uint local_54;
|
|
undefined1 local_50 [8];
|
|
float fStack_48;
|
|
float fStack_44;
|
|
float local_40;
|
|
float fStack_3c;
|
|
float fStack_38;
|
|
float fStack_34;
|
|
float local_30;
|
|
float fStack_2c;
|
|
Entity_Player *local_28;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 uStack_14;
|
|
ANM2 *effectSprite;
|
|
Manager *manager;
|
|
|
|
puStack_20 = local_50 + 0x4c;
|
|
uStack_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af5e50;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((local_50 + 0x40));
|
|
ExceptionList = &local_1c;
|
|
player = effectSprite;
|
|
bVar2 = HasCollectible(effectSprite,0x3b,0);
|
|
if (bVar2 == 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
local_58 = g_manager;
|
|
local_5c = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(activeId);
|
|
if (activeId < 0xbb) {
|
|
if (activeId == 0xba) {
|
|
LAB_005ca3b6:
|
|
iVar5 = 0x7e;
|
|
LAB_005ca3bc:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(iVar5,1,1);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
switch(activeId) {
|
|
case 0x22:
|
|
case 0x3b:
|
|
case 0x85:
|
|
ExceptionList = local_1c;
|
|
return;
|
|
case 0x28:
|
|
case 0x7e:
|
|
local_54 = 0x21;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&local_58->_sfxManager)))->SoundEffects::Play(local_54,1.0,2,0,1.0,0.0);
|
|
UseActiveItem(effectSprite,GHIDRA_CAST<short *>((GHIDRA_INT(&local_58) + 2)),0x23,1,-1,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(8);
|
|
pvVar1 = g_game->_room;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0x7214)) = 10;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0x7218)) = 5;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
case 0x7f:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x81,1,2);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
case 0x87:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x7b,1,1);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
switchD_005c99c5_caseD_23:
|
|
if (local_5c == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (local_5c->maxCharges < 1) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (local_5c->chargeType != 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
else if (activeId < 0x22c) {
|
|
if (activeId == 0x22b) {
|
|
local_54 = 0x89;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&local_58->_sfxManager)))->SoundEffects::Play(local_54,1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0xf);
|
|
local_58 = GHIDRA_CAST<Manager *>(0x0);
|
|
local_5c = g_game->_room;
|
|
game = g_game;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_5c) + 0x1264)) == 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
do {
|
|
tmpEntity = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_5c) + 0x125c)) + GHIDRA_INT(local_58) * 4));
|
|
if ((*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) || (tmpEntity->_type != 1)) {
|
|
local_54 = tmpEntity->_type;
|
|
if (local_54 - 10 < 0x3de) goto LAB_005c9c18;
|
|
}
|
|
else {
|
|
local_54 = 1;
|
|
LAB_005c9c18:
|
|
if ((((tmpEntity->_entityCollisionClass != 1) && (tmpEntity->_entityCollisionClass != 0))
|
|
&& (tmpEntity->_isInvicible == 0)) && (tmpEntity->_dead == 0)) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::HasEntityFlags(0x10);
|
|
if (((bVar2 == 0) || (local_54 == 0x322)) || (local_54 == 0x362)) {
|
|
uVar3 = Random();
|
|
if (uVar3 % 3 == 0) {
|
|
if (effectSprite == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 0.0;
|
|
fStack_48 = 0.0;
|
|
fStack_44 = 0.0;
|
|
local_40 = 0.0;
|
|
fStack_3c = g_vectorZero.x;
|
|
fStack_38 = g_vectorZero.y;
|
|
fStack_34 = g_vectorZero.x;
|
|
local_30 = g_vectorZero.y;
|
|
LAB_005c9d27:
|
|
uVar3 = 0;
|
|
if (effectSprite != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_005c9d2d;
|
|
uVar3 = 0;
|
|
LAB_005c9d48:
|
|
local_54 = 0;
|
|
if (effectSprite != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_005c9d53;
|
|
LAB_005c9d6c:
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = effectSprite->_type;
|
|
fStack_3c = (effectSprite->_pos).x;
|
|
fStack_38 = (effectSprite->_pos).y;
|
|
fStack_48 = (float)effectSprite->_variant;
|
|
fStack_44 = (float)effectSprite->_spawnerType;
|
|
local_40 = (float)effectSprite->_spawnerVariant;
|
|
fStack_34 = (effectSprite->_velocity).x;
|
|
local_30 = (effectSprite->_velocity).y;
|
|
if ((effectSprite->_flags & 0x100) == 0) goto LAB_005c9d27;
|
|
uVar3 = 1;
|
|
LAB_005c9d2d:
|
|
if ((effectSprite->_flags & 0x20000000) == 0) goto LAB_005c9d48;
|
|
local_54 = 2;
|
|
LAB_005c9d53:
|
|
if ((effectSprite->_flags & 0x40000000000000) == 0) goto LAB_005c9d6c;
|
|
uVar4 = 4;
|
|
}
|
|
fStack_2c = (float)(uVar3 | local_54 | uVar4);
|
|
local_28 = effectSprite;
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::AddMidasFreeze(GHIDRA_CAST<EntityRef *>((local_50 + 4)),3,0);
|
|
}
|
|
local_60 = *(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x20);
|
|
if (effectSprite == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 0.0;
|
|
fStack_48 = 0.0;
|
|
fStack_44 = 0.0;
|
|
local_40 = 0.0;
|
|
fStack_3c = g_vectorZero.x;
|
|
fStack_38 = g_vectorZero.y;
|
|
fStack_34 = g_vectorZero.x;
|
|
local_30 = g_vectorZero.y;
|
|
LAB_005c9e39:
|
|
local_54 = 0;
|
|
if (effectSprite != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_005c9e44;
|
|
local_54 = 0;
|
|
LAB_005c9e62:
|
|
uVar3 = 0;
|
|
if (effectSprite != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_005c9e68;
|
|
LAB_005c9e81:
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = effectSprite->_type;
|
|
fStack_3c = (effectSprite->_pos).x;
|
|
fStack_38 = (effectSprite->_pos).y;
|
|
fStack_48 = (float)effectSprite->_variant;
|
|
fStack_44 = (float)effectSprite->_spawnerType;
|
|
local_40 = (float)effectSprite->_spawnerVariant;
|
|
fStack_34 = (effectSprite->_velocity).x;
|
|
local_30 = (effectSprite->_velocity).y;
|
|
if ((effectSprite->_flags & 0x100) == 0) goto LAB_005c9e39;
|
|
local_54 = 1;
|
|
LAB_005c9e44:
|
|
if ((effectSprite->_flags & 0x20000000) == 0) goto LAB_005c9e62;
|
|
uVar3 = 2;
|
|
LAB_005c9e68:
|
|
if ((effectSprite->_flags & 0x40000000000000) == 0) goto LAB_005c9e81;
|
|
uVar4 = 4;
|
|
}
|
|
fStack_2c = (float)(uVar3 | uVar4 | local_54);
|
|
local_28 = effectSprite;
|
|
(*local_60)(effectSprite->_meleeDamage + effectSprite->_meleeDamage + 15.0,0,0,local_50 + 4,0x1e);
|
|
}
|
|
game = g_game;
|
|
}
|
|
}
|
|
local_58 = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_58) + 1));
|
|
if (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_5c) + 0x1264)) <= local_58) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|
|
if (activeId == 0x11a) {
|
|
local_54 = 0x1d7;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&local_58->_sfxManager)))->SoundEffects::Play(local_54,1.0,2,0,1.0,0.0);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (activeId != 0x122) {
|
|
if (activeId == 0x127) {
|
|
uVar3 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((effectSprite->_collectibleRNGs)._begin) + 0x3b0)))))->RNG::RandomInt(4);
|
|
manager = g_manager;
|
|
if (uVar3 != 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
local_54 = 0x112;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_54,1.0,2,0,1.0,0.0);
|
|
iVar5 = 0x22b;
|
|
goto LAB_005ca3bc;
|
|
}
|
|
goto switchD_005c99c5_caseD_23;
|
|
}
|
|
if (charges < 1) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (activeId == 0x26f) goto LAB_005ca3b6;
|
|
if (activeId != 0x282) goto switchD_005c99c5_caseD_23;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x82,1,1);
|
|
local_58 = g_manager;
|
|
}
|
|
if (charges == 0) {
|
|
charges = 1;
|
|
if (1 < local_5c->_initCharge) {
|
|
charges = local_5c->_initCharge;
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x22);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x7b);
|
|
local_54 = 0x22;
|
|
if (bVar2 == 0) goto LAB_005c9f70;
|
|
}
|
|
local_54 = 0x1d7;
|
|
LAB_005c9f70:
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&local_58->_sfxManager)))->SoundEffects::Play(local_54,1.0,2,0,1.0,0.0);
|
|
pvVar1 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if ((0x1ec < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x1ec)), iVar5 != 0)) {
|
|
nullEffect[2] = *GHIDRA_CAST<undefined4 *>((iVar5 + 0x78));
|
|
nullEffect[1] = 0;
|
|
local_7c = 0;
|
|
nullEffect[0] = iVar5;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&effectSprite->_temporaryeffects)))->TemporaryEffects::AddEffect(nullEffect,1,charges);
|
|
}
|
|
if (charges < 4) {
|
|
uVar3 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&effectSprite->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3);
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 0.2;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 0.2;
|
|
fStack_48 = 0.2;
|
|
fStack_44 = 0.6;
|
|
local_40 = 1.0;
|
|
fStack_3c = 1.0;
|
|
fStack_38 = 1.0;
|
|
fStack_34 = 1.0;
|
|
fStack_2c = 0.0;
|
|
local_28 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
tmpEntity->SetColor(local_50,0xffffffff,0xff,0,1);
|
|
tmpEntity->Update();
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 0.2;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 0.2;
|
|
fStack_48 = 0.2;
|
|
fStack_44 = 0.6;
|
|
local_30 = 0.0;
|
|
local_40 = 1.0;
|
|
fStack_3c = 1.0;
|
|
fStack_38 = 1.0;
|
|
fStack_34 = 1.0;
|
|
fStack_2c = 0.0;
|
|
local_28 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effectSprite))))->Entity::MakeGroundPoof(&effectSprite->_pos,GHIDRA_CAST<ColorMod *>(local_50),1.0);
|
|
}
|
|
local_54 = 0;
|
|
do {
|
|
uVar3 = local_54;
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(((float)GHIDRA_INT(local_54) * 0.7 * 0.25 + 0.3));
|
|
local_58 = GHIDRA_CAST<Manager *>(((float)local_5c * 0.0));
|
|
uVar4 = Random();
|
|
local_64 = (Entity *)
|
|
((-10.0 - (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)])
|
|
* 2.3283064e-10 * 6.0) * (float)local_5c);
|
|
uVar4 = Random();
|
|
local_5c = (ItemConfig_Item *)
|
|
(((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 10.0 - 5.0) * 0.017453292);
|
|
local_60 = (code *)cos((float)local_5c);
|
|
fVar6 = sin((float)local_5c);
|
|
fVar7 = ((float)GHIDRA_INT(uVar3) - 0.0) / 12.0;
|
|
if (fVar7 <= 0.0) {
|
|
fVar7 = 0.0;
|
|
}
|
|
if (1.0 <= fVar7) {
|
|
fVar7 = 1.0;
|
|
}
|
|
sparkVelocity.y = fVar7 * 1.4 + 0.6;
|
|
sparkVelocity.x =
|
|
((float)local_60 * (float)local_58 - fVar6 * (float)local_64) * sparkVelocity.y;
|
|
sparkVelocity.y =
|
|
((float)local_60 * (float)local_64 + fVar6 * (float)local_58) * sparkVelocity.y;
|
|
sparkPos.x = sparkVelocity.x + sparkVelocity.x + (effectSprite->_pos).x;
|
|
sparkPos.y = sparkVelocity.y + sparkVelocity.y + (effectSprite->_pos).y;
|
|
uVar3 = Random();
|
|
local_64 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&sparkPos,&sparkVelocity,GHIDRA_CAST<Entity *>(effectSprite),0,uVar3);
|
|
uVar3 = g_graphicsManager_flags;
|
|
effectSprite = &local_64->_sprite;
|
|
sparkLayer = (GHIDRA_CAST<ANM2 *>((effectSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
local_30 = 0.0;
|
|
fStack_2c = 0.0;
|
|
iVar5 = 1;
|
|
local_28 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if ((uVar3 & 4) == 0) {
|
|
iVar5 = 6;
|
|
}
|
|
sparkLayer->_blendMode[0] = 0;
|
|
sparkLayer->_blendMode[1] = iVar5;
|
|
sparkLayer->_blendMode[2] = 1;
|
|
sparkLayer->_blendMode[3] = 1;
|
|
sparkLayer->_blendMode[4] = 1;
|
|
sparkLayer = (GHIDRA_CAST<ANM2 *>((effectSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
if (&sparkLayer->_color != GHIDRA_CAST<ColorMod *>(local_50)) {
|
|
(sparkLayer->_color)._tint[0] = 5.0;
|
|
(sparkLayer->_color)._tint[1] = 0.5;
|
|
(sparkLayer->_color)._tint[2] = 0.2;
|
|
(sparkLayer->_color)._tint[3] = 1.0;
|
|
(sparkLayer->_color)._colorize[0] = 0.0;
|
|
(sparkLayer->_color)._colorize[1] = 0.0;
|
|
(sparkLayer->_color)._colorize[2] = 0.0;
|
|
(sparkLayer->_color)._colorize[3] = 0.0;
|
|
*GHIDRA_CAST<ulonglong *>((sparkLayer->_color)._offset) = CONCAT44(fStack_2c,local_30);
|
|
(sparkLayer->_color)._offset[2] = (float)local_28;
|
|
}
|
|
uVar3 = Random();
|
|
tmpEntity = local_64;
|
|
*GHIDRA_CAST<float *>((local_64[1]._sprite._animDefaultName._buf + 4)) =
|
|
(float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) * 2.3283064e-10
|
|
* 10.0 + 2.0;
|
|
uVar3 = Random();
|
|
iVar5 = uVar3 % 10 + 10;
|
|
*GHIDRA_CAST<int *>((tmpEntity[1]._sprite._filename._buf + 4)) = iVar5;
|
|
*GHIDRA_CAST<int *>((tmpEntity[1]._sprite._filename._buf + 8)) = iVar5;
|
|
uVar3 = Random();
|
|
sparkScaleX = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.4 + 0.2;
|
|
sparkScaleY = sparkScaleX * g_vectorOne.y;
|
|
sparkScaleX = sparkScaleX * g_vectorOne.x;
|
|
fVar7 = (player->_playerSpriteScale).y;
|
|
fVar6 = (player->_playerSpriteScale).x;
|
|
tmpEntity->_renderZOffset = -600;
|
|
(tmpEntity->_sprite)._scale.y = sparkScaleY * fVar7;
|
|
(tmpEntity->_sprite)._scale.x = sparkScaleX * fVar6;
|
|
local_54 = local_54 + 1;
|
|
effectSprite = player;
|
|
} while (GHIDRA_INT(local_54) < 5);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 005ca470
|
|
void Entity_Player::TriggerBookOfVirtues(int collectibleId, int charge)
|
|
{
|
|
code *pcVar1;
|
|
byte isItemHeld;
|
|
uint uVar2;
|
|
void *pvVar3;
|
|
ushort wispCount;
|
|
uint *rngSeed;
|
|
Entity_Player *soundId [2];
|
|
Manager *manager;
|
|
|
|
soundId[0] = this;
|
|
isItemHeld = HasCollectible(this,0x248,0);
|
|
if (isItemHeld == 0) {
|
|
return;
|
|
}
|
|
if (collectibleId == 0x61) {
|
|
pvVar3 = (this->_collectibleRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar3) + 0x2480));
|
|
uVar2 = *rngSeed;
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar2 = *rngSeed;
|
|
if (uVar2 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar2 = uVar2 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + 0x2484)) & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + 0x2488)) & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + 0x248c)) & 0x1f) ^ uVar2;
|
|
*rngSeed = uVar2;
|
|
collectibleId = *GHIDRA_CAST<int *>((&DAT_00b62c9c + (uVar2 % 7) * 4));
|
|
if (collectibleId == 0xb1) {
|
|
wispCount = 3;
|
|
ItemConfig::get_wisp_config(0xb1);
|
|
goto LAB_005ca50f;
|
|
}
|
|
}
|
|
pvVar3 = ItemConfig::get_wisp_config(collectibleId);
|
|
wispCount = *GHIDRA_CAST<ushort *>((GHIDRA_CAST<char *>(pvVar3) + 400));
|
|
LAB_005ca50f:
|
|
isItemHeld = HasCollectible(this,0x164,0);
|
|
if (isItemHeld != 0) {
|
|
wispCount = wispCount * 2;
|
|
}
|
|
if (0 < (short)wispCount) {
|
|
uVar2 = GHIDRA_UINT(wispCount);
|
|
do {
|
|
AddWisp(this,collectibleId,&this->_pos,0,0);
|
|
manager = g_manager;
|
|
uVar2 = uVar2 - 1;
|
|
} while (uVar2 != 0);
|
|
soundId[0] = GHIDRA_CAST<Entity_Player *>(0x1d7);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(soundId));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(soundId[0]),1.0,2,0,1.0,0.0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 005caa70
|
|
void Entity_Player::console_spawn(int *spawnSpec, byte isAddWisp)
|
|
{
|
|
int iVar1;
|
|
code *pcVar2;
|
|
float fVar3;
|
|
Entity_Player *this_00;
|
|
byte isBookOfVirtues;
|
|
uint uVar4;
|
|
Vector *position;
|
|
EntityPtr tmpEntity;
|
|
EntityPtr chainEntity;
|
|
EntityPtr nextChainNpc;
|
|
void *pvVar5;
|
|
float *ptr;
|
|
uint i;
|
|
EntityPtr *pEVar6;
|
|
Vector *pos;
|
|
EntityRef removeSource;
|
|
EntityPtr *spawnedEnd;
|
|
Vector VStack_70;
|
|
EntityRef local_68;
|
|
EntityPtr spawned;
|
|
uint *rng;
|
|
EntityPtr *local_38;
|
|
EntityPtr *local_34;
|
|
Entity_Player *local_30;
|
|
void *local_2c;
|
|
Vector *playerPos;
|
|
float *entriesBegin;
|
|
float *entriesEnd;
|
|
float *entriesCapacityEnd;
|
|
float local_18;
|
|
float local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Game *game;
|
|
float playerPosY;
|
|
uint *rngState;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af5ec5;
|
|
local_10 = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
i = 0;
|
|
local_34 = g_game->_room;
|
|
local_30 = this;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_34) + 0x1264)) != 0) {
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_34) + 0x125c)) + i * 4));
|
|
if (((*GHIDRA_CAST<uint *>((iVar1 + 0x16c)) & 0x10000000) != 0) &&
|
|
(*GHIDRA_CAST<Entity_Player **>((iVar1 + 0x264)) == local_30)) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar1 + 0x168)) = *GHIDRA_CAST<undefined4 *>((iVar1 + 0x168));
|
|
*GHIDRA_CAST<uint *>((iVar1 + 0x16c)) = *GHIDRA_CAST<uint *>((iVar1 + 0x16c)) | 0x20000000;
|
|
removeSource._type = 0;
|
|
removeSource._variant = 0;
|
|
removeSource._spawnerType = 0;
|
|
removeSource._position.y = g_vectorZero.y;
|
|
removeSource._velocity.y = g_vectorZero.y;
|
|
removeSource._spawnerVariant = 0;
|
|
removeSource._position.x = g_vectorZero.x;
|
|
removeSource._velocity.x = g_vectorZero.x;
|
|
removeSource._flags = 0;
|
|
removeSource._entity = (void *)0x0;
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_34) + 0x125c)) + i * 4)) + 0x24))
|
|
(&removeSource,uVar4);
|
|
}
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_34) + 0x1264)));
|
|
}
|
|
if (*spawnSpec == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
pEVar6 = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
rng = GHIDRA_CAST<uint *>((GHIDRA_INT((local_30->_collectibleRNGs)._begin) + 0x1fe0));
|
|
local_38 = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
local_2c = (void *)0x0;
|
|
spawnedEnd = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
local_34 = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
entriesBegin = GHIDRA_CAST<float *>(0x0);
|
|
entriesEnd = GHIDRA_CAST<float *>(0x0);
|
|
entriesCapacityEnd = GHIDRA_CAST<float *>(0x0);
|
|
local_8 = 1;
|
|
playerPos = &local_30->_pos;
|
|
local_68._position.x = playerPos->x;
|
|
local_68._position.y = (local_30->_pos).y;
|
|
local_68._velocity.x = (float)*spawnSpec;
|
|
local_68._velocity.y = (float)spawnSpec[1];
|
|
local_68._flags = spawnSpec[2];
|
|
local_68._entity = (void *)spawnSpec[3];
|
|
std::vector<24byte>::_Emplace_reallocate(0,&local_68._position);
|
|
switch(*spawnSpec) {
|
|
case 0x13:
|
|
playerPosY = (float)*spawnSpec;
|
|
fVar3 = (float)spawnSpec[1];
|
|
VStack_70.x = (float)spawnSpec[2];
|
|
VStack_70.y = (float)spawnSpec[3];
|
|
uVar4 = Random();
|
|
local_14 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_14 = local_14 + local_14;
|
|
local_18 = cos(local_14);
|
|
local_18 = local_18 * 40.0;
|
|
local_14 = sin(local_14);
|
|
local_14 = local_14 * 40.0;
|
|
local_68._position.x = local_18 + playerPos->x;
|
|
local_68._position.y = local_14 + playerPos->y;
|
|
local_68._flags = GHIDRA_INT(VStack_70.x);
|
|
local_68._entity = (void *)VStack_70.y;
|
|
local_68._velocity.x = playerPosY;
|
|
local_68._velocity.y = fVar3;
|
|
if (entriesEnd == entriesCapacityEnd) {
|
|
std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position);
|
|
}
|
|
else {
|
|
*entriesEnd = local_68._position.x;
|
|
entriesEnd[1] = local_68._position.y;
|
|
entriesEnd[2] = playerPosY;
|
|
entriesEnd[3] = fVar3;
|
|
*GHIDRA_CAST<ulonglong *>((entriesEnd + 4)) = CONCAT44(VStack_70.y,VStack_70.x);
|
|
entriesEnd = entriesEnd + 6;
|
|
}
|
|
playerPosY = playerPos->y;
|
|
*entriesBegin = playerPos->x - local_18;
|
|
entriesBegin[1] = playerPosY - local_14;
|
|
break;
|
|
default:
|
|
switchD_005cac1b_caseD_14:
|
|
break;
|
|
case 0x45:
|
|
if (spawnSpec[1] != 1) goto switchD_005cac1b_caseD_14;
|
|
playerPosY = (float)*spawnSpec;
|
|
fVar3 = (float)spawnSpec[1];
|
|
VStack_70.x = (float)spawnSpec[2];
|
|
VStack_70.y = (float)spawnSpec[3];
|
|
uVar4 = Random();
|
|
local_14 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_14 = local_14 + local_14;
|
|
local_18 = cos(local_14);
|
|
local_18 = local_18 * 40.0;
|
|
local_14 = sin(local_14);
|
|
local_14 = local_14 * 40.0;
|
|
local_68._position.x = local_18 + playerPos->x;
|
|
local_68._position.y = local_14 + playerPos->y;
|
|
local_68._flags = GHIDRA_INT(VStack_70.x);
|
|
local_68._entity = (void *)VStack_70.y;
|
|
local_68._velocity.x = playerPosY;
|
|
local_68._velocity.y = fVar3;
|
|
if (entriesEnd == entriesCapacityEnd) {
|
|
std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position);
|
|
}
|
|
else {
|
|
*entriesEnd = local_68._position.x;
|
|
entriesEnd[1] = local_68._position.y;
|
|
entriesEnd[2] = playerPosY;
|
|
entriesEnd[3] = fVar3;
|
|
*GHIDRA_CAST<ulonglong *>((entriesEnd + 4)) = CONCAT44(VStack_70.y,VStack_70.x);
|
|
entriesEnd = entriesEnd + 6;
|
|
}
|
|
playerPosY = playerPos->y;
|
|
*entriesBegin = playerPos->x - local_18;
|
|
entriesBegin[1] = playerPosY - local_14;
|
|
break;
|
|
case 0x52:
|
|
playerPosY = (float)spawnSpec[1];
|
|
VStack_70.x = (float)spawnSpec[2];
|
|
VStack_70.y = (float)spawnSpec[3];
|
|
uVar4 = Random();
|
|
local_14 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_14 = local_14 + local_14;
|
|
local_18 = cos(local_14);
|
|
local_18 = local_18 * 40.0;
|
|
local_14 = sin(local_14);
|
|
local_14 = local_14 * 40.0;
|
|
local_68._position.x = local_18 + playerPos->x;
|
|
VStack_70.x = 50.0;
|
|
local_68._position.y = local_14 + playerPos->y;
|
|
local_68._velocity.x = 1.16308e-43;
|
|
local_68._flags = 0x42480000;
|
|
local_68._entity = (void *)VStack_70.y;
|
|
local_68._velocity.y = playerPosY;
|
|
if (entriesEnd == entriesCapacityEnd) {
|
|
std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position);
|
|
}
|
|
else {
|
|
*entriesEnd = local_68._position.x;
|
|
entriesEnd[1] = local_68._position.y;
|
|
entriesEnd[2] = 1.16308e-43;
|
|
entriesEnd[3] = playerPosY;
|
|
*GHIDRA_CAST<ulonglong *>((entriesEnd + 4)) = CONCAT44(VStack_70.y,0x42480000);
|
|
entriesEnd = entriesEnd + 6;
|
|
}
|
|
playerPosY = playerPos->y;
|
|
*entriesBegin = playerPos->x - local_18;
|
|
entriesBegin[1] = playerPosY - local_14;
|
|
break;
|
|
case 0xed:
|
|
playerPosY = (float)*spawnSpec;
|
|
fVar3 = (float)spawnSpec[1];
|
|
VStack_70.x = (float)spawnSpec[2];
|
|
VStack_70.y = (float)spawnSpec[3];
|
|
uVar4 = Random();
|
|
local_14 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_14 = local_14 + local_14;
|
|
local_18 = cos(local_14);
|
|
local_18 = local_18 * 40.0;
|
|
local_14 = sin(local_14);
|
|
local_14 = local_14 * 40.0;
|
|
local_68._position.x = local_18 + playerPos->x;
|
|
local_68._position.y = local_14 + playerPos->y;
|
|
local_68._flags = GHIDRA_INT(VStack_70.x);
|
|
local_68._entity = (void *)VStack_70.y;
|
|
local_68._velocity.x = playerPosY;
|
|
local_68._velocity.y = fVar3;
|
|
if (entriesEnd == entriesCapacityEnd) {
|
|
std::vector<24byte>::_Emplace_reallocate(entriesEnd,&local_68._position);
|
|
}
|
|
else {
|
|
*entriesEnd = local_68._position.x;
|
|
entriesEnd[1] = local_68._position.y;
|
|
entriesEnd[2] = playerPosY;
|
|
entriesEnd[3] = fVar3;
|
|
*GHIDRA_CAST<ulonglong *>((entriesEnd + 4)) = CONCAT44(VStack_70.y,VStack_70.x);
|
|
entriesEnd = entriesEnd + 6;
|
|
}
|
|
playerPosY = playerPos->y;
|
|
*entriesBegin = playerPos->x - local_18;
|
|
entriesBegin[1] = playerPosY - local_14;
|
|
}
|
|
local_18 = 0.0;
|
|
iVar1 = GHIDRA_INT(entriesEnd) - GHIDRA_INT(entriesBegin) >> 0x1f;
|
|
if ((GHIDRA_INT(entriesEnd) - GHIDRA_INT(entriesBegin)) / 0x18 + iVar1 != iVar1) {
|
|
local_2c = (void *)0x0;
|
|
do {
|
|
local_14 = 0.0;
|
|
if (0 < spawnSpec[3]) {
|
|
do {
|
|
rngState = rng;
|
|
DAT_00c71670 = 1;
|
|
uVar4 = *rng;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *rngState;
|
|
if (uVar4 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
game = g_game;
|
|
uVar4 = uVar4 >> ((byte)rngState[1] & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)rngState[2] & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)rngState[3] & 0x1f) ^ uVar4;
|
|
*rngState = uVar4;
|
|
pos = GHIDRA_CAST<Vector *>((GHIDRA_INT(local_2c) + GHIDRA_INT(entriesBegin)));
|
|
position = Room::FindFreePickupSpawnPosition(game->_room,&VStack_70,pos,40.0,0,0,0);
|
|
tmpEntity = (EntityPtr)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(pos[1].x),GHIDRA_UINT(pos[1].y),position,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(local_30),0,uVar4);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(tmpEntity) + 0x16c)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(tmpEntity) + 0x16c)) | 0x10000020;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(tmpEntity) + 0x168)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(tmpEntity) + 0x168));
|
|
spawned = tmpEntity;
|
|
(GHIDRA_CAST<EntityRef *>((&local_68)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(local_30));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tmpEntity))))->Entity::AddCharmed(&local_68,-1,0,0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tmpEntity))))->Entity::SetVisibleFlag(0);
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(tmpEntity) + 0x380)) = pos[2].x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(tmpEntity) + 900)) = pos[2].x;
|
|
ANM2::LoadDeliriumForm
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(tmpEntity) + 0x48)),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(tmpEntity) + 0x28)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(tmpEntity) + 0x2c)),1);
|
|
if (local_38 == local_34) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(local_38,&spawned);
|
|
local_34 = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
}
|
|
else {
|
|
*local_38 = tmpEntity;
|
|
spawnedEnd = local_38 + 1;
|
|
}
|
|
local_14 = (float)(GHIDRA_INT(local_14) + 1);
|
|
local_38 = spawnedEnd;
|
|
} while (GHIDRA_INT(local_14) < spawnSpec[3]);
|
|
pEVar6 = spawnedEnd;
|
|
}
|
|
local_2c = (void *)(GHIDRA_INT(local_2c) + 0x18);
|
|
local_18 = (float)(GHIDRA_INT(local_18) + 1);
|
|
} while (GHIDRA_UINT(local_18) < GHIDRA_UINT(((GHIDRA_INT(entriesEnd) - GHIDRA_INT(entriesBegin)) / 0x18)));
|
|
local_2c = (void *)0x0;
|
|
}
|
|
pEVar6 = GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(pEVar6) >> 2));
|
|
local_14 = 0.0;
|
|
pvVar5 = (void *)0x0;
|
|
local_38 = pEVar6;
|
|
if (pEVar6 != GHIDRA_CAST<EntityPtr *>(0x0)) {
|
|
do {
|
|
tmpEntity = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(pvVar5) + GHIDRA_INT(local_14) * 4));
|
|
spawned = tmpEntity;
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(tmpEntity) + 0x168)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(tmpEntity) + 0x168)) | 0x80000000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(tmpEntity) + 0x16c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(tmpEntity) + 0x16c));
|
|
EntityList::AddPersistentEntity
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<Entity *>(tmpEntity));
|
|
for (chainEntity = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(tmpEntity) + 0x3bc)); chainEntity != (EntityPtr)0x0;
|
|
chainEntity = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(chainEntity) + 0x3bc))) {
|
|
tmpEntity = chainEntity;
|
|
}
|
|
chainEntity = (EntityPtr)
|
|
__RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
|
tmpEntity = spawned;
|
|
spawnSpec = GHIDRA_CAST<int *>(0x0);
|
|
if (chainEntity != (EntityPtr)0x0) {
|
|
do {
|
|
if (chainEntity == tmpEntity) {
|
|
nextChainNpc = (EntityPtr)
|
|
__RTDynamicCast(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(chainEntity) + 0x3c0)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0)
|
|
;
|
|
if (nextChainNpc == (EntityPtr)spawnSpec) break;
|
|
}
|
|
else {
|
|
ANM2::LoadDeliriumForm
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(chainEntity) + 0x48)),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(chainEntity) + 0x28)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(chainEntity) + 0x2c)),1);
|
|
nextChainNpc = (EntityPtr)
|
|
__RTDynamicCast(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(chainEntity) + 0x3c0)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0)
|
|
;
|
|
spawnSpec = GHIDRA_CAST<int *>(chainEntity);
|
|
}
|
|
chainEntity = nextChainNpc;
|
|
} while (nextChainNpc != (EntityPtr)0x0);
|
|
pEVar6 = local_38;
|
|
}
|
|
local_14 = (float)(GHIDRA_INT(local_14) + 1);
|
|
pvVar5 = local_2c;
|
|
} while (GHIDRA_UINT(local_14) < pEVar6);
|
|
}
|
|
if (g_game->_hallucinationTimer < 1) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShowHallucination(0x19,0x3f);
|
|
}
|
|
this_00 = local_30;
|
|
isBookOfVirtues = HasCollectible(local_30,0x248,0);
|
|
rngState = rng;
|
|
if ((isBookOfVirtues != 0) && (isAddWisp != 0)) {
|
|
uVar4 = *rng;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *rngState;
|
|
if (uVar4 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar4 = uVar4 >> ((byte)rngState[1] & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)rngState[2] & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)rngState[3] & 0x1f) ^ uVar4;
|
|
*rngState = uVar4;
|
|
AddWisp(this_00,*GHIDRA_CAST<int *>((&DAT_00b62c80 + (uVar4 & 3) * 4)),playerPos,0,0);
|
|
}
|
|
if (entriesBegin != GHIDRA_CAST<float *>(0x0)) {
|
|
uVar4 = ((GHIDRA_INT(entriesCapacityEnd) - GHIDRA_INT(entriesBegin)) / 0x18) * 0x18;
|
|
ptr = entriesBegin;
|
|
if (0xfff < uVar4) {
|
|
ptr = GHIDRA_CAST<float *>(entriesBegin[-1]);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(entriesBegin) + (-4 - GHIDRA_INT(ptr))))) goto LAB_005cb36d;
|
|
}
|
|
operator_delete(ptr,uVar4);
|
|
}
|
|
if (local_2c != (void *)0x0) {
|
|
uVar4 = GHIDRA_INT(local_34) - GHIDRA_INT(local_2c) & 0xfffffffc;
|
|
pvVar5 = local_2c;
|
|
if (0xfff < uVar4) {
|
|
pvVar5 = *(void **)(GHIDRA_CAST<char *>(local_2c) + -4);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_2c) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
LAB_005cb36d:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar4);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 005cb480
|
|
void Entity_Player::update_mini_mush_costume()
|
|
{
|
|
bool bVar1;
|
|
char cVar2;
|
|
uint uVar3;
|
|
void *costumesEnd;
|
|
int *piVar4;
|
|
int otherStackCount;
|
|
NetplayManager peer;
|
|
int *effect;
|
|
qword *allocCounter;
|
|
uint uVar5;
|
|
uint peerCount;
|
|
int iVar6;
|
|
void *pvVar7;
|
|
PlayerManager *playerManager;
|
|
int costumeLevel3;
|
|
int costumeLevel2;
|
|
int costumeLevel1;
|
|
int stackCount;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
qword allocatedBytes;
|
|
void **costumesEndSlot;
|
|
int *effectsEnd;
|
|
Game *game;
|
|
bool isCostumeRemoved;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af5ef0;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar4 = (this->_temporaryeffects)._effects._begin;
|
|
piVar4 != (this->_temporaryeffects)._effects._end; piVar4 = piVar4 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar4) == 0) && ((GHIDRA_CAST<int *>(*piVar4))[1] == 0x47)) {
|
|
iVar6 = piVar4[1];
|
|
goto LAB_005cb4e6;
|
|
}
|
|
}
|
|
iVar6 = 0;
|
|
LAB_005cb4e6:
|
|
pvVar7 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x246);
|
|
if (pvVar7 == (void *)0x0) {
|
|
stackCount = 0;
|
|
}
|
|
else {
|
|
stackCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 4));
|
|
}
|
|
}
|
|
else {
|
|
stackCount = 0;
|
|
iVar6 = 0;
|
|
}
|
|
stackCount = stackCount + iVar6;
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
iVar6 = GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) >> 2;
|
|
if (iVar6 < 0x48) {
|
|
costumeLevel1 = 0;
|
|
costumeLevel2 = 0;
|
|
costumeLevel3 = 0;
|
|
}
|
|
else {
|
|
costumeLevel1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x11c));
|
|
if (iVar6 < 0x49) {
|
|
costumeLevel2 = 0;
|
|
costumeLevel3 = 0;
|
|
}
|
|
else {
|
|
costumeLevel2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x120));
|
|
if (iVar6 < 0x4a) {
|
|
costumeLevel3 = 0;
|
|
}
|
|
else {
|
|
costumeLevel3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x124));
|
|
}
|
|
}
|
|
}
|
|
pvVar7 = (this->_costumeSpriteDescs)._begin;
|
|
isCostumeRemoved = false;
|
|
costumesEnd = (this->_costumeSpriteDescs)._end;
|
|
bVar1 = false;
|
|
if (pvVar7 != costumesEnd) {
|
|
do {
|
|
isCostumeRemoved = bVar1;
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x114));
|
|
if (((iVar6 == costumeLevel1) || (iVar6 == costumeLevel2)) || (iVar6 == costumeLevel3)) {
|
|
std::_Move_unchecked<CostumeSprite>(pvVar7,uVar3);
|
|
costumesEnd = (this->_costumeSpriteDescs)._end;
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(costumesEnd) + -0x130)))))->ANM2::Reset();
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(costumesEnd) + -0xd8));
|
|
if (iVar6 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar5 = *GHIDRA_CAST<uint *>((iVar6 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar5;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar5));
|
|
free((void *)(iVar6 + -4));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(costumesEnd) + -0xd8)) = 0;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(costumesEnd) + -0xd4));
|
|
if (iVar6 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar5 = *GHIDRA_CAST<uint *>((iVar6 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar5;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar5));
|
|
free((void *)(iVar6 + -4));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(costumesEnd) + -0xd4)) = 0;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(costumesEnd) + -0xf8));
|
|
if (iVar6 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar5 = *GHIDRA_CAST<uint *>((iVar6 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar5;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar5));
|
|
free((void *)(iVar6 + -4));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(costumesEnd) + -0xf8)) = 0;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(costumesEnd) + -0xf4));
|
|
if (iVar6 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar5 = *GHIDRA_CAST<uint *>((iVar6 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar5;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar5));
|
|
free((void *)(iVar6 + -4));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(costumesEnd) + -0xf4)) = 0;
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(costumesEnd) + -0x118)))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(costumesEnd) + -0x130)))))->std::string::_Tidy_deallocate();
|
|
isCostumeRemoved = true;
|
|
local_8 = 0xffffffff;
|
|
costumesEndSlot = &(this->_costumeSpriteDescs)._end;
|
|
*costumesEndSlot = (void *)(GHIDRA_INT(*costumesEndSlot) + -0x130);
|
|
costumesEnd = (this->_costumeSpriteDescs)._end;
|
|
}
|
|
else {
|
|
pvVar7 = (void *)(GHIDRA_INT(pvVar7) + 0x130);
|
|
}
|
|
bVar1 = isCostumeRemoved;
|
|
} while (pvVar7 != costumesEnd);
|
|
}
|
|
if (stackCount < 7) {
|
|
if (stackCount < 4) {
|
|
if (stackCount < 1) {
|
|
if (isCostumeRemoved) {
|
|
UpdateCostumes(this);
|
|
}
|
|
}
|
|
else {
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x11d
|
|
) {
|
|
AddCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
}
|
|
else {
|
|
AddCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x11c)),0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x121)
|
|
{
|
|
AddCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
}
|
|
else {
|
|
AddCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x120)),0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x125) {
|
|
AddCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
}
|
|
else {
|
|
AddCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x124)),0);
|
|
}
|
|
}
|
|
peer = g_manager->_netplayManager;
|
|
if (peer != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
uVar5 = GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(peer) >> 2;
|
|
uVar3 = 0;
|
|
if (uVar5 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peer) + 0xc)) == this->_controllerIndex) {
|
|
cVar2 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peer) + 0x370)) + 0x14))();
|
|
if (cVar2 == '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
peer = (NetplayManager)(GHIDRA_INT(peer) + 4);
|
|
} while (uVar3 < uVar5);
|
|
}
|
|
}
|
|
uVar3 = 1;
|
|
playerManager = &g_game->_playerManager;
|
|
if (1 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2))) {
|
|
do {
|
|
pvVar7 = (playerManager->_playerList)._end;
|
|
piVar4 = (playerManager->_playerList)._begin;
|
|
if (GHIDRA_INT(pvVar7) - GHIDRA_INT(piVar4) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar7 = (playerManager->_playerList)._end;
|
|
piVar4 = (playerManager->_playerList)._begin;
|
|
}
|
|
if (uVar3 < GHIDRA_UINT((GHIDRA_INT(pvVar7) - GHIDRA_INT(piVar4) >> 2))) {
|
|
piVar4 = piVar4 + uVar3;
|
|
}
|
|
peer = g_manager->_netplayManager;
|
|
if (peer != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
peerCount = GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(peer) >> 2;
|
|
uVar5 = 0;
|
|
if (peerCount != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peer) + 0xc)) == *GHIDRA_CAST<int *>((*piVar4 + 0x1618))) {
|
|
cVar2 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peer) + 0x370)) + 0x14))();
|
|
if (cVar2 == '\0') goto LAB_005cb950;
|
|
break;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
peer = (NetplayManager)(GHIDRA_INT(peer) + 4);
|
|
} while (uVar5 < peerCount);
|
|
}
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
piVar4 = (this->_temporaryeffects)._effects._begin;
|
|
effectsEnd = (this->_temporaryeffects)._effects._end;
|
|
effect = piVar4;
|
|
if (piVar4 == effectsEnd) goto LAB_005cb939;
|
|
do {
|
|
iVar6 = *GHIDRA_CAST<int *>(*effect);
|
|
if ((((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) && ((GHIDRA_CAST<int *>(*effect))[1] == 0x246)) {
|
|
iVar6 = effect[1];
|
|
goto LAB_005cb910;
|
|
}
|
|
effect = effect + 4;
|
|
} while (effect != effectsEnd);
|
|
iVar6 = 0;
|
|
LAB_005cb910:
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>(*piVar4) == 0) && ((GHIDRA_CAST<int *>(*piVar4))[1] == 0x47)) {
|
|
otherStackCount = piVar4[1] + iVar6;
|
|
if (piVar4[1] + iVar6 < stackCount) {
|
|
otherStackCount = stackCount;
|
|
}
|
|
stackCount = otherStackCount;
|
|
goto LAB_005cb950;
|
|
}
|
|
piVar4 = piVar4 + 4;
|
|
} while (piVar4 != effectsEnd);
|
|
}
|
|
else {
|
|
LAB_005cb939:
|
|
iVar6 = 0;
|
|
}
|
|
if (iVar6 < stackCount) {
|
|
iVar6 = stackCount;
|
|
}
|
|
stackCount = iVar6;
|
|
LAB_005cb950:
|
|
uVar3 = uVar3 + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (uVar3 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
game = g_game;
|
|
g_game->_dizzyTargetIntensity = (float)stackCount / 10.0;
|
|
game->_dizzyIntensityChangeSpeed = 0.001;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 005cd740
|
|
Vector * Entity_Player::GetLastDirection()
|
|
{
|
|
return &this->_lastDirection;
|
|
}
|
|
|
|
// 005cd7d0
|
|
EntityDesc * Entity_Player::FriendBallEnemy()
|
|
{
|
|
return &this->_friendBallEnemy;
|
|
}
|
|
|
|
// 0060d050
|
|
int Entity_Player::GetNumBlueSpiders()
|
|
{
|
|
return this->_numBlueSpiders;
|
|
}
|
|
|
|
// 0060d080
|
|
int Entity_Player::GetDamageCooldown()
|
|
{
|
|
return this->_damageCooldown;
|
|
}
|
|
|
|
// 0060d090
|
|
void Entity_Player::ResetDamageCooldown()
|
|
{
|
|
this->_damageCooldown = 0;
|
|
return;
|
|
}
|
|
|
|
// 0060d0a0
|
|
Vector * Entity_Player::SpriteScale(Vector *outScale)
|
|
{
|
|
float scaleY;
|
|
|
|
scaleY = (this->_playerSpriteScale).y;
|
|
outScale->x = (this->_playerSpriteScale).x;
|
|
outScale->y = scaleY;
|
|
return outScale;
|
|
}
|
|
|
|
// 0065cf20
|
|
int Entity_Player::GetBrokenHearts()
|
|
{
|
|
return this->_brokenHearts;
|
|
}
|
|
|
|
// 0065cf30
|
|
int Entity_Player::GetNumBombs()
|
|
{
|
|
return this->_numBombs;
|
|
}
|
|
|
|
// 0065cf40
|
|
byte Entity_Player::HasGoldenKey()
|
|
{
|
|
return this->_hasGoldenKey;
|
|
}
|
|
|
|
// 0065cf50
|
|
byte Entity_Player::HasGoldenBomb()
|
|
{
|
|
return this->_hasGoldenBomb;
|
|
}
|
|
|
|
// 0065cf60
|
|
byte Entity_Player::IsP2Appearing()
|
|
{
|
|
if ((this->_variant == 1) && (0 < this->_damageCooldown)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0065cf80
|
|
RNG * Entity_Player::GetTrinketRNG(int id)
|
|
{
|
|
uint index;
|
|
uint clampedId;
|
|
void *rngs;
|
|
|
|
if ((id < 0) || (GHIDRA_INT((this->_trinketRNGs)._end) - GHIDRA_INT((this->_trinketRNGs)._begin) >> 4 <= id)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Trinket ID out of bounds!\n"));
|
|
}
|
|
rngs = (this->_trinketRNGs)._begin;
|
|
index = (GHIDRA_INT((this->_trinketRNGs)._end) - GHIDRA_INT(rngs) >> 4) - 1;
|
|
clampedId = -GHIDRA_UINT((id != 0)) & id;
|
|
if (clampedId < index) {
|
|
index = clampedId;
|
|
}
|
|
return GHIDRA_CAST<RNG *>((index * 0x10 + GHIDRA_INT(rngs)));
|
|
}
|
|
|
|
// 00665c10
|
|
int Entity_Player::GetTractorBeam()
|
|
{
|
|
return this->_tractorBeam;
|
|
}
|
|
|
|
// 00665c20
|
|
ColorMod * Entity_Player::get_laser_color_copy(ColorMod *outColor)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
|
|
fVar1 = (this->_laserColor)._tint[1];
|
|
fVar2 = (this->_laserColor)._tint[2];
|
|
fVar3 = (this->_laserColor)._tint[3];
|
|
outColor->_tint[0] = (this->_laserColor)._tint[0];
|
|
outColor->_tint[1] = fVar1;
|
|
outColor->_tint[2] = fVar2;
|
|
outColor->_tint[3] = fVar3;
|
|
fVar1 = (this->_laserColor)._colorize[1];
|
|
fVar2 = (this->_laserColor)._colorize[2];
|
|
fVar3 = (this->_laserColor)._colorize[3];
|
|
outColor->_colorize[0] = (this->_laserColor)._colorize[0];
|
|
outColor->_colorize[1] = fVar1;
|
|
outColor->_colorize[2] = fVar2;
|
|
outColor->_colorize[3] = fVar3;
|
|
fVar1 = (this->_laserColor)._offset[2];
|
|
*GHIDRA_CAST<undefined8 *>(outColor->_offset) = *GHIDRA_CAST<undefined8 *>((this->_laserColor)._offset);
|
|
outColor->_offset[2] = fVar1;
|
|
return outColor;
|
|
}
|
|
|
|
// 006b5fd0
|
|
uint Entity_Player::get_grid_collision_at(Vector *position)
|
|
{
|
|
Room *this_00;
|
|
char cVar1;
|
|
byte bVar2;
|
|
uint uVar3;
|
|
uint gridIndex;
|
|
float *gridPos;
|
|
Entity_Player *this_01;
|
|
int gridRow;
|
|
int iVar4;
|
|
float roundBias;
|
|
float dy;
|
|
float dx;
|
|
float gridOriginY;
|
|
undefined1 gridPosOut [4];
|
|
int gridColumn;
|
|
void *roomPtr;
|
|
|
|
this_00 = g_game->_room;
|
|
iVar4 = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
gridRow = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar4 < 0) || (this_00->_gridWidth <= iVar4)) || (gridRow < 0)) ||
|
|
(this_00->_gridHeight <= gridRow)) {
|
|
iVar4 = -1;
|
|
}
|
|
else {
|
|
iVar4 = this_00->_gridWidth * gridRow + iVar4;
|
|
}
|
|
uVar3 = (GHIDRA_CAST<Room *>((this_00)))->Room::GetGridCollision(iVar4);
|
|
roundBias = 0.5;
|
|
if (uVar3 == 3) {
|
|
gridColumn = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
if (-1 < gridColumn) {
|
|
gridOriginY = 120.0;
|
|
roomPtr = g_game->_room;
|
|
if ((((gridColumn < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0xc))) &&
|
|
(iVar4 = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5)), -1 < iVar4)) &&
|
|
((iVar4 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0x10)) &&
|
|
((gridIndex = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0xc)) * iVar4 + gridColumn, gridIndex < 0x1c0 &&
|
|
(iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + gridIndex * 4 + 0x24)), iVar4 != 0)))))) &&
|
|
(*GHIDRA_CAST<int *>((iVar4 + 4)) == 0xe)) {
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 8)) - 7U < 4) {
|
|
gridPos = GHIDRA_CAST<float *>(FUN_00718d20(gridPosOut));
|
|
dx = position->x - *gridPos;
|
|
dy = position->y - gridPos[1];
|
|
if (1444.0 < dy * dy + dx * dx) {
|
|
uVar3 = 0;
|
|
}
|
|
}
|
|
else {
|
|
dx = position->x -
|
|
((float)(*GHIDRA_CAST<int *>((iVar4 + 0x24)) % *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0xc))) * 40.0 + 40.0);
|
|
dy = position->y -
|
|
((float)(*GHIDRA_CAST<int *>((iVar4 + 0x24)) / *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0xc))) * 40.0 + 120.0);
|
|
if (324.0 < dy * dy + dx * dx) {
|
|
uVar3 = 0;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_006b61a0;
|
|
}
|
|
}
|
|
gridOriginY = 120.0;
|
|
LAB_006b61a0:
|
|
if ((this == GHIDRA_CAST<Entity_Player *>(0x0)) || (this->_type != 1)) {
|
|
this = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
if (uVar3 == 4) {
|
|
roomPtr = g_game->_room;
|
|
gridColumn = GHIDRA_INT(((position->x - 40.0) / 40.0 + roundBias));
|
|
if ((((gridColumn < 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0xc)) <= gridColumn)) ||
|
|
(iVar4 = GHIDRA_INT(((position->y - gridOriginY) / 40.0 + roundBias)), iVar4 < 0)) ||
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0x10)) <= iVar4 ||
|
|
(uVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + 0xc)) * iVar4 + gridColumn, 0x1bf < uVar3)))) {
|
|
iVar4 = 0;
|
|
}
|
|
else {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomPtr) + uVar3 * 4 + 0x24));
|
|
}
|
|
if (this == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
return 4;
|
|
}
|
|
if (iVar4 == 0) {
|
|
return 4;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 4)) != 0x10) {
|
|
return 4;
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((iVar4 + 0x3a0)) >> 4 & 1) == 0) {
|
|
return 4;
|
|
}
|
|
cVar1 = FUN_007103a0();
|
|
if (cVar1 == '\0') {
|
|
return 4;
|
|
}
|
|
iVar4 = GetHealthType(this);
|
|
if (((iVar4 != 2) && (bVar2 = HasInstantDeathCurse(this_01), bVar2 == 0)) &&
|
|
(g_game->_currentDimensionIdx != 1)) {
|
|
return 4;
|
|
}
|
|
uVar3 = 5;
|
|
}
|
|
else if (uVar3 != 5) {
|
|
return uVar3;
|
|
}
|
|
if ((((this->_variant != 0) || (this->_isCoopGhost != 0)) || (this->_parent != (EntityPtr)0x0)) ||
|
|
(bVar2 = IsHologram(this), bVar2 != 0)) {
|
|
uVar3 = 4;
|
|
}
|
|
return uVar3;
|
|
}
|
|
|
|
// 006b84a0
|
|
byte Entity_Player::ControlsEnabled()
|
|
{
|
|
return this->_isControlsEnabled;
|
|
}
|
|
|
|
// 006dacd0
|
|
byte Entity_Player::HasFullHearts()
|
|
{
|
|
int healthType;
|
|
int extraout_EDX;
|
|
|
|
healthType = GetHealthType(this);
|
|
if ((healthType == 1) || (healthType == 2)) {
|
|
return *GHIDRA_CAST<int *>((extraout_EDX + 0x1340)) <= *GHIDRA_CAST<int *>((extraout_EDX + 0x1344));
|
|
}
|
|
return *GHIDRA_CAST<int *>((extraout_EDX + 0x1340)) + *GHIDRA_CAST<int *>((extraout_EDX + 0x1d88)) * 2 <=
|
|
*GHIDRA_CAST<int *>((extraout_EDX + 0x1344));
|
|
}
|
|
|
|
// 006dad10
|
|
int Entity_Player::GetJarHearts()
|
|
{
|
|
return this->_jarHearts;
|
|
}
|
|
|
|
// 006dad20
|
|
int Entity_Player::GetSoulCharge()
|
|
{
|
|
return this->_effectiveSoulCharge;
|
|
}
|
|
|
|
// 006dad30
|
|
int Entity_Player::GetBloodCharge()
|
|
{
|
|
return this->_effectiveBloodCharge;
|
|
}
|
|
|
|
// 006dad60
|
|
Vector * Entity_Player::GetVelocityBeforeUpdate()
|
|
{
|
|
return &this->_lastVelocity;
|
|
}
|
|
|
|
// 006dad70
|
|
int Entity_Player::GetEternalHearts()
|
|
{
|
|
return this->_eternalHearts;
|
|
}
|
|
|
|
// 006dad80
|
|
void Entity_Player::set_last_damage(ulonglong damageFlags, EntityRef *source)
|
|
{
|
|
this->_lastDamageFlags = damageFlags;
|
|
(this->_lastDamageSource)._type = source->_type;
|
|
(this->_lastDamageSource)._variant = source->_variant;
|
|
(this->_lastDamageSource)._spawnerType = source->_spawnerType;
|
|
(this->_lastDamageSource)._spawnerVariant = source->_spawnerVariant;
|
|
(this->_lastDamageSource)._position.x = (source->_position).x;
|
|
(this->_lastDamageSource)._position.y = (source->_position).y;
|
|
(this->_lastDamageSource)._velocity.x = (source->_velocity).x;
|
|
(this->_lastDamageSource)._velocity.y = (source->_velocity).y;
|
|
(this->_lastDamageSource)._flags = source->_flags;
|
|
(this->_lastDamageSource)._entity = source->_entity;
|
|
return;
|
|
}
|
|
|
|
// 006dae00
|
|
int Entity_Player::GetBabySkin()
|
|
{
|
|
return this->_babySkin;
|
|
}
|
|
|
|
// 006dae10
|
|
int Entity_Player::GetSubPlayer()
|
|
{
|
|
return this->_subPlayer;
|
|
}
|
|
|
|
// 006f0020
|
|
void Entity_Player::SetSoulCharge(int param_2)
|
|
{
|
|
this->_effectiveSoulCharge = param_2;
|
|
return;
|
|
}
|
|
|
|
// 006f0030
|
|
void Entity_Player::SetBloodCharge(int param_2)
|
|
{
|
|
this->_effectiveBloodCharge = param_2;
|
|
return;
|
|
}
|
|
|
|
// 00753900
|
|
void * Entity_Player::GetPocketItem(int SlotID)
|
|
{
|
|
int clampedSlot;
|
|
|
|
if (SlotID < 1) {
|
|
SlotID = 0;
|
|
}
|
|
clampedSlot = 3;
|
|
if (SlotID < 3) {
|
|
clampedSlot = SlotID;
|
|
}
|
|
return this->_pocketSlots + clampedSlot * 2;
|
|
}
|
|
|
|
// 00753930
|
|
Vector * Entity_Player::TearsOffset()
|
|
{
|
|
return &this->_tearsOffset;
|
|
}
|
|
|
|
// 00753980
|
|
void Entity_Player::EnableWeaponType(int param_2, undefined1 param_3)
|
|
{
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_weapons) + param_2 + 0x14)) = param_3;
|
|
return;
|
|
}
|
|
|
|
// 007539c0
|
|
void Entity_Player::QueueExtraAnimation(byte *animName)
|
|
{
|
|
byte *nameEnd;
|
|
byte nameChar;
|
|
|
|
nameEnd = animName;
|
|
do {
|
|
nameChar = *nameEnd;
|
|
nameEnd = nameEnd + 1;
|
|
} while (nameChar != 0);
|
|
(GHIDRA_CAST<std::string *>(((this->_queuedExtraAnimation)._buf)))->std::string::assign(animName,GHIDRA_INT(nameEnd) - GHIDRA_INT((animName + 1)));
|
|
return;
|
|
}
|
|
|
|
// 007539f0
|
|
byte Entity_Player::CanShoot()
|
|
{
|
|
return this->_canShoot;
|
|
}
|
|
|
|
// 00753a00
|
|
RNG * Entity_Player::GetPillRNG(int pillEffect)
|
|
{
|
|
void *pvVar1;
|
|
uint clampedIndex;
|
|
uint uVar2;
|
|
|
|
if ((pillEffect < 0) ||
|
|
(GHIDRA_INT((this->_pillRNGs)._end) - GHIDRA_INT((this->_pillRNGs)._begin) >> 4 <= pillEffect)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Pill ID out of bounds!\n"));
|
|
}
|
|
pvVar1 = (this->_pillRNGs)._begin;
|
|
clampedIndex = (GHIDRA_INT((this->_pillRNGs)._end) - GHIDRA_INT(pvVar1) >> 4) - 1;
|
|
uVar2 = -GHIDRA_UINT((pillEffect != 0)) & pillEffect;
|
|
if (uVar2 < clampedIndex) {
|
|
clampedIndex = uVar2;
|
|
}
|
|
return GHIDRA_CAST<RNG *>((clampedIndex * 0x10 + GHIDRA_INT(pvVar1)));
|
|
}
|
|
|
|
// 00753a60
|
|
RNG * Entity_Player::GetCardRNG(int cardId)
|
|
{
|
|
void *pvVar1;
|
|
uint cardIndex;
|
|
uint uVar2;
|
|
|
|
if ((cardId < 0) || (GHIDRA_INT((this->_cardRNGs)._end) - GHIDRA_INT((this->_cardRNGs)._begin) >> 4 <= cardId))
|
|
{
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Card ID out of bounds!\n"));
|
|
}
|
|
pvVar1 = (this->_cardRNGs)._begin;
|
|
cardIndex = (GHIDRA_INT((this->_cardRNGs)._end) - GHIDRA_INT(pvVar1) >> 4) - 1;
|
|
uVar2 = -GHIDRA_UINT((cardId != 0)) & cardId;
|
|
if (uVar2 < cardIndex) {
|
|
cardIndex = uVar2;
|
|
}
|
|
return GHIDRA_CAST<RNG *>((cardIndex * 0x10 + GHIDRA_INT(pvVar1)));
|
|
}
|
|
|
|
// 00753ac0
|
|
uint Entity_Player::IsSubPlayer()
|
|
{
|
|
return GHIDRA_UINT(this->_playerIndex) >> 0x1f;
|
|
}
|
|
|
|
// 00753c20
|
|
int Entity_Player::GetPoopMana()
|
|
{
|
|
return this->_poopMana;
|
|
}
|
|
|
|
// 00753c30
|
|
byte Entity_Player::HasCurseMistEffect()
|
|
{
|
|
return this->_hasCurseMistEffect;
|
|
}
|
|
|
|
// 00753da0
|
|
void Entity_Player::constructor()
|
|
{
|
|
undefined1 *puVar1;
|
|
ActiveItemDesc *activeDesc;
|
|
int *containerProxy;
|
|
undefined4 *puVar2;
|
|
void *sentinelNode;
|
|
int remaining;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
std_deque *deque;
|
|
std_set *proceduralItemIds;
|
|
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afe9e2;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::constructor();
|
|
local_14 = 0;
|
|
*GHIDRA_CAST<undefined ***>(this) = IsaacRepentancePlus::Entity_Player::vftable;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_crownOfLightSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_darkPrincesCrownSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
_eh_vector_constructor_iterator_(this->_chargeBarSprites,0x114,7,ANM2::constructor,ANM2::~ANM2);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bloodGushSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_statusEffectSprite)))->ANM2::constructor();
|
|
(this->_costumeSpriteDescs)._begin = (void *)0x0;
|
|
(this->_costumeSpriteDescs)._end = (void *)0x0;
|
|
(this->_costumeSpriteDescs)._capacity = (void *)0x0;
|
|
(this->_headAnim)._buf[0] = '\0';
|
|
(this->_headAnim)._buf[1] = '\0';
|
|
(this->_headAnim)._buf[2] = '\0';
|
|
(this->_headAnim)._buf[3] = '\0';
|
|
(this->_headAnim)._size = 0;
|
|
(this->_headAnim)._capacity = 0xf;
|
|
(this->_headAnim)._buf[0] = '\0';
|
|
(this->_queuedExtraAnimation)._buf[0] = '\0';
|
|
(this->_queuedExtraAnimation)._buf[1] = '\0';
|
|
(this->_queuedExtraAnimation)._buf[2] = '\0';
|
|
(this->_queuedExtraAnimation)._buf[3] = '\0';
|
|
(this->_queuedExtraAnimation)._size = 0;
|
|
(this->_queuedExtraAnimation)._capacity = 0xf;
|
|
(this->_queuedExtraAnimation)._buf[0] = '\0';
|
|
(this->_name)._buf[0] = '\0';
|
|
(this->_name)._buf[1] = '\0';
|
|
(this->_name)._buf[2] = '\0';
|
|
(this->_name)._buf[3] = '\0';
|
|
(this->_name)._size = 0;
|
|
(this->_name)._capacity = 0xf;
|
|
(this->_name)._buf[0] = '\0';
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._l) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._h) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = 0;
|
|
(this->_tearColor)._tint[0] = 1.0;
|
|
(this->_tearColor)._tint[1] = 1.0;
|
|
(this->_tearColor)._tint[2] = 1.0;
|
|
(this->_tearColor)._tint[3] = 1.0;
|
|
(this->_tearColor)._colorize[0] = 0.0;
|
|
(this->_tearColor)._colorize[1] = 0.0;
|
|
(this->_tearColor)._colorize[2] = 0.0;
|
|
(this->_tearColor)._colorize[3] = 0.0;
|
|
(this->_tearColor)._offset[0] = 0.0;
|
|
(this->_tearColor)._offset[1] = 0.0;
|
|
(this->_tearColor)._offset[2] = 0.0;
|
|
(this->_laserColor)._tint[0] = 1.0;
|
|
(this->_laserColor)._tint[1] = 1.0;
|
|
(this->_laserColor)._tint[2] = 1.0;
|
|
(this->_laserColor)._tint[3] = 1.0;
|
|
(this->_laserColor)._colorize[0] = 0.0;
|
|
(this->_laserColor)._colorize[1] = 0.0;
|
|
(this->_laserColor)._colorize[2] = 0.0;
|
|
(this->_laserColor)._colorize[3] = 0.0;
|
|
(this->_laserColor)._offset[0] = 0.0;
|
|
(this->_laserColor)._offset[1] = 0.0;
|
|
(this->_laserColor)._offset[2] = 0.0;
|
|
(this->_playerSpriteScale).y = 0.0;
|
|
(this->_playerSpriteScale).x = 0.0;
|
|
(this->_bodyScale).y = 0.0;
|
|
(this->_bodyScale).x = 0.0;
|
|
(this->_headScale).y = 0.0;
|
|
(this->_headScale).x = 0.0;
|
|
(this->_temporaryeffects)._effects._begin = (void *)0x0;
|
|
(this->_temporaryeffects)._effects._end = (void *)0x0;
|
|
(this->_temporaryeffects)._effects._capacity = (void *)0x0;
|
|
(this->_temporaryeffects)._cacheFlags = 0;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 0;
|
|
(this->_temporaryeffects)._disabled = 0;
|
|
(this->_temporaryeffects)._player = this;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
|
|
remaining = 4;
|
|
activeDesc = this->_activeDesc;
|
|
do {
|
|
activeDesc->_item = 0;
|
|
activeDesc->_unk = 0;
|
|
activeDesc->_charge = 0;
|
|
activeDesc->_batteryCharge = 0;
|
|
activeDesc->_subCharge = 0;
|
|
activeDesc->_timeRechargeCooldown = 0;
|
|
activeDesc->_partialCharge = 0;
|
|
activeDesc->_varData = 0;
|
|
remaining = remaining + -1;
|
|
activeDesc = activeDesc + 1;
|
|
} while (remaining != 0);
|
|
this->_controllerIndex = -1;
|
|
puVar1 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1668)));
|
|
this->_playerIndex = -1;
|
|
this->_glowingHourglassIndex = -1;
|
|
(this->_aimDirection).y = 0.0;
|
|
(this->_aimDirection).x = 0.0;
|
|
(this->_lastDirection).y = 0.0;
|
|
(this->_lastDirection).x = 0.0;
|
|
(this->_movementVector).y = 0.0;
|
|
(this->_movementVector).x = 0.0;
|
|
(this->_tearsOffset).y = 0.0;
|
|
(this->_tearsOffset).x = 0.0;
|
|
(this->_recentMovementVector).y = 0.0;
|
|
(this->_recentMovementVector).x = 0.0;
|
|
(this->_lastVelocity).y = 0.0;
|
|
(this->_lastVelocity).x = 0.0;
|
|
*GHIDRA_CAST<undefined4 *>(puVar1) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x166c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1670)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1674)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1678)))) = 0;
|
|
containerProxy = operator_new(8);
|
|
containerProxy[1] = 0;
|
|
*GHIDRA_CAST<int **>(puVar1) = containerProxy;
|
|
*containerProxy = GHIDRA_INT(puVar1);
|
|
(this->_lastDamageSource)._type = 0;
|
|
(this->_lastDamageSource)._variant = 0;
|
|
(this->_lastDamageSource)._spawnerType = 0;
|
|
(this->_lastDamageSource)._spawnerVariant = 0;
|
|
(this->_lastDamageSource)._position.x = g_vectorZero.x;
|
|
(this->_lastDamageSource)._position.y = g_vectorZero.y;
|
|
(this->_lastDamageSource)._velocity.x = g_vectorZero.x;
|
|
(this->_lastDamageSource)._velocity.y = g_vectorZero.y;
|
|
(this->_lastDamageSource)._flags = 0;
|
|
(this->_lastDamageSource)._entity = (void *)0x0;
|
|
(this->_collectibleCounts)._begin = (void *)0x0;
|
|
(this->_collectibleCounts)._end = (void *)0x0;
|
|
(this->_collectibleCounts)._capacity = (void *)0x0;
|
|
(this->_pillEffectUses)._begin = (void *)0x0;
|
|
(this->_pillEffectUses)._end = (void *)0x0;
|
|
(this->_pillEffectUses)._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e4)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e8)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16ec)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16f0)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16f4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16f8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16fc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1700)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1704)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1708)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x170c)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1710)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1714)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1718)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x171c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1720)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1724)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1728)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x172c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1730)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1734)))) = 0;
|
|
(this->_levelEffectItems)._begin = (void *)0x0;
|
|
(this->_levelEffectItems)._end = (void *)0x0;
|
|
(this->_levelEffectItems)._capacity = (void *)0x0;
|
|
(this->_smeltedTrinkets)._begin = (void *)0x0;
|
|
(this->_smeltedTrinkets)._end = (void *)0x0;
|
|
(this->_smeltedTrinkets)._capacity = (void *)0x0;
|
|
(this->_voidedCollectibles)._begin = (void *)0x0;
|
|
(this->_voidedCollectibles)._end = (void *)0x0;
|
|
(this->_voidedCollectibles)._capacity = (void *)0x0;
|
|
(this->_voidedPassives)._begin = (void *)0x0;
|
|
(this->_voidedPassives)._end = (void *)0x0;
|
|
(this->_voidedPassives)._capacity = (void *)0x0;
|
|
(this->_collectibleRNGs)._begin = (void *)0x0;
|
|
(this->_collectibleRNGs)._end = (void *)0x0;
|
|
(this->_collectibleRNGs)._capacity = (void *)0x0;
|
|
(this->_trinketRNGs)._begin = (void *)0x0;
|
|
(this->_trinketRNGs)._end = (void *)0x0;
|
|
(this->_trinketRNGs)._capacity = (void *)0x0;
|
|
(this->_pillRNGs)._begin = (void *)0x0;
|
|
(this->_pillRNGs)._end = (void *)0x0;
|
|
(this->_pillRNGs)._capacity = (void *)0x0;
|
|
(this->_cardRNGs)._begin = (void *)0x0;
|
|
(this->_cardRNGs)._end = (void *)0x0;
|
|
(this->_cardRNGs)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x17;
|
|
this->_playerFormsRewarded = 0;
|
|
remaining = 4;
|
|
(this->_footprintColor1)._tint[0] = 1.0;
|
|
(this->_footprintColor1)._tint[1] = 1.0;
|
|
(this->_footprintColor1)._tint[2] = 1.0;
|
|
(this->_footprintColor1)._tint[3] = 1.0;
|
|
(this->_footprintColor1)._colorize[0] = 0.0;
|
|
(this->_footprintColor1)._colorize[1] = 0.0;
|
|
(this->_footprintColor1)._colorize[2] = 0.0;
|
|
(this->_footprintColor1)._colorize[3] = 0.0;
|
|
(this->_footprintColor1)._offset[0] = 0.0;
|
|
(this->_footprintColor1)._offset[1] = 0.0;
|
|
(this->_footprintColor1)._offset[2] = 0.0;
|
|
(this->_footprintColor2)._tint[0] = 1.0;
|
|
(this->_footprintColor2)._tint[1] = 1.0;
|
|
(this->_footprintColor2)._tint[2] = 1.0;
|
|
(this->_footprintColor2)._tint[3] = 1.0;
|
|
(this->_footprintColor2)._colorize[0] = 0.0;
|
|
(this->_footprintColor2)._colorize[1] = 0.0;
|
|
(this->_footprintColor2)._colorize[2] = 0.0;
|
|
(this->_footprintColor2)._colorize[3] = 0.0;
|
|
(this->_footprintColor2)._offset[0] = 0.0;
|
|
(this->_footprintColor2)._offset[1] = 0.0;
|
|
(this->_footprintColor2)._offset[2] = 0.0;
|
|
(this->_friendBallEnemy)._type = 0;
|
|
(this->_friendBallEnemy)._variant = 0;
|
|
(this->_friendBallEnemy)._subtype = 0;
|
|
(this->_friendBallEnemy)._championId = -1;
|
|
(this->_friendBallEnemy)._health = 0.0;
|
|
(this->_friendBallEnemy)._maxHealth = 0.0;
|
|
(this->_friendBallEnemy)._playerControlled = 0;
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1af0))));
|
|
do {
|
|
puVar2[1] = 0;
|
|
*puVar2 = 0;
|
|
remaining = remaining + -1;
|
|
puVar2 = puVar2 + 2;
|
|
} while (remaining != 0);
|
|
(this->_moveToTarget).y = 0.0;
|
|
(this->_moveToTarget).x = 0.0;
|
|
FUN_008391a0();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x18;
|
|
FUN_008391a0();
|
|
(this->_movingBoxContents)._begin = (void *)0x0;
|
|
(this->_movingBoxContents)._end = (void *)0x0;
|
|
(this->_movingBoxContents)._capacity = (void *)0x0;
|
|
this->_subPlayer = 0;
|
|
(this->_pendingWisps)._begin = (void *)0x0;
|
|
(this->_pendingWisps)._end = (void *)0x0;
|
|
(this->_pendingWisps)._capacity = (void *)0x0;
|
|
(this->_history)._historyItems._begin = (void *)0x0;
|
|
(this->_history)._historyItems._capacity = (void *)0x0;
|
|
(this->_history)._isLocked = 0;
|
|
(this->_history)._player = this;
|
|
(this->_history)._historyItems._end = (void *)0x0;
|
|
this->_inventory[0] = -1;
|
|
this->_inventory[1] = -1;
|
|
this->_inventory[2] = -1;
|
|
this->_inventory[3] = -1;
|
|
this->_inventory[4] = -1;
|
|
this->_inventory[5] = -1;
|
|
this->_inventory[6] = -1;
|
|
this->_inventory[7] = -1;
|
|
this->_inventory[8] = -1;
|
|
this->_inventory[9] = -1;
|
|
this->_inventory[10] = -1;
|
|
this->_inventory[0xb] = -1;
|
|
this->_inventory[0xc] = -1;
|
|
this->_inventory[0xd] = -1;
|
|
this->_inventory[0xe] = -1;
|
|
this->_inventory[0xf] = -1;
|
|
(this->_contactHitList)._begin = (void *)0x0;
|
|
(this->_contactHitList)._end = (void *)0x0;
|
|
(this->_contactHitList)._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e50)))) = 0;
|
|
this->_userProfile = KAGE::System::UserProfile::vftable;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1e;
|
|
deque = &this->_afterImageFrames;
|
|
deque->_proxy = (void *)0x0;
|
|
(this->_afterImageFrames)._map = (void *)0x0;
|
|
(this->_afterImageFrames)._mapSize = 0;
|
|
(this->_afterImageFrames)._offset = 0;
|
|
(this->_afterImageFrames)._size = 0;
|
|
containerProxy = operator_new(8);
|
|
containerProxy[1] = 0;
|
|
deque->_proxy = containerProxy;
|
|
*containerProxy = GHIDRA_INT(deque);
|
|
this->_twinPlayer = (EntityPtr)0x0;
|
|
this->_backupPlayer = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e84)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x21;
|
|
deque = &this->_echoChamberItems;
|
|
this->_marsUnk1 = 0x5a;
|
|
this->_marsCooldown = 0;
|
|
this->_marsUnk2 = -1;
|
|
this->_marsUnkBool = 1;
|
|
(this->_forgottenBodyPos).y = 0.0;
|
|
(this->_forgottenBodyPos).x = 0.0;
|
|
deque->_proxy = (void *)0x0;
|
|
(this->_echoChamberItems)._map = (void *)0x0;
|
|
(this->_echoChamberItems)._mapSize = 0;
|
|
(this->_echoChamberItems)._offset = 0;
|
|
(this->_echoChamberItems)._size = 0;
|
|
containerProxy = operator_new(8);
|
|
containerProxy[1] = 0;
|
|
deque->_proxy = containerProxy;
|
|
*containerProxy = GHIDRA_INT(deque);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x22;
|
|
(this->_suplexTargetPos).y = 0.0;
|
|
(this->_suplexTargetPos).x = 0.0;
|
|
(this->_suplexLandPos).y = 0.0;
|
|
(this->_suplexLandPos).x = 0.0;
|
|
this->_bagOfCraftingOutput = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f50)))) = 0xffffffff;
|
|
(this->_itemWispsList)._head = (void *)0x0;
|
|
(this->_itemWispsList)._size = 0;
|
|
sentinelNode = operator_new(0x18);
|
|
*(void **)sentinelNode = sentinelNode;
|
|
*(void **)(GHIDRA_CAST<char *>(sentinelNode) + 4) = sentinelNode;
|
|
*(void **)(GHIDRA_CAST<char *>(sentinelNode) + 8) = sentinelNode;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(sentinelNode) + 0xc)) = 0x101;
|
|
(this->_itemWispsList)._head = sentinelNode;
|
|
(this->_itemCards)._begin = (void *)0x0;
|
|
(this->_itemCards)._end = (void *)0x0;
|
|
(this->_itemCards)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x24;
|
|
(this->_roomTemporaryCollectibles)._head = (void *)0x0;
|
|
(this->_roomTemporaryCollectibles)._size = 0;
|
|
sentinelNode = operator_new(0x18);
|
|
*(void **)sentinelNode = sentinelNode;
|
|
*(void **)(GHIDRA_CAST<char *>(sentinelNode) + 4) = sentinelNode;
|
|
*(void **)(GHIDRA_CAST<char *>(sentinelNode) + 8) = sentinelNode;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(sentinelNode) + 0xc)) = 0x101;
|
|
(this->_roomTemporaryCollectibles)._head = sentinelNode;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x25;
|
|
proceduralItemIds = &(this->_proceduralItems)._itemIds;
|
|
proceduralItemIds->_head = (void *)0x0;
|
|
(this->_proceduralItems)._itemIds._size = 0;
|
|
sentinelNode = operator_new(0x18);
|
|
*(void **)sentinelNode = sentinelNode;
|
|
*(void **)(GHIDRA_CAST<char *>(sentinelNode) + 4) = sentinelNode;
|
|
*(void **)(GHIDRA_CAST<char *>(sentinelNode) + 8) = sentinelNode;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(sentinelNode) + 0xc)) = 0x101;
|
|
proceduralItemIds->_head = sentinelNode;
|
|
(this->_extraCollectibleCounts)._begin = (void *)0x0;
|
|
(this->_extraCollectibleCounts)._end = (void *)0x0;
|
|
(this->_extraCollectibleCounts)._capacity = (void *)0x0;
|
|
(this->_extraTrinketCounts)._begin = (void *)0x0;
|
|
(this->_extraTrinketCounts)._end = (void *)0x0;
|
|
(this->_extraTrinketCounts)._capacity = (void *)0x0;
|
|
(this->_proceduralItems)._player = (void *)0x0;
|
|
(this->_darkArtsHitList)._begin = (void *)0x0;
|
|
(this->_darkArtsHitList)._end = (void *)0x0;
|
|
(this->_darkArtsHitList)._capacity = (void *)0x0;
|
|
this->_shadowImage[0] = 0;
|
|
this->_shadowImage[1] = 0;
|
|
this->_shadowImage[2] = 0;
|
|
this->_shadowImage[3] = 0;
|
|
this->_shadowImage[4] = 0;
|
|
this->_shadowImage[5] = 0;
|
|
this->_shadowImage[6] = 0;
|
|
this->_shadowImage[7] = 0;
|
|
(this->_consumablesBackup).coins = 0;
|
|
(this->_consumablesBackup).keys = 0;
|
|
(this->_consumablesBackup).bombs = 0;
|
|
(this->_consumablesBackup).goldkey = 0;
|
|
(this->_consumablesBackup).goldbomb = 0;
|
|
(this->_consumablesBackup).soulcharges = 0;
|
|
(this->_consumablesBackup).gigabombs = 0;
|
|
(this->_consumablesBackup).poopmana = 0;
|
|
(this->_consumablesBackup).bloodcharges = 0;
|
|
(this->_curseMistFamiliars)._begin = (void *)0x0;
|
|
(this->_curseMistFamiliars)._end = (void *)0x0;
|
|
(this->_curseMistFamiliars)._capacity = (void *)0x0;
|
|
(this->_minecartOffset).y = 0.0;
|
|
(this->_minecartOffset).x = 0.0;
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a8)))) = 1;
|
|
this->_playerHUD = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20d8)))) = 0;
|
|
(this->_greedResetCollectibles)._begin = (void *)0x0;
|
|
(this->_greedResetCollectibles)._end = (void *)0x0;
|
|
(this->_greedResetCollectibles)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x2b;
|
|
input_state_reset(&this->_unlistedRestoreState);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x2c);
|
|
this->_replacedPlayer = (void *)0x0;
|
|
(GHIDRA_CAST<OnlineEmotes *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26d8))))))->OnlineEmotes::constructor();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2eec)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) = 1;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) = 0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007579c0
|
|
void Entity_Player::ResetColor()
|
|
{
|
|
ColorMod *spriteColor;
|
|
undefined4 local_30 [11];
|
|
float colorizeA;
|
|
float colorizeB;
|
|
float colorizeG;
|
|
float colorizeR;
|
|
float offsetB;
|
|
float tintA;
|
|
float tintB;
|
|
float tintG;
|
|
float tintR;
|
|
|
|
tintR = (this->_color)._tint[0];
|
|
tintG = (this->_color)._tint[1];
|
|
tintB = (this->_color)._tint[2];
|
|
tintA = (this->_color)._tint[3];
|
|
offsetB = (this->_color)._offset[2];
|
|
colorizeR = (this->_color)._colorize[0];
|
|
colorizeG = (this->_color)._colorize[1];
|
|
colorizeB = (this->_color)._colorize[2];
|
|
colorizeA = (this->_color)._colorize[3];
|
|
spriteColor = &(this->_sprite)._color;
|
|
if (spriteColor != GHIDRA_CAST<ColorMod *>(local_30)) {
|
|
*GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset) = *GHIDRA_CAST<undefined8 *>((this->_color)._offset);
|
|
spriteColor->_tint[0] = tintR;
|
|
(this->_sprite)._color._tint[1] = tintG;
|
|
(this->_sprite)._color._tint[2] = tintB;
|
|
(this->_sprite)._color._tint[3] = tintA;
|
|
(this->_sprite)._color._offset[2] = offsetB;
|
|
(this->_sprite)._color._colorize[0] = colorizeR;
|
|
(this->_sprite)._color._colorize[1] = colorizeG;
|
|
(this->_sprite)._color._colorize[2] = colorizeB;
|
|
(this->_sprite)._color._colorize[3] = colorizeA;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00757a40
|
|
void Entity_Player::ClearReferences()
|
|
{
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearReferences();
|
|
release_weapons_and_effects(this,0);
|
|
return;
|
|
}
|
|
|
|
// 00757ab0
|
|
undefined1 Entity_Player::CanShutDoors()
|
|
{
|
|
return CONCAT31((int3)(GHIDRA_UINT(g_game) >> 8),1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager));
|
|
}
|
|
|
|
// 00757ac0
|
|
void Entity_Player::release_weapons_and_effects(byte isRemoveEntities)
|
|
{
|
|
undefined1 *puVar1;
|
|
Entity_Player *player;
|
|
undefined4 *playerSlot;
|
|
EntityPtr EVar2;
|
|
void *playerListEnd;
|
|
EntityPtr *playerListBegin;
|
|
int weaponsLeft;
|
|
Game *game;
|
|
void **weaponSlot;
|
|
PlayerManager *playerManager;
|
|
EntityPtr *pEStack_14;
|
|
Vector throwVelocity;
|
|
int *ownedPlayer;
|
|
|
|
weaponsLeft = 4;
|
|
weaponSlot = this->_weapons;
|
|
do {
|
|
weaponSlot = weaponSlot + 1;
|
|
if (*weaponSlot != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*weaponSlot) + 0x14))();
|
|
if (*weaponSlot != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(*weaponSlot))(1);
|
|
}
|
|
*weaponSlot = (void *)0x0;
|
|
}
|
|
weaponsLeft = weaponsLeft + -1;
|
|
} while (weaponsLeft != 0);
|
|
if (this->_weapons[0] != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_weapons[0]) + 0x14))();
|
|
if (this->_weapons[0] != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(this->_weapons[0]))(1);
|
|
}
|
|
this->_weapons[0] = (void *)0x0;
|
|
}
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1424)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1424)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1424)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1424))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1424)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1420)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1420)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1420)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1420))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1420)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c)))) = 0;
|
|
if ((isRemoveEntities != 0) && (GHIDRA_CAST<int *>(this->_tractorBeam) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_tractorBeam) + 0x28))();
|
|
}
|
|
if (this->_tractorBeam != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_tractorBeam);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_tractorBeam = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x143c)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x143c)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x143c)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x143c))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x143c)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1440)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1440)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1440)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1440))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1440)))) = 0;
|
|
if ((isRemoveEntities != 0) && (this->_breathOfLifeEffect != (EntityPtr)0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_breathOfLifeEffect) + 0x28))();
|
|
}
|
|
if (this->_breathOfLifeEffect != (EntityPtr)0x0) {
|
|
pEStack_14 = &this->_breathOfLifeEffect;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_breathOfLifeEffect = (EntityPtr)0x0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1448)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1448)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1448)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1448))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1448)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x144c)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x144c)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x144c)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x144c))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x144c)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1450)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1450)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1450)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1450))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1450)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1454)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1454)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1454)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1454))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1454)))) = 0;
|
|
if ((isRemoveEntities != 0) && (this->_megaBlastLaser != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_megaBlastLaser) + 0x28))();
|
|
}
|
|
if (this->_megaBlastLaser != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_megaBlastLaser);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_megaBlastLaser = (void *)0x0;
|
|
if ((isRemoveEntities != 0) && (this->_markedTarget != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_markedTarget) + 0x28))();
|
|
}
|
|
if (this->_markedTarget != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_markedTarget);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_markedTarget = (void *)0x0;
|
|
if ((isRemoveEntities != 0) && (this->_forgottenBody != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_forgottenBody) + 0x28))();
|
|
}
|
|
if (this->_forgottenBody != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_forgottenBody);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_forgottenBody = (void *)0x0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e78)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e78)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e78)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e78))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e78)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e7c)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e7c)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e7c)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e7c))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e7c)))) = 0;
|
|
if ((isRemoveEntities != 0) && (this->_salvationEffect != (EntityPtr)0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_salvationEffect) + 0x28))();
|
|
}
|
|
if (this->_salvationEffect != (EntityPtr)0x0) {
|
|
pEStack_14 = &this->_salvationEffect;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_salvationEffect = (EntityPtr)0x0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e88)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e88)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e88)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e88))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e88)))) = 0;
|
|
if ((isRemoveEntities != 0) && (this->_astralProjectionBody != (EntityPtr)0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_astralProjectionBody) + 0x28))();
|
|
}
|
|
if (this->_astralProjectionBody != (EntityPtr)0x0) {
|
|
pEStack_14 = &this->_astralProjectionBody;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_astralProjectionBody = (EntityPtr)0x0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f00)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f00)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f00)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f00))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f00)))) = 0;
|
|
if ((isRemoveEntities != 0) && (this->_montezumaLaser != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_montezumaLaser) + 0x28))();
|
|
}
|
|
if (this->_montezumaLaser != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_montezumaLaser);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_montezumaLaser = (void *)0x0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f04)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f04)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f04)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f04))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f04)))) = 0;
|
|
if ((isRemoveEntities != 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)))) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0))));
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)))) = 0;
|
|
if ((isRemoveEntities != 0) && (this->_darkArtsLastSnare != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_darkArtsLastSnare) + 0x28))();
|
|
}
|
|
if (this->_darkArtsLastSnare != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_darkArtsLastSnare);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_darkArtsLastSnare = (void *)0x0;
|
|
if ((isRemoveEntities != 0) && (this->_darkEsau != (EntityPtr)0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_darkEsau) + 0x28))();
|
|
}
|
|
if (this->_darkEsau != (EntityPtr)0x0) {
|
|
pEStack_14 = &this->_darkEsau;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_darkEsau = (EntityPtr)0x0;
|
|
puVar1 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e84)));
|
|
if (*GHIDRA_CAST<int *>(puVar1) != 0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(puVar1);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
*GHIDRA_CAST<undefined4 *>(puVar1) = 0;
|
|
}
|
|
(this->_moveToTarget).x = g_vectorZero.x;
|
|
(this->_moveToTarget).y = g_vectorZero.y;
|
|
if (isRemoveEntities != 0) {
|
|
throwVelocity.x = (this->_velocity).x * 0.1;
|
|
throwVelocity.y = (this->_velocity).y * 0.1;
|
|
ThrowHeldEntity(this,&throwVelocity);
|
|
}
|
|
if (this->_heldEntity != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&this->_heldEntity);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
this->_heldEntity = (void *)0x0;
|
|
if (this->_replacedPlayer == (void *)0x0) {
|
|
if (((this->_valid != 0) && (ownedPlayer = GHIDRA_CAST<int *>(this->_subPlayer), ownedPlayer != GHIDRA_CAST<int *>(0x0)))
|
|
&& ((char)ownedPlayer[0x5c] == '\0')) {
|
|
(**(code **)(*ownedPlayer + 0x44))();
|
|
if (GHIDRA_CAST<undefined4 *>(this->_subPlayer) != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(this->_subPlayer))(1);
|
|
}
|
|
this->_subPlayer = 0;
|
|
}
|
|
ownedPlayer = this->_backupPlayer;
|
|
if ((ownedPlayer != GHIDRA_CAST<int *>(0x0)) && ((char)ownedPlayer[0x5c] == '\0')) {
|
|
(**(code **)(*ownedPlayer + 0x44))();
|
|
if (this->_backupPlayer != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(this->_backupPlayer))(1);
|
|
}
|
|
this->_backupPlayer = (void *)0x0;
|
|
}
|
|
if (((isRemoveEntities != 0) && (EVar2 = this->_twinPlayer, EVar2 != (EntityPtr)0x0)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar2) + 0x161c)) == -1 ||
|
|
((this->_playerIndex <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar2) + 0x161c)) || (EVar2 == (EntityPtr)this)))))) {
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(GHIDRA_CAST<Entity_Player *>(EVar2),0);
|
|
}
|
|
if (this->_twinPlayer != (EntityPtr)0x0) {
|
|
pEStack_14 = &this->_twinPlayer;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
this->_twinPlayer = (EntityPtr)0x0;
|
|
}
|
|
if (isRemoveEntities != 0) {
|
|
playerManager = &g_game->_playerManager;
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin)
|
|
>> 2 != 0) {
|
|
do {
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
game = g_game;
|
|
}
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (pEStack_14 < GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(playerListEnd) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + GHIDRA_INT(pEStack_14);
|
|
}
|
|
player = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
|
EVar2 = player->_parent;
|
|
if ((EVar2 == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar2) + 0x28)) != 1)) {
|
|
if (player->_variant == 1) {
|
|
playerListBegin = (game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(playerListBegin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n")
|
|
);
|
|
playerListBegin = (game->_playerManager)._playerList._begin;
|
|
game = g_game;
|
|
}
|
|
EVar2 = *playerListBegin;
|
|
}
|
|
else {
|
|
EVar2 = (EntityPtr)0x0;
|
|
}
|
|
}
|
|
if ((EVar2 == (EntityPtr)this) && (player->_parent != (EntityPtr)0x0)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::RemoveCoPlayer(player,0);
|
|
game = g_game;
|
|
}
|
|
playerManager = &game->_playerManager;
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEStack_14)) + 0x1))));
|
|
} while (pEStack_14 <
|
|
(undefined1 *)
|
|
(GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2));
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007584b0
|
|
uint Entity_Player::InvalidateCoPlayerItems()
|
|
{
|
|
int *playerSlot;
|
|
Entity_Player *ownerPlayer;
|
|
uint playerCount;
|
|
void *playerListEnd;
|
|
uint i;
|
|
PlayerManager *playerManager;
|
|
Game *game;
|
|
int otherPlayer;
|
|
|
|
i = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
playerCount = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2
|
|
!= 0) {
|
|
do {
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
game = g_game;
|
|
}
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (i < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + i;
|
|
}
|
|
otherPlayer = *playerSlot;
|
|
ownerPlayer = *GHIDRA_CAST<Entity_Player **>((otherPlayer + 0x3bc));
|
|
if ((ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) || (ownerPlayer->_type != 1)) {
|
|
if (*GHIDRA_CAST<int *>((otherPlayer + 0x2c)) == 1) {
|
|
playerSlot = (game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(playerSlot) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerSlot = (game->_playerManager)._playerList._begin;
|
|
game = g_game;
|
|
}
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
|
}
|
|
else {
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
}
|
|
if (ownerPlayer == this) {
|
|
*GHIDRA_CAST<undefined1 *>((otherPlayer + 0x131c)) = 1;
|
|
}
|
|
playerManager = &game->_playerManager;
|
|
i = i + 1;
|
|
playerCount = GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2;
|
|
} while (i < playerCount);
|
|
}
|
|
return playerCount;
|
|
}
|
|
|
|
// 007585b0
|
|
void Entity_Player::cycle_spectate_target()
|
|
{
|
|
byte isValidTarget;
|
|
EntityPtr nextTarget;
|
|
EntityPtr extraout_ECX;
|
|
EntityPtr extraout_ECX_00;
|
|
EntityPtr extraout_ECX_01;
|
|
EntityPtr unused;
|
|
EntityPtr extraout_ECX_02;
|
|
EntityPtr EVar1;
|
|
EntityPtr candidate;
|
|
uint uVar2;
|
|
float fVar3;
|
|
EntityPtr local_48;
|
|
Entity_Player *local_44;
|
|
EntityPtr local_40;
|
|
char isPastCurrent;
|
|
int actionOrder [13];
|
|
Manager *manager;
|
|
|
|
actionOrder[0xc] = __security_cookie ^ GHIDRA_UINT((actionOrder + 0xd));
|
|
local_44 = this;
|
|
isValidTarget = input_is_action_triggered(g_manager,0xd,this->_controllerIndex,GHIDRA_CAST<Entity *>(0x0),0);
|
|
unused = extraout_ECX;
|
|
if (isValidTarget != 0) {
|
|
unused = (EntityPtr)&this->_target;
|
|
isPastCurrent = *GHIDRA_CAST<EntityPtr *>(unused) == (EntityPtr)0x0;
|
|
local_48 = (EntityPtr)g_game->_room;
|
|
uVar2 = 0;
|
|
EVar1 = (EntityPtr)0x0;
|
|
local_40 = unused;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_48) + 0x1264)) != 0) {
|
|
do {
|
|
candidate = *GHIDRA_CAST<EntityPtr *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_48) + 0x125c)) + uVar2 * 4));
|
|
if ((candidate == (EntityPtr)0x0) ||
|
|
(((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(candidate) + 0x28)) != 1)) &&
|
|
(0x3dd < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(candidate) + 0x28)) - 10U)))) {
|
|
candidate = (EntityPtr)0x0;
|
|
}
|
|
nextTarget = EVar1;
|
|
if (candidate == *GHIDRA_CAST<EntityPtr *>(unused)) {
|
|
isPastCurrent = '\x01';
|
|
}
|
|
else if (candidate != (EntityPtr)0x0) {
|
|
isValidTarget = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(candidate))))->Entity::is_valid_target();
|
|
if (isValidTarget != 0) {
|
|
nextTarget = candidate;
|
|
if (EVar1 != (EntityPtr)0x0) {
|
|
nextTarget = EVar1;
|
|
}
|
|
if (isPastCurrent != '\0') goto LAB_00758685;
|
|
}
|
|
unused = local_40;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
EVar1 = nextTarget;
|
|
} while (uVar2 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_48) + 0x1264)));
|
|
candidate = nextTarget;
|
|
if (nextTarget != (EntityPtr)0x0) {
|
|
LAB_00758685:
|
|
EVar1 = local_40;
|
|
this = local_44;
|
|
unused = *GHIDRA_CAST<EntityPtr *>(local_40);
|
|
if (candidate != unused) {
|
|
fVar3 = 0.0;
|
|
if (unused == (EntityPtr)0x0) {
|
|
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(candidate) + 0x340));
|
|
(local_44->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(candidate) + 0x33c));
|
|
(local_44->_pos).y = fVar3;
|
|
(local_44->_velocity).x = g_vectorZero.x;
|
|
(local_44->_velocity).y = g_vectorZero.y;
|
|
fVar3 = 1.0;
|
|
}
|
|
else if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(unused) + 0x28)) == 1)
|
|
) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(unused) + 0x28)) - 10U < 0x3de)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(unused) + 0xf1c)) = -1;
|
|
}
|
|
(local_44->_targetPosition).x = fVar3;
|
|
if (*GHIDRA_CAST<int *>(local_40) != 0) {
|
|
local_48 = local_40;
|
|
std::multiset<unsigned_int>::erase(&local_48);
|
|
}
|
|
*GHIDRA_CAST<EntityPtr *>(EVar1) = candidate;
|
|
std::multiset<unsigned_int>::insert(EVar1);
|
|
if ((g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) ||
|
|
(isValidTarget =
|
|
NetplayManager::IsIdxLocalPlayer
|
|
(&g_manager->_netplayManager,this->_controllerIndex),
|
|
unused = extraout_ECX_00, isValidTarget != 0)) {
|
|
manager = g_manager;
|
|
local_40 = (EntityPtr)0xc3;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_40));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_40),1.0,2,0,1.0,0.0);
|
|
unused = extraout_ECX_01;
|
|
}
|
|
goto LAB_007587aa;
|
|
}
|
|
}
|
|
}
|
|
this = local_44;
|
|
}
|
|
LAB_007587aa:
|
|
EVar1 = this->_target;
|
|
if (((EVar1 != (EntityPtr)0x0) &&
|
|
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0x28)) == 1)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0x28)) - 10U < 0x3de)))) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0xf1c)) == -1)) {
|
|
uVar2 = 0;
|
|
actionOrder[0] = 0;
|
|
actionOrder[1] = 2;
|
|
actionOrder[2] = 1;
|
|
actionOrder[3] = 3;
|
|
actionOrder[4] = 4;
|
|
actionOrder[5] = 6;
|
|
actionOrder[6] = 5;
|
|
actionOrder[7] = 7;
|
|
actionOrder[8] = 9;
|
|
actionOrder[9] = 10;
|
|
actionOrder[10] = 8;
|
|
actionOrder[0xb] = 0xb;
|
|
while (isValidTarget =
|
|
input_is_action_pressed
|
|
(actionOrder[uVar2],this->_controllerIndex,GHIDRA_CAST<Entity *>(0x0),GHIDRA_INT(unused)),
|
|
isValidTarget == 0) {
|
|
uVar2 = uVar2 + 1;
|
|
unused = extraout_ECX_02;
|
|
if (0xb < uVar2) {
|
|
return;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0xf1c)) = this->_controllerIndex;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00758850
|
|
void Entity_Player::trigger_max_hearts_removed(int removed)
|
|
{
|
|
int *strengthRemovedPtr;
|
|
int empressRemoved;
|
|
int heartsRemoved;
|
|
int empressHearts;
|
|
int *strengthHearts;
|
|
|
|
empressHearts = this->_reverseEmpressMaxHearts;
|
|
heartsRemoved = removed / 2;
|
|
empressRemoved = empressHearts;
|
|
if (heartsRemoved < empressHearts) {
|
|
empressRemoved = heartsRemoved;
|
|
}
|
|
this->_reverseEmpressMaxHearts = empressHearts - empressRemoved;
|
|
strengthHearts = &this->_strengthMaxHearts;
|
|
removed = heartsRemoved - empressRemoved;
|
|
strengthRemovedPtr = &removed;
|
|
if (*strengthHearts <= heartsRemoved - empressRemoved) {
|
|
strengthRemovedPtr = strengthHearts;
|
|
}
|
|
*strengthHearts = *strengthHearts - *strengthRemovedPtr;
|
|
return;
|
|
}
|
|
|
|
// 007588a0
|
|
void Entity_Player::AddMaxHearts(int amount, byte ignoreKeeper)
|
|
{
|
|
byte bVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
Entity_Player *this_00;
|
|
Entity_Player *this_01;
|
|
int clampedSoulHearts;
|
|
int newMaxHearts;
|
|
EntityPtr linkedPlayer;
|
|
|
|
iVar2 = this->_playerType;
|
|
while ((iVar2 == 0x28 &&
|
|
(linkedPlayer = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)), linkedPlayer != (EntityPtr)0x0))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(linkedPlayer) + 0x13c0));
|
|
this = GHIDRA_CAST<Entity_Player *>(linkedPlayer);
|
|
}
|
|
iVar2 = GetHealthType(this);
|
|
if (iVar2 != 2) {
|
|
iVar2 = GetHealthType(this_00);
|
|
if (iVar2 == 1) {
|
|
bVar1 = HasCollectible(this_01,0x26b,0);
|
|
if (((bVar1 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 4)) && (0 < amount)) {
|
|
AddSoulHearts(this,amount * 2,0);
|
|
return;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0xc) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x18)) {
|
|
AddBlackHearts(this,amount);
|
|
return;
|
|
}
|
|
AddSoulHearts(this,amount,0);
|
|
return;
|
|
}
|
|
iVar2 = GetHealthType(this_01);
|
|
if (iVar2 == 4) {
|
|
AddBoneHearts(this,amount / 2);
|
|
return;
|
|
}
|
|
iVar2 = GetHeartLimit(this,ignoreKeeper);
|
|
if (amount < 0) {
|
|
trigger_max_hearts_removed(this,-amount);
|
|
}
|
|
if (ignoreKeeper == 0) {
|
|
amount = scale_for_hard_difficulty(amount);
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
if (iVar2 < iVar3 + amount) {
|
|
trigger_max_hearts_removed(this,(iVar3 - iVar2) + amount);
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
}
|
|
newMaxHearts = amount + iVar3;
|
|
if (iVar2 < amount + iVar3) {
|
|
newMaxHearts = iVar2;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) = newMaxHearts;
|
|
if (newMaxHearts < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1340)) = 0;
|
|
AddBoneHearts(this,newMaxHearts / 2);
|
|
newMaxHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
}
|
|
iVar3 = GetEffectiveMaxHearts(this);
|
|
if (iVar2 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + iVar3) {
|
|
clampedSoulHearts = 0;
|
|
if (0 < iVar2 - iVar3) {
|
|
clampedSoulHearts = iVar2 - iVar3;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) = clampedSoulHearts;
|
|
}
|
|
if (iVar3 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) = iVar3;
|
|
}
|
|
if (0xd < newMaxHearts) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(1);
|
|
}
|
|
UpdateBlackHeartMask(this);
|
|
update_greeds_gullet(this);
|
|
UpdateHeartDependentEffects(this);
|
|
ClampGoldenHearts(this,0);
|
|
update_bone_hearts(this);
|
|
ClampHeartsToLimit(this,1,0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00758a70
|
|
void Entity_Player::AddHearts(int hearts, byte unk, byte unk2)
|
|
{
|
|
int oldRedHearts;
|
|
Entity_Player *this_00;
|
|
Entity_Player *this_01;
|
|
int oldRedHearts;
|
|
|
|
while( true ) {
|
|
while( true ) {
|
|
if ((0 < hearts) && (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager))) {
|
|
hearts = hearts << 3;
|
|
}
|
|
oldRedHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0));
|
|
if ((oldRedHearts != 0x28) || (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) == (EntityPtr)0x0)) break;
|
|
unk2 = 0;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
if ((0 < hearts) && ((unk == 0 && (g_game->_challenge == 0x19)))) {
|
|
return;
|
|
}
|
|
if (oldRedHearts != 0x11) break;
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)) == (EntityPtr)0x0) goto LAB_00758b08;
|
|
unk2 = 0;
|
|
unk = 0;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)));
|
|
}
|
|
if (oldRedHearts == 0x24) {
|
|
AddBloodCharge(this,hearts);
|
|
return;
|
|
}
|
|
if (((oldRedHearts == 0x16) && (unk == 0)) && (0 < hearts)) {
|
|
hearts = hearts * 2;
|
|
}
|
|
LAB_00758b08:
|
|
oldRedHearts = GetHealthType(this);
|
|
if ((oldRedHearts != 1) && (oldRedHearts = GetHealthType(this_00), oldRedHearts != 2)) {
|
|
oldRedHearts = GetHealthType(this_01);
|
|
if (oldRedHearts == 3) {
|
|
oldRedHearts = hearts + 1;
|
|
if (hearts < 1) {
|
|
oldRedHearts = hearts - 1;
|
|
}
|
|
hearts = oldRedHearts - (oldRedHearts >> 0x1f) & 0xfffffffe;
|
|
}
|
|
oldRedHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
oldRedHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2;
|
|
if (oldRedHearts + hearts < oldRedHearts) {
|
|
oldRedHearts = oldRedHearts + hearts;
|
|
}
|
|
if (oldRedHearts < 0) {
|
|
oldRedHearts = 0;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) = oldRedHearts;
|
|
if (0 < hearts) {
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x168)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x168));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x138c)) = 0;
|
|
}
|
|
if (oldRedHearts != oldRedHearts) {
|
|
UpdateHeartDependentEffects(this);
|
|
}
|
|
ClampGoldenHearts(this,unk2);
|
|
update_bone_hearts(this);
|
|
if ((0 < hearts) && (oldRedHearts < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)))) {
|
|
_player_hud_set_heart_anim_state(this);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00758c20
|
|
void Entity_Player::AddEternalHearts(int amount)
|
|
{
|
|
int iVar1;
|
|
int newEternalHearts;
|
|
uint leftoverEternalHearts;
|
|
Entity_Player *this_00;
|
|
Entity_Player *this_01;
|
|
|
|
if (this->_isCoopGhost != 0) {
|
|
RevivePlayerGhost(this);
|
|
return;
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 != 3) {
|
|
iVar1 = GetHealthType(this_00);
|
|
if (iVar1 != 2) {
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
AddMaxHearts(this_01,amount,0);
|
|
AddHearts(this,amount,0,0);
|
|
return;
|
|
}
|
|
newEternalHearts = amount + this->_eternalHearts;
|
|
iVar1 = 0;
|
|
if (0 < newEternalHearts) {
|
|
iVar1 = newEternalHearts;
|
|
}
|
|
this->_eternalHearts = iVar1;
|
|
if (1 < iVar1) {
|
|
FUN_00758bd0();
|
|
AddMaxHearts(this,this->_eternalHearts - (this->_eternalHearts >> 0x1f) & 0xfffffffe,0);
|
|
AddHearts(this,this->_eternalHearts - (this->_eternalHearts >> 0x1f) & 0xfffffffe,0,0);
|
|
leftoverEternalHearts = this->_eternalHearts & 0x80000001;
|
|
if (GHIDRA_INT(leftoverEternalHearts) < 0) {
|
|
leftoverEternalHearts = (leftoverEternalHearts - 1 | 0xfffffffe) + 1;
|
|
}
|
|
this->_eternalHearts = leftoverEternalHearts;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00758d00
|
|
void Entity_Player::AddSoulHearts(int amount, byte unk)
|
|
{
|
|
byte bVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
int heartLimit;
|
|
EntityPtr *hudPlayerSlot;
|
|
Entity_Player *this_00;
|
|
uint uVar4;
|
|
int extraout_EDX;
|
|
int count;
|
|
int extraout_EDX_00;
|
|
int iVar5;
|
|
int *activeCharge;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
do {
|
|
while ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x28 &&
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) != (EntityPtr)0x0))) {
|
|
unk = 0;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x154a)) == '\0') && (game->_isStartingFromState == 0)) &&
|
|
(game->_isRestoringGlowingHourglassState == 0)) && (0 < amount)) {
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasNullEffect(0x66);
|
|
if (bVar1 == 0) {
|
|
LAB_00758d9a:
|
|
uVar4 = 0;
|
|
activeCharge = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x1588));
|
|
do {
|
|
if (activeCharge[-2] == 0x249) {
|
|
iVar3 = GetActiveMaxCharge(this,uVar4);
|
|
iVar2 = *activeCharge;
|
|
if (iVar2 + amount < iVar3) {
|
|
iVar3 = iVar2 + amount;
|
|
}
|
|
iVar5 = 0;
|
|
if (0 < iVar3) {
|
|
iVar5 = iVar3;
|
|
}
|
|
if (iVar5 != iVar2) {
|
|
SetActiveCharge(this,iVar5,uVar4);
|
|
amount = amount + (iVar2 - iVar5);
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
activeCharge = activeCharge + 8;
|
|
} while (uVar4 < 4);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::RemoveNullEffect(0x66,-1);
|
|
iVar2 = amount + -2;
|
|
amount = 0;
|
|
if (0 < iVar2) {
|
|
amount = iVar2;
|
|
}
|
|
if (0 < amount) goto LAB_00758d9a;
|
|
}
|
|
game = g_game;
|
|
}
|
|
iVar2 = GetHealthType(this);
|
|
if (iVar2 == 2) {
|
|
if (extraout_EDX < 1) {
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x134c)) = 1;
|
|
return;
|
|
}
|
|
iVar2 = GetHealthType(this_00);
|
|
if (iVar2 == 3) {
|
|
if (count < 1) {
|
|
return;
|
|
}
|
|
AddBlueFlies(this,(count * 3 + 1) / 2,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),GHIDRA_CAST<Entity *>(0x0));
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x10) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x12) {
|
|
AddSoulCharge(this,count);
|
|
return;
|
|
}
|
|
iVar2 = GetHealthType(this);
|
|
if ((iVar2 == 1) && (extraout_EDX_00 < 0)) {
|
|
trigger_max_hearts_removed(this,-extraout_EDX_00);
|
|
}
|
|
if (1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) {
|
|
ClampHeartsToLimit(this,3,amount);
|
|
return;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c));
|
|
iVar2 = iVar3 + amount;
|
|
iVar5 = 0;
|
|
if (0 < iVar2) {
|
|
iVar5 = iVar2;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) = iVar5;
|
|
heartLimit = GetHeartLimit(this,0);
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2;
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c));
|
|
if (heartLimit < iVar2 + iVar5) {
|
|
iVar5 = heartLimit - iVar2;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) = iVar5;
|
|
}
|
|
if (7 < iVar5) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x50);
|
|
}
|
|
UpdateBlackHeartMask(this);
|
|
ClampGoldenHearts(this,unk);
|
|
update_bone_hearts(this);
|
|
if ((amount < 1) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) < iVar3)) {
|
|
return;
|
|
}
|
|
hudPlayerSlot = GHIDRA_CAST<EntityPtr *>(&g_game->_hud);
|
|
uVar4 = 0;
|
|
do {
|
|
if (*hudPlayerSlot == (EntityPtr)this) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(hudPlayerSlot[3])) + 0x1))) = 4;
|
|
return;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
hudPlayerSlot = hudPlayerSlot + 0x1b7;
|
|
} while (uVar4 < 8);
|
|
return;
|
|
}
|
|
this = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x1d98));
|
|
if ((EntityPtr)this == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
unk = 0;
|
|
} while( true );
|
|
}
|
|
|
|
// 00758f90
|
|
void Entity_Player::AddBlackHearts(int amount)
|
|
{
|
|
int iVar1;
|
|
int heartLimit;
|
|
uint slotParity;
|
|
Entity_Player *this_00;
|
|
int extraout_EDX;
|
|
uint uVar2;
|
|
int iVar3;
|
|
uint uVar4;
|
|
uint local_10;
|
|
int roundingAdjust;
|
|
|
|
while( true ) {
|
|
for (; (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x28 &&
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) != (EntityPtr)0x0));
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)))) {
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 == 2) {
|
|
return;
|
|
}
|
|
if (extraout_EDX != 0x10) break;
|
|
this = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x1d98));
|
|
if ((EntityPtr)this == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 == 3) {
|
|
AddBlueFlies(this_00,(amount * 4 + 1) / 2,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),GHIDRA_CAST<Entity *>(0x0));
|
|
return;
|
|
}
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
ClampHeartsToLimit(this,6,amount);
|
|
return;
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x134c));
|
|
roundingAdjust = 0;
|
|
uVar2 = uVar4 + 1;
|
|
if ((uVar4 & 1) == 0) {
|
|
uVar2 = uVar4;
|
|
}
|
|
local_10 = amount & 1;
|
|
if (((uVar4 & 1) != 0) && (local_10 != 0)) {
|
|
roundingAdjust = -1;
|
|
local_10 = 0;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88));
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
heartLimit = GetHeartLimit(this,0);
|
|
if (GHIDRA_INT((uVar2 + iVar3 + iVar1 * 2)) < heartLimit + -1) {
|
|
iVar1 = GHIDRA_INT((local_10 + uVar2 + amount)) / 2;
|
|
uVar4 = GHIDRA_INT((roundingAdjust + uVar2)) / 2;
|
|
if (GHIDRA_INT(uVar4) < iVar1) {
|
|
uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1350));
|
|
do {
|
|
uVar2 = uVar2 | 1 << (uVar4 & 0x1f);
|
|
uVar4 = uVar4 + 1;
|
|
} while (GHIDRA_INT(uVar4) < iVar1);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1350)) = uVar2;
|
|
}
|
|
}
|
|
else {
|
|
uVar4 = uVar2 - 1;
|
|
local_10 = 0;
|
|
while ((0 < GHIDRA_INT(uVar4) && (uVar2 = uVar2 - 2, GHIDRA_INT(local_10) < amount))) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) < GHIDRA_INT(uVar4)) || (GHIDRA_INT(uVar4) < 1)) {
|
|
LAB_007590f3:
|
|
local_10 = local_10 + 2;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1350)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1350)) | 1 << (GHIDRA_INT(uVar4) / 2 & 0x1fU);
|
|
}
|
|
else {
|
|
slotParity = uVar4 & 0x80000001;
|
|
if (GHIDRA_INT(slotParity) < 0) {
|
|
slotParity = (slotParity - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if ((slotParity != 1) ||
|
|
((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1350)) & 1 << ((byte)(GHIDRA_INT(uVar2) / 2) & 0x1f)) == 0))
|
|
goto LAB_007590f3;
|
|
}
|
|
uVar4 = uVar4 - 2;
|
|
}
|
|
}
|
|
AddSoulHearts(this,amount,0);
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x173)) == '\0')) &&
|
|
(iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194c)), 0 < iVar1)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344))) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
}
|
|
iVar3 = (iVar3 + 1) / 2 + (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + 1) / 2 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88));
|
|
if (iVar3 < iVar1) {
|
|
BreakGoldenHearts(this,iVar1 - iVar3);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194c)) = iVar3;
|
|
}
|
|
}
|
|
update_bone_hearts(this);
|
|
return;
|
|
}
|
|
|
|
// 007591e0
|
|
void Entity_Player::RemoveBlackHeart(int soulHeartIndex)
|
|
{
|
|
if ((soulHeartIndex <= this->_soulHearts) && (-1 < soulHeartIndex)) {
|
|
this->_blackHearts = this->_blackHearts & ~(1 << (GHIDRA_UINT(soulHeartIndex) >> 1 & 0x1f));
|
|
ClampGoldenHearts(this,0);
|
|
update_bone_hearts(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759220
|
|
byte Entity_Player::IsBlackHeart(int heart)
|
|
{
|
|
if ((((this->_soulHearts < heart) || (heart < 1)) || ((heart & 1U) == 0)) ||
|
|
((this->_blackHearts & 1 << ((byte)((heart + -1) / 2) & 0x1f)) == 0)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007592a0
|
|
void Entity_Player::UpdateBlackHeartMask()
|
|
{
|
|
uint uVar1;
|
|
int movedCount;
|
|
uint uVar2;
|
|
uint local_8;
|
|
byte rotateShift;
|
|
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
uVar1 = this->_soulHearts;
|
|
if (uVar1 == 0) {
|
|
this->_blackHearts = 0;
|
|
return;
|
|
}
|
|
movedCount = 0;
|
|
local_8 = GHIDRA_INT((uVar1 + 1)) / 2;
|
|
uVar2 = 0;
|
|
if (local_8 < 0x20) {
|
|
rotateShift = (byte)local_8 & 0x1f;
|
|
uVar1 = 1 << rotateShift | 1U >> 0x20 - rotateShift;
|
|
do {
|
|
if ((this->_blackHearts & uVar1) != 0) {
|
|
uVar2 = uVar2 | 1 << (local_8 & 0x1f);
|
|
movedCount = movedCount + 1;
|
|
}
|
|
uVar1 = uVar1 << 1 | GHIDRA_UINT((GHIDRA_INT(uVar1) < 0));
|
|
local_8 = local_8 + 1;
|
|
} while (local_8 < 0x20);
|
|
uVar1 = this->_soulHearts;
|
|
}
|
|
this->_blackHearts = this->_blackHearts & ~uVar2;
|
|
uVar2 = uVar1;
|
|
local_8 = uVar1;
|
|
while ((0 < GHIDRA_INT(uVar1) && (local_8 = local_8 - 1, 0 < movedCount))) {
|
|
if ((uVar1 & 1) != 0) {
|
|
if (((GHIDRA_INT(uVar2) < GHIDRA_INT(uVar1)) || (uVar1 == 0)) ||
|
|
((this->_blackHearts & 1 << ((byte)(GHIDRA_INT(local_8) / 2) & 0x1f)) == 0)) {
|
|
movedCount = movedCount + -1;
|
|
this->_blackHearts = this->_blackHearts | 1 << (uVar1 >> 1 & 0x1f);
|
|
}
|
|
uVar2 = this->_soulHearts;
|
|
}
|
|
uVar1 = uVar1 - 1;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759390
|
|
void Entity_Player::AddJarHearts(int amount)
|
|
{
|
|
int iVar1;
|
|
int newJarHearts;
|
|
Game *game;
|
|
EntityPtr twin;
|
|
|
|
iVar1 = this->_playerType;
|
|
while ((iVar1 == 0x28 && (twin = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)), twin != (EntityPtr)0x0))) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x13c0));
|
|
this = GHIDRA_CAST<Entity_Player *>(twin);
|
|
}
|
|
newJarHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1354)) + amount;
|
|
iVar1 = 8;
|
|
if (newJarHearts < 8) {
|
|
iVar1 = newJarHearts;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1354)) = iVar1;
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759400
|
|
void Entity_Player::AddCoins(int amount)
|
|
{
|
|
int iVar1;
|
|
Entity_Player *deepPocketsOwner;
|
|
int *clampedPtr;
|
|
Entity_Player *this_00;
|
|
int leftoverCoins;
|
|
int *cappedPtr;
|
|
int extraout_EDX;
|
|
int coins;
|
|
int clampValues [4];
|
|
Game *game;
|
|
|
|
coins = amount;
|
|
if (0 < amount) {
|
|
iVar1 = GetHealthType(this);
|
|
coins = extraout_EDX;
|
|
if (iVar1 == 3) {
|
|
iVar1 = this->_redHearts;
|
|
AddHearts(this_00,extraout_EDX * 2,0,0);
|
|
leftoverCoins = amount - (this->_redHearts - iVar1) / 2;
|
|
coins = 0;
|
|
if (0 < leftoverCoins) {
|
|
coins = leftoverCoins;
|
|
}
|
|
if (iVar1 < this->_redHearts) {
|
|
AddImmaculateConceptionCounter(1);
|
|
}
|
|
}
|
|
}
|
|
coins = this->_numCoins + coins;
|
|
clampValues[0] = coins;
|
|
deepPocketsOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x1a0,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
clampValues[2] = 0;
|
|
clampValues[1] = (-GHIDRA_UINT((deepPocketsOwner != GHIDRA_CAST<Entity_Player *>(0x0))) & 900) + 99;
|
|
cappedPtr = clampValues;
|
|
if (clampValues[1] <= coins) {
|
|
cappedPtr = clampValues + 1;
|
|
}
|
|
clampedPtr = clampValues + 2;
|
|
if (0 < *cappedPtr) {
|
|
clampedPtr = cappedPtr;
|
|
}
|
|
this->_numCoins = *clampedPtr;
|
|
ConsumableCountChanged(this,1);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759500
|
|
void Entity_Player::AddBombs(int amount)
|
|
{
|
|
int *clamped;
|
|
int *upperClamped;
|
|
int clampValues [4];
|
|
Game *game;
|
|
|
|
if ((this->_playerType == 0x19) && (0 < amount)) {
|
|
if (0x18 < amount) {
|
|
amount = 0x18;
|
|
}
|
|
if (amount != 0) {
|
|
AddBlueFlies(this,amount,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
clampValues[0] = this->_numBombs + amount;
|
|
clampValues[1] = 99;
|
|
clampValues[2] = 0;
|
|
upperClamped = clampValues;
|
|
if (0x62 < clampValues[0]) {
|
|
upperClamped = clampValues + 1;
|
|
}
|
|
clamped = clampValues + 2;
|
|
if (0 < *upperClamped) {
|
|
clamped = upperClamped;
|
|
}
|
|
this->_numBombs = *clamped;
|
|
ConsumableCountChanged(this,4);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007595b0
|
|
void Entity_Player::AddKeys(int amount)
|
|
{
|
|
int *clampedKeys;
|
|
int *cappedKeys;
|
|
int keyBounds [2];
|
|
Game *game;
|
|
|
|
amount = amount + this->_numKeys;
|
|
keyBounds[1] = 99;
|
|
cappedKeys = &amount;
|
|
if (0x62 < amount) {
|
|
cappedKeys = keyBounds + 1;
|
|
}
|
|
keyBounds[0] = 0;
|
|
clampedKeys = keyBounds;
|
|
if (0 < *cappedKeys) {
|
|
clampedKeys = cappedKeys;
|
|
}
|
|
this->_numKeys = *clampedKeys;
|
|
ConsumableCountChanged(this,2);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759620
|
|
void Entity_Player::AddGoldenKey()
|
|
{
|
|
Game *game;
|
|
|
|
this->_hasGoldenKey = 1;
|
|
ConsumableCountChanged(this,8);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759660
|
|
void Entity_Player::RemoveGoldenKey()
|
|
{
|
|
Game *game;
|
|
|
|
this->_hasGoldenKey = 0;
|
|
ConsumableCountChanged(this,8);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007596a0
|
|
void Entity_Player::SyncConsumables(Entity_Player *target, uint mask)
|
|
{
|
|
byte isHasItem;
|
|
int iVar1;
|
|
|
|
if (((mask & 1) != 0) && (target->_numCoins = this->_numCoins, target->_valid != 0)) {
|
|
isHasItem = HasCollectible(target,0x6d,0);
|
|
if (isHasItem != 0) {
|
|
target->_cacheFlags = target->_cacheFlags | 1;
|
|
EvaluateItems(target);
|
|
}
|
|
update_greeds_gullet(target);
|
|
}
|
|
if ((mask & 2) != 0) {
|
|
target->_numKeys = this->_numKeys;
|
|
}
|
|
if ((mask & 4) != 0) {
|
|
target->_numBombs = this->_numBombs;
|
|
iVar1 = target->_numGigaBombs;
|
|
if (this->_numBombs < target->_numGigaBombs) {
|
|
iVar1 = this->_numBombs;
|
|
}
|
|
target->_numGigaBombs = iVar1;
|
|
}
|
|
if ((mask & 8) != 0) {
|
|
target->_hasGoldenKey = this->_hasGoldenKey;
|
|
}
|
|
if ((mask & 0x10) != 0) {
|
|
target->_hasGoldenBomb = this->_hasGoldenBomb;
|
|
}
|
|
if ((mask & 0x40) != 0) {
|
|
iVar1 = this->_numGigaBombs;
|
|
if (this->_numBombs < this->_numGigaBombs) {
|
|
iVar1 = this->_numBombs;
|
|
}
|
|
target->_numGigaBombs = iVar1;
|
|
}
|
|
if ((mask & 0x20) != 0) {
|
|
iVar1 = target->_effectiveSoulCharge;
|
|
target->_effectiveSoulCharge = this->_effectiveSoulCharge;
|
|
if (target->_valid != 0) {
|
|
apply_soul_charge_to_actives(target,iVar1);
|
|
}
|
|
}
|
|
if ((mask & 0x100) != 0) {
|
|
iVar1 = target->_effectiveBloodCharge;
|
|
target->_effectiveBloodCharge = this->_effectiveBloodCharge;
|
|
if (target->_valid != 0) {
|
|
blood_charge_changed(target,iVar1);
|
|
}
|
|
}
|
|
if ((char)mask < '\0') {
|
|
target->_poopMana = this->_poopMana;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007597e0
|
|
void Entity_Player::ConsumableCountChanged(int bitflags)
|
|
{
|
|
undefined4 *playerSlot;
|
|
void *playerListEnd;
|
|
int coins;
|
|
uint playerIdx;
|
|
Game *game;
|
|
qword oldStateFlags;
|
|
uint *stateFlagsHigh;
|
|
|
|
if (-1 < this->_playerIndex) {
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
playerIdx = 0;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
game = g_game;
|
|
playerListEnd = (g_game->_playerManager)._playerList._end;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (game->_playerManager)._playerList._end;
|
|
}
|
|
playerSlot = (game->_playerManager)._playerList._begin;
|
|
if (playerIdx < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + playerIdx;
|
|
}
|
|
SyncConsumables(this,GHIDRA_CAST<Entity_Player *>(*playerSlot),bitflags);
|
|
playerIdx = playerIdx + 1;
|
|
} while (playerIdx <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
if ((bitflags & 1U) != 0) {
|
|
coins = this->_numCoins;
|
|
if (0x36 < coins) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(2);
|
|
coins = this->_numCoins;
|
|
}
|
|
game = g_game;
|
|
if (0x62 < coins) {
|
|
oldStateFlags = g_game->_gameStateFlags;
|
|
stateFlagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*stateFlagsHigh = *stateFlagsHigh | 0x800;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(oldStateFlags);
|
|
coins = this->_numCoins;
|
|
}
|
|
if ((((coins < 1) && ((game->_gameStateFlags & 0x80000000000) != 0)) &&
|
|
(game->_isRestoringGlowingHourglassState == 0)) &&
|
|
((game->_isStartingFromState == 0 && (this->_hasCurseMistEffect == 0)))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x247);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
SyncConsumables(this,this,bitflags);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759950
|
|
void Entity_Player::restore_curse_mist_backup(int *backup)
|
|
{
|
|
this->_numCoins = *backup;
|
|
this->_numKeys = backup[1];
|
|
this->_numBombs = backup[2];
|
|
this->_hasGoldenKey = *GHIDRA_CAST<byte *>((backup + 3));
|
|
this->_hasGoldenBomb = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(backup) + 0xd));
|
|
this->_numGigaBombs = backup[5];
|
|
this->_effectiveSoulCharge = backup[4];
|
|
this->_effectiveBloodCharge = backup[7];
|
|
this->_poopMana = backup[6];
|
|
if (this->_valid == 0) {
|
|
return;
|
|
}
|
|
ConsumableCountChanged(this,-1);
|
|
return;
|
|
}
|
|
|
|
// 007599d0
|
|
Entity * Entity_Player::AddBlueFlies(int amount, Vector *pos, Entity *target)
|
|
{
|
|
Manager *unusedArg;
|
|
byte isInputActive;
|
|
int iVar1;
|
|
int iVar2;
|
|
uint rngResult;
|
|
Entity *fly;
|
|
bool isInputActive;
|
|
bool bVar4;
|
|
EntityPtr *erasedRef;
|
|
Entity_Player *player;
|
|
EntityPtr *flyTarget;
|
|
PersistentGameData *persistentData;
|
|
|
|
player = this;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x5e)) {
|
|
iVar2 = GetTrinketMultiplier(this,0x5e);
|
|
bVar4 = false;
|
|
isInputActive = iVar2 == 0;
|
|
LAB_00759a0e:
|
|
if (isInputActive || bVar4 != iVar2 < 0) goto LAB_00759a6a;
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar1 = GetTrinketMultiplier(this,0x5e);
|
|
bVar4 = SBORROW4(iVar1,1);
|
|
iVar2 = iVar1 + -1;
|
|
isInputActive = iVar1 == 1;
|
|
goto LAB_00759a0e;
|
|
}
|
|
iVar1 = 2;
|
|
iVar2 = GetTrinketMultiplier(this,0x5e);
|
|
if (iVar2 == 2) {
|
|
rngResult = Random();
|
|
if (rngResult % 5 == 0) {
|
|
iVar1 = 3;
|
|
}
|
|
}
|
|
else if ((iVar2 == 3) && (rngResult = Random(), rngResult % 5 == 0)) {
|
|
amount = amount * 4;
|
|
goto LAB_00759a6a;
|
|
}
|
|
amount = iVar1 * amount;
|
|
LAB_00759a6a:
|
|
this->_numBlueFlies = this->_numBlueFlies + amount;
|
|
fly = GHIDRA_CAST<Entity *>(0x0);
|
|
iVar2 = this->_numBlueFlies;
|
|
if (0 < amount) {
|
|
do {
|
|
rngResult = Random();
|
|
fly = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x2b,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,rngResult,0);
|
|
if ((target != GHIDRA_CAST<Entity *>(0x0)) && (target->_dead == 0)) {
|
|
flyTarget = &fly->_target;
|
|
if (fly->_target != (EntityPtr)0x0) {
|
|
erasedRef = flyTarget;
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
}
|
|
*flyTarget = (EntityPtr)target;
|
|
std::multiset<unsigned_int>::insert(flyTarget);
|
|
this = player;
|
|
}
|
|
*GHIDRA_CAST<uint *>(&fly->_flags) = GHIDRA_UINT(fly->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&fly->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&fly->_flags) + 4));
|
|
amount = amount + -1;
|
|
} while (amount != 0);
|
|
iVar2 = this->_numBlueFlies;
|
|
}
|
|
unusedArg = g_manager;
|
|
if (iVar2 < 0x14) {
|
|
return fly;
|
|
}
|
|
persistentData = &g_manager->_persistentGameData;
|
|
if ((g_manager->_persistentGameData)._isReadOnly != 0) {
|
|
return fly;
|
|
}
|
|
if ((g_manager->_persistentGameData)._achievements[0x184] != 0) {
|
|
return fly;
|
|
}
|
|
(g_manager->_persistentGameData)._achievements[0x184] = 1;
|
|
if (((unusedArg->_netplayManager == *GHIDRA_CAST<NetplayManager *>((unusedArg + 1))) ||
|
|
(isInputActive = Manager::IsGameplayInputActive(GHIDRA_INT(unusedArg)), isInputActive == 0)) &&
|
|
((unusedArg->_persistentGameData)._isSteamAchievementsEnabled != 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::UnlockSteamAchievement(0x184);
|
|
Manager::queue_achievement_popup(0x184);
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>(persistentData) = 1;
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::check_challenge_unlocks();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::check_collection_unlocks();
|
|
return fly;
|
|
}
|
|
|
|
// 00759b80
|
|
void Entity_Player::RemoveBlueFly()
|
|
{
|
|
this->_numBlueFlies = this->_numBlueFlies + -1;
|
|
return;
|
|
}
|
|
|
|
// 00759b90
|
|
void Entity_Player::AddLeprosy()
|
|
{
|
|
if (this->_numLeprosy < 3) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x200;
|
|
this->_numLeprosy = this->_numLeprosy + 1;
|
|
EvaluateItems(this);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00759bc0
|
|
Entity * Entity_Player::AddBoneOrbital(Vector *Position)
|
|
{
|
|
uint seed;
|
|
Entity *orbital;
|
|
|
|
seed = Random();
|
|
orbital = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0x80,Position,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,seed);
|
|
return orbital;
|
|
}
|
|
|
|
// 00759bf0
|
|
Entity * Entity_Player::AddSwarmFlyOrbital(Vector *position)
|
|
{
|
|
Entity_Player *game = this;
|
|
code *pcVar1;
|
|
uint uVar2;
|
|
Entity *swarmFly;
|
|
void *pvVar3;
|
|
void *pvVar4;
|
|
uint entityIndex;
|
|
uint *rngSeed;
|
|
int blockIndex;
|
|
int *flyDeque;
|
|
void *flyDequeMap;
|
|
int flyDequeMapSize;
|
|
uint flyDequeOffset;
|
|
uint flyDequeSize;
|
|
int familiar;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
int *flyDequeProxy;
|
|
Game *game;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afebed;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
flyDeque = GHIDRA_CAST<int *>(0x0);
|
|
flyDequeMap = (void *)0x0;
|
|
flyDequeMapSize = 0;
|
|
flyDequeOffset = 0;
|
|
flyDequeSize = 0;
|
|
flyDeque = operator_new(8);
|
|
flyDeque[1] = 0;
|
|
*flyDeque = GHIDRA_INT(&flyDeque);
|
|
local_8 = 0;
|
|
entityIndex = 0;
|
|
pvVar3 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x1264)) != 0) {
|
|
do {
|
|
familiar = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x125c)) + entityIndex * 4));
|
|
if ((familiar == 0) || (*GHIDRA_CAST<int *>((familiar + 0x28)) != 3)) {
|
|
familiar = 0;
|
|
}
|
|
else if ((*GHIDRA_CAST<int *>((familiar + 0x2c)) == 0xe5) &&
|
|
(*GHIDRA_CAST<Entity_Player **>((familiar + 0x410)) == game)) {
|
|
std::deque<int>::push_front(&familiar);
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar3) + 0x1264)));
|
|
}
|
|
if (0xf < flyDequeSize) {
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_INT(flyDequeMap) +
|
|
(flyDequeOffset >> 2 & flyDequeMapSize - 1U) * 4)) +
|
|
(flyDequeOffset & 3) * 4)) + 0x28))(uVar2);
|
|
flyDequeSize = flyDequeSize - 1;
|
|
if (flyDequeSize == 0) {
|
|
flyDequeOffset = 0;
|
|
}
|
|
else {
|
|
flyDequeOffset = flyDequeOffset + 1;
|
|
}
|
|
} while (0xf < flyDequeSize);
|
|
}
|
|
pvVar3 = (game->_collectibleRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar3) + 0x2b50));
|
|
uVar2 = *rngSeed;
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar2 = *rngSeed;
|
|
if (uVar2 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
swarmFly = GHIDRA_CAST<Entity *>((*pcVar1)());
|
|
return swarmFly;
|
|
}
|
|
}
|
|
game = g_game;
|
|
uVar2 = uVar2 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + 0x2b54)) & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + 0x2b58)) & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + 0x2b5c)) & 0x1f) ^ uVar2;
|
|
*rngSeed = uVar2;
|
|
swarmFly = (GHIDRA_CAST<Game *>((game)))->Game::Spawn(3,0xe5,position,&g_vectorZero,GHIDRA_CAST<Entity *>(game),0,uVar2);
|
|
swarmFly->Update();
|
|
if (flyDequeSize != 0) {
|
|
do {
|
|
flyDequeSize = flyDequeSize - 1;
|
|
} while (flyDequeSize != 0);
|
|
flyDequeOffset = 0;
|
|
flyDequeSize = 0;
|
|
}
|
|
pvVar3 = flyDequeMap;
|
|
blockIndex = flyDequeMapSize;
|
|
if (flyDequeMapSize != 0) {
|
|
do {
|
|
pvVar4 = *(void **)(GHIDRA_CAST<char *>(pvVar3) + blockIndex * 4 + -4);
|
|
blockIndex = blockIndex + -1;
|
|
if (pvVar4 != (void *)0x0) {
|
|
operator_delete(pvVar4,0x10);
|
|
pvVar3 = flyDequeMap;
|
|
}
|
|
} while (blockIndex != 0);
|
|
}
|
|
if (pvVar3 != (void *)0x0) {
|
|
uVar2 = flyDequeMapSize * 4;
|
|
pvVar4 = pvVar3;
|
|
if (0xfff < uVar2) {
|
|
pvVar4 = *(void **)(GHIDRA_CAST<char *>(pvVar3) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar3) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,uVar2);
|
|
}
|
|
flyDequeProxy = flyDeque;
|
|
flyDequeMapSize = 0;
|
|
flyDequeMap = (void *)0x0;
|
|
flyDeque = GHIDRA_CAST<int *>(0x0);
|
|
operator_delete(flyDequeProxy,8);
|
|
ExceptionList = local_10;
|
|
return swarmFly;
|
|
}
|
|
|
|
// 00759e20
|
|
byte Entity_Player::TryUseKey()
|
|
{
|
|
byte bVar1;
|
|
int hearts;
|
|
uint seed;
|
|
Entity *heartEffect;
|
|
byte unk2;
|
|
int soundId [2];
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
if (this->_hasGoldenKey == 0) {
|
|
if (this->_numKeys < 1) {
|
|
return 0;
|
|
}
|
|
this->_numKeys = this->_numKeys + -1;
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
ConsumableCountChanged(this,2);
|
|
bVar1 = HasTrinket(this,0x57,0);
|
|
if (bVar1 != 0) {
|
|
unk2 = 0;
|
|
bVar1 = 0;
|
|
hearts = GetTrinketMultiplier(this,0x57);
|
|
AddHearts(this,hearts,bVar1,unk2);
|
|
manager = g_manager;
|
|
soundId[0] = 0x9d;
|
|
if (this->_playerType == 0x16) {
|
|
soundId[0] = 0x266;
|
|
}
|
|
seed_fart_sound_override(soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId[0],1.0,2,0,1.0,0.0);
|
|
seed = Random();
|
|
heartEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed,0)
|
|
;
|
|
__RTDynamicCast(heartEffect,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0);
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0075bf00
|
|
void Entity_Player::UpdateCostumes()
|
|
{
|
|
int iVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
byte bVar4;
|
|
void *costumeIter;
|
|
int *piVar5;
|
|
ItemConfig_Item *nullItem;
|
|
uint uVar6;
|
|
LayerState *layer;
|
|
byte *pbVar7;
|
|
float fVar8;
|
|
undefined4 *headSkinPath;
|
|
undefined4 *puVar9;
|
|
std_string *pngFilename;
|
|
void *pvVar10;
|
|
char cVar11;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
undefined4 layerId;
|
|
byte *expectedAnimName;
|
|
ColorMod *layerColor;
|
|
undefined4 *extraout_ECX;
|
|
undefined4 *extraout_ECX_00;
|
|
undefined4 *puVar12;
|
|
undefined4 *extraout_ECX_01;
|
|
undefined4 *extraout_ECX_02;
|
|
undefined4 *extraout_ECX_03;
|
|
int iVar13;
|
|
uint size;
|
|
ANM2 *costumeSprite;
|
|
byte *pbVar14;
|
|
Entity_Player *playerAlias;
|
|
bool isNameLess;
|
|
char *pcVar15;
|
|
undefined1 eraseResult [4];
|
|
LayerState *local_e4;
|
|
int matchedLayers;
|
|
ANM2 *local_dc;
|
|
byte *bodyIndex;
|
|
void *playerConfig;
|
|
undefined4 *headColor;
|
|
ANM2 *local_cc;
|
|
int local_c8;
|
|
undefined4 *bodyColor;
|
|
uint cleanupFlags;
|
|
byte *local_bc;
|
|
std_vector *costumeDescs;
|
|
byte local_b1;
|
|
Entity_Player *local_b0;
|
|
char local_aa;
|
|
char local_a9;
|
|
undefined4 *local_a8;
|
|
byte local_a2;
|
|
byte local_a1;
|
|
undefined4 local_a0 [5];
|
|
char bodySkinPathTmp [12];
|
|
undefined4 local_80;
|
|
undefined4 uStack_7c;
|
|
float local_78;
|
|
std_string headSheetPath;
|
|
std_string bodySheetPath;
|
|
std_string skinPath;
|
|
std_string tmpPath;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
int *effectsEnd;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afeef5;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(&tmpPath) + 0x28U;
|
|
cleanupFlags = 0;
|
|
if (this->_variant == 1) {
|
|
return;
|
|
}
|
|
if (DAT_00c81148 != '\0') {
|
|
return;
|
|
}
|
|
pvVar10 = (this->_costumeSpriteDescs)._end;
|
|
local_a9 = '\0';
|
|
iVar13 = -1;
|
|
local_a1 = 0;
|
|
local_aa = '\0';
|
|
local_a2 = 0;
|
|
costumeDescs = &this->_costumeSpriteDescs;
|
|
costumeIter = costumeDescs->_begin;
|
|
DAT_00c81148 = '\x01';
|
|
local_c8 = -1;
|
|
local_a8 = GHIDRA_CAST<undefined4 *>(0x4b);
|
|
if (costumeIter == pvVar10) {
|
|
LAB_0075c0c6:
|
|
local_a8 = GHIDRA_CAST<undefined4 *>(0xffffffff);
|
|
}
|
|
else {
|
|
local_b1 = this->_canFly;
|
|
do {
|
|
piVar5 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(costumeIter) + 0x114));
|
|
if (piVar5 != GHIDRA_CAST<int *>(0x0)) {
|
|
iVar1 = *piVar5;
|
|
if (((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) {
|
|
iVar1 = piVar5[1];
|
|
if (iVar1 < 0x253) {
|
|
if (iVar1 == 0x252) {
|
|
local_a9 = '\x01';
|
|
}
|
|
else if (iVar1 == 0x82) {
|
|
local_a8 = GHIDRA_CAST<undefined4 *>(0x4d);
|
|
}
|
|
else if (iVar1 == 0xb5) {
|
|
local_a8 = GHIDRA_CAST<undefined4 *>(0x4e);
|
|
}
|
|
}
|
|
else if (iVar1 == 0x271) {
|
|
local_a2 = 1;
|
|
}
|
|
else if (iVar1 == 0x2c0) {
|
|
local_a1 = 1;
|
|
}
|
|
}
|
|
else if (*piVar5 == 0) {
|
|
iVar1 = piVar5[1];
|
|
iVar13 = iVar1;
|
|
if (3 < iVar1 - 0x4bU) {
|
|
iVar13 = local_c8;
|
|
}
|
|
local_c8 = iVar13;
|
|
if (iVar1 == 0x67) {
|
|
local_aa = '\x01';
|
|
}
|
|
}
|
|
}
|
|
if ((((local_b1 != 0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(costumeIter) + 0x11d)) != '\0')) &&
|
|
((piVar5 == GHIDRA_CAST<int *>(0x0) || (3 < piVar5[1] - 0x4bU)))) && (local_a8 == GHIDRA_CAST<undefined4 *>(0x4b)))
|
|
{
|
|
local_a8 = GHIDRA_CAST<undefined4 *>(0x4c);
|
|
}
|
|
costumeIter = (void *)(GHIDRA_INT(costumeIter) + 0x130);
|
|
pvVar10 = (this->_costumeSpriteDescs)._end;
|
|
} while (costumeIter != pvVar10);
|
|
if (local_a9 == '\0') goto LAB_0075c0c6;
|
|
}
|
|
ExceptionList = &local_10;
|
|
local_b0 = this;
|
|
if (local_a8 != GHIDRA_CAST<undefined4 *>(iVar13)) {
|
|
costumeIter = (this->_costumeSpriteDescs)._begin;
|
|
if (costumeIter != pvVar10) {
|
|
do {
|
|
piVar5 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(costumeIter) + 0x114));
|
|
if (((piVar5 == GHIDRA_CAST<int *>(0x0)) || (*piVar5 != 0)) || (3 < piVar5[1] - 0x4bU)) {
|
|
costumeIter = (void *)(GHIDRA_INT(costumeIter) + 0x130);
|
|
}
|
|
else {
|
|
piVar5 = GHIDRA_CAST<int *>(std)::vector<CostumeSprite>::erase(eraseResult,costumeIter);
|
|
costumeIter = (void *)*piVar5;
|
|
}
|
|
} while (costumeIter != (this->_costumeSpriteDescs)._end);
|
|
}
|
|
if (local_a8 != GHIDRA_CAST<undefined4 *>(0xffffffff)) {
|
|
if ((GHIDRA_INT(local_a8) < 0) ||
|
|
(pvVar10 = (g_manager->_itemConfig)._nullItems._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar10) >> 2 <= GHIDRA_INT(local_a8))) {
|
|
nullItem = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
nullItem = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar10) + GHIDRA_INT(local_a8) * 4));
|
|
}
|
|
AddCostume(this,nullItem,0);
|
|
}
|
|
}
|
|
if ((local_a1 == 0) || (this->_playerType != 0x1b)) {
|
|
cVar11 = '\0';
|
|
}
|
|
else {
|
|
cVar11 = '\x01';
|
|
}
|
|
if (cVar11 != local_aa) {
|
|
pvVar10 = (g_manager->_itemConfig)._nullItems._begin;
|
|
iVar13 = GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar10) >> 2;
|
|
if (local_aa == '\0') {
|
|
if (iVar13 < 0x68) {
|
|
nullItem = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
nullItem = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar10) + 0x19c));
|
|
}
|
|
AddCostume(this,nullItem,0);
|
|
}
|
|
else if (iVar13 < 0x68) {
|
|
RemoveCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
}
|
|
else {
|
|
RemoveCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar10) + 0x19c)));
|
|
}
|
|
}
|
|
iVar13 = this->_playerType;
|
|
if ((iVar13 < 0) ||
|
|
(playerConfig = (g_manager->_entityConfig)._players._begin,
|
|
(GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(playerConfig)) / 0x148 <= iVar13)) {
|
|
playerConfig = (void *)0x0;
|
|
LAB_0075c224:
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Could not load config for player type %d\n"));
|
|
}
|
|
else {
|
|
playerConfig = (void *)(iVar13 * 0x148 + GHIDRA_INT(playerConfig));
|
|
if (playerConfig == (void *)0x0) goto LAB_0075c224;
|
|
}
|
|
headColor = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(playerConfig) + 0xe4));
|
|
uVar6 = 0;
|
|
piVar5 = &local_b0->_playerCostumeMap[0]._layerID;
|
|
do {
|
|
(GHIDRA_CAST<PlayerCostumeMap *>((piVar5 + -1)))->_index = -1;
|
|
*piVar5 = -1;
|
|
piVar5[1] = -1;
|
|
if (((uVar6 == 0) || (3 < uVar6)) && (uVar6 != 0xb)) {
|
|
bVar4 = 0;
|
|
}
|
|
else {
|
|
bVar4 = 1;
|
|
}
|
|
*GHIDRA_CAST<byte *>((piVar5 + 2)) = bVar4;
|
|
uVar6 = uVar6 + 1;
|
|
piVar5 = piVar5 + 4;
|
|
} while (uVar6 < 0xf);
|
|
local_c8 = -1;
|
|
local_a8 = GHIDRA_CAST<undefined4 *>(0xffffffff);
|
|
local_bc = GHIDRA_CAST<byte *>(0x0);
|
|
pvVar10 = costumeDescs->_begin;
|
|
bodyColor = headColor;
|
|
if (0 < (GHIDRA_INT(costumeDescs->_end) - GHIDRA_INT(pvVar10)) / 0x130) {
|
|
do {
|
|
costumeSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar10) + GHIDRA_INT(local_bc) * 0x130));
|
|
pbVar14 = local_bc;
|
|
bodyIndex = local_bc;
|
|
if ((local_b0->_hasCurseMistEffect == 0) ||
|
|
(((piVar5 = *GHIDRA_CAST<int **>(costumeSprite[1]._filename._buf), piVar5 != GHIDRA_CAST<int *>(0x0) &&
|
|
(*piVar5 == 0)) && (piVar5[1] == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerConfig) + 0xac)))))) {
|
|
LAB_0075c397:
|
|
if (((local_b0->_isCoopGhost == 0) &&
|
|
((local_a2 == 0 ||
|
|
(((piVar5 = *GHIDRA_CAST<int **>(costumeSprite[1]._filename._buf), piVar5 != GHIDRA_CAST<int *>(0x0) &&
|
|
(*piVar5 == 3)) && (piVar5[1] == 0x271)))))) &&
|
|
((piVar5 = *GHIDRA_CAST<int **>(costumeSprite[1]._filename._buf), piVar5 == GHIDRA_CAST<int *>(0x0) ||
|
|
((((iVar13 = *piVar5, iVar13 != 1 && (iVar13 != 3)) && (iVar13 != 4)) ||
|
|
((piVar5[1] != 0xd6 || ((local_b0->_playerType != 8 && (local_b0->_playerType != 0xb)))
|
|
))))))) {
|
|
local_dc = &local_b0->_sprite;
|
|
local_a1 = 0;
|
|
matchedLayers = 0;
|
|
pbVar14 = GHIDRA_CAST<byte *>(0x0);
|
|
local_cc = costumeSprite;
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((local_dc)))->ANM2::GetLayer(pbVar14);
|
|
pvVar10 = layer->_layerData;
|
|
if (pvVar10 == (void *)0x0) {
|
|
pbVar7 = &s_empty;
|
|
}
|
|
else {
|
|
pbVar7 = GHIDRA_CAST<byte *>((GHIDRA_INT(pvVar10) + 8));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar10) + 0x1c))) {
|
|
pbVar7 = *GHIDRA_CAST<byte **>(pbVar7);
|
|
}
|
|
}
|
|
local_e4 = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::GetLayer(pbVar7);
|
|
if (local_e4 == GHIDRA_CAST<LayerState *>(0x0)) {
|
|
LAB_0075c5f9:
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((costumeSprite[1]._filename._buf + 4)) <
|
|
local_b0->_playerCostumeMap[GHIDRA_INT(pbVar14)]._priority) ||
|
|
(((local_b0->_canFly != 0 && (costumeSprite[1]._filename._buf[9] == '\0')) &&
|
|
(local_b0->_playerCostumeMap[GHIDRA_INT(pbVar14)]._isBodyLayer != 0)))) {
|
|
if (pbVar14 == &DAT_00000004) {
|
|
LAB_0075c594:
|
|
if ((char)costumeSprite[1]._filename._capacity != '\0') goto LAB_0075c59d;
|
|
}
|
|
else if (pbVar14 == GHIDRA_CAST<byte *>(0x1)) {
|
|
LAB_0075c5ca:
|
|
if ((char)costumeSprite[1]._filename._capacity != '\0') goto LAB_0075c5d3;
|
|
}
|
|
goto LAB_0075c5f9;
|
|
}
|
|
if (((matchedLayers != 0) && (bodyIndex == local_bc)) &&
|
|
((pbVar14 != GHIDRA_CAST<byte *>(0x0) &&
|
|
(bVar4 = local_b0->_playerCostumeMap[GHIDRA_INT(pbVar14)]._isBodyLayer, local_a1 != bVar4
|
|
)))) {
|
|
if (bVar4 == 0) {
|
|
local_bc = local_bc + 1;
|
|
}
|
|
else {
|
|
bodyIndex = bodyIndex + 1;
|
|
}
|
|
}
|
|
local_a1 = local_b0->_playerCostumeMap[GHIDRA_INT(pbVar14)]._isBodyLayer;
|
|
pbVar7 = local_bc;
|
|
if (local_a1 != 0) {
|
|
pbVar7 = bodyIndex;
|
|
}
|
|
local_b0->_playerCostumeMap[GHIDRA_INT(pbVar14)]._index = GHIDRA_INT(pbVar7);
|
|
if (local_e4->_layerData == GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
layerId = 0xffffffff;
|
|
}
|
|
else {
|
|
layerId = *GHIDRA_CAST<undefined4 *>(local_e4->_layerData);
|
|
}
|
|
matchedLayers = matchedLayers + 1;
|
|
*(undefined4 *)
|
|
(GHIDRA_INT((&(local_b0->_sprite)._filename + -3)) + GHIDRA_INT((pbVar14 + 0x123)) * 0x10) =
|
|
layerId;
|
|
local_b0->_playerCostumeMap[GHIDRA_INT(pbVar14)]._priority =
|
|
*GHIDRA_CAST<int *>((local_cc[1]._filename._buf + 4));
|
|
cVar11 = (char)local_cc[1]._filename._capacity;
|
|
costumeSprite = local_cc;
|
|
if (pbVar14 == &DAT_00000004) {
|
|
if (cVar11 == '\0') goto LAB_0075c594;
|
|
headColor = *GHIDRA_CAST<undefined4 **>((local_cc[1]._filename._buf + 0xc));
|
|
LAB_0075c59d:
|
|
iVar13 = *GHIDRA_CAST<int *>((costumeSprite[1]._filename._buf + 4));
|
|
if (local_c8 <= iVar13) {
|
|
headColor = *GHIDRA_CAST<undefined4 **>((costumeSprite[1]._filename._buf + 0xc));
|
|
local_c8 = iVar13;
|
|
}
|
|
}
|
|
else {
|
|
if (pbVar14 != GHIDRA_CAST<byte *>(0x1)) goto LAB_0075c5f9;
|
|
if (cVar11 == '\0') goto LAB_0075c5ca;
|
|
bodyColor = *GHIDRA_CAST<undefined4 **>((local_cc[1]._filename._buf + 0xc));
|
|
LAB_0075c5d3:
|
|
puVar9 = *GHIDRA_CAST<undefined4 **>((costumeSprite[1]._filename._buf + 4));
|
|
if (GHIDRA_INT(local_a8) <= GHIDRA_INT(puVar9)) {
|
|
bodyColor = *GHIDRA_CAST<undefined4 **>((costumeSprite[1]._filename._buf + 0xc));
|
|
local_a8 = puVar9;
|
|
}
|
|
}
|
|
}
|
|
pbVar14 = pbVar14 + 1;
|
|
} while (pbVar14 < &DAT_0000000f);
|
|
if ((char)costumeSprite[1]._filename._capacity != '\0') {
|
|
iVar13 = *GHIDRA_CAST<int *>(costumeSprite[1]._filename._buf);
|
|
if (iVar13 != 0) {
|
|
if (*GHIDRA_CAST<char *>((iVar13 + 0xa9)) != '\0') {
|
|
iVar1 = *GHIDRA_CAST<int *>((costumeSprite[1]._filename._buf + 4));
|
|
if (local_c8 <= iVar1) {
|
|
headColor = *GHIDRA_CAST<undefined4 **>((costumeSprite[1]._filename._buf + 0xc));
|
|
local_c8 = iVar1;
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<char *>((iVar13 + 0xaa)) != '\0') {
|
|
puVar9 = *GHIDRA_CAST<undefined4 **>((costumeSprite[1]._filename._buf + 4));
|
|
if (GHIDRA_INT(local_a8) <= GHIDRA_INT(puVar9)) {
|
|
bodyColor = *GHIDRA_CAST<undefined4 **>((costumeSprite[1]._filename._buf + 0xc));
|
|
local_a8 = puVar9;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pbVar14 = bodyIndex;
|
|
if (GHIDRA_INT(bodyIndex) < GHIDRA_INT(local_bc)) {
|
|
pbVar14 = local_bc;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar13 = *piVar5;
|
|
if ((((iVar13 == 1) || (iVar13 == 3)) || (iVar13 == 4)) &&
|
|
((piVar5[1] == 0x14 && ((local_b0->_temporaryeffects)._disabled == 0)))) {
|
|
piVar5 = (local_b0->_temporaryeffects)._effects._begin;
|
|
effectsEnd = (local_b0->_temporaryeffects)._effects._end;
|
|
if (piVar5 != effectsEnd) {
|
|
do {
|
|
iVar13 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar13 == 1) || (iVar13 == 3)) || (iVar13 == 4)) &&
|
|
((GHIDRA_CAST<int *>(*piVar5))[1] == 0x14)) goto LAB_0075c397;
|
|
piVar5 = piVar5 + 4;
|
|
} while (piVar5 != effectsEnd);
|
|
}
|
|
}
|
|
}
|
|
local_bc = pbVar14 + 1;
|
|
pvVar10 = costumeDescs->_begin;
|
|
} while (GHIDRA_INT(local_bc) < (GHIDRA_INT(costumeDescs->_end) - GHIDRA_INT(pvVar10)) / 0x130);
|
|
}
|
|
if ((local_b0->_playerType == 0xc) || (local_a9 = '\0', local_b0->_playerType == 0x18)) {
|
|
local_a9 = '\x01';
|
|
}
|
|
local_cc = GHIDRA_CAST<ANM2 *>(0x0);
|
|
playerAlias = local_b0;
|
|
LAB_0075c6e0:
|
|
iVar13 = playerAlias->_playerCostumeMap[GHIDRA_INT(local_cc)]._index;
|
|
if (iVar13 < 0) goto LAB_0075cdb5;
|
|
pvVar10 = (playerAlias->_costumeSpriteDescs)._begin;
|
|
iVar13 = iVar13 * 0x130;
|
|
local_a2 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x11f));
|
|
if (((local_a2 == 0) ||
|
|
(((puVar9 = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x124)), puVar9 == headColor ||
|
|
(playerAlias->_playerCostumeMap[GHIDRA_INT(local_cc)]._isBodyLayer != 0)) &&
|
|
((playerAlias = local_b0, puVar9 == bodyColor ||
|
|
(local_b0->_playerCostumeMap[GHIDRA_INT(local_cc)]._isBodyLayer == 0)))))) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 300)) == playerAlias->_playerType)) goto LAB_0075cdb5;
|
|
local_bc = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x34));
|
|
if (local_bc == GHIDRA_CAST<byte *>(0x0)) {
|
|
local_bc = &s_empty;
|
|
LAB_0075c790:
|
|
local_b1 = 0;
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint *>((local_bc + 0x14))) {
|
|
local_bc = *GHIDRA_CAST<byte **>(local_bc);
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x44)) == '\0') goto LAB_0075c790;
|
|
local_b1 = 1;
|
|
}
|
|
local_e4 = GHIDRA_CAST<LayerState *>(GHIDRA_INT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x40))));
|
|
local_a8 = headColor;
|
|
if ((*GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x124)) != bodyColor) &&
|
|
(local_b0->_playerCostumeMap[GHIDRA_INT(local_cc)]._isBodyLayer != 0)) {
|
|
local_a8 = bodyColor;
|
|
}
|
|
piVar5 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x114));
|
|
if ((*piVar5 == 0) && ((iVar1 = piVar5[1], iVar1 == 0xc || (iVar1 == 0x58)))) {
|
|
LAB_0075cd71:
|
|
puVar9 = local_a8;
|
|
LAB_0075cac5:
|
|
}
|
|
else {
|
|
if ((local_a2 != 0) && (*GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x120)) != local_a8)) {
|
|
pbVar14 = GHIDRA_CAST<byte *>(0x0);
|
|
local_aa = '\0';
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x80)) != 0) {
|
|
do {
|
|
local_a2 = 0;
|
|
local_a1 = 0;
|
|
local_dc = GHIDRA_CAST<ANM2 *>(local_b0->_playerType);
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar10) + iVar13)))))->ANM2::GetLayer(pbVar14);
|
|
if (layer->_layerData == (void *)0x0) {
|
|
tmpPath._capacity = 0xf;
|
|
tmpPath._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((tmpPath._buf)))->std::string::string((void *)(GHIDRA_INT(layer->_layerData) + 0x20));
|
|
}
|
|
cleanupFlags = cleanupFlags | 2;
|
|
local_8 = 3;
|
|
costume_path_apply_skin_color
|
|
(&skinPath,&tmpPath,GHIDRA_INT(local_a8),GHIDRA_INT(local_dc),&local_a2,&local_a1);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),5);
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar6 = tmpPath._capacity + 1;
|
|
pcVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pcVar15 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4));
|
|
uVar6 = tmpPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar15)))))
|
|
goto LAB_0075cfcd;
|
|
}
|
|
operator_delete(pcVar15,uVar6);
|
|
}
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_INT(costumeDescs->_begin) + iVar13)),GHIDRA_INT(pbVar14),&skinPath);
|
|
if ((local_a1 == 0) && (local_a9 != '\0')) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14);
|
|
fVar3 = fRam00c5d09c;
|
|
fVar2 = fRam00c5d098;
|
|
fVar8 = fRam00c5d094;
|
|
layerColor = &layer->_color;
|
|
if (layerColor != GHIDRA_CAST<ColorMod *>(&DAT_00c5d090)) {
|
|
layerColor->_tint[0] = _DAT_00c5d090;
|
|
(layer->_color)._tint[1] = fVar8;
|
|
(layer->_color)._tint[2] = fVar2;
|
|
(layer->_color)._tint[3] = fVar3;
|
|
fVar3 = fRam00c5d0ac;
|
|
fVar2 = fRam00c5d0a8;
|
|
fVar8 = fRam00c5d0a4;
|
|
(layer->_color)._colorize[0] = _DAT_00c5d0a0;
|
|
(layer->_color)._colorize[1] = fVar8;
|
|
(layer->_color)._colorize[2] = fVar2;
|
|
(layer->_color)._colorize[3] = fVar3;
|
|
*GHIDRA_CAST<undefined8 *>((layer->_color)._offset) = DAT_00c5d0b0;
|
|
fVar8 = DAT_00c5d0b8;
|
|
goto LAB_0075c9d3;
|
|
}
|
|
}
|
|
else {
|
|
local_80 = 0;
|
|
uStack_7c = 0;
|
|
local_78 = 0.0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14);
|
|
layerColor = &layer->_color;
|
|
if (layerColor != GHIDRA_CAST<ColorMod *>(local_a0)) {
|
|
layerColor->_tint[0] = 1.0;
|
|
(layer->_color)._tint[1] = 1.0;
|
|
(layer->_color)._tint[2] = 1.0;
|
|
(layer->_color)._tint[3] = 1.0;
|
|
(layer->_color)._colorize[0] = 0.0;
|
|
(layer->_color)._colorize[1] = 0.0;
|
|
(layer->_color)._colorize[2] = 0.0;
|
|
(layer->_color)._colorize[3] = 0.0;
|
|
*GHIDRA_CAST<ulonglong *>((layer->_color)._offset) = CONCAT44(uStack_7c,local_80);
|
|
fVar8 = local_78;
|
|
LAB_0075c9d3:
|
|
layerColor->_offset[2] = fVar8;
|
|
}
|
|
}
|
|
if ((local_a2 != 0) || (local_a1 != 0)) {
|
|
local_aa = '\x01';
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (0xf < skinPath._capacity) {
|
|
uVar6 = skinPath._capacity + 1;
|
|
pvVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)skinPath._buf)) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pvVar10 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(skinPath._buf)) + 0x0))) + -4);
|
|
uVar6 = skinPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(skinPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar10))))) goto LAB_0075cfcd;
|
|
}
|
|
operator_delete(pvVar10,uVar6);
|
|
}
|
|
pbVar14 = pbVar14 + 1;
|
|
pvVar10 = costumeDescs->_begin;
|
|
} while (pbVar14 < *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x80)));
|
|
}
|
|
if (local_aa != '\0') goto LAB_0075cd71;
|
|
(GHIDRA_CAST<std::string *>((tmpPath._buf)))->std::string::string((void *)(GHIDRA_INT(pvVar10) + iVar13));
|
|
puVar9 = local_a8;
|
|
cleanupFlags = cleanupFlags | 4;
|
|
local_8 = 6;
|
|
KAGE_LogMessage(1,(byte *)
|
|
"Costume %s supports skin color alts but no alt spritesheet could be found! (skin color %d)\n"
|
|
);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar6 = tmpPath._capacity + 1;
|
|
pcVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pcVar15 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4));
|
|
uVar6 = tmpPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar15))))) goto LAB_0075cfcd;
|
|
}
|
|
operator_delete(pcVar15,uVar6);
|
|
}
|
|
goto LAB_0075cac5;
|
|
}
|
|
pbVar14 = GHIDRA_CAST<byte *>(0x0);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x80)) == 0) goto LAB_0075cd71;
|
|
do {
|
|
local_a2 = 0;
|
|
local_dc = GHIDRA_CAST<ANM2 *>(local_b0->_playerType);
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar10) + iVar13)))))->ANM2::GetLayer(pbVar14);
|
|
if (layer->_layerData == (void *)0x0) {
|
|
tmpPath._capacity = 0xf;
|
|
tmpPath._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((tmpPath._buf)))->std::string::string((void *)(GHIDRA_INT(layer->_layerData) + 0x20));
|
|
}
|
|
cleanupFlags = cleanupFlags | 1;
|
|
local_8 = 0;
|
|
costume_path_apply_skin_color(&skinPath,&tmpPath,-1,GHIDRA_INT(local_dc),GHIDRA_CAST<byte *>(0x0),&local_a2);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar6 = tmpPath._capacity + 1;
|
|
pcVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pcVar15 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4));
|
|
uVar6 = tmpPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar15))))) goto LAB_0075cfcd;
|
|
}
|
|
operator_delete(pcVar15,uVar6);
|
|
}
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_INT(costumeDescs->_begin) + iVar13)),GHIDRA_INT(pbVar14),&skinPath);
|
|
if ((local_a2 == 0) && (local_a9 != '\0')) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14);
|
|
fVar3 = fRam00c5d09c;
|
|
fVar2 = fRam00c5d098;
|
|
fVar8 = fRam00c5d094;
|
|
layerColor = &layer->_color;
|
|
if (layerColor != GHIDRA_CAST<ColorMod *>(&DAT_00c5d090)) {
|
|
layerColor->_tint[0] = _DAT_00c5d090;
|
|
(layer->_color)._tint[1] = fVar8;
|
|
(layer->_color)._tint[2] = fVar2;
|
|
(layer->_color)._tint[3] = fVar3;
|
|
fVar3 = fRam00c5d0ac;
|
|
fVar2 = fRam00c5d0a8;
|
|
fVar8 = fRam00c5d0a4;
|
|
(layer->_color)._colorize[0] = _DAT_00c5d0a0;
|
|
(layer->_color)._colorize[1] = fVar8;
|
|
(layer->_color)._colorize[2] = fVar2;
|
|
(layer->_color)._colorize[3] = fVar3;
|
|
*GHIDRA_CAST<undefined8 *>((layer->_color)._offset) = DAT_00c5d0b0;
|
|
fVar8 = DAT_00c5d0b8;
|
|
goto LAB_0075cd12;
|
|
}
|
|
}
|
|
else {
|
|
local_80 = 0;
|
|
uStack_7c = 0;
|
|
local_78 = 0.0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14);
|
|
layerColor = &layer->_color;
|
|
if (layerColor != GHIDRA_CAST<ColorMod *>(local_a0)) {
|
|
layerColor->_tint[0] = 1.0;
|
|
(layer->_color)._tint[1] = 1.0;
|
|
(layer->_color)._tint[2] = 1.0;
|
|
(layer->_color)._tint[3] = 1.0;
|
|
(layer->_color)._colorize[0] = 0.0;
|
|
(layer->_color)._colorize[1] = 0.0;
|
|
(layer->_color)._colorize[2] = 0.0;
|
|
(layer->_color)._colorize[3] = 0.0;
|
|
*GHIDRA_CAST<ulonglong *>((layer->_color)._offset) = CONCAT44(uStack_7c,local_80);
|
|
fVar8 = local_78;
|
|
LAB_0075cd12:
|
|
layerColor->_offset[2] = fVar8;
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (0xf < skinPath._capacity) {
|
|
uVar6 = skinPath._capacity + 1;
|
|
pvVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)skinPath._buf)) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pvVar10 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(skinPath._buf)) + 0x0))) + -4);
|
|
uVar6 = skinPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(skinPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar10))))) goto LAB_0075cfcd;
|
|
}
|
|
operator_delete(pvVar10,uVar6);
|
|
}
|
|
pbVar14 = pbVar14 + 1;
|
|
pvVar10 = costumeDescs->_begin;
|
|
} while (pbVar14 < *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar10) + iVar13 + 0x80)));
|
|
puVar9 = local_a8;
|
|
}
|
|
playerAlias = local_b0;
|
|
*GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(costumeDescs->_begin) + iVar13 + 0x124)) = puVar9;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((local_b0->_costumeSpriteDescs)._begin) + iVar13 + 300)) = local_b0->_playerType;
|
|
costumeSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_INT((local_b0->_costumeSpriteDescs)._begin) + iVar13));
|
|
(GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::LoadGraphics((byte)costumeSprite);
|
|
if ((local_bc != GHIDRA_CAST<byte *>(0x0)) && (*local_bc != 0)) {
|
|
pvVar10 = (playerAlias->_costumeSpriteDescs)._begin;
|
|
if (local_b1 == 0) {
|
|
costumeSprite = GHIDRA_CAST<ANM2 *>((iVar13 + GHIDRA_INT(pvVar10)));
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::SetAnimation(local_bc,1);
|
|
if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&costumeSprite->_animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_e4)),
|
|
(costumeSprite->_animState)._animData != (void *)0x0)) {
|
|
(costumeSprite->_animState)._isPlaying = 0;
|
|
}
|
|
}
|
|
else {
|
|
costumeSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar10) + iVar13));
|
|
pbVar14 = (costumeSprite->_animState)._animData;
|
|
if (pbVar14 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_0075cd95:
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::SetAnimation(local_bc,1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&costumeSprite->_animState)))->AnimationState::Rewind();
|
|
(costumeSprite->_animState)._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar7 = pbVar14;
|
|
expectedAnimName = local_bc;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar14 + 0x14))) {
|
|
pbVar7 = *GHIDRA_CAST<byte **>(pbVar14);
|
|
}
|
|
do {
|
|
bVar4 = *pbVar7;
|
|
isNameLess = bVar4 < *expectedAnimName;
|
|
if (bVar4 != *expectedAnimName) {
|
|
LAB_0075cd7c:
|
|
uVar6 = -GHIDRA_UINT(isNameLess) | 1;
|
|
goto LAB_0075cd81;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = pbVar7[1];
|
|
isNameLess = bVar4 < expectedAnimName[1];
|
|
if (bVar4 != expectedAnimName[1]) goto LAB_0075cd7c;
|
|
pbVar7 = pbVar7 + 2;
|
|
expectedAnimName = expectedAnimName + 2;
|
|
} while (bVar4 != 0);
|
|
uVar6 = 0;
|
|
LAB_0075cd81:
|
|
if ((uVar6 != 0) || ((pbVar14[0x34] != 0 && ((costumeSprite->_animState)._isPlaying == 0))))
|
|
goto LAB_0075cd95;
|
|
}
|
|
playerAlias = local_b0;
|
|
}
|
|
}
|
|
LAB_0075cdb5:
|
|
puVar9 = bodyColor;
|
|
local_cc = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_cc) + 1));
|
|
if (0xe < local_cc) goto code_r0x0075cdcb;
|
|
goto LAB_0075c6e0;
|
|
code_r0x0075cdcb:
|
|
puVar12 = GHIDRA_CAST<undefined4 *>(playerAlias->_headColor);
|
|
if ((puVar12 != headColor) || (GHIDRA_CAST<undefined4 *>(playerAlias->_bodyColor) != bodyColor)) {
|
|
if ((g_game->_challenge == 0x2a) && (playerAlias->_playerType == 0x23)) {
|
|
uVar6 = 0;
|
|
do {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = std::_Allocate(0x40);
|
|
tmpPath._size = 0x3c;
|
|
tmpPath._capacity = 0x3f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0))),
|
|
"gfx/characters/costumes/character_016b_theforgotten_bomb.png",0x3d);
|
|
local_8 = 7;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&playerAlias->_sprite))))->Sprite::ReplaceSpritesheet(uVar6,&tmpPath);
|
|
local_8 = 0xffffffff;
|
|
bVar4 = extraout_CL;
|
|
if (0xf < tmpPath._capacity) {
|
|
size = tmpPath._capacity + 1;
|
|
pcVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0)));
|
|
if (0xfff < size) {
|
|
pcVar15 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4));
|
|
size = tmpPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar15)))))
|
|
goto LAB_0075d0d4;
|
|
}
|
|
operator_delete(pcVar15,size);
|
|
bVar4 = extraout_CL_00;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 0xf);
|
|
(GHIDRA_CAST<ANM2 *>((&playerAlias->_sprite)))->ANM2::LoadGraphics(bVar4);
|
|
playerAlias = local_b0;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerConfig) + 0x2c)) != 0) {
|
|
headSheetPath._size = 0;
|
|
headSheetPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0x0))) = (void *)0x0;
|
|
bodySheetPath._size = 0;
|
|
bodySheetPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0x0))) = (void *)0x0;
|
|
local_8 = 9;
|
|
if (puVar12 != headColor) {
|
|
headSkinPath = costume_path_apply_skin_color
|
|
(&skinPath,(void *)(GHIDRA_INT(playerConfig) + 0x1c),GHIDRA_INT(headColor),-1,
|
|
GHIDRA_CAST<byte *>(0x0),GHIDRA_CAST<byte *>(0x0));
|
|
puVar12 = GHIDRA_CAST<undefined4 *>(&headSheetPath);
|
|
if (puVar12 != headSkinPath) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0x0))) = *headSkinPath;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0x4))) = headSkinPath[1];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0x8))) = headSkinPath[2];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0xc))) = headSkinPath[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(headSheetPath)) + 0x10))) = *GHIDRA_CAST<undefined8 *>((headSkinPath + 4));
|
|
headSkinPath[4] = 0;
|
|
headSkinPath[5] = 0xf;
|
|
*GHIDRA_CAST<undefined1 *>(headSkinPath) = 0;
|
|
}
|
|
if (0xf < skinPath._capacity) {
|
|
uVar6 = skinPath._capacity + 1;
|
|
pvVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)skinPath._buf)) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pvVar10 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(skinPath._buf)) + 0x0))) + -4);
|
|
uVar6 = skinPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(skinPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar10))))) {
|
|
LAB_0075cfcd:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar10,uVar6);
|
|
puVar12 = extraout_ECX;
|
|
}
|
|
}
|
|
if (GHIDRA_CAST<undefined4 *>(playerAlias->_bodyColor) != puVar9) {
|
|
puVar9 = costume_path_apply_skin_color
|
|
(bodySkinPathTmp,(void *)(GHIDRA_INT(playerConfig) + 0x1c),GHIDRA_INT(puVar9),-1,
|
|
GHIDRA_CAST<byte *>(0x0),GHIDRA_CAST<byte *>(0x0));
|
|
if (&bodySheetPath != GHIDRA_CAST<std_string *>(puVar9)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0x0))) = *puVar9;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0x4))) = puVar9[1];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0x8))) = puVar9[2];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0xc))) = puVar9[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(bodySheetPath)) + 0x10))) = *GHIDRA_CAST<undefined8 *>((puVar9 + 4));
|
|
puVar9[4] = 0;
|
|
puVar9[5] = 0xf;
|
|
*GHIDRA_CAST<undefined1 *>(puVar9) = 0;
|
|
}
|
|
(GHIDRA_CAST<std::string *>((bodySkinPathTmp)))->std::string::_Tidy_deallocate();
|
|
puVar12 = extraout_ECX_00;
|
|
}
|
|
uVar6 = 0;
|
|
do {
|
|
if (uVar6 != 0xd) {
|
|
if (((uVar6 == 0) || (3 < uVar6)) && (uVar6 != 0xb)) {
|
|
puVar12 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
}
|
|
else {
|
|
puVar12 = GHIDRA_CAST<undefined4 *>(0x1);
|
|
}
|
|
pngFilename = &bodySheetPath;
|
|
if ((char)puVar12 == '\0') {
|
|
pngFilename = &headSheetPath;
|
|
}
|
|
if (pngFilename->_size != 0) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&playerAlias->_sprite))))->Sprite::ReplaceSpritesheet(uVar6,pngFilename);
|
|
puVar12 = extraout_ECX_01;
|
|
}
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 0xf);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),8);
|
|
if (0xf < bodySheetPath._capacity) {
|
|
uVar6 = bodySheetPath._capacity + 1;
|
|
pvVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)bodySheetPath._buf)) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pvVar10 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0x0))) + -4);
|
|
uVar6 = bodySheetPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bodySheetPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar10))))) goto LAB_0075d0d4;
|
|
}
|
|
operator_delete(pvVar10,uVar6);
|
|
puVar12 = extraout_ECX_02;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (0xf < headSheetPath._capacity) {
|
|
uVar6 = headSheetPath._capacity + 1;
|
|
pvVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)headSheetPath._buf)) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pvVar10 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0x0))) + -4);
|
|
uVar6 = headSheetPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(headSheetPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar10))))) {
|
|
LAB_0075d0d4:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar10,uVar6);
|
|
puVar12 = extraout_ECX_03;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&playerAlias->_sprite)))->ANM2::LoadGraphics((byte)puVar12);
|
|
}
|
|
playerAlias->_headColor = GHIDRA_INT(headColor);
|
|
playerAlias->_bodyColor = GHIDRA_INT(bodyColor);
|
|
}
|
|
pbVar14 = &playerAlias->_playerCostumeMap[0]._isBodyLayer;
|
|
local_cc = GHIDRA_CAST<ANM2 *>(0xf);
|
|
do {
|
|
if (-1 < (GHIDRA_CAST<PlayerCostumeMap *>((pbVar14 + -0xc)))->_index) {
|
|
costumeSprite =
|
|
GHIDRA_CAST<ANM2 *>(((GHIDRA_CAST<PlayerCostumeMap *>((pbVar14 + -0xc)))->_index * 0x130 +
|
|
GHIDRA_INT(costumeDescs->_begin)));
|
|
if (*pbVar14 == 0) {
|
|
pcVar15 = "HeadDown";
|
|
}
|
|
else {
|
|
pcVar15 = "WalkDown";
|
|
}
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(pcVar15),1);
|
|
if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&costumeSprite->_animState)))->AnimationState::SetFrameFloat(0.0),
|
|
(costumeSprite->_animState)._animData != (void *)0x0)) {
|
|
(costumeSprite->_animState)._isPlaying = 0;
|
|
}
|
|
pvVar10 = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::GetAnimationData(GHIDRA_CAST<byte *>("SubAnim"));
|
|
if (pvVar10 != (void *)0x0) {
|
|
(GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::PlayOverlay(GHIDRA_CAST<byte *>("SubAnim"),0);
|
|
}
|
|
}
|
|
pbVar14 = pbVar14 + 0x10;
|
|
local_cc = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_cc) + -1));
|
|
} while (local_cc != GHIDRA_CAST<ANM2 *>(0x0));
|
|
if (local_b0->_isCoopGhost != 0) {
|
|
reset_body_sprite(local_b0);
|
|
}
|
|
DAT_00c81148 = '\0';
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0075d1d0
|
|
void Entity_Player::AddCostume(ItemConfig_Item *collectibleID, byte itemStateOnly)
|
|
{
|
|
void **ppvVar1;
|
|
byte bVar2;
|
|
int iVar3;
|
|
int *piVar4;
|
|
void *pvVar5;
|
|
LayerState *layer;
|
|
byte *layerName;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
uint uVar6;
|
|
byte *costumeMapEntry;
|
|
byte *layerId;
|
|
uint local_184;
|
|
ANM2 *local_180;
|
|
ItemConfig_Item *costumeItem;
|
|
char isHasHeadLayer;
|
|
char isHasBodyLayer;
|
|
ANM2 newCostume;
|
|
ItemConfig_Item *local_60;
|
|
undefined4 local_5c;
|
|
undefined4 local_58;
|
|
undefined4 local_54;
|
|
undefined4 local_50;
|
|
undefined2 local_4c;
|
|
undefined4 local_48;
|
|
void *duplicateItemName [5];
|
|
uint uStack_30;
|
|
void *itemName [4];
|
|
uint uStack_1c;
|
|
uint uStack_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
ANM2 *costumeSprite;
|
|
void *edenHairBegin;
|
|
bool isDuplicate;
|
|
Manager *manager;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00afef40;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((itemName + 10));
|
|
ExceptionList = &local_10;
|
|
costumeItem = collectibleID;
|
|
if (((this->_variant != 1) && (collectibleID != GHIDRA_CAST<ItemConfig_Item *>(0x0))) &&
|
|
(this->_isCoopGhost == 0)) {
|
|
if (collectibleID->type == 1) {
|
|
if ((collectibleID->id == 0x76) && (iVar3 = GetCollectibleNum(this,0x76,0), 1 < iVar3)) {
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) >> 2 < 0x2e) {
|
|
collectibleID = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
collectibleID = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0xb4));
|
|
}
|
|
costumeItem = collectibleID;
|
|
}
|
|
if (collectibleID->type == 1) {
|
|
if ((collectibleID->id == 0x299) && (iVar3 = GetCollectibleNum(this,0x299,0), 1 < iVar3)) {
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) >> 2 < 0x7e) {
|
|
collectibleID = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
collectibleID = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 500));
|
|
}
|
|
costumeItem = collectibleID;
|
|
}
|
|
if (((collectibleID->type == 1) && (collectibleID->id == 0x2da)) &&
|
|
(iVar3 = GetCollectibleNum(this,0x2da,0), 1 < iVar3)) {
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) >> 2 < 0x7f) {
|
|
collectibleID = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
collectibleID = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x1f8));
|
|
}
|
|
costumeItem = collectibleID;
|
|
}
|
|
}
|
|
}
|
|
if (((collectibleID->type == 0) && (collectibleID->id == 0x37)) &&
|
|
(bVar2 = HasCollectible(this,0x14,0), bVar2 != 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x84,1,1);
|
|
}
|
|
if ((collectibleID->costume).anm2Path._size != 0) {
|
|
if (((this->_valid != 0) && (bVar2 = (GHIDRA_CAST<Item *>((collectibleID)))->Item::HasTags(0x40000000), bVar2 != 0)) &&
|
|
(this->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
AddCostume(this->_backupPlayer,collectibleID,itemStateOnly);
|
|
}
|
|
if ((g_game->_challenge != 0x1e) ||
|
|
((bVar2 = (GHIDRA_CAST<Item *>((collectibleID)))->Item::IsCollectible(), bVar2 != 0 && (collectibleID->id == 0xb8))))
|
|
{
|
|
pvVar5 = (this->_costumeSpriteDescs)._begin;
|
|
isDuplicate = false;
|
|
if (pvVar5 != (this->_costumeSpriteDescs)._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x114)) == collectibleID) {
|
|
piVar4 = GHIDRA_CAST<int *>(std)::vector<CostumeSprite>::erase(&local_184,pvVar5);
|
|
isDuplicate = true;
|
|
pvVar5 = (void *)*piVar4;
|
|
}
|
|
else {
|
|
pvVar5 = (void *)(GHIDRA_INT(pvVar5) + 0x130);
|
|
}
|
|
} while (pvVar5 != (this->_costumeSpriteDescs)._end);
|
|
if (isDuplicate) {
|
|
(GHIDRA_CAST<ItemConfig_Item *>((collectibleID)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(duplicateItemName),0);
|
|
local_8 = (void *)0x0;
|
|
KAGE_LogMessage(1,(byte *)
|
|
"Adding costume for %d (%s) which was added before and never removed.\n"
|
|
);
|
|
local_8 = (void *)0xffffffff;
|
|
if (0xf < uStack_30) {
|
|
uVar6 = uStack_30 + 1;
|
|
pvVar5 = duplicateItemName[0];
|
|
if (0xfff < uVar6) {
|
|
pvVar5 = *(void **)(GHIDRA_INT(duplicateItemName[0]) + -4);
|
|
uVar6 = uStack_30 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(duplicateItemName[0]) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar6);
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&newCostume)))->ANM2::constructor();
|
|
local_5c = 0;
|
|
local_58 = 0;
|
|
local_54 = 0;
|
|
local_50 = 0;
|
|
local_4c = 0;
|
|
local_48 = 0xffffffff;
|
|
local_8 = (void *)0x1;
|
|
pvVar5 = (this->_costumeSpriteDescs)._end;
|
|
local_60 = collectibleID;
|
|
if (pvVar5 == (this->_costumeSpriteDescs)._capacity) {
|
|
FUN_007dd940(pvVar5,&newCostume);
|
|
}
|
|
else {
|
|
FUN_007dd8a0();
|
|
ppvVar1 = &(this->_costumeSpriteDescs)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x130);
|
|
}
|
|
local_8 = (void *)0x2;
|
|
(GHIDRA_CAST<ANM2 *>((&newCostume)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&newCostume._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&newCostume._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((newCostume._animDefaultName._buf)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&newCostume))))->std::string::_Tidy_deallocate();
|
|
local_8 = (void *)0xffffffff;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x18)) = (collectibleID->costume).priority;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x13)) = (collectibleID->costume).isFlying
|
|
;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x12)) =
|
|
(collectibleID->costume).hasOverlay;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x10)) = (collectibleID->costume).skinColor
|
|
;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0xc)) = (collectibleID->costume).skinColor;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x11)) =
|
|
(collectibleID->costume).hasSkinAlt;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -8)) =
|
|
(collectibleID->costume).overwriteColor;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -7)) = itemStateOnly;
|
|
if (((g_game->_dailyChallenge)._specialDailyId == 0xd) &&
|
|
((((iVar3 = collectibleID->type, iVar3 == 1 || (iVar3 == 3)) || (iVar3 == 4)) &&
|
|
(collectibleID->id == 0x1a8)))) {
|
|
piVar4 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x18));
|
|
*piVar4 = *piVar4 + 3;
|
|
}
|
|
local_180 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x130));
|
|
(GHIDRA_CAST<ANM2 *>((local_180)))->ANM2::Load(&(collectibleID->costume).anm2Path,0);
|
|
manager = g_manager;
|
|
bVar2 = extraout_CL;
|
|
if ((collectibleID->type == 0) &&
|
|
((collectibleID->id == 0xc || (collectibleID->id == 0x58)))) {
|
|
local_184 = this->_initSeed;
|
|
pvVar5 = (g_manager->_entityConfig)._edenHair._end;
|
|
if ((g_manager->_entityConfig)._edenHair._begin == pvVar5) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Eden has no hair!\n"));
|
|
pvVar5 = (manager->_entityConfig)._edenHair._end;
|
|
}
|
|
edenHairBegin = (manager->_entityConfig)._edenHair._begin;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(local_180),0,
|
|
(std_string *)
|
|
(GHIDRA_INT(edenHairBegin) +
|
|
(local_184 % GHIDRA_UINT(((GHIDRA_INT(pvVar5) - GHIDRA_INT(edenHairBegin)) / 0x18))) * 0x18));
|
|
bVar2 = extraout_CL_00;
|
|
}
|
|
costumeSprite = local_180;
|
|
(GHIDRA_CAST<ANM2 *>((local_180)))->ANM2::LoadGraphics(bVar2);
|
|
local_180 = &this->_sprite;
|
|
isHasHeadLayer = '\0';
|
|
costumeMapEntry = &this->_playerCostumeMap[0]._isBodyLayer;
|
|
isHasBodyLayer = '\0';
|
|
layerId = GHIDRA_CAST<byte *>(0x0);
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((local_180)))->ANM2::GetLayer(layerId);
|
|
pvVar5 = layer->_layerData;
|
|
if (pvVar5 == (void *)0x0) {
|
|
layerName = &s_empty;
|
|
}
|
|
else {
|
|
layerName = GHIDRA_CAST<byte *>((GHIDRA_INT(pvVar5) + 8));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar5) + 0x1c))) {
|
|
layerName = *GHIDRA_CAST<byte **>(layerName);
|
|
}
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::GetLayer(layerName);
|
|
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
if (*costumeMapEntry == 0) {
|
|
isHasHeadLayer = '\x01';
|
|
}
|
|
else {
|
|
isHasBodyLayer = '\x01';
|
|
}
|
|
}
|
|
layerId = layerId + 1;
|
|
costumeMapEntry = costumeMapEntry + 0x10;
|
|
} while (layerId < &DAT_0000000f);
|
|
if (isHasHeadLayer == '\0') {
|
|
if (isHasBodyLayer == '\0') {
|
|
(GHIDRA_CAST<ItemConfig_Item *>((costumeItem)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(itemName),0);
|
|
local_8 = (void *)0x3;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Costume for item %d (%s) has no layers!\n"));
|
|
local_8 = (void *)0xffffffff;
|
|
if (0xf < uStack_18) {
|
|
uVar6 = uStack_18 + 1;
|
|
pvVar5 = itemName[0];
|
|
if (0xfff < uVar6) {
|
|
pvVar5 = *(void **)(GHIDRA_INT(itemName[0]) + -4);
|
|
uVar6 = uStack_18 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(itemName[0]) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar6);
|
|
}
|
|
uStack_1c = 0;
|
|
uStack_18 = 0xf;
|
|
itemName[0] = (void *)(GHIDRA_UINT(itemName[0]) & 0xffffff00);
|
|
}
|
|
}
|
|
else if (isHasBodyLayer != '\0') {
|
|
pvVar5 = (this->_costumeSpriteDescs)._end;
|
|
if (pvVar5 == (this->_costumeSpriteDescs)._capacity) {
|
|
FUN_007ddac0(pvVar5,GHIDRA_INT(pvVar5) + -0x130);
|
|
}
|
|
else {
|
|
FUN_007de0e0(GHIDRA_INT(pvVar5) + -0x130);
|
|
ppvVar1 = &(this->_costumeSpriteDescs)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x130);
|
|
}
|
|
}
|
|
UpdateCostumes(this);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0075d800
|
|
void Entity_Player::AddNullCostume(int costumeid)
|
|
{
|
|
void *nullItemsBegin;
|
|
|
|
if ((costumeid < 0) ||
|
|
(nullItemsBegin = (g_manager->_itemConfig)._nullItems._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItemsBegin) >> 2 <= costumeid)) {
|
|
AddCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
return;
|
|
}
|
|
AddCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(nullItemsBegin) + costumeid * 4)),0);
|
|
return;
|
|
}
|
|
|
|
// 0075d850
|
|
void Entity_Player::RemoveCostume(ItemConfig_Item *Item)
|
|
{
|
|
byte isHasTag;
|
|
int *nextCostumeIt;
|
|
void *costumeIt;
|
|
Entity_Player *local_c [2];
|
|
bool isRemoved;
|
|
|
|
if (((Item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (this->_variant != 1)) &&
|
|
((Item->costume).anm2Path._size != 0)) {
|
|
local_c[0] = this;
|
|
if (this->_valid != 0) {
|
|
isHasTag = ::(GHIDRA_CAST<Item *>((Item)))->Item::HasTags(0x40000000);
|
|
if ((isHasTag != 0) && (this->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
RemoveCostume(this->_backupPlayer,Item);
|
|
}
|
|
}
|
|
costumeIt = (this->_costumeSpriteDescs)._begin;
|
|
isRemoved = false;
|
|
if (costumeIt != (this->_costumeSpriteDescs)._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(costumeIt) + 0x114)) == Item) {
|
|
nextCostumeIt = GHIDRA_CAST<int *>(std)::vector<CostumeSprite>::erase(local_c,costumeIt);
|
|
isRemoved = true;
|
|
costumeIt = (void *)*nextCostumeIt;
|
|
}
|
|
else {
|
|
costumeIt = (void *)(GHIDRA_INT(costumeIt) + 0x130);
|
|
}
|
|
} while (costumeIt != (this->_costumeSpriteDescs)._end);
|
|
if (isRemoved) {
|
|
UpdateCostumes(this);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0075d980
|
|
byte Entity_Player::IsNullItemCostumeVisible(int nullItemID, int playerSpriteLayerID)
|
|
{
|
|
byte isVisible;
|
|
void *nullItems;
|
|
|
|
if ((nullItemID < 0) ||
|
|
(nullItems = (g_manager->_itemConfig)._nullItems._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) >> 2 <= nullItemID)) {
|
|
isVisible = IsItemCostumeVisible(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),playerSpriteLayerID);
|
|
return isVisible;
|
|
}
|
|
isVisible = IsItemCostumeVisible
|
|
(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(nullItems) + nullItemID * 4)),
|
|
playerSpriteLayerID);
|
|
return isVisible;
|
|
}
|
|
|
|
// 0075dfe0
|
|
void Entity_Player::ClearCostumes()
|
|
{
|
|
uint layer;
|
|
byte bVar1;
|
|
int *costumeMapLayerId;
|
|
|
|
FUN_007ddf80(this);
|
|
(this->_costumeSpriteDescs)._end = (this->_costumeSpriteDescs)._begin;
|
|
layer = 0;
|
|
costumeMapLayerId = &this->_playerCostumeMap[0]._layerID;
|
|
do {
|
|
(GHIDRA_CAST<PlayerCostumeMap *>((costumeMapLayerId + -1)))->_index = -1;
|
|
*costumeMapLayerId = -1;
|
|
costumeMapLayerId[1] = 0;
|
|
if (((layer == 0) || (3 < layer)) && (layer != 0xb)) {
|
|
bVar1 = 0;
|
|
}
|
|
else {
|
|
bVar1 = 1;
|
|
}
|
|
*GHIDRA_CAST<byte *>((costumeMapLayerId + 2)) = bVar1;
|
|
layer = layer + 1;
|
|
costumeMapLayerId = costumeMapLayerId + 4;
|
|
} while (layer < 0xf);
|
|
return;
|
|
}
|
|
|
|
// 0075e190
|
|
void Entity_Player::ClearQueueItem()
|
|
{
|
|
byte isHoldingItem;
|
|
|
|
isHoldingItem = IsHoldingItem(this);
|
|
if (isHoldingItem != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
}
|
|
(this->_queuedItem)._item = (void *)0x0;
|
|
(this->_queuedItem)._charge = 0;
|
|
(this->_queuedItem)._flags = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x17d0)))) = 0;
|
|
return;
|
|
}
|
|
|
|
// 0075e1d0
|
|
byte Entity_Player::FlushQueueItem()
|
|
{
|
|
int unk;
|
|
int charge;
|
|
int vardata;
|
|
uint trinketId;
|
|
uint uVar1;
|
|
int iVar2;
|
|
uint type;
|
|
byte queueFlags;
|
|
RNG dailyRng;
|
|
int *itemConfig;
|
|
void *room;
|
|
|
|
if ((this->_queuedItem)._item == (void *)0x0) {
|
|
try_trigger_astral_projection(this);
|
|
return 0;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("item queue flush\n"));
|
|
itemConfig = (this->_queuedItem)._item;
|
|
charge = (this->_queuedItem)._charge;
|
|
uVar1 = *GHIDRA_CAST<uint *>(&(this->_queuedItem)._flags);
|
|
vardata = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x17d0))));
|
|
unk = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x17d4))));
|
|
(this->_queuedItem)._item = (void *)0x0;
|
|
(this->_queuedItem)._charge = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x17d0)))) = 0;
|
|
iVar2 = *itemConfig;
|
|
queueFlags = (byte)uVar1;
|
|
if (((iVar2 == 1) || (iVar2 == 3)) || (iVar2 == 4)) {
|
|
iVar2 = itemConfig[1];
|
|
if ((g_game->_dailyChallenge)._specialDailyId == 7) {
|
|
room = g_game->_room;
|
|
dailyRng._shift1 = 1;
|
|
dailyRng._shift2 = 5;
|
|
dailyRng._shift3 = 0x10;
|
|
dailyRng._seed = iVar2;
|
|
uVar1 = (GHIDRA_CAST<RNG *>((&dailyRng)))->RNG::Next();
|
|
iVar2 = ItemPool::GetSeededCollectible(uVar1,0,*GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(room) + 4)));
|
|
}
|
|
AddCollectible(this,iVar2,charge,~queueFlags & 1,0,vardata,unk);
|
|
}
|
|
else if (iVar2 == 2) {
|
|
trinketId = itemConfig[1];
|
|
if ((g_game->_dailyChallenge)._specialDailyId == 7) {
|
|
trinketId = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetTrinket(0);
|
|
}
|
|
type = trinketId | 0x8000;
|
|
if ((uVar1 & 2) == 0) {
|
|
type = trinketId;
|
|
}
|
|
AddTrinket(this,type,queueFlags & 1 ^ 1);
|
|
try_trigger_astral_projection(this);
|
|
return 1;
|
|
}
|
|
try_trigger_astral_projection(this);
|
|
return 1;
|
|
}
|
|
|
|
// 0075e320
|
|
void Entity_Player::IncrementPlayerFormCounter(int ePlayerForm, int num)
|
|
{
|
|
byte bVar1;
|
|
Vector *position;
|
|
int iVar2;
|
|
int charge;
|
|
ItemConfig_Item *Item;
|
|
char isFormActive;
|
|
int iVar3;
|
|
byte *formName;
|
|
uint uVar4;
|
|
Manager *manager;
|
|
int *activeVarData;
|
|
HUD *messageSlot;
|
|
bool bVar5;
|
|
uint slot;
|
|
byte bVar6;
|
|
byte bVar7;
|
|
char isFormActiveBefore;
|
|
Manager *sfxOwner;
|
|
Vector local_18;
|
|
Vector local_10;
|
|
bool isPrevFound;
|
|
void *playerFormConfigs;
|
|
|
|
if ((((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && (GHIDRA_UINT(ePlayerForm) < 0x10)
|
|
) && (2 < this->_playerForms[ePlayerForm])) {
|
|
isFormActiveBefore = '\x01';
|
|
}
|
|
else {
|
|
isFormActiveBefore = '\0';
|
|
}
|
|
iVar3 = this->_playerForms[ePlayerForm] + num;
|
|
iVar2 = 0;
|
|
if (0 < iVar3) {
|
|
iVar2 = iVar3;
|
|
}
|
|
this->_playerForms[ePlayerForm] = iVar2;
|
|
if (ePlayerForm == 0xf) {
|
|
this->_playerForms[0xf] = 0;
|
|
bVar1 = HasCollectible(this,0x23,0);
|
|
if (bVar1 != 0) {
|
|
this->_playerForms[0xf] = this->_playerForms[0xf] + 1;
|
|
}
|
|
bVar1 = HasCollectible(this,0x106,0);
|
|
if (bVar1 != 0) {
|
|
this->_playerForms[0xf] = this->_playerForms[0xf] + 1;
|
|
}
|
|
bVar1 = HasTrinket(this,0x30,0);
|
|
if (bVar1 != 0) {
|
|
this->_playerForms[0xf] = this->_playerForms[0xf] + 1;
|
|
}
|
|
}
|
|
if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) &&
|
|
((GHIDRA_UINT(ePlayerForm) < 0x10 && (2 < this->_playerForms[ePlayerForm])))) {
|
|
isFormActive = '\x01';
|
|
}
|
|
else {
|
|
isFormActive = '\0';
|
|
}
|
|
if (isFormActiveBefore == isFormActive) {
|
|
return;
|
|
}
|
|
if (isFormActive != '\0') {
|
|
Player_stats_add(&g_game->_onlinePlayerStats,10,this,1.0);
|
|
}
|
|
manager = g_manager;
|
|
sfxOwner = g_manager;
|
|
if ((ePlayerForm < 0) ||
|
|
(playerFormConfigs = (g_manager->_itemConfig)._playerForms._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) - GHIDRA_INT(playerFormConfigs) >> 2 <= ePlayerForm))
|
|
{
|
|
local_10.x = 0.0;
|
|
}
|
|
else {
|
|
local_10.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(playerFormConfigs) + ePlayerForm * 4));
|
|
if (local_10.x != 0.0) {
|
|
this->_cacheFlags = this->_cacheFlags | *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_10.x) + 0x2c));
|
|
}
|
|
}
|
|
switch(ePlayerForm) {
|
|
case 0:
|
|
if (isFormActive == '\0') break;
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x41);
|
|
goto LAB_0075e806;
|
|
case 1:
|
|
if (isFormActive != '\0') {
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::TryUnlock(0xb2);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x160);
|
|
goto LAB_0075e806;
|
|
}
|
|
break;
|
|
case 2:
|
|
if (isFormActive == '\0') break;
|
|
bVar5 = (this->_playerFormsRewarded & 4) == 0;
|
|
goto LAB_0075e541;
|
|
case 3:
|
|
if (isFormActive != '\0') {
|
|
if ((this->_playerFormsRewarded & 8) == 0) {
|
|
AddSoulHearts(this,6,0);
|
|
}
|
|
goto LAB_0075e806;
|
|
}
|
|
break;
|
|
default:
|
|
goto switchD_0075e474_caseD_4;
|
|
case 5:
|
|
if (isFormActive != '\0') {
|
|
if ((this->_playerFormsRewarded & 0x20) == 0) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0xd0)))))->RNG::Next();
|
|
position = Room::FindFreePickupSpawnPosition(g_game->_room,&local_18,&this->_pos,40.0,0,0,0)
|
|
;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,0x46,position,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
}
|
|
goto LAB_0075e806;
|
|
}
|
|
break;
|
|
case 8:
|
|
if (isFormActive != '\0') {
|
|
if ((this->_playerFormsRewarded & 0x100U) == 0) {
|
|
AddBlackHearts(this,4);
|
|
}
|
|
goto LAB_0075e806;
|
|
}
|
|
break;
|
|
case 0xb:
|
|
if (isFormActive == '\0') break;
|
|
bVar5 = (this->_playerFormsRewarded & 0x800U) == 0;
|
|
LAB_0075e541:
|
|
if (bVar5) {
|
|
AddMaxHearts(this,2,0);
|
|
AddHearts(this,2,0,0);
|
|
}
|
|
LAB_0075e806:
|
|
AddPlayerFormCostume(this,ePlayerForm);
|
|
if (local_10.x != 0.0) {
|
|
formName = GHIDRA_CAST<byte *>((GHIDRA_INT(local_10.x) + 0x10));
|
|
messageSlot = &g_game->_hud;
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_10.x) + 0x24))) {
|
|
formName = *GHIDRA_CAST<byte **>(formName);
|
|
}
|
|
formName = string_table_translate(&g_manager->_stringTable,formName);
|
|
uVar4 = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((messageSlot->_messageStack + 2)) == '\0') {
|
|
(GHIDRA_CAST<HUD_Message *>((messageSlot->_messageStack)))->HUD_Message::Show(formName,&s_empty,1,0);
|
|
break;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
messageSlot = GHIDRA_CAST<HUD *>((messageSlot->_playerHUD + 500));
|
|
} while (uVar4 < 6);
|
|
}
|
|
manager = g_manager;
|
|
local_10.x = 1.84971e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_10));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_10.x),1.0,2,0,1.0,0.0);
|
|
uVar4 = Random();
|
|
local_10.x = (this->_pos).x + 0.0;
|
|
local_10.y = (this->_pos).y + 5.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&local_10,&g_vectorZero,GHIDRA_CAST<Entity *>(this),2,uVar4,0);
|
|
this->_playerForms[(GHIDRA_UINT(ePlayerForm) >> 5) + 0x10] =
|
|
this->_playerForms[(GHIDRA_UINT(ePlayerForm) >> 5) + 0x10] | 1 << ((byte)ePlayerForm & 0x1f);
|
|
return;
|
|
case 0xf:
|
|
bVar5 = false;
|
|
activeVarData = &this->_activeDesc[0]._varData;
|
|
isPrevFound = false;
|
|
uVar4 = 0;
|
|
do {
|
|
if ((GHIDRA_CAST<ActiveItemDesc *>((activeVarData + -7)))->_item == 0x23) {
|
|
if (bVar5) {
|
|
*activeVarData = 0;
|
|
bVar5 = isPrevFound;
|
|
}
|
|
else {
|
|
bVar5 = isPrevFound;
|
|
if (*activeVarData == 1) {
|
|
if ((this->_playerFormsRewarded & 0x8000U) == 0) {
|
|
bVar7 = 1;
|
|
bVar6 = 0;
|
|
bVar1 = 0;
|
|
slot = uVar4;
|
|
iVar2 = GetActiveMaxCharge(this,uVar4);
|
|
AddActiveCharge(this,iVar2,slot,bVar1,bVar6,bVar7);
|
|
sfxOwner = g_manager;
|
|
}
|
|
if (isFormActive != '\0') {
|
|
local_18.x = 1.46996e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_18));
|
|
(GHIDRA_CAST<SoundEffects *>((&sfxOwner->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18.x),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x2f,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
sfxOwner = g_manager;
|
|
}
|
|
bVar5 = true;
|
|
}
|
|
}
|
|
local_18.x = 1.46996e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_18));
|
|
(GHIDRA_CAST<SoundEffects *>((&sfxOwner->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18.x),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::InvalidateActiveItem(this,uVar4);
|
|
sfxOwner = g_manager;
|
|
manager = g_manager;
|
|
isPrevFound = bVar5;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
activeVarData = activeVarData + 8;
|
|
} while (uVar4 < 4);
|
|
if (!bVar5) {
|
|
if (isFormActive != '\0') {
|
|
iVar2 = GetActiveItemSlot(this,0x23);
|
|
if (-1 < iVar2) {
|
|
if (((this->_playerFormsRewarded & 0x8000U) == 0) ||
|
|
((this->_activeDesc[iVar2]._varData == 1 &&
|
|
(iVar3 = GetActiveItem(this,iVar2), 0 < iVar3)))) {
|
|
iVar3 = 1;
|
|
}
|
|
else {
|
|
iVar3 = 0;
|
|
}
|
|
this->_activeDesc[iVar2]._varData = iVar3;
|
|
if ((this->_playerFormsRewarded & 0x8000U) == 0) {
|
|
bVar7 = 1;
|
|
bVar6 = 0;
|
|
bVar1 = 0;
|
|
iVar3 = iVar2;
|
|
charge = GetActiveMaxCharge(this,iVar2);
|
|
AddActiveCharge(this,charge,iVar3,bVar1,bVar6,bVar7);
|
|
sfxOwner = g_manager;
|
|
}
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::InvalidateActiveItem(this,iVar2);
|
|
local_18.x = 1.46996e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_18));
|
|
(GHIDRA_CAST<SoundEffects *>((&sfxOwner->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18.x),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x2f,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
goto LAB_0075e806;
|
|
}
|
|
break;
|
|
}
|
|
switchD_0075e474_caseD_4:
|
|
if (isFormActive == '\0') break;
|
|
goto LAB_0075e806;
|
|
}
|
|
if ((((-1 < ePlayerForm) &&
|
|
(playerFormConfigs = (manager->_itemConfig)._playerForms._begin,
|
|
ePlayerForm < GHIDRA_INT((manager->_itemConfig)._playerForms._end) - GHIDRA_INT(playerFormConfigs) >> 2))
|
|
&& (iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerFormConfigs) + ePlayerForm * 4)), iVar2 != 0)) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((iVar2 + 0x28)), iVar2 != -1)) {
|
|
Item = (GHIDRA_CAST<Config *>((&manager->_itemConfig)))->Config::GetNullItem(iVar2);
|
|
RemoveCostume(this,Item);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0075e9a0
|
|
void Entity_Player::AddPlayerFormCostume(int playerForm)
|
|
{
|
|
void *pvVar1;
|
|
int iVar2;
|
|
|
|
if (-1 < playerForm) {
|
|
pvVar1 = (g_manager->_itemConfig)._playerForms._begin;
|
|
if (((playerForm < GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) - GHIDRA_INT(pvVar1) >> 2) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + playerForm * 4)), iVar2 != 0)) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((iVar2 + 0x28)), iVar2 != -1)) {
|
|
if ((-1 < iVar2) &&
|
|
(pvVar1 = (g_manager->_itemConfig)._nullItems._begin,
|
|
iVar2 < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) >> 2)) {
|
|
AddCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + iVar2 * 4)),0);
|
|
return;
|
|
}
|
|
AddCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0075ea20
|
|
void Entity_Player::SetItemState(int collectibleId)
|
|
{
|
|
FlushQueueItem(this);
|
|
this->_itemState = collectibleId;
|
|
return;
|
|
}
|
|
|
|
// 0075ea40
|
|
void Entity_Player::render_charge_bars(Vector *renderPos)
|
|
{
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
int bar;
|
|
void *effect;
|
|
ANM2 *chargeBar;
|
|
AnimationState *secondLayer;
|
|
void **weaponSlot2;
|
|
uint uVar4;
|
|
void **weaponSlot;
|
|
float10 fVar5;
|
|
float fVar6;
|
|
int visibleBars [6];
|
|
int visibleBarCount;
|
|
float barOffsetY;
|
|
float barOffsetX;
|
|
undefined1 local_14 [8];
|
|
float local_c;
|
|
float local_8;
|
|
int bar;
|
|
void *collectibles;
|
|
Manager *manager;
|
|
EntityPtr twin;
|
|
|
|
if ((g_manager->_optionsConfig)._enableChargeBars == 0) {
|
|
return;
|
|
}
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) &&
|
|
(bVar2 = (GHIDRA_CAST<NetplayManager *>((&g_manager->_netplayManager)))->NetplayManager::IsIdxLocalPlayer(this->_controllerIndex),
|
|
bVar2 == 0)) {
|
|
return;
|
|
}
|
|
manager = g_manager;
|
|
barOffsetY = (this->_playerSpriteScale).y;
|
|
visibleBarCount = 0;
|
|
barOffsetX = barOffsetY * 12.0;
|
|
barOffsetY = barOffsetY * -35.0;
|
|
if ((this->_itemState == 0x2c6) && (5 < this->_bagOfCraftingHoldFrames)) {
|
|
bar = GHIDRA_INT(((((float)this->_bagOfCraftingHoldFrames - 5.0) / 25.0) * 100.0));
|
|
chargeBar = this->_chargeBarSprites;
|
|
}
|
|
else {
|
|
if (this->_playerType == 0x1b) {
|
|
effect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x2c0);
|
|
collectibles = (manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibles) & 0xfffffffcU)) <
|
|
0xb01) {
|
|
bar = 0;
|
|
}
|
|
else {
|
|
bar = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibles) + 0xb00));
|
|
}
|
|
if (effect == (void *)0x0) {
|
|
fVar6 = 0.0;
|
|
}
|
|
else {
|
|
fVar6 = ((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(effect) + 8)) * 100.0) / (float)*GHIDRA_CAST<int *>((bar + 0x78));
|
|
}
|
|
FUN_0075ef20(this->_chargeBarSprites + 5,GHIDRA_INT(fVar6));
|
|
}
|
|
bVar2 = HasCollectible(this,0x2c9,0);
|
|
if ((bVar2 != 0) && (this->_playerType == 0x1a)) {
|
|
FUN_0075ef20(this->_chargeBarSprites + 6,
|
|
GHIDRA_INT((((float)this->_eveSumptoriumCharge / 60.0) * 100.0)));
|
|
}
|
|
weaponSlot2 = this->_weapons + 1;
|
|
local_8 = 0.0;
|
|
weaponSlot = weaponSlot2;
|
|
do {
|
|
if (*weaponSlot != GHIDRA_CAST<int *>(0x0)) {
|
|
fVar5 = (float10)(**(code **)(*GHIDRA_CAST<int *>(*weaponSlot) + 0x1c))();
|
|
local_c = (float)fVar5;
|
|
if (0.0 < local_c) {
|
|
bar = GHIDRA_INT((local_c * 100.0));
|
|
goto LAB_0075ebfa;
|
|
}
|
|
}
|
|
local_8 = (float)(GHIDRA_INT(local_8) + 1);
|
|
weaponSlot = weaponSlot + 1;
|
|
} while (GHIDRA_UINT(local_8) < 4);
|
|
bar = 0;
|
|
LAB_0075ebfa:
|
|
FUN_0075ef20(this->_chargeBarSprites,bar);
|
|
uVar4 = 0;
|
|
do {
|
|
if (*weaponSlot2 != GHIDRA_CAST<int *>(0x0)) {
|
|
fVar5 = (float10)(**(code **)(*GHIDRA_CAST<int *>(*weaponSlot2) + 0x20))();
|
|
local_c = (float)fVar5;
|
|
if (0.0 < local_c) {
|
|
bar = GHIDRA_INT((local_c * 100.0));
|
|
goto LAB_0075ec3c;
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
weaponSlot2 = weaponSlot2 + 1;
|
|
} while (uVar4 < 4);
|
|
bar = 0;
|
|
LAB_0075ec3c:
|
|
FUN_0075ef20(this->_chargeBarSprites + 1,bar);
|
|
bVar2 = HasCollectible(this,399,0);
|
|
if (bVar2 != 0) {
|
|
fVar6 = ((float)this->_mawOfTheVoidChargeTimer * 100.0) / 150.0;
|
|
if (fVar6 <= 0.0) {
|
|
fVar6 = 0.0;
|
|
}
|
|
if (100.0 <= fVar6) {
|
|
fVar6 = 100.0;
|
|
}
|
|
bar = 0;
|
|
if (5 < GHIDRA_INT(fVar6)) {
|
|
bar = GHIDRA_INT(fVar6);
|
|
}
|
|
FUN_0075ef20(this->_chargeBarSprites + 2,bar);
|
|
}
|
|
bVar2 = HasCollectible(this,0x283,0);
|
|
if (bVar2 != 0) {
|
|
fVar6 = ((float)this->_revelationChargeTimer * 100.0) / 150.0;
|
|
if (fVar6 <= 0.0) {
|
|
fVar6 = 0.0;
|
|
}
|
|
if (100.0 <= fVar6) {
|
|
fVar6 = 100.0;
|
|
}
|
|
bar = 0;
|
|
if (5 < GHIDRA_INT(fVar6)) {
|
|
bar = GHIDRA_INT(fVar6);
|
|
}
|
|
FUN_0075ef20(this->_chargeBarSprites + 3,bar);
|
|
}
|
|
bVar2 = HasCollectible(this,0x2a8,0);
|
|
if (bVar2 == 0) goto LAB_0075ed54;
|
|
fVar6 = ((float)this->_montezumaChargeTimer * 100.0) / 150.0;
|
|
if (fVar6 <= 0.0) {
|
|
fVar6 = 0.0;
|
|
}
|
|
if (100.0 <= fVar6) {
|
|
fVar6 = 100.0;
|
|
}
|
|
bar = 0;
|
|
if (5 < GHIDRA_INT(fVar6)) {
|
|
bar = GHIDRA_INT(fVar6);
|
|
}
|
|
chargeBar = this->_chargeBarSprites + 4;
|
|
}
|
|
FUN_0075ef20(chargeBar,bar);
|
|
LAB_0075ed54:
|
|
local_8 = 1.0;
|
|
bar = visibleBarCount;
|
|
if (((this->_exists != 0) &&
|
|
(((this->_playerType == 0x1d || (this->_playerType == 0x26)) &&
|
|
(twin = this->_twinPlayer, twin != (EntityPtr)0x0)))) &&
|
|
(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x161c)) != -1 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x161c)) < this->_playerIndex))
|
|
&& (twin != (EntityPtr)this)))) {
|
|
local_14 = (undefined1 [8])0x500000002;
|
|
uVar4 = g_game->_frameCount + 1;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> 2 ^ uVar4;
|
|
uVar4 = uVar4 << 5 ^ uVar4;
|
|
uVar4 = uVar4 >> 0x15 ^ uVar4;
|
|
local_8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10 * 0.15 + 0.05;
|
|
}
|
|
while (bar = bar + -1, -1 < bar) {
|
|
bar = visibleBars[bar];
|
|
*GHIDRA_CAST<float *>((bar + 0xb4)) = local_8;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x4))) = barOffsetX + renderPos->x + *GHIDRA_CAST<float *>((&DAT_00c5d0bc + bar * 8));
|
|
local_c = barOffsetY + renderPos->y + *GHIDRA_CAST<float *>((&DAT_00c5d0c0 + bar * 8));
|
|
if (*GHIDRA_CAST<char *>((bar + 0x109)) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((bar + 0x70)) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((bar + 0x30)),GHIDRA_CAST<Vector *>((local_14 + 4)),&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondLayer = GHIDRA_CAST<AnimationState *>((bar + 0x50));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((bar + 0x50)),GHIDRA_CAST<Vector *>((local_14 + 4)),&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondLayer = GHIDRA_CAST<AnimationState *>((bar + 0x30));
|
|
}
|
|
AnimationState::Render(secondLayer,GHIDRA_CAST<Vector *>((local_14 + 4)),&g_vectorZero,&g_vectorZero);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((bar + 0xb4)) = 0x3f800000;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0075eff0
|
|
int Entity_Player::GetCollectibleCount()
|
|
{
|
|
int totalCount;
|
|
int remaining;
|
|
int *countIt;
|
|
|
|
countIt = (this->_collectibleCounts)._begin;
|
|
totalCount = 0;
|
|
for (remaining = GHIDRA_INT((this->_collectibleCounts)._end) - GHIDRA_INT(countIt) >> 2; remaining != 0;
|
|
remaining = remaining + -1) {
|
|
totalCount = totalCount + *countIt;
|
|
countIt = countIt + 1;
|
|
}
|
|
return totalCount;
|
|
}
|
|
|
|
// 00763570
|
|
void Entity_Player::EvaluateItems()
|
|
{
|
|
undefined1 auVar1 [16];
|
|
byte bVar2;
|
|
char cVar3;
|
|
byte isProptosisEffect;
|
|
int iVar4;
|
|
int iVar5;
|
|
Vector *vecResult;
|
|
Weapon *weapon;
|
|
int iVar6;
|
|
int iVar7;
|
|
int iVar8;
|
|
int iVar9;
|
|
float *pfVar10;
|
|
void *pvVar11;
|
|
Entity *entity;
|
|
ChallengeParam *challengeParams;
|
|
float *pfVar12;
|
|
int *piVar13;
|
|
undefined4 *puVar14;
|
|
int iVar15;
|
|
int iVar16;
|
|
int iVar17;
|
|
int iVar18;
|
|
int iVar19;
|
|
int numOddMushroomLarge;
|
|
int numMark;
|
|
int numGrowthHormones;
|
|
int numPentagram;
|
|
int numSteven;
|
|
int numSynthoilEffects;
|
|
int numDarkMatterEffects;
|
|
int numGuillotineEffects;
|
|
int numOddMushroomEffects;
|
|
int numGrowthHormonesEffects;
|
|
int nullDamageUpCount;
|
|
ItemConfig *itemConfig;
|
|
ItemConfig_Item *pIVar20;
|
|
Entity_Player *pEVar21;
|
|
BitSet128 *flagsResult;
|
|
ColorMod *other;
|
|
ColorMod *other_00;
|
|
Entity_Familiar *this_00;
|
|
ColorMod *other_01;
|
|
ColorMod *color;
|
|
ColorMod *other_02;
|
|
RNG *pRVar22;
|
|
uint *clampedCount;
|
|
ItemConfig_Item *collectibleItem;
|
|
PersistentGameData *persistentGameData;
|
|
char *pcVar23;
|
|
RNG *rng;
|
|
ItemOverlay *this_01;
|
|
EntityList *entityList;
|
|
Room *room;
|
|
PlayerManager *playerManager;
|
|
TemporaryEffects *temporaryEffects;
|
|
ColorMod *extraout_EAX;
|
|
ColorMod *colorResult;
|
|
Entity_Player *parentPlayer;
|
|
uint uVar24;
|
|
int *weaponTypeCursor;
|
|
uint uVar25;
|
|
undefined1 *puVar26;
|
|
char *pcVar27;
|
|
bool isWeaponTypesChanged;
|
|
float10 fVar28;
|
|
undefined1 auVar29 [16];
|
|
float fVar30;
|
|
TemporaryEffects *pTVar31;
|
|
float fVar32;
|
|
Entity_Player *pEVar33;
|
|
Color aCStackY_1d2c [128];
|
|
float fVar34;
|
|
BitSet128 ringWormFlags;
|
|
BitSet128 tinyPlanetFlags;
|
|
BitSet128 ipecacFlags;
|
|
BitSet128 hookWormFlags;
|
|
BitSet128 wiggleWormFlags;
|
|
BitSet128 belialFlags;
|
|
BitSet128 continuumFlags;
|
|
BitSet128 ouroborosFlags;
|
|
Vector randomOffset;
|
|
Vector randomDir;
|
|
Vector throwVelocity;
|
|
Vector headScaleVec;
|
|
Vector spriteScaleVec;
|
|
Vector coPlayerSpawnPos;
|
|
Vector coPlayerOffset;
|
|
Vector coopBabySpawnPos;
|
|
Vector coopBabyOffset;
|
|
Vector clampedSpawnPos;
|
|
Vector unclampedSpawnPos;
|
|
KColor playerSlotColor;
|
|
undefined1 fortuneCookieWisps [16];
|
|
undefined1 familiarList [20];
|
|
void *local_5b4;
|
|
int virusCount;
|
|
int local_5ac;
|
|
EntityList_EL local_5a8;
|
|
EntityList_EL local_598;
|
|
int stitchesCount;
|
|
float throwVelocityScale;
|
|
int haloFlyCount;
|
|
int local_57c;
|
|
EntityList_EL local_578;
|
|
undefined4 local_568;
|
|
float twinAverageSpeed;
|
|
undefined4 dogmaMinSpeed;
|
|
float berserkColorAmount;
|
|
float bloodLustColorAmount;
|
|
undefined4 bloodLustCap;
|
|
int bloodLustCount;
|
|
int lustyBloodEffectNum;
|
|
float taurusColorAmount;
|
|
float headScaleFactor;
|
|
float spriteScaleFactor;
|
|
int local_53c;
|
|
int foundSoulNeeded;
|
|
void *local_534;
|
|
int damoclesCount;
|
|
int local_52c;
|
|
int soulTrinketMultiplier;
|
|
float spawnRadius;
|
|
undefined4 local_520;
|
|
int lilDeliriumCount;
|
|
undefined4 haloFlyCap;
|
|
float scaledRange;
|
|
float rangeAboveMin;
|
|
undefined4 local_50c;
|
|
undefined4 local_508;
|
|
undefined4 local_504;
|
|
undefined4 local_500;
|
|
int evesMascaraCount;
|
|
undefined4 local_4f8;
|
|
int eyeOfOccultCount;
|
|
undefined4 local_4f0;
|
|
float rawDamage;
|
|
undefined4 local_4e8;
|
|
float local_4e4;
|
|
undefined4 local_4e0;
|
|
float local_4dc;
|
|
undefined4 local_4d8;
|
|
float local_4d4;
|
|
undefined4 local_4d0;
|
|
int extraBrimstoneCount;
|
|
undefined4 local_4c8;
|
|
float local_4c4;
|
|
undefined4 local_4c0;
|
|
undefined4 local_4bc;
|
|
float local_4b8;
|
|
undefined1 coopBabyList [12];
|
|
undefined1 coPlayerList [12];
|
|
float fireRate;
|
|
Entity_Player *coPlayer;
|
|
Entity_Player *coopBaby;
|
|
float colorLerpAmount;
|
|
Entity_Player *otherPlayer;
|
|
RNG *local_488;
|
|
RNG *local_484;
|
|
Entity_Player *local_480;
|
|
byte isEffectsDisabled;
|
|
byte local_47b;
|
|
bool isActiveFullyCharged;
|
|
bool isActiveEmpty;
|
|
float local_478;
|
|
char isMistOrGhost;
|
|
ItemConfig_Item *local_470;
|
|
Entity_Player *local_46c;
|
|
TemporaryEffects *local_468;
|
|
TemporaryEffects *local_464;
|
|
ItemConfig_Item *local_460;
|
|
Entity_Player *player;
|
|
ColorMod lerpedColor;
|
|
Color defaultLaserColor [2];
|
|
Color defaultTearColor;
|
|
Color pvpTearColor;
|
|
Color tearGlowColor;
|
|
Color laserGlowColor;
|
|
Color antiGravityColor [3];
|
|
Color toxicShockColor;
|
|
Color lerpTargetColor;
|
|
RNG seededRng;
|
|
Color spriteColor;
|
|
RNG formFamiliarRng;
|
|
RNG statShuffleRng;
|
|
char local_1c0 [2];
|
|
byte abStack_1be [2];
|
|
undefined1 local_1bc;
|
|
undefined1 auStack_1bb [379];
|
|
undefined1 damageTearsBonus [8];
|
|
float rangeBonus;
|
|
float shotSpeedBonus;
|
|
float speedBonus;
|
|
float luckBonus;
|
|
undefined1 prevWeaponTypes [16];
|
|
undefined1 prevWeaponTypesTail;
|
|
float local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Game *game;
|
|
undefined4 swapStat;
|
|
float tintAlpha;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00aff0d2;
|
|
local_10 = ExceptionList;
|
|
local_14 = (float)(__security_cookie ^ GHIDRA_UINT((prevWeaponTypes + 0x24)));
|
|
ExceptionList = &local_10;
|
|
isEffectsDisabled = (this->_temporaryeffects)._disabled;
|
|
if ((this->_hasCurseMistEffect != 0) || (isMistOrGhost = '\0', this->_isCoopGhost != 0)) {
|
|
isMistOrGhost = '\x01';
|
|
}
|
|
temporaryEffects = &this->_temporaryeffects;
|
|
speedBonus = 0.0;
|
|
_damageTearsBonus = ZEXT816(0);
|
|
luckBonus = 0.0;
|
|
local_468 = temporaryEffects;
|
|
player = this;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xf0);
|
|
if (bVar2 != 0) {
|
|
rangeBonus = 1.0;
|
|
damageTearsBonus = (undefined1 [8])0x3f80000000000000;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x0))) = 0x3f800000;
|
|
luckBonus = (float)&DAT_bf800000;
|
|
speedBonus = (float)&DAT_bf800000;
|
|
shotSpeedBonus = (float)&DAT_bf800000;
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4));
|
|
statShuffleRng._seed = 0;
|
|
if (iVar4 != 0) {
|
|
statShuffleRng._seed = *GHIDRA_CAST<uint *>((iVar4 + 0x5c));
|
|
}
|
|
statShuffleRng._shift1 = 3;
|
|
statShuffleRng._shift2 = 3;
|
|
statShuffleRng._shift3 = 0x1a;
|
|
local_8 = (void *)0x0;
|
|
uVar25 = 0;
|
|
do {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((6 - uVar25));
|
|
(GHIDRA_CAST<RNG *>((&statShuffleRng)))->RNG::Next();
|
|
uVar24 = 0;
|
|
if (local_460 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
uVar24 = GHIDRA_UINT(statShuffleRng._seed) % GHIDRA_UINT(local_460);
|
|
}
|
|
swapStat = *GHIDRA_CAST<undefined4 *>((damageTearsBonus + uVar25 * 4));
|
|
iVar4 = uVar24 + uVar25;
|
|
*GHIDRA_CAST<undefined4 *>((damageTearsBonus + uVar25 * 4)) = *GHIDRA_CAST<undefined4 *>((damageTearsBonus + iVar4 * 4))
|
|
;
|
|
uVar25 = uVar25 + 1;
|
|
*GHIDRA_CAST<undefined4 *>((damageTearsBonus + iVar4 * 4)) = swapStat;
|
|
} while (uVar25 < 5);
|
|
local_8 = (void *)0xffffffff;
|
|
}
|
|
iVar4 = GetTrinketMultiplier(player,0x5c);
|
|
local_484 = GHIDRA_CAST<RNG *>(((float)iVar4 * 0.2 + 1.0));
|
|
if (player->_playerType == 0x24) {
|
|
local_484 = GHIDRA_CAST<RNG *>(((float)local_484 * 0.75));
|
|
}
|
|
bVar2 = HasCollectible(player,0x298,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = GetCollectibleNum(player,0x16,0);
|
|
auVar29 = _damageTearsBonus;
|
|
fVar30 = (float)iVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x4))) = (void *)(fVar30 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))));
|
|
rangeBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0x8)));
|
|
shotSpeedBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0xc)));
|
|
rangeBonus = fVar30 + rangeBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x17,0);
|
|
auVar29 = _damageTearsBonus;
|
|
fVar30 = (float)iVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x4))) = (void *)(fVar30 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))));
|
|
auVar1 = _damageTearsBonus;
|
|
shotSpeedBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0xc)));
|
|
_damageTearsBonus = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x0)));
|
|
shotSpeedBonus = fVar30 + shotSpeedBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x18,0);
|
|
auVar29 = _damageTearsBonus;
|
|
fVar30 = (float)iVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x0))) = fVar30 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x0)));
|
|
auVar1 = _damageTearsBonus;
|
|
shotSpeedBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0xc)));
|
|
_damageTearsBonus = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x0)));
|
|
shotSpeedBonus = fVar30 + shotSpeedBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x19,0);
|
|
fVar30 = (float)iVar4;
|
|
rangeBonus = fVar30 + rangeBonus;
|
|
shotSpeedBonus = fVar30 + shotSpeedBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x1a,0);
|
|
auVar29 = _damageTearsBonus;
|
|
fVar30 = (float)iVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x0))) = fVar30 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x0)));
|
|
auVar1 = _damageTearsBonus;
|
|
rangeBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0x8)));
|
|
shotSpeedBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0xc)));
|
|
damageTearsBonus = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x0)));
|
|
rangeBonus = fVar30 + rangeBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x15a,0);
|
|
fVar30 = (float)iVar4;
|
|
luckBonus = fVar30 + luckBonus;
|
|
shotSpeedBonus = fVar30 + shotSpeedBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x1c8,0);
|
|
fVar30 = (float)iVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x0))) = fVar30 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x0)));
|
|
luckBonus = fVar30 + luckBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
iVar4 = GetCollectibleNum(player,0x2c3,0);
|
|
fVar30 = (float)iVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x4))) = (void *)(fVar30 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))));
|
|
luckBonus = fVar30 + luckBonus;
|
|
speedBonus = speedBonus - fVar30 * 0.15;
|
|
}
|
|
bVar2 = HasCollectible(player,0x29f,0);
|
|
auVar29 = _damageTearsBonus;
|
|
if (bVar2 != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x4))) =
|
|
(void *)((float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1db2)))) * 0.1 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x0))) =
|
|
(void *)((float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1db0)))) * 0.1 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x0))));
|
|
rangeBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0x8)));
|
|
shotSpeedBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0xc)));
|
|
rangeBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1db4)))) * 0.1 + rangeBonus;
|
|
shotSpeedBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1db6)))) * 0.1 + shotSpeedBonus;
|
|
speedBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1db8)))) * 0.1 + speedBonus;
|
|
luckBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dba)))) * 0.1 + luckBonus;
|
|
}
|
|
bVar2 = HasCollectible(player,0x2ae,0);
|
|
auVar29 = _damageTearsBonus;
|
|
if (bVar2 != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x4))) =
|
|
(void *)((float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dbe)))) * 0.2 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(damageTearsBonus)) + 0x0))) =
|
|
(void *)((float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dbc)))) * 0.2 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x0))));
|
|
rangeBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0x8)));
|
|
shotSpeedBonus = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0xc)));
|
|
rangeBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dc0)))) * 0.2 + rangeBonus;
|
|
shotSpeedBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dc2)))) * 0.2 + shotSpeedBonus;
|
|
speedBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dc4)))) * 0.2 + speedBonus;
|
|
luckBonus = (float)*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dc6)))) * 0.2 + luckBonus;
|
|
}
|
|
iVar4 = GetActiveMaxCharge(player,0);
|
|
if (iVar4 < 1) {
|
|
isActiveEmpty = false;
|
|
isActiveFullyCharged = false;
|
|
}
|
|
else {
|
|
iVar5 = GetTotalActiveCharge(player,0);
|
|
isActiveFullyCharged = iVar4 <= iVar5;
|
|
isActiveEmpty = player->_activeDesc[0]._charge == 0;
|
|
}
|
|
if ((player->_cacheFlags & 0x100U) != 0) {
|
|
prevWeaponTypes = *(undefined1 (*) [16])&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x13f0)));
|
|
prevWeaponTypesTail = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1400)));
|
|
FUN_007539a0();
|
|
if ((player->_playerType == 0x10) ||
|
|
(((((player->_variant == 1 && (player->_babySkin == 0x39)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c0), bVar2 != 0)) ||
|
|
((player->_playerType == 0x23 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x271), bVar2 != 0)))) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x6e), bVar2 != 0)))) {
|
|
LAB_00763e51:
|
|
EnableWeaponType(player);
|
|
}
|
|
else {
|
|
bVar2 = HasCollectible(player,0x243,0);
|
|
if (bVar2 != 0) {
|
|
HasCollectible(player,0x2a6,0);
|
|
goto LAB_00763e51;
|
|
}
|
|
bVar2 = HasCollectible(player,0xa8,0);
|
|
if (((bVar2 != 0) || (bVar2 = HasCollectible(player,0x2a6,0), bVar2 != 0)) ||
|
|
(bVar2 = HasCollectible(player,0x72,0), bVar2 != 0)) goto LAB_00763e51;
|
|
bVar2 = HasCollectible(player,0x213,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(player,0x34,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(player,0x76,0);
|
|
if ((((bVar2 == 0) || (bVar2 = HasCollectible(player,0x18b,0), bVar2 != 0)) &&
|
|
(((player->_playerType != 7 &&
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar2 == 0 &&
|
|
(player->_playerType != 0x1c)))) ||
|
|
(bVar2 = HasCollectible(player,0x18b,0), bVar2 != 0)))) &&
|
|
(((bVar2 = HasCollectible(player,0x18b,0), bVar2 == 0 &&
|
|
(bVar2 = HasCollectible(player,0x44,0), bVar2 == 0)) &&
|
|
(bVar2 = HasCollectible(player,0x149,0), bVar2 == 0)))) {
|
|
HasCollectible(player,0xe5,0);
|
|
}
|
|
}
|
|
else {
|
|
HasCollectible(player,0xe5,0);
|
|
}
|
|
goto LAB_00763e51;
|
|
}
|
|
HasCollectible(player,0xe5,0);
|
|
EnableWeaponType(player);
|
|
bVar2 = HasCollectible(player,0x72,0);
|
|
if (bVar2 != 0) goto LAB_00763e51;
|
|
}
|
|
bVar2 = HasWeaponType(player,2);
|
|
if ((bVar2 != 0) && (bVar2 = HasWeaponType(player,4), bVar2 != 0)) {
|
|
EnableWeaponType(player);
|
|
}
|
|
bVar2 = HasWeaponType(player,0xe);
|
|
if ((bVar2 != 0) &&
|
|
(((bVar2 = HasCollectible(player,0x76,0), bVar2 != 0 &&
|
|
(bVar2 = HasCollectible(player,0x18b,0), bVar2 == 0)) ||
|
|
(((player->_playerType == 7 ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar2 != 0 ||
|
|
(player->_playerType == 0x1c)))) && (bVar2 = HasCollectible(player,0x18b,0), bVar2 == 0))
|
|
)))) {
|
|
EnableWeaponType(player);
|
|
EnableWeaponType(player);
|
|
}
|
|
bVar2 = HasWeaponType(player,7);
|
|
pEVar33 = player;
|
|
if ((bVar2 != 0) && (bVar2 = HasWeaponType(player,5), bVar2 != 0)) {
|
|
EnableWeaponType(pEVar33);
|
|
}
|
|
bVar2 = HasWeaponType(pEVar33,2);
|
|
if ((bVar2 != 0) && (bVar2 = HasWeaponType(pEVar33,3), bVar2 != 0)) {
|
|
EnableWeaponType(pEVar33);
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x100);
|
|
weaponTypeCursor = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar33)) + 0x13f0))));
|
|
uVar25 = 0xd;
|
|
piVar13 = GHIDRA_CAST<int *>(prevWeaponTypes);
|
|
do {
|
|
if (*piVar13 != *weaponTypeCursor) goto LAB_00763fb3;
|
|
piVar13 = piVar13 + 1;
|
|
weaponTypeCursor = weaponTypeCursor + 1;
|
|
isWeaponTypesChanged = 3 < uVar25;
|
|
uVar25 = uVar25 - 4;
|
|
} while (isWeaponTypesChanged);
|
|
if ((char)*piVar13 == (char)*weaponTypeCursor) {
|
|
isWeaponTypesChanged = false;
|
|
}
|
|
else {
|
|
LAB_00763fb3:
|
|
isWeaponTypesChanged = true;
|
|
}
|
|
if (isWeaponTypesChanged) {
|
|
pEVar33 = player;
|
|
if (((player->_heldEntity != GHIDRA_CAST<Entity *>(0x0)) && (player->_itemState != 0x25c)) &&
|
|
(player->_itemState != 0x2c5)) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((player->_heldEntity)))->Entity::IsEnemy();
|
|
pEVar33 = player;
|
|
if (bVar2 == 0) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(player->_heldEntity) + 0x28))();
|
|
}
|
|
else {
|
|
throwVelocityScale = 0.1;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&player->_velocity)))->Vector::__mul(&throwVelocity,&throwVelocityScale);
|
|
ThrowHeldEntity(pEVar33,vecResult);
|
|
}
|
|
}
|
|
uVar25 = 0;
|
|
do {
|
|
Isaac::DestoryWeapon(GHIDRA_CAST<Weapon **>((GHIDRA_INT(pEVar33->_weapons) + uVar25 + 4)));
|
|
uVar25 = uVar25 + 4;
|
|
pEVar33 = player;
|
|
} while (uVar25 < 0x10);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>((player->_weapons + 1));
|
|
uVar25 = 0;
|
|
iVar4 = 0;
|
|
do {
|
|
if (3 < iVar4) break;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pEVar33->_weapons) + uVar25 + 0x14)) != '\0') {
|
|
weapon = Isaac::CreateWeapon(uVar25,GHIDRA_CAST<Entity *>(pEVar33));
|
|
iVar4 = iVar4 + 1;
|
|
local_470->type = GHIDRA_INT(weapon);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(&local_470->id);
|
|
pEVar33 = player;
|
|
}
|
|
uVar25 = uVar25 + 1;
|
|
} while (uVar25 < 0x11);
|
|
pEVar33->_cacheFlags = pEVar33->_cacheFlags | 1;
|
|
temporaryEffects = local_468;
|
|
}
|
|
}
|
|
if ((player->_cacheFlags & 4U) != 0) {
|
|
player->_cacheFlags = player->_cacheFlags | 8;
|
|
}
|
|
bVar2 = HasCollectible(player,0x130,0);
|
|
if (((bVar2 != 0) || (iVar4 = GetZodiacEffect(player), iVar4 == 0x130)) &&
|
|
((player->_cacheFlags & 0x1bU) != 0)) {
|
|
player->_cacheFlags = player->_cacheFlags | 0x1b;
|
|
}
|
|
pEVar33 = player;
|
|
if ((player->_cacheFlags & 2) != 0) {
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.5 - (float)*piVar13 * 0.4));
|
|
}
|
|
else {
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
iVar4 = GetCollectibleNum(player,0x20,0);
|
|
pEVar33 = player;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_470));
|
|
iVar4 = GetCollectibleNum(player,0x50,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x17d,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,1,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(1);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x172,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x155,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x156,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x156);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0xb7,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x18a,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x223,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x259,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x256,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((((float)iVar4 + (float)local_460) * 0.7));
|
|
iVar4 = GetCollectibleNum(pEVar33,6,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(6);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)(iVar4 + iVar5) * 1.5 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x29d,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0x234,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0xff,0);
|
|
iVar7 = GetCollectibleNum(pEVar33,0x73,0);
|
|
iVar8 = GetCollectibleNum(pEVar33,0x48,0);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)(iVar8 + iVar4 + iVar5 + iVar6 + iVar7) * 0.5 + (float)local_460);
|
|
iVar4 = GetCollectibleNum(pEVar33,0xc4,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0xb6,0);
|
|
iVar6 = GetTrinketMultiplier(pEVar33,0x60);
|
|
iVar7 = GetTrinketMultiplier(pEVar33,0x1a);
|
|
iVar8 = GetTrinketMultiplier(pEVar33,0xb);
|
|
iVar9 = GetTrinketMultiplier(pEVar33,10);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)(iVar9 + (iVar4 - iVar5) + iVar6 + iVar7 + iVar8) * 0.4 + (float)local_460);
|
|
iVar4 = GetCollectibleNum(pEVar33,0xbd,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0x65,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0x5a,0);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)(iVar6 + iVar4 + iVar5) * 0.2 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x14b,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0xed,0);
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xed);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)local_46c - (float)(iVar6 + iVar4 + iVar5) * 0.3));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1b6,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.75 + (float)local_46c));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1bb,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.3 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d1,0);
|
|
local_478 = (float)iVar4 * 0.35 + (float)local_460;
|
|
bVar2 = HasTrinket(pEVar33,0x65,0);
|
|
if ((bVar2 != 0) && (isActiveEmpty != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x65);
|
|
local_478 = local_478 + (float)iVar4 * 0.5;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,100,0);
|
|
if ((bVar2 != 0) && (isActiveFullyCharged != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,100);
|
|
local_478 = local_478 + (float)iVar4 * 0.2;
|
|
}
|
|
iVar4 = pEVar33->_playerType;
|
|
if ((iVar4 == 6) || (iVar4 == 0x1b)) {
|
|
local_478 = local_478 - 0.1;
|
|
LAB_0076474b:
|
|
fVar30 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))) * 0.5;
|
|
if ((iVar4 == 9) || (iVar4 == 0x1e)) {
|
|
fVar30 = fVar30 + pEVar33->_edenFireDelay;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 != 0x19) {
|
|
if ((iVar4 == 0x22) || (iVar4 == 0x1a)) {
|
|
local_478 = local_478 - 0.5;
|
|
}
|
|
else {
|
|
if (iVar4 != 7) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::HasTrinketEffect(0xa2);
|
|
if (bVar2 == 0) {
|
|
iVar4 = pEVar33->_playerType;
|
|
if (((iVar4 == 0x13) || (iVar4 == 0x25)) || (iVar4 == 0x27)) {
|
|
local_478 = local_478 + 0.27777;
|
|
}
|
|
else if ((iVar4 == 0x14) || (iVar4 == 0x26)) {
|
|
local_478 = local_478 - 0.099649;
|
|
}
|
|
goto LAB_0076474b;
|
|
}
|
|
iVar4 = pEVar33->_playerType;
|
|
}
|
|
local_478 = local_478 + 0.5;
|
|
}
|
|
goto LAB_0076474b;
|
|
}
|
|
local_478 = local_478 - 0.35;
|
|
fVar30 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x4))) * 0.5;
|
|
}
|
|
if (fVar30 < 0.0) {
|
|
fVar30 = fVar30 * 0.686655;
|
|
}
|
|
local_478 = fVar30 + local_478;
|
|
if ((iVar4 == 0xe) && (bVar2 = HasCollectible(pEVar33,0xf5,0), bVar2 == 0)) {
|
|
local_478 = local_478 - 1.9;
|
|
}
|
|
if ((pEVar33->_playerType == 0x21) && (bVar2 = HasCollectible(pEVar33,0xf5,0), bVar2 == 0)) {
|
|
local_478 = local_478 - 2.2;
|
|
}
|
|
temporaryEffects = local_468;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
if (bVar2 != 0) {
|
|
local_478 = local_478 - 1.9;
|
|
}
|
|
bVar2 = HasPlayerForm(player,7);
|
|
if (bVar2 != 0) {
|
|
local_478 = local_478 - 0.3;
|
|
}
|
|
if (0 < player->_coopBabyBuffTimers[1]) {
|
|
local_478 = local_478 + 1.0;
|
|
}
|
|
local_4bc = 0;
|
|
local_4b8 = local_478 * 1.3 + 1.0;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
FUN_00431260();
|
|
local_4c0 = 0;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(fVar30);
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
local_4c8 = 0x40a00000;
|
|
local_4c4 = (16.0 - (float)local_460 * 6.0) - *pfVar10 * 6.0;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33 = player;
|
|
local_478 = *pfVar10;
|
|
local_480 = GHIDRA_CAST<Entity_Player *>((30.0 / (local_478 + 1.0)));
|
|
bVar2 = HasCollectible(player,600,0);
|
|
if (bVar2 != 0) {
|
|
local_480 = GHIDRA_CAST<Entity_Player *>(((float)local_480 * 1.2));
|
|
}
|
|
if (((float)local_484 != 1.0) && (2.7272727 < (float)local_480)) {
|
|
local_480 = (Entity_Player *)
|
|
((float)local_480 + ((float)local_480 - 2.7272727) * ((float)local_484 - 1.0));
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x197,0);
|
|
if (((bVar2 == 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x197), bVar2 == 0)) ||
|
|
(pEVar33->_purityState != 1)) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(0x0);
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(0x40000000);
|
|
}
|
|
iVar4 = GetZodiacEffect(pEVar33);
|
|
if (iVar4 == 0x133) {
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(0x3f800000);
|
|
}
|
|
else {
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
iVar4 = GetZodiacEffect(pEVar33);
|
|
if (iVar4 == 0x135) {
|
|
local_488 = GHIDRA_CAST<RNG *>(0x3f800000);
|
|
}
|
|
else {
|
|
local_488 = GHIDRA_CAST<RNG *>(0x0);
|
|
}
|
|
if ((pEVar33->_hasCurseMistEffect == 0) && (pEVar33->_isCoopGhost == 0)) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(pEVar33->_fireDelayModifier);
|
|
}
|
|
else {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
pEVar33 = player;
|
|
if (bVar2 == 0) {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x40000000);
|
|
}
|
|
iVar4 = GetCollectibleNum(player,0x133,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0xe4,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0xe0,0);
|
|
iVar7 = GetCollectibleNum(pEVar33,0xce,0);
|
|
iVar8 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xce);
|
|
local_470 = (ItemConfig_Item *)
|
|
((float)(iVar8 + iVar4 + iVar5 + iVar6 + iVar7) + (float)local_470);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x135,0);
|
|
local_470 = (ItemConfig_Item *)
|
|
(((float)iVar4 + (float)local_470 + (float)local_488 + (float)GHIDRA_INT(local_46c)) * 0.5)
|
|
;
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x27);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)GHIDRA_INT(pEVar33->_brittleBonesUpgrades) * 0.4 +
|
|
(float)iVar4 + (float)local_464 + (float)local_470 + (float)local_460);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x18d,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x18d);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)(iVar4 + iVar5) + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetNullEffectNum(0x3e);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 1.5 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x246);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.75 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetNullEffectNum(0x47);
|
|
local_480 = GHIDRA_CAST<Entity_Player *>(((float)iVar4 * 0.3 + (float)local_460 + (float)local_480));
|
|
bVar2 = HasCollectible(pEVar33,0x78,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x78), bVar2 == 0
|
|
)) {
|
|
temporaryEffects = local_468;
|
|
}
|
|
else {
|
|
iVar4 = GetCollectibleNum(pEVar33,0x78,0);
|
|
temporaryEffects = local_468;
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::GetCollectibleEffectNum(0x78);
|
|
local_480 = GHIDRA_CAST<Entity_Player *>(((float)(iVar4 + iVar5) * 0.7 + 1.0 + (float)local_480));
|
|
}
|
|
if ((((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) != 0x67) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ef0))) != '\x01')) ||
|
|
(player->_numKeys != player->_numBombs)) ||
|
|
(local_47b = 1, player->_numBombs != player->_numCoins)) {
|
|
local_47b = 0;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0x67);
|
|
pEVar33 = player;
|
|
if ((bVar2 != 0) || (local_47b != 0)) {
|
|
iVar4 = GetTrinketMultiplier(player,0x67);
|
|
local_480 = GHIDRA_CAST<Entity_Player *>(((float)iVar4 + (float)iVar4 + (float)local_480));
|
|
}
|
|
iVar4 = GetCollectibleNum(pEVar33,0x22a,0);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)iVar4 * 0.5 + (float)local_480));
|
|
bVar2 = HasWeaponType(player,2);
|
|
if (bVar2 == 0) {
|
|
iVar4 = GetCollectibleNum(player,0xde,0);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)iVar4 + (float)local_46c));
|
|
}
|
|
iVar4 = is_achievement_79_unlocked(player);
|
|
fVar30 = (float)iVar4 * 0.5 + (float)local_46c;
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(fVar30);
|
|
iVar4 = get_seeded_variant(player);
|
|
if (iVar4 == 3) {
|
|
LAB_00764de6:
|
|
fVar30 = (float)local_464 * 0.4;
|
|
LAB_00764df6:
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(fVar30);
|
|
}
|
|
else {
|
|
if (iVar4 == 4) {
|
|
fVar30 = (float)local_464 * 5.5;
|
|
goto LAB_00764df6;
|
|
}
|
|
if (iVar4 == 5) goto LAB_00764de6;
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x1b4);
|
|
if (pvVar11 != (void *)0x0) {
|
|
fVar30 = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) + (float)local_464;
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(fVar30);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x39);
|
|
if (0 < iVar4) {
|
|
fVar30 = (float)iVar4 * 0.4 + 0.8 + (float)local_464;
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(fVar30);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x237);
|
|
if (0 < iVar4) {
|
|
fVar30 = (float)iVar4 * 0.4 + (float)local_464;
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(fVar30);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x4a);
|
|
if (0 < iVar4) {
|
|
fVar30 = (float)iVar4 * 0.5 + 0.5 + (float)local_464;
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(fVar30);
|
|
}
|
|
FUN_00753880();
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>((fVar30 + (float)local_464));
|
|
if (0 < player->_grantedCollectibleCountdown) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 + 1.5));
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x30);
|
|
if (pvVar11 != (void *)0x0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 + (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 0.25));
|
|
}
|
|
bVar2 = HasCollectible(player,0xf5,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(player,0x99,0);
|
|
if ((bVar2 == 0) &&
|
|
((bVar2 = HasCollectible(player,0xa9,0), bVar2 == 0 ||
|
|
(bVar2 = HasWeaponType(player,0xe), bVar2 != 0)))) {
|
|
bVar2 = HasCollectible(player,2,0);
|
|
if ((bVar2 != 0) ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(2), bVar2 != 0 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x41), bVar2 != 0)))) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.51));
|
|
}
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.42));
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(player,0x95,0);
|
|
if ((bVar2 != 0) &&
|
|
(((bVar2 = HasWeaponType(player,1), bVar2 != 0 ||
|
|
(bVar2 = HasWeaponType(player,7), bVar2 != 0)) ||
|
|
(bVar2 = HasWeaponType(player,3), bVar2 != 0)))) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 3.0));
|
|
}
|
|
bVar2 = HasCollectible(player,0x213,0);
|
|
if (bVar2 != 0) {
|
|
bVar2 = HasCollectible(player,0x95,0);
|
|
if ((bVar2 == 0) && (bVar2 = HasWeaponType(player,1), bVar2 != 0)) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.5));
|
|
}
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((30.0 / (float)local_464));
|
|
bVar2 = HasWeaponType(player,0xe);
|
|
if (bVar2 == 0) {
|
|
fVar30 = (float)local_464 * 10.0;
|
|
fVar32 = (float)local_460 + 10.0;
|
|
}
|
|
else {
|
|
fVar30 = (float)local_464 * 4.0;
|
|
fVar32 = (float)local_460 + 4.0;
|
|
}
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - fVar30 / fVar32));
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
bVar2 = HasCollectible(player,0x76,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(player,0x34,0);
|
|
if (bVar2 != 0) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x41200000);
|
|
}
|
|
}
|
|
else {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x41a00000);
|
|
}
|
|
bVar2 = HasWeaponType(player,7);
|
|
pEVar33 = local_46c;
|
|
if (bVar2 != 0) {
|
|
pEVar33 = GHIDRA_CAST<Entity_Player *>(((float)local_46c * 0.5));
|
|
}
|
|
local_464 = (TemporaryEffects *)
|
|
((float)local_464 -
|
|
((float)pEVar33 * (float)local_464) / (30.0 / (float)local_464 + (float)pEVar33));
|
|
}
|
|
bVar2 = HasWeaponType(player,2);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasWeaponType(player,5);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasWeaponType(player,10);
|
|
if (bVar2 != 0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.5));
|
|
}
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 2.5));
|
|
}
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 3.0));
|
|
if (((player->_playerType == 7) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar2 != 0)) &&
|
|
(bVar2 = HasCollectible(player,0x76,0), bVar2 == 0)) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 1.25));
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(player,0x98,0);
|
|
if (bVar2 != 0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 1.5));
|
|
}
|
|
if (player->_playerType == 0x1a) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.66));
|
|
}
|
|
bVar2 = HasCollectible(player,0x136,0);
|
|
if (bVar2 != 0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.66));
|
|
}
|
|
bVar2 = HasWeaponType(player,7);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasWeaponType(player,9);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(player,0xe5,0), bVar2 != 0)) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 3.1));
|
|
}
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 / 4.3));
|
|
}
|
|
bVar2 = HasCollectible(player,0x231,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(player,0x14a,0);
|
|
if (bVar2 != 0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 5.5));
|
|
}
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 4.0));
|
|
}
|
|
if (player->_hallowedGroundCountdown != 0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 2.5));
|
|
}
|
|
bVar2 = HasCollectible(player,0x170,0);
|
|
if ((bVar2 != 0) && (0 < player->_epiphoraCharge)) {
|
|
local_464 = (TemporaryEffects *)
|
|
((float)local_464 * ((float)player->_epiphoraCharge / 180.0 + 1.0));
|
|
}
|
|
if (0 < player->_peeBurstCooldown) {
|
|
local_464 = (TemporaryEffects *)
|
|
((((float)player->_peeBurstCooldown * 5.0) / (float)player->_maxPeeBurstCooldown +
|
|
1.0) * (float)local_464);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x3f);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2d9);
|
|
if ((((bVar2 != 0) && (bVar2 = HasCollectible(player,0x3b,0), bVar2 != 0)) &&
|
|
(entity = GHIDRA_CAST<Entity *>(FUN_0042d040()), entity != GHIDRA_CAST<Entity *>(0x0))) &&
|
|
(((iVar4 = (GHIDRA_CAST<Entity *>((entity)))->Entity::SubType(), iVar4 != 8 &&
|
|
(iVar4 = (GHIDRA_CAST<Entity *>((entity)))->Entity::SubType(), iVar4 != 4)) &&
|
|
((iVar4 = (GHIDRA_CAST<Entity *>((entity)))->Entity::SubType(), iVar4 != 0xf &&
|
|
(uVar25 = (GHIDRA_CAST<Entity *>((entity)))->Entity::SpawnerType(), (uVar25 & 0x10) == 0)))))) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 3.0));
|
|
}
|
|
}
|
|
else {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 4.0));
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c0);
|
|
if (bVar2 != 0) {
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 + 2.0));
|
|
}
|
|
bVar2 = HasCollectible(player,0x2b7,0);
|
|
if ((bVar2 != 0) && (isEffectsDisabled == 0)) {
|
|
fVar30 = Math::clamp(0.0,6.0,(float)GHIDRA_INT(player->_bloodLustCounter));
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>((fVar30 * 0.05 * fVar30 + fVar30 * 0.2 + (float)local_464));
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xba);
|
|
if ((bVar2 != 0) && (isEffectsDisabled == 0)) {
|
|
fVar30 = Math::clamp(0.0,999.0,(float)GHIDRA_INT(player->_bloodLustCounter));
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>((fVar30 * 0.15 + 0.33 + (float)local_464));
|
|
}
|
|
iVar4 = get_seeded_variant(player);
|
|
pTVar31 = local_464;
|
|
if (iVar4 == 2) {
|
|
pTVar31 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 * 0.75));
|
|
}
|
|
local_478 = 30.0 / ((float)pTVar31 * player->_d8FireDelayModifier) - 1.0;
|
|
if (player->_variant == 1) {
|
|
pEVar33 = GetMainPlayer(player);
|
|
cVar3 = CanShoot(pEVar33);
|
|
if (cVar3 == '\0') {
|
|
local_478 = 10.0;
|
|
}
|
|
}
|
|
if ((player->_variant == 0) && (iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge(), iVar4 != 0)) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
challengeParams = (GHIDRA_CAST<Manager *>((g_manager)))->Manager::GetChallengeParams(iVar4);
|
|
if (0.0 < challengeParams->_minFireRate) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
(GHIDRA_CAST<Manager *>((g_manager)))->Manager::GetChallengeParams(iVar4);
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
local_478 = *pfVar10;
|
|
}
|
|
}
|
|
pvVar11 = g_luaEngine;
|
|
pfVar10 = &player->_maxfiredelay;
|
|
*pfVar10 = local_478;
|
|
(GHIDRA_CAST<LuaEngine *>((pvVar11)))->LuaEngine::EvaluateItems(player,2);
|
|
pfVar12 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
game = g_game;
|
|
*pfVar10 = *pfVar12;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
pEVar33 = player;
|
|
}
|
|
else {
|
|
entityList = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar13 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((entityList)))->EntityList)::Size();
|
|
pEVar33 = player;
|
|
(**(code **)(*piVar13 + 0x6c))();
|
|
}
|
|
}
|
|
if ((pEVar33->_cacheFlags & 1) != 0) {
|
|
pTVar31 = GHIDRA_CAST<TemporaryEffects *>(&pEVar33->_damage);
|
|
*GHIDRA_CAST<float *>(pTVar31) = 0.0;
|
|
pEVar33->_meleeDamage = 0.0;
|
|
local_464 = pTVar31;
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x22);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) + -1) + 2.0 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasCollectible(player,7,0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 1.0;
|
|
}
|
|
bVar2 = HasCollectible(player,0x5a,0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 1.0;
|
|
}
|
|
bVar2 = HasCollectible(player,0xd8,0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 1.0;
|
|
}
|
|
bVar2 = HasPlayerForm(player,5);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 2.0;
|
|
}
|
|
bVar2 = HasPlayerForm(player,7);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) - 0.3;
|
|
}
|
|
bVar2 = HasCollectible(player,0x6d,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x3d23d70a);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
fVar30 = 0.04;
|
|
}
|
|
else {
|
|
fVar30 = 0.1;
|
|
}
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)player->_numCoins * fVar30 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasCollectible(player,0x28e,0);
|
|
if (bVar2 != 0) {
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(*puVar14);
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
local_488 = GHIDRA_CAST<RNG *>(*puVar14);
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(*puVar14);
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar5 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
*GHIDRA_CAST<float *>(local_464) =
|
|
(float)GHIDRA_INT((GHIDRA_CAST<char *>((GHIDRA_INT(&(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_488) + -8)))[-9].x) +
|
|
GHIDRA_INT(((local_470->name)._buf + *piVar13 + iVar4 + iVar5)))) +
|
|
GHIDRA_INT((local_46c->_sprite)._filename._buf))) * 0.6 + *GHIDRA_CAST<float *>(local_464);
|
|
pTVar31 = local_464;
|
|
temporaryEffects = local_468;
|
|
}
|
|
if ((0 < player->_redStewBonusDuration) && (isEffectsDisabled == 0)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x3d656042);
|
|
}
|
|
*GHIDRA_CAST<float *>(local_464) =
|
|
(float)(player->_redStewBonusDuration / 10) * (float)local_460 + *GHIDRA_CAST<float *>(local_464);
|
|
pTVar31 = local_464;
|
|
}
|
|
bVar2 = HasCollectible(player,0x2cc,0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(local_464) =
|
|
(float)((player->_keepersSackBonus / 3 + 2) / 3) * 0.5 + *GHIDRA_CAST<float *>(local_464);
|
|
pTVar31 = local_464;
|
|
}
|
|
local_460 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x7b);
|
|
local_470 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x7c);
|
|
local_488 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x81);
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x82);
|
|
if (local_460 == (void *)0x0) {
|
|
fVar30 = player->_damage;
|
|
}
|
|
else {
|
|
fVar30 = ((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_460) + 4)) + (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_460) + 4))) / 3.0 +
|
|
*GHIDRA_CAST<float *>(pTVar31);
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
if (local_470 != (void *)0x0) {
|
|
fVar30 = fVar30 + ((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_470) + 8)) + (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_470) + 8)))
|
|
/ 90.0;
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
if (local_488 != GHIDRA_CAST<RNG *>(0x0)) {
|
|
fVar30 = fVar30 + ((float)local_488->_shift1 * 6.0) / 3.0;
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 0.5 + fVar30;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2d9);
|
|
if (((((bVar2 != 0) && (bVar2 = HasCollectible(player,0x3b,0), bVar2 != 0)) &&
|
|
(local_46c = GHIDRA_CAST<Entity_Player *>(FUN_0042d040()), local_46c != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
((iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_46c))))->Entity::SubType(), iVar4 != 8 &&
|
|
(iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_46c))))->Entity::SubType(), iVar4 != 4)))) &&
|
|
((iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_46c))))->Entity::SubType(), iVar4 != 0xf &&
|
|
(uVar25 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_46c))))->Entity::SpawnerType(), (uVar25 & 0x10) == 0)))) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 2.0;
|
|
}
|
|
bVar2 = HasTrinket(player,0x65,0);
|
|
if ((bVar2 != 0) && (isActiveEmpty != false)) {
|
|
iVar4 = GetTrinketMultiplier(player,0x65);
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)iVar4 * 1.5 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasTrinket(player,100,0);
|
|
if ((bVar2 != 0) && (isActiveFullyCharged != false)) {
|
|
iVar4 = GetTrinketMultiplier(player,100);
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)iVar4 * 0.5 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
if (player->_variant == 1) {
|
|
iVar4 = player->_babySkin;
|
|
if (iVar4 == 0xd) {
|
|
fVar30 = *GHIDRA_CAST<float *>(pTVar31) + 2.0;
|
|
}
|
|
else if (iVar4 == 0x17) {
|
|
fVar30 = *GHIDRA_CAST<float *>(pTVar31) + 1.0;
|
|
}
|
|
else {
|
|
if (iVar4 != 0x36) goto LAB_00765c5f;
|
|
fVar30 = *GHIDRA_CAST<float *>(pTVar31) + 1.5;
|
|
}
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
LAB_00765c5f:
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x7a);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) =
|
|
(float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4))) * 1.5 +
|
|
*GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x6e);
|
|
if (pvVar11 == (void *)0x0) {
|
|
fVar30 = player->_damage;
|
|
}
|
|
else {
|
|
fVar30 = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4))) * 1.5 +
|
|
*GHIDRA_CAST<float *>(pTVar31);
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
if (0 < player->_grantedCollectibleCountdown) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30 + 1.0;
|
|
}
|
|
extraBrimstoneCount = GetCollectibleNum(player,0x76,0);
|
|
extraBrimstoneCount = extraBrimstoneCount + -1;
|
|
local_4d0 = 0;
|
|
iVar4 = GetCollectibleNum(player,0x279,0);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>((float)iVar4);
|
|
iVar5 = GetCollectibleNum(player,0x2c4,0);
|
|
iVar6 = GetCollectibleNum(player,0x250,0);
|
|
iVar7 = GetCollectibleNum(player,0x23c,0);
|
|
iVar8 = GetCollectibleNum(player,0x213,0);
|
|
iVar9 = GetCollectibleNum(player,0x159,0);
|
|
iVar15 = GetCollectibleNum(player,0x148,0);
|
|
iVar16 = GetCollectibleNum(player,0x103,0);
|
|
iVar17 = GetCollectibleNum(player,0xd0,0);
|
|
iVar18 = GetCollectibleNum(player,0xce,0);
|
|
iVar19 = GetCollectibleNum(player,0xa5,0);
|
|
numOddMushroomLarge = GetCollectibleNum(player,0x79,0);
|
|
numMark = GetCollectibleNum(player,0x4f,0);
|
|
numGrowthHormones = GetCollectibleNum(player,0x46,0);
|
|
numPentagram = GetCollectibleNum(player,0x33,0);
|
|
numSteven = GetCollectibleNum(player,0x32,0);
|
|
piVar13 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
iVar4 = *piVar13;
|
|
numSynthoilEffects = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::GetCollectibleEffectNum(0x159);
|
|
temporaryEffects = local_468;
|
|
numDarkMatterEffects = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::GetCollectibleEffectNum(0x103);
|
|
numGuillotineEffects = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0xce);
|
|
numOddMushroomEffects = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x79);
|
|
numGrowthHormonesEffects = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x46);
|
|
nullDamageUpCount = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x38);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)nullDamageUpCount * 3.0 +
|
|
(float)(iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar15 + iVar16 + iVar17 + iVar18 +
|
|
iVar19 + numOddMushroomLarge + numMark + numGrowthHormones + numPentagram +
|
|
numSteven + iVar4 + numSynthoilEffects + numDarkMatterEffects +
|
|
numGuillotineEffects + numOddMushroomEffects + numGrowthHormonesEffects));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x42);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1dc8)))) + (float)iVar4 * 1.5 + (float)local_460);
|
|
iVar4 = GetCollectibleNum(player,0x2dc,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(player,0x2da,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.75 + (float)local_460));
|
|
iVar4 = is_achievement_79_unlocked(player);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.75 + (float)local_460));
|
|
bVar2 = HasCollectible(player,0x105,0);
|
|
isProptosisEffect = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x105);
|
|
iVar4 = GetCollectibleNum(player,0x29d,0);
|
|
iVar5 = GetCollectibleNum(player,0x14b,0);
|
|
iVar6 = GetCollectibleNum(player,0x133,0);
|
|
iVar7 = GetCollectibleNum(player,0xc5,0);
|
|
iVar8 = GetCollectibleNum(player,0x50,0);
|
|
iVar9 = GetCollectibleNum(player,4,0);
|
|
iVar15 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2b4);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)GHIDRA_INT((iVar15 + GHIDRA_UINT(bVar2) + GHIDRA_UINT(isProptosisEffect) + iVar4 + iVar5 + iVar6
|
|
+ iVar7 + iVar8 + iVar9)) * 0.5 + (float)local_460);
|
|
iVar4 = GetCollectibleNum(player,0x1cf,0);
|
|
iVar5 = GetCollectibleNum(player,0x1bd,0);
|
|
iVar6 = GetCollectibleNum(player,0xc9,0);
|
|
iVar7 = GetCollectibleNum(player,0xc1,0);
|
|
iVar8 = GetCollectibleNum(player,0xbd,0);
|
|
iVar9 = GetCollectibleNum(player,0x8a,0);
|
|
iVar15 = GetCollectibleNum(player,0x65,0);
|
|
iVar16 = GetCollectibleNum(player,0x3e,0);
|
|
iVar17 = GetCollectibleNum(player,0xc,0);
|
|
iVar18 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0xc9);
|
|
iVar19 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0xc);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)(iVar19 + iVar4 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar15 + iVar16 +
|
|
iVar17 + iVar18) * 0.3 + (float)local_460);
|
|
iVar4 = GetCollectibleNum(player,0x167,0);
|
|
iVar5 = GetCollectibleNum(player,0xed,0);
|
|
iVar6 = GetCollectibleNum(player,0xe6,0);
|
|
iVar7 = GetCollectibleNum(player,5,0);
|
|
iVar8 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0xed);
|
|
pTVar31 = local_464;
|
|
*GHIDRA_CAST<float *>(local_464) =
|
|
(float)(iVar8 + iVar4 + iVar5 + iVar6 + iVar7) * 1.5 + (float)local_460 +
|
|
(float)local_470 + (float)local_470 + *GHIDRA_CAST<float *>(local_464);
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x36);
|
|
if (0 < iVar4) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = ((float)iVar4 / 23.0) * ((float)iVar4 / 23.0) * 20.0 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasCollectible(player,0x2b6,0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)player->_brokenHearts * 0.25 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasCollectible(player,0x3b,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x246);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.2));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x47);
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)iVar4 * 0.2 + (float)local_460 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar4 != 0) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
challengeParams = (GHIDRA_CAST<Manager *>((g_manager)))->Manager::GetChallengeParams(iVar4);
|
|
*GHIDRA_CAST<float *>(pTVar31) = challengeParams->_addDamage + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasCollectible(player,0x78,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x78), bVar2 != 0)) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) * 0.9 - 0.4;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x53);
|
|
if (bVar2 == 0) {
|
|
fVar30 = player->_damage;
|
|
}
|
|
else {
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x53);
|
|
fVar30 = (float)iVar4 + (float)iVar4 + *GHIDRA_CAST<float *>(pTVar31);
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
if (0 < player->_coopBabyBuffTimers[0]) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30 + 2.0;
|
|
}
|
|
local_460 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x19b);
|
|
if (local_460 != (void *)0x0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
local_4d8 = 0x40a00000;
|
|
}
|
|
else {
|
|
local_4d8 = 0x42c80000;
|
|
}
|
|
local_4d4 = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_460) + 4)) * 0.5;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
*GHIDRA_CAST<float *>(pTVar31) = *pfVar10 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetTrinketEffect(0x3a);
|
|
if (pvVar11 != (void *)0x0) {
|
|
local_4e0 = 0x40a00000;
|
|
local_4dc = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 0.5;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
*GHIDRA_CAST<float *>(pTVar31) = *pfVar10 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x7e);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 1.2 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x22b);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 1.2 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x6f);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 0.25 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x31);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 0.5 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffect(0x30);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 0.35 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetTrinketEffect(0x28);
|
|
if (pvVar11 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4)) * 1.8 + *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
bVar2 = HasTrinket(player,0x50,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = GetCollectibleNum(player,0x28e,0);
|
|
iVar5 = GetCollectibleNum(player,0x158,0);
|
|
iVar6 = GetCollectibleNum(player,0x153,0);
|
|
iVar7 = GetCollectibleNum(player,0x106,0);
|
|
iVar8 = GetCollectibleNum(player,0x104,0);
|
|
iVar9 = GetCollectibleNum(player,0xe6,0);
|
|
iVar15 = GetCollectibleNum(player,0xd8,0);
|
|
iVar16 = GetCollectibleNum(player,0xd7,0);
|
|
iVar17 = GetCollectibleNum(player,0x50,0);
|
|
iVar18 = GetCollectibleNum(player,0x4f,0);
|
|
iVar19 = GetTrinketMultiplier(player,0x11);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)iVar19 +
|
|
(float)(iVar4 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar15 + iVar16 + iVar17 +
|
|
iVar18));
|
|
iVar4 = GetTrinketMultiplier(player,0x16);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((((float)iVar4 + (float)local_460) * 0.5));
|
|
iVar4 = GetTrinketMultiplier(player,0x50);
|
|
*GHIDRA_CAST<float *>(local_464) = (float)iVar4 * (float)local_460 + *GHIDRA_CAST<float *>(local_464);
|
|
pTVar31 = local_464;
|
|
}
|
|
bVar2 = HasCollectible(player,0x197,0);
|
|
if (((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x197), bVar2 != 0)) &&
|
|
(player->_purityState == 0)) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 4.0;
|
|
}
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x40600000);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
entityList = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar13 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((entityList)))->EntityList)::Size();
|
|
local_460 = *GHIDRA_CAST<ItemConfig_Item **>((*piVar13 + 0x4c));
|
|
fVar28 = (float10)(*(code *)local_460)();
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((float)(fVar28 * (float10)3.5));
|
|
}
|
|
pTVar31 = local_464;
|
|
local_4e8 = 0;
|
|
local_4e4 = *GHIDRA_CAST<float *>(local_464) * 1.2 + 1.0;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
FUN_00431260();
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30 * (float)local_460;
|
|
bVar2 = HasCollectible(player,0xa9,0);
|
|
if (bVar2 != 0) {
|
|
bVar2 = HasCollectible(player,2,0);
|
|
if (((bVar2 == 0) && (bVar2 = HasCollectible(player,0x99,0), bVar2 == 0)) &&
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(2), bVar2 == 0 &&
|
|
((bVar2 = HasWeaponType(player,0xe), bVar2 == 0 &&
|
|
(bVar2 = HasCollectible(player,0xf5,0), bVar2 == 0)))))) {
|
|
fVar30 = *GHIDRA_CAST<float *>(pTVar31) + 4.0 + *GHIDRA_CAST<float *>(pTVar31) + 4.0;
|
|
}
|
|
else {
|
|
fVar30 = *GHIDRA_CAST<float *>(pTVar31) + 5.0;
|
|
}
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2);
|
|
if (bVar2 == 0) {
|
|
uVar25 = player->_playerType;
|
|
if (uVar25 == 5) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x7a);
|
|
if (bVar2 != 0) goto LAB_00766878;
|
|
uVar25 = player->_playerType;
|
|
}
|
|
if (uVar25 == 0x1a) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x6e);
|
|
if (bVar2 != 0) goto LAB_00766878;
|
|
uVar25 = player->_playerType;
|
|
}
|
|
if (uVar25 < 0x29) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = (*GHIDRA_CAST<float *>((&DAT_00b6bce8 + uVar25 * 4)) + 1.0) * *GHIDRA_CAST<float *>(pTVar31);
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) * 1.5;
|
|
}
|
|
LAB_00766878:
|
|
if ((player->_variant == 1) && (player->_babySkin == 0x39)) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) * 1.5;
|
|
}
|
|
iVar4 = player->_playerType;
|
|
if ((iVar4 == 9) || (iVar4 == 0x1e)) {
|
|
fVar30 = player->_edenDamage + *GHIDRA_CAST<float *>(pTVar31);
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
else {
|
|
fVar30 = player->_damage;
|
|
}
|
|
if (iVar4 == 0x13) {
|
|
fVar30 = fVar30 - 0.75;
|
|
LAB_007668df:
|
|
*GHIDRA_CAST<float *>(pTVar31) = fVar30;
|
|
}
|
|
else if (iVar4 == 0x14) {
|
|
fVar30 = fVar30 + 0.25;
|
|
goto LAB_007668df;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(100);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) + 2.0;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
pEVar33 = player;
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) * 4.0;
|
|
}
|
|
if ((player->_playerType == 0x10) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x78), bVar2 != 0)) {
|
|
pEVar33->_damage = (pEVar33->_damage + 2.0) * 3.0;
|
|
}
|
|
fVar30 = (float)(pEVar33->_potatoPeelerBandageCounter + pEVar33->_potatoPeelerCounter) * 0.2 +
|
|
pEVar33->_damage;
|
|
pEVar33->_damage = fVar30;
|
|
if ((pEVar33->_hasCurseMistEffect == 0) && (pEVar33->_isCoopGhost == 0)) {
|
|
iVar4 = pEVar33->_damageModifier;
|
|
}
|
|
else {
|
|
iVar4 = 0;
|
|
}
|
|
fVar30 = (float)iVar4 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)damageTearsBonus)) + 0x0))) + fVar30;
|
|
rawDamage = fVar30;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_damage = *pfVar10;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c0);
|
|
if (bVar2 != 0) {
|
|
fVar30 = pEVar33->_damage + 3.0;
|
|
pEVar33->_damage = fVar30;
|
|
}
|
|
FUN_00753870();
|
|
pEVar33->_damage = fVar30 + pEVar33->_damage;
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x23);
|
|
pEVar33->_damage = (float)iVar4 + (float)iVar4 + pEVar33->_damage;
|
|
bVar2 = HasCollectible(pEVar33,0x201,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage + 0.1;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x29);
|
|
bVar2 = TemporaryEffects::has_item_effect(temporaryEffects,pIVar20);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage + 7.0;
|
|
}
|
|
bVar2 = HasWeaponType(pEVar33,10);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(pEVar33,0x72,0), bVar2 != 0)) {
|
|
pEVar33->_damage = pEVar33->_damage + 4.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x19f,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x19f), bVar2 != 0)) {
|
|
pEVar33->_damage = pEVar33->_damage + pEVar33->_damage;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xb6,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage * 2.3 + 1.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x3b,0);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(pEVar33,0x290,0), bVar2 != 0)) {
|
|
pEVar33->_damage = pEVar33->_damage * 1.4 + 1.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x23d,0);
|
|
if ((bVar2 != 0) || (0 < pEVar33->_hallowedGroundCountdown)) {
|
|
pEVar33->_damage = pEVar33->_damage * 1.2;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x1ed,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x1ed), bVar2 != 0)) {
|
|
local_460 = (ItemConfig_Item *)
|
|
(((pEVar33->_boneHearts * 2 - pEVar33->_redHearts) + pEVar33->_maxHearts) / 2);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
pIVar20 = local_460;
|
|
if (cVar3 != '\0') {
|
|
pIVar20 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_UINT(local_460) >> 3));
|
|
}
|
|
fVar30 = (float)GHIDRA_INT(pIVar20) + (float)GHIDRA_INT(pIVar20);
|
|
pow_wrapper();
|
|
pEVar33->_damage = fVar30 * 0.1 + pEVar33->_damage;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x9d,0);
|
|
if ((bVar2 != 0) && (isEffectsDisabled == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x26b,0);
|
|
if ((bVar2 == 0) || (pEVar33->_playerType != 6)) {
|
|
fVar30 = 6.0;
|
|
}
|
|
else {
|
|
fVar30 = 10.0;
|
|
}
|
|
fVar30 = Math::clamp(0.0,fVar30,(float)GHIDRA_INT(pEVar33->_bloodLustCounter));
|
|
pEVar33->_damage = fVar30 * 0.1 * fVar30 + fVar30 * 0.4 + pEVar33->_damage;
|
|
}
|
|
if ((((pEVar33->_playerType == 7) || (pEVar33->_playerType == 0x1c)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar2 != 0)) &&
|
|
(bVar2 = HasCollectible(pEVar33,0x76,0), bVar2 == 0)) {
|
|
bVar2 = HasWeaponType(pEVar33,2);
|
|
if ((bVar2 == 0) || (bVar2 = HasCollectible(pEVar33,0x149,0), bVar2 == 0)) {
|
|
bVar2 = HasWeaponType(pEVar33,9);
|
|
if (bVar2 == 0) goto LAB_00766d4e;
|
|
fVar30 = pEVar33->_damage * 0.65;
|
|
}
|
|
else {
|
|
fVar30 = pEVar33->_damage * 0.5;
|
|
}
|
|
pEVar33->_damage = fVar30;
|
|
}
|
|
LAB_00766d4e:
|
|
bVar2 = HasWeaponType(pEVar33,2);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasWeaponType(pEVar33,9);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(pEVar33,0x76,0), bVar2 != 0)) goto LAB_00766d97;
|
|
}
|
|
else {
|
|
iVar4 = GetCollectibleNum(pEVar33,0x76,0);
|
|
if (iVar4 < 2) {
|
|
LAB_00766d97:
|
|
bVar2 = HasCollectible(pEVar33,0x44,0);
|
|
if (bVar2 == 0) goto LAB_00766dbe;
|
|
fVar30 = pEVar33->_damage * 1.5;
|
|
}
|
|
else {
|
|
fVar30 = pEVar33->_damage * 1.2;
|
|
}
|
|
pEVar33->_damage = fVar30;
|
|
}
|
|
LAB_00766dbe:
|
|
bVar2 = HasCollectible(pEVar33,0x213,0);
|
|
fVar30 = pEVar33->_damage;
|
|
if (bVar2 != 0) {
|
|
fVar30 = fVar30 * 1.5;
|
|
pEVar33->_damage = fVar30;
|
|
}
|
|
pEVar33->_meleeDamage = fVar30;
|
|
bVar2 = HasCollectible(pEVar33,0x95,0);
|
|
if (bVar2 != 0) {
|
|
bVar2 = HasWeaponType(pEVar33,1);
|
|
if (((bVar2 == 0) && (bVar2 = HasWeaponType(pEVar33,7), bVar2 == 0)) &&
|
|
(bVar2 = HasWeaponType(pEVar33,0xe), bVar2 == 0)) {
|
|
fVar30 = pEVar33->_damage + 2.0;
|
|
}
|
|
else {
|
|
fVar30 = pEVar33->_damage + 40.0;
|
|
}
|
|
pEVar33->_damage = fVar30;
|
|
pEVar33->_meleeDamage = pEVar33->_meleeDamage + 2.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,4,0);
|
|
if ((((bVar2 != 0) ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x22), bVar2 != 0 &&
|
|
(bVar2 = HasCollectible(pEVar33,7,0), bVar2 != 0)))) ||
|
|
(bVar2 = HasCollectible(pEVar33,0xc,0), bVar2 != 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xc), bVar2 != 0)) {
|
|
pEVar33->_damage = pEVar33->_damage * 1.5;
|
|
pEVar33->_meleeDamage = pEVar33->_meleeDamage * 1.5;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x136,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage + pEVar33->_damage;
|
|
pEVar33->_meleeDamage = pEVar33->_meleeDamage + pEVar33->_meleeDamage;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x231,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x14a,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage * 0.2;
|
|
fVar30 = pEVar33->_meleeDamage * 0.2;
|
|
goto LAB_00766f9a;
|
|
}
|
|
}
|
|
else {
|
|
pEVar33->_damage = pEVar33->_damage * 0.3;
|
|
fVar30 = pEVar33->_meleeDamage * 0.3;
|
|
LAB_00766f9a:
|
|
pEVar33->_meleeDamage = fVar30;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xf5,0);
|
|
if ((bVar2 != 0) || (pEVar33->_babySkin == 0x41)) {
|
|
pEVar33->_damage = pEVar33->_damage * 0.8;
|
|
pEVar33->_meleeDamage = pEVar33->_meleeDamage * 0.8;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x175,0);
|
|
pfVar10 = &pEVar33->_damage;
|
|
pfVar12 = &pEVar33->_meleeDamage;
|
|
if (bVar2 == 0) {
|
|
pEVar33->_deadEyeMisses = 0;
|
|
pEVar33->_deadEyeCharges = 0;
|
|
fVar30 = *pfVar10;
|
|
fVar32 = *pfVar12;
|
|
}
|
|
else {
|
|
fVar32 = (float)pEVar33->_deadEyeCharges * 0.125 + 1.0;
|
|
fVar30 = fVar32 * *pfVar10;
|
|
*pfVar10 = fVar30;
|
|
fVar32 = fVar32 * *pfVar12;
|
|
*pfVar12 = fVar32;
|
|
}
|
|
if (0 < pEVar33->_damageMultiplierStacks) {
|
|
fVar32 = pow(1.5,(float)GHIDRA_INT(pEVar33->_damageMultiplierStacks));
|
|
fVar30 = fVar32 * pEVar33->_damage;
|
|
fVar32 = fVar32 * pEVar33->_meleeDamage;
|
|
}
|
|
fVar32 = pEVar33->_d8DamageModifier * fVar32;
|
|
fVar30 = pEVar33->_d8DamageModifier * fVar30;
|
|
pEVar33->_damage = fVar30;
|
|
pEVar33->_meleeDamage = fVar32;
|
|
if (((float)local_484 != 0.0) && (3.5 < fVar30)) {
|
|
pEVar33->_damage = (fVar30 - 3.5) * ((float)local_484 - 1.0) + fVar30;
|
|
pEVar33->_meleeDamage = (fVar32 - 3.5) * ((float)local_484 - 1.0) + fVar32;
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,1);
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x42);
|
|
pEVar33->_damage = (float)iVar4 * 0.5 + pEVar33->_damage;
|
|
if (pEVar33->_variant == 1) {
|
|
pEVar21 = GetMainPlayer(pEVar33);
|
|
cVar3 = CanShoot(pEVar21);
|
|
if (cVar3 == '\0') {
|
|
pEVar33->_damage = 3.5;
|
|
}
|
|
}
|
|
if ((pEVar33->_variant == 0) && (iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge(), iVar4 != 0)) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
challengeParams = (GHIDRA_CAST<Manager *>((g_manager)))->Manager::GetChallengeParams(iVar4);
|
|
if (challengeParams->_maxDamage != 0) {
|
|
local_4f0 = 0x42c80000;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_damage = *pfVar10;
|
|
}
|
|
}
|
|
if (pEVar33->_variant == 1) {
|
|
if ((pEVar33->_babySkin == 0x3b) &&
|
|
(pEVar21 = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast()), pEVar21 != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
iVar4 = GetTrinketMultiplier(pEVar21,0xb4);
|
|
pTVar31 = local_464;
|
|
if (iVar4 == 2) {
|
|
*GHIDRA_CAST<float *>(local_464) = *GHIDRA_CAST<float *>(local_464) * 0.75;
|
|
}
|
|
else {
|
|
if (iVar4 != 3) goto LAB_00767233;
|
|
*GHIDRA_CAST<float *>(local_464) = *GHIDRA_CAST<float *>(local_464) * 1.0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00767233:
|
|
*GHIDRA_CAST<float *>(local_464) = *GHIDRA_CAST<float *>(local_464) * 0.5;
|
|
pTVar31 = local_464;
|
|
}
|
|
}
|
|
else {
|
|
pTVar31 = GHIDRA_CAST<TemporaryEffects *>(&pEVar33->_damage);
|
|
}
|
|
if (pEVar33->_isCoopGhost == 0) {
|
|
bVar2 = IsHologram(pEVar33);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage * 0.25;
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(pTVar31) = *GHIDRA_CAST<float *>(pTVar31) * 0.25;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetDebugFlag(3);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_damage = pEVar33->_damage + 40.0;
|
|
pEVar33->_meleeDamage = pEVar33->_meleeDamage + 40.0;
|
|
}
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_damage = *pfVar10;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
game = g_game;
|
|
pEVar33->_meleeDamage = *pfVar10;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
entityList = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar13 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((entityList)))->EntityList)::Size();
|
|
(**(code **)(*piVar13 + 0x68))();
|
|
}
|
|
}
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
if ((uVar25 & 4) != 0) {
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((float)(*piVar13 - iVar4));
|
|
pEVar33 = player;
|
|
}
|
|
else {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
eyeOfOccultCount = GetCollectibleNum(pEVar33,0x23c,0);
|
|
local_4f8 = 1;
|
|
evesMascaraCount = GetCollectibleNum(player,0x136,0);
|
|
local_500 = 1;
|
|
piVar13 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
iVar4 = *piVar13;
|
|
iVar5 = GetCollectibleNum(player,0xb7,0);
|
|
pEVar33 = player;
|
|
iVar6 = GetCollectibleNum(player,0x156,0);
|
|
iVar7 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x156);
|
|
iVar8 = GetCollectibleNum(pEVar33,0x29d,0);
|
|
pEVar33 = player;
|
|
iVar9 = GetCollectibleNum(player,0x18d,0);
|
|
iVar15 = GetCollectibleNum(pEVar33,0x155,0);
|
|
iVar16 = GetCollectibleNum(pEVar33,0x153,0);
|
|
iVar17 = GetCollectibleNum(pEVar33,0xc2,0);
|
|
iVar18 = GetCollectibleNum(pEVar33,0xb0,0);
|
|
local_488 = GHIDRA_CAST<RNG *>(((float)(iVar18 + iVar8 + (((iVar5 - iVar4) - iVar6) - iVar7) + iVar9 +
|
|
iVar15 + iVar16 + iVar17) * 0.16));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x234,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0xff,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0x8f,0);
|
|
iVar7 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x8f);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)(iVar7 + iVar4 + iVar5 + iVar6) * 0.2));
|
|
iVar4 = GetCollectibleNum(pEVar33,0xa5,0);
|
|
local_464 = (TemporaryEffects *)
|
|
((float)iVar4 * 0.23 + 1.0 + (float)local_470 + (float)local_488 +
|
|
(float)local_460 * 0.15);
|
|
iVar4 = GetCollectibleNum(pEVar33,0xb6,0);
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - (float)iVar4 * 0.25));
|
|
iVar4 = GetCollectibleNum(pEVar33,0xd5,0);
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - (float)iVar4 * 0.15));
|
|
piVar13 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - (float)*piVar13 * 0.5));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x150,0);
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - (float)iVar4 * 0.4));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x14b,0);
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - (float)iVar4 * 0.3));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x19f);
|
|
local_464 = GHIDRA_CAST<TemporaryEffects *>(((float)local_464 - (float)iVar4 * 0.3));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x149,0);
|
|
if ((pEVar33->_hasCurseMistEffect == 0) && (pEVar33->_isCoopGhost == 0)) {
|
|
iVar5 = pEVar33->_shotSpeedModifier;
|
|
}
|
|
else {
|
|
iVar5 = 0;
|
|
}
|
|
fVar30 = ((float)iVar5 + shotSpeedBonus) * 0.2 + (float)iVar4 * 0.2 + (float)local_464;
|
|
pEVar33->_shotspeed = fVar30;
|
|
bVar2 = HasTrinket(pEVar33,0x65,0);
|
|
if ((bVar2 != 0) && (isActiveEmpty != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x65);
|
|
fVar30 = (float)iVar4 * 0.3 + pEVar33->_shotspeed;
|
|
pEVar33->_shotspeed = fVar30;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,100,0);
|
|
if ((bVar2 != 0) && (isActiveFullyCharged != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,100);
|
|
fVar30 = (float)iVar4 * 0.1 + pEVar33->_shotspeed;
|
|
pEVar33->_shotspeed = fVar30;
|
|
}
|
|
iVar4 = pEVar33->_playerType;
|
|
if (iVar4 == 6) {
|
|
fVar30 = pEVar33->_shotspeed + 0.31;
|
|
LAB_007677a7:
|
|
pEVar33->_shotspeed = fVar30;
|
|
}
|
|
else {
|
|
if ((iVar4 == 9) || (iVar4 == 0x1e)) {
|
|
fVar30 = pEVar33->_edenShotSpeed + pEVar33->_shotspeed;
|
|
goto LAB_007677a7;
|
|
}
|
|
if (iVar4 == 0x13) {
|
|
fVar30 = pEVar33->_shotspeed + 0.15;
|
|
goto LAB_007677a7;
|
|
}
|
|
if (iVar4 == 0x14) {
|
|
fVar30 = pEVar33->_shotspeed - 0.15;
|
|
goto LAB_007677a7;
|
|
}
|
|
}
|
|
FUN_007538b0();
|
|
fVar30 = fVar30 * 0.2 + pEVar33->_shotspeed;
|
|
pEVar33->_shotspeed = fVar30;
|
|
if (0 < pEVar33->_coopBabyBuffTimers[3]) {
|
|
pEVar33->_shotspeed = fVar30 + 0.5;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_shotspeed = pEVar33->_shotspeed + 0.2;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x2a);
|
|
bVar2 = TemporaryEffects::has_item_effect(&pEVar33->_temporaryeffects,pIVar20);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_shotspeed = pEVar33->_shotspeed - 1.0;
|
|
}
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x1b);
|
|
pEVar33->_shotspeed = (float)iVar4 * 0.5 + pEVar33->_shotspeed;
|
|
iVar4 = GetCollectibleNum(pEVar33,0x22a,0);
|
|
pEVar33->_shotspeed = (float)iVar4 * 0.2 + pEVar33->_shotspeed;
|
|
bVar2 = HasCollectible(pEVar33,5,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(5), bVar2 != 0))
|
|
{
|
|
pEVar33->_shotspeed = pEVar33->_shotspeed * 1.6;
|
|
}
|
|
pfVar10 = &pEVar33->_shotspeed;
|
|
bVar2 = HasCollectible(pEVar33,0x95,0);
|
|
if (bVar2 == 0) {
|
|
fVar30 = pEVar33->_shotspeed;
|
|
}
|
|
else {
|
|
fVar30 = *pfVar10 * 0.8;
|
|
*pfVar10 = fVar30;
|
|
}
|
|
if ((pEVar33->_variant == 1) && (pEVar33->_babySkin == 0x15)) {
|
|
*pfVar10 = fVar30 * 0.5;
|
|
}
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x42);
|
|
fVar30 = *pfVar10 - (float)iVar4 * 0.5;
|
|
*pfVar10 = fVar30;
|
|
if (((float)local_484 != 1.0) && (0.0 < fVar30 - 1.0)) {
|
|
*pfVar10 = ((float)local_484 - 1.0) * (fVar30 - 1.0) + fVar30;
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,4);
|
|
if ((pEVar33->_variant == 0) && (iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge(), iVar4 != 0)) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
challengeParams = (GHIDRA_CAST<Manager *>((g_manager)))->Manager::GetChallengeParams(iVar4);
|
|
if (challengeParams->_minShotSpeed != 0) {
|
|
local_504 = 0x3f800000;
|
|
pfVar12 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
*pfVar10 = *pfVar12;
|
|
}
|
|
}
|
|
iVar4 = get_seeded_variant(pEVar33);
|
|
if (iVar4 != -1) {
|
|
local_508 = 0x40400000;
|
|
pfVar12 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
*pfVar10 = *pfVar12;
|
|
}
|
|
pfVar12 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
*pfVar10 = *pfVar12;
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
temporaryEffects = local_468;
|
|
}
|
|
if ((uVar25 & 8) == 0) {
|
|
temporaryEffects = local_468;
|
|
pEVar33 = player;
|
|
}
|
|
else {
|
|
pfVar10 = &pEVar33->_tearrange;
|
|
*pfVar10 = 260.0;
|
|
pEVar33->_tearheight = -23.75;
|
|
pEVar33->_tearfallspeed = 0.0;
|
|
pEVar33->_tearfallaccel = 0.0;
|
|
iVar4 = pEVar33->_playerType;
|
|
if ((((((iVar4 == 2) || (iVar4 == 8)) || (iVar4 == 7)) || ((iVar4 == 0x17 || (iVar4 == 0x18))))
|
|
|| (iVar4 == 0x1d)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar2 != 0)) {
|
|
fVar30 = *pfVar10 - 80.0;
|
|
LAB_00767b03:
|
|
*pfVar10 = fVar30;
|
|
}
|
|
else {
|
|
iVar4 = player->_playerType;
|
|
if ((iVar4 == 6) || (iVar4 == 0x1b)) {
|
|
LAB_00767ac2:
|
|
fVar30 = *pfVar10 - 60.0;
|
|
goto LAB_00767b03;
|
|
}
|
|
if ((iVar4 == 9) || (iVar4 == 0x1e)) {
|
|
fVar30 = player->_edenTearRange + *pfVar10;
|
|
goto LAB_00767b03;
|
|
}
|
|
if (iVar4 == 0x13) goto LAB_00767ac2;
|
|
if (iVar4 == 0x14) {
|
|
fVar30 = *pfVar10 + 60.0;
|
|
goto LAB_00767b03;
|
|
}
|
|
}
|
|
if ((player->_hasCurseMistEffect == 0) && (player->_isCoopGhost == 0)) {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(player->_tearRangeModifier);
|
|
}
|
|
else {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.5 - (float)*piVar13 * 0.4));
|
|
}
|
|
else {
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
pEVar33 = player;
|
|
iVar4 = GetCollectibleNum(player,0x47,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0xc,0);
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x47);
|
|
iVar7 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xc);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)(iVar7 + GHIDRA_INT(local_460) + iVar4 + iVar5 + iVar6) + rangeBonus);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1e,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1f,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 1.5 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x18d,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460 + (float)local_470));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x153,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x159,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x159);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0xe,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xe);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x172,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0xbd,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1c7,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x163,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x293,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x29d,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((((float)iVar4 + (float)local_460) * 100.0));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1ce,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0x1c5,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0xc5,0);
|
|
iVar7 = GetCollectibleNum(pEVar33,0x79,0);
|
|
iVar8 = GetCollectibleNum(pEVar33,0x6e,0);
|
|
iVar9 = GetCollectibleNum(pEVar33,0x65,0);
|
|
iVar15 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x79);
|
|
local_46c = (Entity_Player *)
|
|
((float)(iVar15 + iVar4 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9) * 60.0 +
|
|
(float)local_460);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x150,0);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)local_46c - (float)iVar4 * 60.0));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x171,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 120.0 + (float)local_46c));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x18a,0);
|
|
fVar30 = (float)iVar4 * 120.0 + (float)local_460 + pEVar33->_tearrange;
|
|
pEVar33->_tearrange = fVar30;
|
|
bVar2 = HasCollectible(pEVar33,0x23c,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_tearheight = pEVar33->_tearheight - 8.0;
|
|
fVar30 = pEVar33->_tearrange + 80.0;
|
|
pEVar33->_tearrange = fVar30;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x252,0);
|
|
if (bVar2 != 0) {
|
|
fVar30 = pEVar33->_tearheight - 8.0;
|
|
pEVar33->_tearheight = fVar30;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x256,0);
|
|
temporaryEffects = &pEVar33->_temporaryeffects;
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2b0), bVar2 != 0)) {
|
|
fVar30 = pEVar33->_tearheight * 0.4;
|
|
pEVar33->_tearheight = fVar30;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x2cc,0);
|
|
if (bVar2 != 0) {
|
|
fVar30 = (float)((pEVar33->_keepersSackBonus / 3 + 1) / 3) * 10.0 + pEVar33->_tearrange;
|
|
pEVar33->_tearrange = fVar30;
|
|
}
|
|
FUN_007538a0();
|
|
pEVar33->_tearrange = fVar30 * 60.0 + pEVar33->_tearrange;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
pfVar10 = &pEVar33->_tearrange;
|
|
if (bVar2 == 0) {
|
|
fVar30 = pEVar33->_tearrange;
|
|
}
|
|
else {
|
|
pEVar33->_tearfallaccel = 0.8;
|
|
pEVar33->_tearheight = pEVar33->_tearheight - 80.0;
|
|
fVar30 = *pfVar10 + 80.0;
|
|
*pfVar10 = fVar30;
|
|
}
|
|
if (0 < pEVar33->_coopBabyBuffTimers[3]) {
|
|
*pfVar10 = fVar30 + 80.0;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x65,0);
|
|
if ((bVar2 != 0) && (isActiveEmpty != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x65);
|
|
pEVar33->_tearrange = (float)iVar4 * 60.0 + pEVar33->_tearrange;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,100,0);
|
|
if ((bVar2 != 0) && (isActiveFullyCharged != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,100);
|
|
pEVar33->_tearrange = (float)iVar4 * 30.0 + pEVar33->_tearrange;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 60.0;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x29);
|
|
bVar2 = TemporaryEffects::has_item_effect(temporaryEffects,pIVar20);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_tearheight = pEVar33->_tearheight - 30.0;
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 120.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x197,0);
|
|
if (((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x197), bVar2 != 0)) &&
|
|
(pEVar33->_purityState == 3)) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 120.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x95,0);
|
|
if ((bVar2 == 0) && (bVar2 = HasCollectible(pEVar33,0x213,0), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0xe0,0);
|
|
if (bVar2 != 0) goto LAB_00768248;
|
|
}
|
|
else {
|
|
bVar2 = HasCollectible(pEVar33,0xe5,0);
|
|
if (bVar2 == 0) {
|
|
pEVar33->_tearfallaccel = 0.8;
|
|
LAB_00768248:
|
|
pEVar33->_tearrange = pEVar33->_tearrange * 0.8;
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xe9,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 260.0;
|
|
pEVar33->_tearfallaccel = pEVar33->_tearfallaccel * 0.01;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x133,0);
|
|
if ((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x133)) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 30.0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xd6,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xd6), bVar2 != 0)) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 60.0;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x1a,0);
|
|
if ((bVar2 != 0) && (bVar2 = HasWeaponType(pEVar33,1), bVar2 != 0)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x1a);
|
|
pEVar33->_tearrange = (float)iVar4 * 60.0 + pEVar33->_tearrange;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x60,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x60);
|
|
pEVar33->_tearrange = (float)iVar4 * 60.0 + pEVar33->_tearrange;
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar4 != 0) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
challengeParams = (GHIDRA_CAST<Manager *>((g_manager)))->Manager::GetChallengeParams(iVar4);
|
|
if (challengeParams->_bigRange != 0) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 400.0;
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xc0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_tearheight = pEVar33->_tearheight + pEVar33->_tearheight;
|
|
pEVar33->_tearfallspeed = pEVar33->_tearfallspeed * 0.5;
|
|
pEVar33->_tearrange = pEVar33->_tearrange + 120.0;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x41,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x41);
|
|
pEVar33->_tearheight = ((float)iVar4 + (float)iVar4) * pEVar33->_tearheight;
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x41);
|
|
pEVar33->_tearfallspeed = (float)iVar4 * 0.5 * pEVar33->_tearfallspeed;
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x41);
|
|
pEVar33->_tearrange = (float)iVar4 * 120.0 + pEVar33->_tearrange;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,6,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(6), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x1b8,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_tearheight = pEVar33->_tearheight + 18.0;
|
|
}
|
|
}
|
|
else {
|
|
pEVar33->_tearheight = pEVar33->_tearheight + 18.0;
|
|
local_50c = 0x43480000;
|
|
rangeAboveMin = pEVar33->_tearrange - 60.0;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
scaledRange = *pfVar10 * 0.8;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
pEVar33->_tearrange = *pfVar10;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,5,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(5), bVar2 != 0)) {
|
|
pEVar33->_tearrange = pEVar33->_tearrange + pEVar33->_tearrange + 60.0;
|
|
}
|
|
iVar4 = get_seeded_variant(pEVar33);
|
|
pfVar10 = &pEVar33->_tearrange;
|
|
if (iVar4 == 5) {
|
|
fVar30 = *pfVar10 + 200.0;
|
|
}
|
|
else {
|
|
fVar30 = pEVar33->_tearrange;
|
|
}
|
|
fVar30 = fVar30 * pEVar33->_d8RangeModifier;
|
|
*pfVar10 = fVar30;
|
|
if (((float)local_484 != 1.0) && (260.0 < fVar30)) {
|
|
*pfVar10 = (fVar30 - 260.0) * ((float)local_484 - 1.0) + fVar30;
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,8);
|
|
if (pEVar33->_tearrange <= 40.0 && pEVar33->_tearrange != 40.0) {
|
|
pEVar33->_tearrange = 40.0;
|
|
}
|
|
if (0.0 < pEVar33->_tearfallaccel) {
|
|
pEVar33->_tearfallaccel = pEVar33->_shotspeed * pEVar33->_shotspeed * pEVar33->_tearfallaccel;
|
|
}
|
|
}
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
if ((uVar25 & 0x10) != 0) {
|
|
_DAT_00c5c3d4 = pEVar33->_edenSpeed;
|
|
local_480 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (GHIDRA_UINT(pEVar33->_playerType) < 0x29) {
|
|
local_480 = *GHIDRA_CAST<Entity_Player **>((&DAT_00c5c3b0 + pEVar33->_playerType * 4));
|
|
}
|
|
_DAT_00c5c428 = _DAT_00c5c3d4;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2);
|
|
if (bVar2 != 0) {
|
|
local_480 = DAT_00c5c3cc;
|
|
}
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.5 - (float)*piVar13 * 0.4));
|
|
temporaryEffects = local_468;
|
|
pEVar33 = player;
|
|
}
|
|
else {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
iVar4 = is_achievement_79_unlocked(pEVar33);
|
|
if (iVar4 < 1) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(GetCollectibleNum(pEVar33,0x8f,0));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x8f);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_46c) + iVar4));
|
|
}
|
|
else {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
iVar4 = GetCollectibleNum(pEVar33,0xe,0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(familiarList)) + 0x10))) = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xe)
|
|
;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(familiarList)) + 0x10))) = iVar4 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(familiarList)) + 0x10)));
|
|
local_5b4 = (void *)0x1;
|
|
iVar4 = GetCollectibleNum(pEVar33,0xd,0);
|
|
virusCount = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xd);
|
|
virusCount = iVar4 + virusCount;
|
|
local_5ac = 1;
|
|
iVar4 = GetCollectibleNum(pEVar33,0xe8,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0x77,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0x1c,0);
|
|
iVar7 = GetCollectibleNum(pEVar33,0x1b,0);
|
|
iVar8 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x42);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)(iVar8 + iVar4 + iVar5 + iVar6 + iVar7) + (float)local_460);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x154,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0xc,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0xc);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x47,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x47);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x65,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x7a);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x78,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x78);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460 + (float)GHIDRA_INT(local_46c)));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x52,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x23b,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetNullEffectNum(0x6e);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>((((float)iVar4 + (float)local_460) * 0.3));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x46,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x46);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)(iVar4 + iVar5) * 0.5));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x24e,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2c0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((((float)iVar4 + (float)local_460) * 0.4));
|
|
piVar13 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
iVar6 = GetCollectibleNum(player,0x5a,0);
|
|
iVar5 = *piVar13;
|
|
iVar7 = GetCollectibleNum(player,0x81,0);
|
|
iVar8 = GetCollectibleNum(player,0x79,0);
|
|
iVar9 = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::GetCollectibleEffectNum(0x79);
|
|
iVar15 = GetCollectibleNum(player,0x29d,0);
|
|
iVar16 = GetCollectibleNum(player,0xbd,0);
|
|
iVar17 = GetCollectibleNum(player,0x4f,0);
|
|
iVar18 = (GHIDRA_CAST<TemporaryEffects *>((local_468)))->TemporaryEffects::GetCollectibleEffectNum(0x2b0);
|
|
pEVar33 = player;
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)(iVar18 + ((((iVar5 - iVar6) - iVar7) - iVar8) - iVar9) + iVar15 + iVar16 +
|
|
iVar17) * 0.2 +
|
|
(float)iVar4 * 0.3 + (float)local_480 + 1.0 + (float)local_460 + (float)local_470);
|
|
iVar4 = GetCollectibleNum(player,0x1bd,0);
|
|
if ((pEVar33->_hasCurseMistEffect == 0) && (pEVar33->_isCoopGhost == 0)) {
|
|
iVar5 = pEVar33->_speedModifier;
|
|
}
|
|
else {
|
|
iVar5 = 0;
|
|
}
|
|
pEVar33->_movespeed = ((float)iVar5 + speedBonus) * 0.2 + (float)iVar4 * 0.1 + (float)local_460;
|
|
if ((0x28 < GHIDRA_UINT(pEVar33->_playerType)) ||
|
|
(0.0 <= *GHIDRA_CAST<float *>((&DAT_00c5c3b0 + pEVar33->_playerType * 4)))) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x3e);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x41), bVar2 != 0)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed - 0.1;
|
|
}
|
|
}
|
|
temporaryEffects = &pEVar33->_temporaryeffects;
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x36);
|
|
if (0 < iVar4) {
|
|
pEVar33->_movespeed = (float)iVar4 * 0.05 + pEVar33->_movespeed;
|
|
}
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x246);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.03));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetNullEffectNum(0x47);
|
|
fVar30 = pEVar33->_movespeed - ((float)iVar4 * 0.06 + (float)local_460);
|
|
pEVar33->_movespeed = fVar30;
|
|
bVar2 = HasCollectible(pEVar33,0x252,0);
|
|
if (bVar2 != 0) {
|
|
fVar30 = Math::lerp(-0.3,0.2,pEVar33->_jupiterCharge,0);
|
|
fVar30 = fVar30 + pEVar33->_movespeed;
|
|
pEVar33->_movespeed = fVar30;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x2b7,0);
|
|
if ((bVar2 != 0) && (isEffectsDisabled == 0)) {
|
|
fVar32 = Math::clamp(0.0,6.0,(float)GHIDRA_INT(pEVar33->_bloodLustCounter));
|
|
fVar30 = fVar32 * 0.05;
|
|
pEVar33->_movespeed = fVar32 * 0.02 * fVar32 + fVar30 + pEVar33->_movespeed;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x2cc,0);
|
|
if (bVar2 != 0) {
|
|
fVar30 = (float)(pEVar33->_keepersSackBonus / 9) * 0.03 + pEVar33->_movespeed;
|
|
pEVar33->_movespeed = fVar30;
|
|
}
|
|
FUN_00753890();
|
|
pEVar33->_movespeed = fVar30 * 0.2 + pEVar33->_movespeed;
|
|
bVar2 = HasTrinket(pEVar33,0x65,0);
|
|
if ((bVar2 != 0) && (isActiveEmpty != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x65);
|
|
pEVar33->_movespeed = (float)iVar4 * 0.5 + pEVar33->_movespeed;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,100,0);
|
|
if ((bVar2 != 0) && (isActiveFullyCharged != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,100);
|
|
pEVar33->_movespeed = (float)iVar4 * 0.25 + pEVar33->_movespeed;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x12a), bVar2 != 0)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.28;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x25,0);
|
|
if (bVar2 == 0) {
|
|
fVar30 = pEVar33->_movespeed;
|
|
}
|
|
else {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x25);
|
|
fVar30 = (float)iVar4 * 0.15 + pEVar33->_movespeed;
|
|
pEVar33->_movespeed = fVar30;
|
|
}
|
|
if (0 < pEVar33->_coopBabyBuffTimers[2]) {
|
|
pEVar33->_movespeed = fVar30 + 0.15;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x53);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed - 0.18;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xe6,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.2;
|
|
}
|
|
bVar2 = HasPlayerForm(pEVar33,5);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.15;
|
|
}
|
|
bVar2 = HasPlayerForm(pEVar33,0xe);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.2;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x82,0);
|
|
if ((bVar2 != 0) || (bVar2 = HasCollectible(pEVar33,0xb5,0), bVar2 != 0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_5a8)) + 0x0))) = 0x3fc00000;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_movespeed = *pfVar10;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,299,0);
|
|
if ((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 299)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed - 0.3;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(299);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_taurusSpeedBonus + pEVar33->_movespeed;
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,300,0);
|
|
if ((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 300)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.25;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x132,0);
|
|
if ((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x132)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.2;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x133,0);
|
|
if ((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x133)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.1;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x13a,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed - 0.4;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x197,0);
|
|
if (((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x197), bVar2 != 0)) &&
|
|
(pEVar33->_purityState == 2)) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.5;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x2a);
|
|
bVar2 = TemporaryEffects::has_item_effect(temporaryEffects,pIVar20);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.5;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x32);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed + 0.5;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c1);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x1f1);
|
|
if (bVar2 != 0) {
|
|
fVar30 = pEVar33->_movespeed + 0.5;
|
|
goto LAB_00769200;
|
|
}
|
|
}
|
|
else {
|
|
fVar30 = pEVar33->_movespeed + 1.0;
|
|
LAB_00769200:
|
|
pEVar33->_movespeed = fVar30;
|
|
}
|
|
pfVar10 = &pEVar33->_movespeed;
|
|
fVar30 = pEVar33->_d8SpeedModifier * *pfVar10;
|
|
*pfVar10 = fVar30;
|
|
if (((float)local_484 != 1.0) && (1.0 < fVar30)) {
|
|
*pfVar10 = (fVar30 - 1.0) * ((float)local_484 - 1.0) + fVar30;
|
|
}
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00421780());
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((entityList)))->EntityList::Size();
|
|
if (iVar4 == 0x2b) {
|
|
pEVar33->_movespeed = pEVar33->_movespeed - 1.0;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
entityList = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar13 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((entityList)))->EntityList)::Size();
|
|
(**(code **)(*piVar13 + 100))();
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x10);
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
}
|
|
if ((uVar25 & 0x20) == 0) {
|
|
local_464 = &pEVar33->_temporaryeffects;
|
|
}
|
|
else {
|
|
pEVar33->_tearFlags = g_tearFlagsNone;
|
|
bVar2 = HasCollectible(pEVar33,0x23c,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x23c), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagOccult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x254,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x254), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagIce);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x250,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x250), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagRock);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x90,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagTurnHorizontal);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x23a,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagRainbow);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xb6,0);
|
|
if (((((bVar2 != 0) || (bVar2 = HasCollectible(pEVar33,3,0), bVar2 != 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xc0), bVar2 != 0)) ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(3), bVar2 != 0 ||
|
|
(bVar2 = HasCollectible(pEVar33,0x14b,0), bVar2 != 0)))) ||
|
|
(((pEVar33->_variant == 1 && (pEVar33->_babySkin == 4)) ||
|
|
(0 < pEVar33->_hallowedGroundCountdown)))) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagHoming);
|
|
}
|
|
local_468 = GHIDRA_CAST<TemporaryEffects *>(&pEVar33->_tearFlags);
|
|
local_464 = local_468;
|
|
bVar2 = HasCollectible(pEVar33,0x84,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagGrow);
|
|
local_468 = GHIDRA_CAST<TemporaryEffects *>(&pEVar33->_tearFlags);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x20c,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagLaser);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x105,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x105), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagShrink);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xb9,0);
|
|
if ((((((bVar2 != 0) || (bVar2 = HasCollectible(pEVar33,0x73,0), bVar2 != 0)) ||
|
|
(bVar2 = HasCollectible(pEVar33,0x9f,0), bVar2 != 0)) ||
|
|
(((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x73), bVar2 != 0 ||
|
|
(bVar2 = HasWeaponType(pEVar33,8), bVar2 != 0)) ||
|
|
((bVar2 = HasCollectible(pEVar33,0x150,0), bVar2 != 0 ||
|
|
((bVar2 = HasCollectible(pEVar33,0x17b,0), bVar2 != 0 ||
|
|
(bVar2 = HasCollectible(pEVar33,0x166,0), bVar2 != 0)))))))) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x166), bVar2 != 0)) ||
|
|
(((((iVar4 = pEVar33->_playerType, iVar4 == 10 || (iVar4 == 0x1f)) || (iVar4 == 0x27)) ||
|
|
(((pEVar33->_variant == 1 && (pEVar33->_babySkin == 0x3b)) ||
|
|
((iVar4 == 0x11 || ((pEVar33->_variant == 1 && (pEVar33->_babySkin == 0x3a)))))))) ||
|
|
((pEVar33->_isCoopGhost != 0 ||
|
|
((((iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2a5), iVar4 == 1
|
|
|| (bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x42), bVar2 != 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x65), bVar2 != 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x70), bVar2 != 0)))))))) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagSpectral);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x30,0);
|
|
if (((((bVar2 != 0) || (bVar2 = HasCollectible(pEVar33,0xed,0), bVar2 != 0)) ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xed), bVar2 != 0 ||
|
|
((bVar2 = HasCollectible(pEVar33,0x132,0), bVar2 != 0 ||
|
|
(iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x132)))))) ||
|
|
(bVar2 = HasWeaponType(pEVar33,8), bVar2 != 0)) ||
|
|
(bVar2 = HasCollectible(pEVar33,0x150,0), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagPiercing);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xa9,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagPersistent);
|
|
local_468 = local_464;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x131,0);
|
|
if ((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x131)) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagPoison);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x68,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_464))))->BitSet128::operator__(&g_tearFlagSplit);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,5,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(5), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagBoomerang);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,10,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&wiggleWormFlags,&g_tearFlagWiggle,&g_tearFlagSpectral);
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x1a,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&hookWormFlags,&g_tearFlagSquare,&g_tearFlagSpectral);
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x95,0);
|
|
if ((bVar2 != 0) &&
|
|
((bVar2 = HasWeaponType(pEVar33,8), bVar2 == 0 ||
|
|
(bVar2 = HasCollectible(pEVar33,0x21c,0), bVar2 != 0)))) {
|
|
flagsResult = BitSet128::operator_or(&ipecacFlags,&g_tearFlagExplosive,&g_tearFlagPoison);
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xe9,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&tinyPlanetFlags,&g_tearFlagOrbit,&g_tearFlagSpectral);
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xde,0);
|
|
if ((((bVar2 != 0) && (bVar2 = HasWeaponType(pEVar33,8), bVar2 == 0)) &&
|
|
(bVar2 = HasWeaponType(pEVar33,7), bVar2 == 0)) &&
|
|
((bVar2 = HasWeaponType(pEVar33,1), bVar2 == 0 ||
|
|
((bVar2 = HasCollectible(pEVar33,0x13c,0), bVar2 == 0 &&
|
|
(bVar2 = HasCollectible(pEVar33,0x45,0), bVar2 == 0)))))) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagWait);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xe0,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagQuadsplit);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xdd,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagBounce);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x13b,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagAttractor);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,9,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagPulse);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x135,0);
|
|
if (((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x135)) ||
|
|
((bVar2 = HasCollectible(pEVar33,0x167,0), bVar2 != 0 ||
|
|
((bVar2 = HasTrinket(pEVar33,0x4d,0), bVar2 != 0 ||
|
|
(bVar2 = HasCollectible(pEVar33,0x250,0), bVar2 != 0)))))) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagKnockback);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0xb,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&ringWormFlags,&g_tearFlagSpiral,&g_tearFlagSpectral);
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0xc,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagFlat);
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x60,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&ouroborosFlags,&g_tearFlagBigSpiral,&g_tearFlagSpectral)
|
|
;
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x14b,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagGlow);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x171,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&continuumFlags,&g_tearFlagContinuum,&g_tearFlagSpectral)
|
|
;
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x18d,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagTractorBeam);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x215,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagLasershot);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x101,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x101), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagBurn);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x13d,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x13d), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((&pEVar33->_tearFlags)))->BitSet128::operator__(&g_tearFlagMysteriousLiquidCreep);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x103,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x103), bVar2 != 0)) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagDarkMatter);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x1c5,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagBone);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x1ce,0);
|
|
if (bVar2 != 0) {
|
|
flagsResult = BitSet128::operator_or(&belialFlags,&g_tearFlagPiercing,&g_tearFlagBelial);
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(flagsResult);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x1ee,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagJacobs);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x214,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagAbsorb);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x211,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagPop);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x21c,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagHydrobounce);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xd5,0);
|
|
if (bVar2 == 0) {
|
|
local_464 = temporaryEffects;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x78);
|
|
if (bVar2 != 0) goto LAB_00769c23;
|
|
}
|
|
else {
|
|
LAB_00769c23:
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagShielded);
|
|
local_464 = &pEVar33->_temporaryeffects;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x1fa,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(local_468))))->BitSet128::operator__(&g_tearFlagBackstab);
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x20);
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
}
|
|
cVar3 = (char)uVar25;
|
|
if ((uVar25 & 0x40) != 0) {
|
|
(GHIDRA_CAST<Color *>((defaultLaserColor)))->Color::Color();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::operator_assign(other);
|
|
bVar2 = HasCollectible(pEVar33,0x1ad,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x1ad), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x95,0);
|
|
if (bVar2 != 0) {
|
|
fVar34 = 1.0;
|
|
fVar32 = 3.0;
|
|
fVar30 = 1.8;
|
|
goto LAB_0076a3bd;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0xb6,0);
|
|
if ((bVar2 != 0) || (0 < pEVar33->_hallowedGroundCountdown)) {
|
|
fVar34 = 6.0;
|
|
fVar32 = 6.0;
|
|
fVar30 = 5.0;
|
|
goto LAB_0076a3bd;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x254,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x23c,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x23c), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x101,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x67,0);
|
|
if ((((bVar2 == 0) && (bVar2 = HasCollectible(pEVar33,0x13d,0), bVar2 == 0)) &&
|
|
(bVar2 = HasCollectible(pEVar33,0x131,0), bVar2 == 0)) &&
|
|
((iVar4 = GetZodiacEffect(pEVar33), iVar4 != 0x131 &&
|
|
(bVar2 = HasCollectible(pEVar33,0x1cb,0), bVar2 == 0)))) {
|
|
bVar2 = HasCollectible(pEVar33,0x68,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x59,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x13b,0);
|
|
if (((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x13b),
|
|
bVar2 == 0)) &&
|
|
((bVar2 = HasCollectible(pEVar33,0x191,0), bVar2 == 0 &&
|
|
(bVar2 = HasCollectible(pEVar33,0x269,0), bVar2 == 0)))) {
|
|
bVar2 = HasCollectible(pEVar33,0x26a,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x229,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x1ee,0);
|
|
if (bVar2 != 0) {
|
|
fVar32 = 4.9;
|
|
fVar30 = 3.8;
|
|
goto LAB_00769f94;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,6,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(6),
|
|
bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,3,0);
|
|
if (((bVar2 == 0) &&
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(3),
|
|
bVar2 == 0 &&
|
|
(bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(temporaryEffects,0xc0), bVar2 == 0)))) &&
|
|
((pEVar33->_variant != 1 || (pEVar33->_babySkin != 4)))) {
|
|
bVar2 = HasCollectible(pEVar33,200,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x18e,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(temporaryEffects,0x18e), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x45,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x231,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x14a,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x84,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x103,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetTint(3.0,3.0,3.0,
|
|
1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetOffset(-0.5,-0.5,
|
|
-0.5);
|
|
goto LAB_0076a232;
|
|
}
|
|
if (pEVar33->_playerType != 0x19) goto LAB_0076a3c8;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetTint(2.0,2.0,2.0,
|
|
1.0);
|
|
fVar34 = 0.1;
|
|
fVar32 = 0.3;
|
|
fVar30 = 0.7;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetTint(3.0,3.0,3.0,
|
|
1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetOffset(-0.5,-0.5,
|
|
-0.5);
|
|
fVar34 = 1.2;
|
|
fVar32 = 1.2;
|
|
fVar30 = 1.3;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 4.2;
|
|
fVar32 = 5.0;
|
|
fVar30 = 5.6;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 3.8;
|
|
fVar32 = 5.2;
|
|
fVar30 = 5.6;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 1.7;
|
|
fVar32 = 1.7;
|
|
fVar30 = 3.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 4.0;
|
|
fVar32 = 1.2;
|
|
fVar30 = 1.2;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 3.5;
|
|
fVar32 = 1.0;
|
|
fVar30 = 4.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 3.5;
|
|
fVar32 = 1.0;
|
|
fVar30 = 3.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 1.0;
|
|
fVar32 = 4.9;
|
|
fVar30 = 5.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 4.0;
|
|
fVar32 = 2.0;
|
|
fVar30 = 2.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 0.0;
|
|
fVar32 = 1.0;
|
|
fVar30 = 5.0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0076a232:
|
|
fVar34 = 1.0;
|
|
fVar32 = 1.0;
|
|
fVar30 = 1.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 5.0;
|
|
fVar32 = 5.2;
|
|
fVar30 = 5.2;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 0.4;
|
|
fVar32 = 1.5;
|
|
fVar30 = 3.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 1.0;
|
|
fVar32 = 4.0;
|
|
fVar30 = 1.8;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 1.0;
|
|
fVar32 = 3.0;
|
|
fVar30 = 5.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar34 = 3.0;
|
|
fVar32 = 0.5;
|
|
fVar30 = 3.0;
|
|
}
|
|
goto LAB_0076a3bd;
|
|
}
|
|
fVar32 = 4.4;
|
|
fVar30 = 4.0;
|
|
LAB_00769f94:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetColorize(fVar30,fVar32,6.0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetOffset(0.1,0.1,0.1);
|
|
}
|
|
else {
|
|
fVar34 = 1.0;
|
|
fVar32 = 4.0;
|
|
fVar30 = 6.0;
|
|
LAB_0076a3bd:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::SetColorize(fVar30,fVar32,fVar34,1.0);
|
|
}
|
|
LAB_0076a3c8:
|
|
(GHIDRA_CAST<Color *>((&defaultTearColor)))->Color::Color();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::operator_assign(other_00);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
this_00 = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
(GHIDRA_CAST<Entity_Familiar *>((this_00)))->Entity_Familiar::GetPlayerSlot(&playerSlotColor,pEVar33);
|
|
(GHIDRA_CAST<Color *>((&pvpTearColor)))->Color::Color();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::operator_assign(other_01);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x13d,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x13d), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x101,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x101), bVar2 != 0)) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetColorize(1.8,0.9,0.3,1.0);
|
|
fVar34 = 0.0;
|
|
fVar32 = 0.0;
|
|
fVar30 = 0.3;
|
|
goto LAB_0076aab9;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x103,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x103), bVar2 == 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0x95,0);
|
|
if ((bVar2 == 0) || (bVar2 = HasWeaponType(pEVar33,5), bVar2 != 0)) {
|
|
bVar2 = HasCollectible(pEVar33,0xb6,0);
|
|
if ((bVar2 == 0) && (pEVar33->_hallowedGroundCountdown < 1)) {
|
|
bVar2 = HasCollectible(pEVar33,0x23c,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x23c), bVar2 != 0))
|
|
{
|
|
fVar32 = 0.25;
|
|
fVar30 = 0.0;
|
|
goto LAB_0076a9c3;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x84,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x68,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x45,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,6,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(6), bVar2 == 0
|
|
)) {
|
|
bVar2 = HasCollectible(pEVar33,3,0);
|
|
if (((bVar2 == 0) &&
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(3),
|
|
bVar2 == 0 &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xc0),
|
|
bVar2 == 0)))) && ((pEVar33->_variant != 1 || (pEVar33->_babySkin != 4))))
|
|
{
|
|
bVar2 = HasCollectible(pEVar33,0x136,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0xdd,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(1.0,1.0,0.8,1.0);
|
|
fVar34 = 0.1;
|
|
fVar32 = 0.1;
|
|
fVar30 = 0.1;
|
|
goto LAB_0076aab9;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x150,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x231,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar33,0x14a,0);
|
|
if (bVar2 != 0) goto LAB_0076a9da;
|
|
bVar2 = HasCollectible(pEVar33,0x18e,0);
|
|
if (((bVar2 != 0) ||
|
|
(bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(temporaryEffects,0x18e), bVar2 != 0)) &&
|
|
(bVar2 = HasWeaponType(pEVar33,4), bVar2 != 0)) {
|
|
fVar32 = 1.0;
|
|
fVar30 = 0.5;
|
|
goto LAB_0076a81e;
|
|
}
|
|
bVar2 = HasWeaponType(pEVar33,10);
|
|
if ((bVar2 == 0) ||
|
|
(bVar2 = HasCollectible(pEVar33,0x213,0), bVar2 == 0)) {
|
|
if ((pEVar33->_playerType == 0x19) &&
|
|
(bVar2 = HasCollectible(pEVar33,0x2a6,0), bVar2 == 0)) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(1.5,1.5,1.5,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetColorize(0.7,0.6,0.5,1.0);
|
|
fVar34 = -0.4;
|
|
fVar32 = -0.45;
|
|
fVar30 = -0.4;
|
|
goto LAB_0076aab9;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(0.92,0.05,0.03,1.0);
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(1.8,1.7,1.0,1.0);
|
|
}
|
|
goto LAB_0076aac4;
|
|
}
|
|
tintAlpha = 0.9;
|
|
fVar34 = 0.1;
|
|
fVar32 = 0.25;
|
|
fVar30 = 0.5;
|
|
}
|
|
else {
|
|
tintAlpha = 1.0;
|
|
fVar34 = 0.2;
|
|
fVar32 = 0.2;
|
|
fVar30 = 0.2;
|
|
}
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(fVar30,fVar32,fVar34,tintAlpha);
|
|
FUN_00683010();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(0.4,0.15,0.38,1.0);
|
|
FUN_00683010();
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(1.0,1.0,0.0,1.0);
|
|
FUN_00683010();
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(0.33,0.18,0.18,1.0);
|
|
FUN_00683010();
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(0.9,0.3,0.08,1.0);
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(0.2,0.09,0.065,1.0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_0076a9da:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(1.5,2.0,2.0,1.0);
|
|
}
|
|
}
|
|
else {
|
|
fVar32 = 0.4;
|
|
fVar30 = 0.9;
|
|
LAB_0076a81e:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetTint(0.5,fVar30,fVar32,1.0);
|
|
}
|
|
}
|
|
else {
|
|
fVar32 = 0.3;
|
|
fVar30 = 0.3;
|
|
LAB_0076a9c3:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetColorize(0.3,fVar30,fVar32,1.0);
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetColorize(0.2,1.0,0.2,1.0);
|
|
fVar34 = 0.0;
|
|
fVar32 = 0.2;
|
|
fVar30 = 0.0;
|
|
LAB_0076aab9:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::SetOffset(fVar30,fVar32,fVar34);
|
|
}
|
|
LAB_0076aac4:
|
|
bVar2 = HasCollectible(pEVar33,0x73,0);
|
|
if ((((((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x73), bVar2 != 0)) ||
|
|
((iVar4 = pEVar33->_playerType, iVar4 == 10 || ((iVar4 == 0x1f || (iVar4 == 0x27)))))) ||
|
|
((pEVar33->_variant == 1 && (pEVar33->_babySkin == 0x3b)))) ||
|
|
(((((bVar2 = HasCollectible(pEVar33,0x9f,0), bVar2 != 0 ||
|
|
(bVar2 = HasCollectible(pEVar33,0xb9,0), bVar2 != 0)) || (pEVar33->_playerType == 0x11))
|
|
|| ((pEVar33->_variant == 1 && (pEVar33->_babySkin == 0x3a)))) ||
|
|
(pEVar33->_isCoopGhost != 0)))) ||
|
|
(((iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2a5), iVar4 == 1 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x42), bVar2 != 0)) ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x65), bVar2 != 0 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x70), bVar2 != 0)))))) {
|
|
(GHIDRA_CAST<Color *>((&tearGlowColor)))->Color::Color(1.5,2.0,2.0,0.5);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_tearColor))))->Color::__mul(color);
|
|
(GHIDRA_CAST<Color *>((&laserGlowColor)))->Color::Color(1.5,2.0,2.0,0.5);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_laserColor))))->Color::__mul(other_02);
|
|
}
|
|
bVar2 = IsHologram(pEVar33);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(&pEVar33->_tearColor))))->Font::SetLineHeightModifier(0.2);
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(&pEVar33->_laserColor))))->Font::SetLineHeightModifier(0.2);
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x40);
|
|
cVar3 = (char)pEVar33->_cacheFlags;
|
|
}
|
|
if (cVar3 < '\0') {
|
|
local_47b = pEVar33->_canFly;
|
|
iVar4 = GetCollectibleNum(pEVar33,0xb9,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0xb8,0);
|
|
iVar6 = GetCollectibleNum(pEVar33,0xb5,0);
|
|
iVar7 = GetCollectibleNum(pEVar33,0xb3,0);
|
|
iVar8 = GetCollectibleNum(pEVar33,0x9f,0);
|
|
iVar9 = GetCollectibleNum(pEVar33,0x82,0);
|
|
iVar15 = GetCollectibleNum(pEVar33,0x52,0);
|
|
iVar16 = GetCollectibleNum(pEVar33,0x14,0);
|
|
iVar17 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x14);
|
|
if ((((iVar17 + iVar4 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar15 + iVar16 < 1) &&
|
|
(bVar2 = HasPlayerForm(pEVar33,0), bVar2 == 0)) &&
|
|
(bVar2 = HasPlayerForm(pEVar33,1), bVar2 == 0)) &&
|
|
(bVar2 = HasPlayerForm(pEVar33,8), bVar2 == 0)) {
|
|
bVar2 = HasPlayerForm(pEVar33,3);
|
|
temporaryEffects = &pEVar33->_temporaryeffects;
|
|
if (((((((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x21), bVar2 != 0))
|
|
|| ((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x14), bVar2 != 0
|
|
|| ((pEVar33->_variant == 1 || (iVar4 = pEVar33->_playerType, iVar4 == 10)))))) ||
|
|
(iVar4 == 0x1f)) || (((iVar4 == 0x27 || (iVar4 == 0x28)) || (iVar4 == 7)))) ||
|
|
((iVar4 == 0x11 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x199), bVar2 != 0))))
|
|
|| ((((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0x76), bVar2 != 0 ||
|
|
((bVar2 = HasPlayerForm(pEVar33,0xe), bVar2 != 0 ||
|
|
(iVar4 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2a5),
|
|
iVar4 == 1)))) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x42), bVar2 != 0)) ||
|
|
((((((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x43), bVar2 != 0 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(100), bVar2 != 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x65), bVar2 != 0)) ||
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasNullEffect(0x70), bVar2 != 0 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar2 != 0))))
|
|
|| ((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x2ca),
|
|
bVar2 != 0 && (pEVar33->_playerType == 0x23)))) ||
|
|
((bVar2 = HasCollectible(pEVar33,0x283,0), bVar2 != 0 ||
|
|
(bVar2 = HasCollectible(pEVar33,0x279,0), bVar2 != 0)))))))) goto LAB_0076ae8d;
|
|
iVar4 = 5;
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
LAB_0076ae8d:
|
|
iVar4 = 3;
|
|
bVar2 = 1;
|
|
}
|
|
pEVar33->_canFly = bVar2;
|
|
pEVar33->_entityGridCollisionClass = iVar4;
|
|
if (((local_47b != 0) && (bVar2 == 0)) && (cVar3 = FUN_007d1810(), cVar3 != '\0')) {
|
|
pEVar33->_canFly = 1;
|
|
pEVar33->_entityGridCollisionClass = 3;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x21);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x21,1,1);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x80);
|
|
pEVar33->_entityGridCollisionClass = GHIDRA_UINT((pEVar33->_canFly == 0)) * 2 + 3;
|
|
if (pEVar33->_canFly != local_47b) {
|
|
UpdateCostumes(pEVar33);
|
|
}
|
|
}
|
|
if ((((pEVar33->_cacheFlags & 0x200U) != 0) && (pEVar33->_variant == 0)) &&
|
|
(cVar3 = FUN_00417390(), cVar3 != '\0')) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(8);
|
|
local_468 = GHIDRA_CAST<TemporaryEffects *>(&pEVar33->_collectibleRNGs);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(player,8,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(8);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,1,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x71);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x71,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x71);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,2,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x58);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x58,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x58);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,3,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(99);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,99,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(99);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,4,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(100);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,100,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(100);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,5,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x5f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x5f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x5f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,6,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x43);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x43,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x43);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,7,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xbc);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xbc,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xbc);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,8,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xa3);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xa3,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xa3);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,9,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xa7);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xa7,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xa7);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,10,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xae);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xae,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xae);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xb,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x83);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x83,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x83);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x14,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x5e);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x5e,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x5e);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x15,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x60);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x60,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x60);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x16,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x62);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x62,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x62);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x17,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x80);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x80,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x80);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x1e,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x39);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x39,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x39);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x1f,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x70);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x70,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x70);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x20,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x9b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x9b,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x9b);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x11,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xaa);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xaa,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xaa);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x10,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xb2);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xb2,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xb2);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x19,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xb);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xb,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xb);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x29,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xbb);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xbb,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xbb);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x2a,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xac);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xac,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xac);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x23,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x108);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x108,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x108);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x32,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x10b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x10b,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x10b);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x35,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xce);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0xce,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xce);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x44,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x109);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x109,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x109);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x33,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x10a);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x10a,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x10a);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x34,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x10c);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x10c,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x10c);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x36,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x141);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x141,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x141);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x4b,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x10f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x10f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x10f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x39,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x10e);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x10e,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x10e);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x38,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x13f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x13f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x13f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x4c,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x140);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x140,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x140);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x4d,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x117);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x117,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x117);
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetNullEffectNum(0x6b);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x41,iVar6 + iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x10d);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x10d,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x10d);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x37,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x110);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x110,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x110);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x3a,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x111);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x111,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x111);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x3b,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x118);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x118,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x118);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x42,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x119);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x119,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x119);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x43,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x142);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x142,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x142);
|
|
CheckFamiliar(player,0x4a,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x114);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_5a8._data = (void *)GetCollectibleNum(player,0x114,0);
|
|
local_5a8._capacity = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x3e,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x13e);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x13e,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x13e);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x4f,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x115);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x115,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x115);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x3f,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x113);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x113,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x113);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x3d,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x168);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x168,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x168);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x50,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x169);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x169,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x169);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x51,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x16a);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x16a,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x16a);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x52,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x16b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x16b,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x16b);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x53,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x16c);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x16c,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x16c);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x54,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x16d);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x16d,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x16d);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x55,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x174);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x174,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x174);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x56,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x180);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x180,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x180);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x57,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x181);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x181,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x181);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x58,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x186);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x186,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x186);
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetNullEffectNum(0x43);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x5c,iVar6 + iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x183);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x183,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x183);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x59,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1a1);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1a1,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1a1);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x60,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x185);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x185,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x185);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x5b,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x195);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x195,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x195);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x5d,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x193);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x193,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x193);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x5e,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x194);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x194,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x194);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x5f,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1b3);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1b3,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1b3);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x61,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1aa);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1aa,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1aa);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x62,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1ae);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1ae,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1ae);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,99,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1af);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1af,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1af);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x65,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d9);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d9,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d9);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x68,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d5);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d5,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d5);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x69,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d4);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d4,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d4);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x6a,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d6);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d6,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d6);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x6b,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d7);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d7,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d7);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x6c,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d8);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d8,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d8);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x6d,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1d3);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1d3,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1d3);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x6e,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1ec);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1ec,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1ec);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x6f,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1eb);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1eb,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1eb);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x70,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(500);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,500,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(500);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x72,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1fd);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1fd,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1fd);
|
|
CheckFamiliar(player,0x74,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1fc);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = GetCollectibleNum(player,0x1fc,0);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x75,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1ff);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1ff,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1ff);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x76,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x206);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x206,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x206);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x77,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x20e);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x20e,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x20e);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x7a,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x210);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x210,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x210);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x7b,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x21b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x21b,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x21b);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x7c,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x219);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x219,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x219);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x7d,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x21e);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x21e,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x21e);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x7e,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x220);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x220,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x220);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x7f,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x21f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x21f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x21f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x81,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x224);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x224,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x224);
|
|
CheckFamiliar(player,0x82,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1b1);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_5a8._size = GetCollectibleNum(player,0x1b1,0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_598)) + 0x0))) = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x83,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x28f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x28f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x28f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xe2,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x289);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x289,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x289);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xe1,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x23f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x23f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x23f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,200,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x25f);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x25f,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x25f);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xd0,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x260);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x260,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x260);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xd1,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x285);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x285,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x285);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xd8,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x275);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x275,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x275);
|
|
CheckFamiliar(player,0xda,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x239);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_598._data = (void *)GetCollectibleNum(player,0x239,0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_578)) + 0x0))) = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
CheckFamiliar(player,0xcb,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x237);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_598._capacity = GetCollectibleNum(player,0x237,0);
|
|
local_598._size = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
CheckFamiliar(player,0xdd,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x27b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
stitchesCount = GetCollectibleNum(player,0x27b,0);
|
|
local_57c = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xde,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x245);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x245,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x245);
|
|
CheckFamiliar(player,0xcc,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x264);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_578._data = (void *)GetCollectibleNum(player,0x264,0);
|
|
local_578._capacity = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xd3,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x267);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x267,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x267);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xd4,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2a7);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2a7,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x2a7);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xe6,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2a9);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2a9,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x2a9);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xe8,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2aa);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2aa,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x2aa);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xe9,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x28c);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x28c,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x28c);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xef,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2ba);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2ba,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x2ba);
|
|
CheckFamiliar(player,0xeb,(iVar4 + iVar5) * 2,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x28b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_578._size = GetCollectibleNum(player,0x28b,0);
|
|
local_568 = 1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xec,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetTrinket(0xba);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(&pEVar33->_trinketRNGs);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = GetTrinketMultiplier(player,0xba);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xe7,uVar25,pRVar22,pIVar20,0);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x235);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x235,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x235);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xf1,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2b9);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2b9,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x2b9);
|
|
CheckFamiliar(player,0xf2,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2bf);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetNullEffectNum(0x83);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xf4,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x20d);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(pEVar33,0x79,GHIDRA_INT(pEVar33->_numLeprosy),pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1b4);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = GetCollectibleNum(player,0x1b4,0);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,100,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(10);
|
|
local_488 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
haloFlyCount = *piVar13;
|
|
}
|
|
else {
|
|
haloFlyCount = 0;
|
|
}
|
|
iVar4 = GetCollectibleNum(pEVar33,10,0);
|
|
haloFlyCap = 10;
|
|
haloFlyCount = haloFlyCount + iVar4 * 2;
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetNullEffectNum(0x6b);
|
|
piVar13 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
CheckFamiliar(pEVar33,0x21,*piVar13 + iVar4 * -2,local_488,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x51);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = GetCollectibleNum(player,0x51,0);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x28,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x75);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(rng_vector_at());
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::HasCollectibleEffect(0x75);
|
|
if ((bVar2 == 0) &&
|
|
(((bVar2 = HasCollectible(pEVar33,0x75,0), bVar2 == 0 || (pEVar33->_playerType != 5)) ||
|
|
(bVar2 = HasCollectible(pEVar33,0x26b,0), bVar2 == 0)))) {
|
|
uVar25 = 0;
|
|
}
|
|
else {
|
|
uVar25 = 1;
|
|
}
|
|
CheckFamiliar(pEVar33,0xe,uVar25,GHIDRA_CAST<RNG *>(local_460),pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x112);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::HasCollectibleEffect(0x112);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x3c,GHIDRA_UINT((bVar2 != 0)),pRVar22,pIVar20,-1);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x49,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x49);
|
|
uVar25 = pEVar33->_potatoPeelerCounter + iVar5 + iVar4;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT((uVar25 + (GHIDRA_INT(uVar25) >> 0x1f & 3U))) >> 2));
|
|
uVar25 = uVar25 & 0x80000003;
|
|
if (GHIDRA_INT(uVar25) < 0) {
|
|
uVar25 = (uVar25 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
collectibleItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x49);
|
|
iVar4 = -1;
|
|
pIVar20 = collectibleItem;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(player,0x2c,GHIDRA_UINT((uVar25 == 1)),pRVar22,pIVar20,iVar4);
|
|
iVar4 = -1;
|
|
pIVar20 = collectibleItem;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(player,0x2d,GHIDRA_UINT((uVar25 == 2)),pRVar22,pIVar20,iVar4);
|
|
iVar4 = -1;
|
|
pIVar20 = collectibleItem;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x2e,GHIDRA_UINT((uVar25 == 3)),pRVar22,pIVar20,iVar4);
|
|
iVar4 = -1;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
pIVar20 = local_460;
|
|
CheckFamiliar(pEVar33,0x2f,GHIDRA_UINT(local_460),pRVar22,collectibleItem,iVar4);
|
|
if (0 < GHIDRA_INT(pIVar20)) {
|
|
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::TryUnlock(0x90);
|
|
}
|
|
iVar4 = GetCollectibleNum(pEVar33,0xcf,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xcf);
|
|
uVar25 = pEVar33->_potatoPeelerBandageCounter + iVar5 + iVar4;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT((uVar25 + (GHIDRA_INT(uVar25) >> 0x1f & 3U))) >> 2));
|
|
uVar25 = uVar25 & 0x80000003;
|
|
if (GHIDRA_INT(uVar25) < 0) {
|
|
uVar25 = (uVar25 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
collectibleItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xcf);
|
|
iVar4 = -1;
|
|
pIVar20 = collectibleItem;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(player,0x45,GHIDRA_UINT((uVar25 == 1)),pRVar22,pIVar20,iVar4);
|
|
iVar4 = -1;
|
|
pIVar20 = collectibleItem;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(player,0x46,GHIDRA_UINT((uVar25 == 2)),pRVar22,pIVar20,iVar4);
|
|
iVar4 = -1;
|
|
pIVar20 = collectibleItem;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x47,GHIDRA_UINT((uVar25 == 3)),pRVar22,pIVar20,iVar4);
|
|
iVar4 = -1;
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
pIVar20 = local_460;
|
|
CheckFamiliar(pEVar33,0x48,GHIDRA_UINT(local_460),pRVar22,collectibleItem,iVar4);
|
|
if (0 < GHIDRA_INT(pIVar20)) {
|
|
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::TryUnlock(0x13);
|
|
}
|
|
uVar24 = 0x23;
|
|
uVar25 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<RNG *>((&seededRng)))->RNG::game_constructor(uVar25,uVar24);
|
|
local_8 = (void *)0x1;
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x6b);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x6b);
|
|
CheckFamiliar(player,0x30,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x145);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x145);
|
|
CheckFamiliar(player,0x4e,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x1f8);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x1f8);
|
|
CheckFamiliar(player,0x73,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x204);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x204);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x78,uVar25,pRVar22,pIVar20,-1);
|
|
local_488 = GHIDRA_CAST<RNG *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetNumPlayers();
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
if (local_488 != GHIDRA_CAST<RNG *>(0x0)) {
|
|
puVar26 = auStack_1bb;
|
|
do {
|
|
local_46c = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(local_460));
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_46c))))->Entity::Variant();
|
|
if (iVar4 == 0) {
|
|
iVar4 = GetCollectibleNum(local_46c,0xee,0);
|
|
puVar26[-5] = (char)iVar4;
|
|
iVar4 = GetCollectibleNum(local_46c,0xef,0);
|
|
puVar26[-4] = (char)iVar4;
|
|
puVar26[-3] = 0;
|
|
iVar4 = GetCollectibleNum(local_46c,0x272,0);
|
|
puVar26[-2] = (char)iVar4;
|
|
iVar4 = GetCollectibleNum(local_46c,0x273,0);
|
|
puVar26[-1] = (char)iVar4;
|
|
*puVar26 = 0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined2 *>((puVar26 + -4)) = 0;
|
|
puVar26[-5] = 0;
|
|
*GHIDRA_CAST<undefined2 *>((puVar26 + -1)) = 0;
|
|
puVar26[-2] = 0;
|
|
}
|
|
puVar26 = puVar26 + 6;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&local_460->type) + 1));
|
|
} while (local_460 < local_488);
|
|
pcVar27 = local_1c0;
|
|
local_484 = local_488;
|
|
pRVar22 = local_488;
|
|
do {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(&local_1bc);
|
|
for (local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
((pEVar33 = player, *pcVar27 != '\0' || (pcVar27[3] != '\0')) && (local_460 < pRVar22));
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&local_460->type) + 1))) {
|
|
pEVar33 = local_46c + -1;
|
|
pcVar23 = GHIDRA_CAST<char *>(FUN_007dd3a0());
|
|
cVar3 = *pcVar23;
|
|
*pcVar27 = *pcVar27 - cVar3;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar33)) + 0x2efd))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar33)) + 0x2efd))) - cVar3;
|
|
pcVar27[2] = pcVar27[2] + cVar3;
|
|
pcVar23 = GHIDRA_CAST<char *>(FUN_007dd3a0());
|
|
cVar3 = *pcVar23;
|
|
pcVar27[3] = pcVar27[3] - cVar3;
|
|
*GHIDRA_CAST<char *>(local_46c) = *GHIDRA_CAST<char *>(local_46c) - cVar3;
|
|
pcVar27[5] = pcVar27[5] + cVar3;
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_46c)) + 0x6))));
|
|
pRVar22 = local_488;
|
|
}
|
|
pcVar27 = pcVar27 + 6;
|
|
local_484 = GHIDRA_CAST<RNG *>((GHIDRA_INT(&local_484[-1]._shift3) + 3));
|
|
} while (local_484 != GHIDRA_CAST<RNG *>(0x0));
|
|
local_484 = GHIDRA_CAST<RNG *>(abStack_1be);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
do {
|
|
pRVar22 = local_484;
|
|
local_480 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(local_460));
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_480))))->Entity::Variant();
|
|
if (iVar4 == 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xee);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(&local_480->_collectibleRNGs);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(local_480,0x1a,GHIDRA_UINT(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_484) + -2))),pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xef);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(local_480,0x1b,GHIDRA_UINT(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_484) + -1))),pRVar22,pIVar20,-1);
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
pRVar22 = local_484;
|
|
CheckFamiliar(local_480,0x1c,GHIDRA_UINT(*GHIDRA_CAST<byte *>(local_484)),rng,GHIDRA_CAST<ItemConfig_Item *>(0x0),-1);
|
|
if (*GHIDRA_CAST<byte *>(pRVar22) != 0) {
|
|
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::TryUnlock(0x3a);
|
|
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::TryUnlock(0x172);
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x272);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(local_480,0xd5,GHIDRA_UINT(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_484) + 1))),pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x273);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(local_480,0xd6,GHIDRA_UINT(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_484) + 2))),pRVar22,pIVar20,-1);
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
pRVar22 = local_484;
|
|
CheckFamiliar(local_480,0xdf,GHIDRA_UINT(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_484) + 3))),rng,
|
|
GHIDRA_CAST<ItemConfig_Item *>(0x0),-1);
|
|
}
|
|
local_484 = GHIDRA_CAST<RNG *>((GHIDRA_INT(pRVar22) + 6));
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&local_460->type) + 1));
|
|
} while (local_460 < local_488);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x184,0);
|
|
if (((bVar2 == 0) || (bVar2 = HasCollectible(pEVar33,0x116,0), bVar2 == 0)) ||
|
|
(bVar2 = HasCollectible(pEVar33,0x90,0), bVar2 == 0)) {
|
|
iVar4 = -1;
|
|
pIVar20 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(pEVar33,0x66,0,pRVar22,pIVar20,iVar4);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x184);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(player,0x184,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x184);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x5a,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x116);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x116,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x116);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0x40,iVar4 + iVar5,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x90);
|
|
local_488 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
iVar4 = GetCollectibleNum(pEVar33,0x90,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x90);
|
|
uVar25 = iVar4 + iVar5;
|
|
pRVar22 = local_488;
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x25);
|
|
if (bVar2 == 0) {
|
|
Game::SetStateFlag();
|
|
this_01 = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((this_01)))->ItemOverlay::Show(0x26,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
iVar4 = -1;
|
|
pIVar20 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(pEVar33,0x66,1,pRVar22,pIVar20,iVar4);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x184);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(pEVar33,0x5a,0,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x116);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(pEVar33,0x40,0,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x90);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = 0;
|
|
}
|
|
CheckFamiliar(pEVar33,0x18,uVar25,pRVar22,local_460,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_460 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x207);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x207,0);
|
|
lilDeliriumCount = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x207);
|
|
lilDeliriumCount = iVar4 + lilDeliriumCount;
|
|
local_520 = 0;
|
|
piVar13 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
local_488 = GHIDRA_CAST<RNG *>(0x0);
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>(*piVar13);
|
|
local_46c = pEVar21;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(familiarList),3,-1,-1,0,0);
|
|
local_8 = GHIDRA_CAST<undefined1 *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2));
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(familiarList))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
uVar25 = 0;
|
|
do {
|
|
std::vector<int>::operator_index();
|
|
piVar13 = GHIDRA_CAST<int *>(__RTDynamicCast());
|
|
cVar3 = FUN_005b18e0();
|
|
if ((cVar3 != '\0') && (cVar3 = FUN_0060d130(), cVar3 == '\0')) {
|
|
if (GHIDRA_INT(local_488) < GHIDRA_INT(local_46c)) {
|
|
local_488 = GHIDRA_CAST<RNG *>((GHIDRA_INT(&local_488->_seed) + 1));
|
|
FUN_005b1910();
|
|
}
|
|
else {
|
|
(**(code **)(*piVar13 + 0x28))();
|
|
}
|
|
}
|
|
uVar25 = uVar25 + 1;
|
|
uVar24 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(familiarList))))->EntityList::Size();
|
|
} while (uVar25 < uVar24);
|
|
pEVar21 = local_46c;
|
|
pEVar33 = player;
|
|
}
|
|
if (GHIDRA_INT(local_488) < GHIDRA_INT(pEVar21)) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(pEVar21) - GHIDRA_INT(local_488)));
|
|
local_488 = GHIDRA_CAST<RNG *>(&pEVar33->_pos);
|
|
do {
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<RNG *>((pRVar22)))->RNG::Next();
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = MusicManager::RandomVector(&randomDir);
|
|
spawnRadius = 20.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&randomOffset,&spawnRadius);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_488))))->Vector::__add(&unclampedSpawnPos,vecResult);
|
|
vecResult = (GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&clampedSpawnPos,vecResult,20.0);
|
|
pEVar33 = player;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0x33,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(player),0,uVar25);
|
|
piVar13 = GHIDRA_CAST<int *>(__RTDynamicCast());
|
|
FUN_00638e20();
|
|
FUN_005b1910();
|
|
(**(code **)(*piVar13 + 0xc))();
|
|
local_46c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_46c) + -1));
|
|
} while (local_46c != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<EntityList_Query *>((familiarList)))->EntityList_Query::~EntityList_Query();
|
|
FUN_007e8f70();
|
|
iVar4 = -1;
|
|
pIVar20 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
pRVar22 = &formFamiliarRng;
|
|
local_8 = GHIDRA_CAST<undefined1 *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3));
|
|
bVar2 = HasPlayerForm(pEVar33,0xc);
|
|
CheckFamiliar(pEVar33,0x71,GHIDRA_UINT((bVar2 != 0)),pRVar22,pIVar20,iVar4);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetTrinket(0x36);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
bVar2 = HasTrinket(player,0x36,0);
|
|
CheckFamiliar(player,0xc,GHIDRA_UINT((bVar2 != 0)),pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetTrinket(0x39);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
soulTrinketMultiplier = GetTrinketMultiplier(player,0x39);
|
|
local_52c = 3;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
CheckFamiliar(player,0xd,*clampedCount,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetTrinket(0x3c);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::HasTrinketEffect(0x3c);
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xf,GHIDRA_UINT((bVar2 != 0)),pRVar22,pIVar20,-1);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
CheckFamiliar(pEVar33,0x67,GHIDRA_INT(pEVar33->_tonsilCount),pRVar22,GHIDRA_CAST<ItemConfig_Item *>(0x0),-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x262);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::HasCollectibleEffect(0x262);
|
|
CheckFamiliar(player,0xd2,GHIDRA_UINT((bVar2 != 0)),pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x25d);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar25 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x25d);
|
|
CheckFamiliar(player,0xcf,uVar25,pRVar22,pIVar20,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pIVar20 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x290);
|
|
pRVar22 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
damoclesCount = GetCollectibleNum(player,0x290,0);
|
|
local_534 = (void *)0x1;
|
|
clampedCount = GHIDRA_CAST<uint *>(std)::min<int>();
|
|
pEVar33 = player;
|
|
CheckFamiliar(player,0xca,*clampedCount,pRVar22,pIVar20,-1);
|
|
if (DAT_00c7ac69 == '\0') {
|
|
DAT_00c7ac69 = 1;
|
|
bVar2 = HasTrinket(pEVar33,0xb4,0);
|
|
if (bVar2 == 0) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
foundSoulNeeded = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetTrinketEffectNum(0xb4);
|
|
local_53c = 0;
|
|
foundSoulNeeded = 1 - foundSoulNeeded;
|
|
piVar13 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(*piVar13);
|
|
}
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(GetCollectibleNum(pEVar33,0x29b,0));
|
|
_eh_vector_constructor_iterator_(coopBabyList,0xc,2,FUN_00424510,FID_conflict__Tidy);
|
|
local_8 = GHIDRA_CAST<undefined1 *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),4));
|
|
uVar25 = 0;
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
otherPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar25);
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(otherPlayer))))->Entity)::Parent();
|
|
if ((pEVar21 == pEVar33) && (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(otherPlayer))))->Entity::IsDead(), cVar3 == '\0')
|
|
) {
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(otherPlayer))))->Entity::Variant();
|
|
if ((iVar4 == 1) && (iVar4 = GetBabySkin(otherPlayer), iVar4 == 0x3b)) {
|
|
LAB_0076ef58:
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
else {
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(otherPlayer))))->Entity::Variant();
|
|
if (iVar4 == 0) {
|
|
temporaryEffects = GHIDRA_CAST<TemporaryEffects *>(GetEffects(otherPlayer));
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x29b);
|
|
if (bVar2 != 0) goto LAB_0076ef58;
|
|
}
|
|
}
|
|
}
|
|
uVar25 = uVar25 + 1;
|
|
uVar24 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
} while (uVar25 < uVar24);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coopBabyList)))->std::vector::size();
|
|
pEVar21 = local_46c;
|
|
if (GHIDRA_INT(local_46c) < iVar4) {
|
|
do {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(FUN_00708a50());
|
|
(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::RemoveCoPlayer(GHIDRA_CAST<Entity_Player *>(*puVar14),0);
|
|
FUN_007dc650();
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coopBabyList)))->std::vector::size();
|
|
} while (GHIDRA_INT(pEVar21) < iVar4);
|
|
pEVar33 = player;
|
|
}
|
|
pEVar21 = local_46c;
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coopBabyList)))->std::vector::size();
|
|
while (iVar4 < GHIDRA_INT(pEVar21)) {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
coopBaby = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::SpawnCoPlayerBaby(0x3b);
|
|
SetControllerIndex(coopBaby,pEVar33->_controllerIndex,0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(coopBaby))))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar33));
|
|
vecResult = (GHIDRA_CAST<Vector *>((&coopBabyOffset)))->Vector::Vector(0.0,4.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&pEVar33->_pos)))->Vector::__add(&coopBabySpawnPos,vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(coopBaby))))->Entity::SetPosition(vecResult);
|
|
apply_coop_baby_spawn_bonus(coopBaby);
|
|
coopBaby->_cacheFlags = 0xffff;
|
|
EvaluateItems(coopBaby);
|
|
std::vector<unsigned_int>::push_back();
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coopBabyList)))->std::vector::size();
|
|
}
|
|
cVar3 = FUN_0060d1e0();
|
|
if ((cVar3 == '\0') && (cVar3 = FUN_00738330(), cVar3 == '\0')) {
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coPlayerList)))->std::vector::size();
|
|
pIVar20 = local_470;
|
|
if (GHIDRA_INT(local_470) < iVar4) {
|
|
do {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(FUN_00708a50());
|
|
(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::RemoveCoPlayer(GHIDRA_CAST<Entity_Player *>(*puVar14),0);
|
|
FUN_007dc650();
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coPlayerList)))->std::vector::size();
|
|
} while (GHIDRA_INT(pIVar20) < iVar4);
|
|
pEVar33 = player;
|
|
}
|
|
pIVar20 = local_470;
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coPlayerList)))->std::vector::size();
|
|
while (iVar4 < GHIDRA_INT(pIVar20)) {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
coPlayer = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::SpawnCoPlayer2(0xe);
|
|
SetControllerIndex(coPlayer,pEVar33->_controllerIndex,0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(coPlayer))))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar33));
|
|
vecResult = (GHIDRA_CAST<Vector *>((&coPlayerOffset)))->Vector::Vector(0.0,4.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&pEVar33->_pos)))->Vector::__add(&coPlayerSpawnPos,vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(coPlayer))))->Entity::SetPosition(vecResult);
|
|
temporaryEffects = GHIDRA_CAST<TemporaryEffects *>(GetEffects(coPlayer));
|
|
(GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::AddCollectibleEffect(0x29b,1,1);
|
|
InitPostLevelInitStats(coPlayer);
|
|
std::vector<unsigned_int>::push_back();
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((coPlayerList)))->std::vector::size();
|
|
}
|
|
}
|
|
DAT_00c7ac69 = '\0';
|
|
local_8 = GHIDRA_CAST<undefined1 *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3));
|
|
_eh_vector_destructor_iterator_(coopBabyList,0xc,2,FID_conflict__Tidy);
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x200);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x1);
|
|
do {
|
|
pIVar20 = local_460;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
if (*piVar13 != 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_470 = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(pIVar20));
|
|
if ((local_470 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (local_470->type == 4)) {
|
|
iVar4 = GetCollectibleNum(pEVar33,local_470->id,0);
|
|
iVar5 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(local_470->id);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT((&(local_46c->_sprite)._filename + -3)) + iVar4 + iVar5))
|
|
;
|
|
pIVar20 = local_460;
|
|
}
|
|
}
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(pIVar20) + 1));
|
|
} while (GHIDRA_INT(local_460) < 0x2dd);
|
|
if (GHIDRA_CAST<Entity_Player *>(&DAT_00000004) < local_46c) {
|
|
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::TryUnlock(0x163);
|
|
}
|
|
guard_check_icall();
|
|
local_8 = (void *)0xffffffff;
|
|
guard_check_icall();
|
|
}
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
if ((uVar25 & 0x400) != 0) {
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>((float)(*piVar13 - iVar4));
|
|
pEVar33 = player;
|
|
}
|
|
else {
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
if ((pEVar33->_hasCurseMistEffect == 0) && (pEVar33->_isCoopGhost == 0)) {
|
|
iVar4 = pEVar33->_luckModifier;
|
|
}
|
|
else {
|
|
iVar4 = 0;
|
|
}
|
|
iVar5 = GetCollectibleNum(pEVar33,0xfd,0);
|
|
local_460 = (ItemConfig_Item *)
|
|
((float)iVar4 + luckBonus + (float)local_460 + (float)pEVar33->_donateLuck +
|
|
pEVar33->_edenLuck + (float)iVar5);
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2e,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x157,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x163,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x1b7,0);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,5,0);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)local_470 - (float)iVar4));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x29d,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_470));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetNullEffectNum(0x38);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x278,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)(iVar4 * 2) + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x2da,0);
|
|
pEVar33->_luck = (float)iVar4 + (float)local_460;
|
|
bVar2 = HasTrinket(pEVar33,0x2a,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x2a);
|
|
pEVar33->_luck = (float)iVar4 + pEVar33->_luck;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x91,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x91);
|
|
pEVar33->_luck = (float)iVar4 * 10.0 + pEVar33->_luck;
|
|
}
|
|
if ((pEVar33->_playerType == 2) && (bVar2 = HasCollectible(pEVar33,0x26b,0), bVar2 != 0)) {
|
|
pEVar33->_luck = pEVar33->_luck + 1.0;
|
|
}
|
|
iVar4 = pEVar33->_playerType;
|
|
if (iVar4 == 8) {
|
|
fVar30 = pEVar33->_luck - 1.0;
|
|
LAB_0076f615:
|
|
pEVar33->_luck = fVar30;
|
|
}
|
|
else {
|
|
if ((iVar4 == 0xe) || (iVar4 == 0x21)) {
|
|
LAB_0076f605:
|
|
fVar30 = pEVar33->_luck - 2.0;
|
|
goto LAB_0076f615;
|
|
}
|
|
if (iVar4 == 0x13) {
|
|
fVar30 = pEVar33->_luck + 1.0;
|
|
goto LAB_0076f615;
|
|
}
|
|
if (iVar4 == 0x14) {
|
|
fVar30 = pEVar33->_luck - 1.0;
|
|
goto LAB_0076f615;
|
|
}
|
|
if (iVar4 == 0x26) goto LAB_0076f605;
|
|
}
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(fortuneCookieWisps),3,0xce,0x22d,0,0);
|
|
local_8 = &DAT_00000005;
|
|
uVar25 = 0;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(fortuneCookieWisps))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(*puVar14))))->Entity_Familiar)::Player();
|
|
if (pEVar21 == pEVar33) {
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&local_470->type) + 1));
|
|
}
|
|
uVar25 = uVar25 + 1;
|
|
uVar24 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(fortuneCookieWisps))))->EntityList::Size();
|
|
} while (uVar25 < uVar24);
|
|
}
|
|
fVar30 = (float)((double)GHIDRA_INT(local_470) + __uint_to_double_fixup[-(GHIDRA_INT(local_470) >> 0x1f)]) *
|
|
0.2 + pEVar33->_luck;
|
|
auVar29 = ZEXT416(GHIDRA_UINT(fVar30));
|
|
pEVar33->_luck = fVar30;
|
|
FUN_007538c0();
|
|
fVar30 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0x0))) + pEVar33->_luck;
|
|
pEVar33->_luck = fVar30;
|
|
if (0 < pEVar33->_coopBabyBuffTimers[4]) {
|
|
pEVar33->_luck = fVar30 + 2.0;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,0x65,0);
|
|
if ((bVar2 != 0) && (isActiveEmpty != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,0x65);
|
|
pEVar33->_luck = (float)iVar4 + (float)iVar4 + pEVar33->_luck;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x1ec,0);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_luck = pEVar33->_luck + 1.0;
|
|
}
|
|
bVar2 = HasTrinket(pEVar33,100,0);
|
|
if ((bVar2 != 0) && (isActiveFullyCharged != false)) {
|
|
iVar4 = GetTrinketMultiplier(pEVar33,100);
|
|
pEVar33->_luck = (float)iVar4 + pEVar33->_luck;
|
|
}
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00421780());
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((entityList)))->EntityList::Size();
|
|
if (iVar4 == 0x17) {
|
|
pEVar33->_luck = pEVar33->_luck + 50.0;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetDebugFlag(8);
|
|
if (bVar2 != 0) {
|
|
pEVar33->_luck = pEVar33->_luck + 50.0;
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x400);
|
|
local_8 = (void *)0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((fortuneCookieWisps)))->EntityList_Query::~EntityList_Query();
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
}
|
|
if (((uVar25 & 0x800) != 0) && (pEVar33->_variant == 0)) {
|
|
if (isMistOrGhost == '\0') {
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar4 = *piVar13;
|
|
piVar13 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
fVar30 = (float)(*piVar13 - iVar4);
|
|
pEVar33 = player;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(fVar30);
|
|
}
|
|
else {
|
|
fVar30 = 0.0;
|
|
}
|
|
iVar4 = GetCollectibleNum(pEVar33,0x47,0);
|
|
local_460 = (ItemConfig_Item *)
|
|
(((GHIDRA_UINT((0 < pEVar33->_coopBabyBuffTimers[6])) -
|
|
GHIDRA_UINT((0 < pEVar33->_coopBabyBuffTimers[5]))) + GHIDRA_INT(fVar30)) - iVar4);
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x47);
|
|
iVar4 = GHIDRA_INT(local_460) - iVar4;
|
|
iVar5 = GetCollectibleNum(pEVar33,0x1b6,0);
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0xc);
|
|
iVar7 = GetCollectibleNum(pEVar33,0xc,0);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(((float)(iVar7 + (iVar4 - iVar5) + iVar6) * 0.322 + 0.0));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x12e,0);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)iVar4 * 0.263 + (float)local_460));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x154,0);
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(((float)local_470 - (float)iVar4 * 0.152));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetNullEffectNum(0x29);
|
|
local_484 = GHIDRA_CAST<RNG *>(((float)iVar4 * 0.678 + (float)local_470));
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x2b0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0x256,0);
|
|
local_484 = GHIDRA_CAST<RNG *>(((float)local_484 - (float)(iVar5 + iVar4)));
|
|
iVar4 = GetCollectibleNum(pEVar33,0x79,0);
|
|
iVar5 = GetCollectibleNum(pEVar33,0x78,0);
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x78);
|
|
iVar7 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::GetCollectibleEffectNum(0x79);
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)(iVar7 + ((iVar4 - iVar5) - iVar6)) * 0.152 + 0.0));
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x23);
|
|
if (bVar2 != 0) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)local_46c + 1.585));
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x24);
|
|
if (bVar2 != 0) {
|
|
local_46c = GHIDRA_CAST<Entity_Player *>(((float)local_46c - 1.0));
|
|
}
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00421780());
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((entityList)))->EntityList::Size();
|
|
pRVar22 = local_484;
|
|
if (iVar4 == 0x2d) {
|
|
pRVar22 = GHIDRA_CAST<RNG *>(((float)local_484 + 0.485));
|
|
}
|
|
fVar30 = 2.0;
|
|
if ((float)pRVar22 < 2.0) {
|
|
pow_wrapper();
|
|
}
|
|
else {
|
|
fVar30 = ((float)pRVar22 - 2.0) * 2.77259 + 4.0;
|
|
}
|
|
spriteScaleFactor = fVar30;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&spriteScaleVec,&spriteScaleFactor);
|
|
(GHIDRA_CAST<Vector *>((&pEVar33->_playerSpriteScale)))->Vector::operator_assign(vecResult);
|
|
headScaleFactor = 2.0;
|
|
if ((float)local_46c < 2.0) {
|
|
pow_wrapper();
|
|
}
|
|
else {
|
|
headScaleFactor = ((float)local_46c - 2.0) * 2.77259 + 4.0;
|
|
}
|
|
vecResult = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&headScaleVec,&headScaleFactor);
|
|
(GHIDRA_CAST<Vector *>((&pEVar33->_headScale)))->Vector::operator_assign(vecResult);
|
|
(GHIDRA_CAST<Vector *>((&pEVar33->_bodyScale)))->Vector::operator_assign(&g_vectorOne);
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x800);
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
if (3.0 <= *pfVar10) {
|
|
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::TryUnlock(0x169);
|
|
}
|
|
}
|
|
if ((pEVar33->_cacheFlags & 0x1000U) != 0) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar33->_sprite))))->Sprite::Color();
|
|
local_47b = FUN_00753560();
|
|
(GHIDRA_CAST<Color *>((&spriteColor)))->Color::Color();
|
|
if (((pEVar33->_playerType == 0x11) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((local_464)))->TemporaryEffects::HasNullEffect(0x65), bVar2 != 0)) ||
|
|
(pEVar33->_playerType == 0x28)) {
|
|
colorResult = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
LAB_0076fc8b:
|
|
(GHIDRA_CAST<Color *>((&spriteColor)))->Color::__mul(colorResult);
|
|
}
|
|
else {
|
|
bVar2 = HasCollectible(pEVar33,0xde,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Color *>((antiGravityColor)))->Color::Color(1.4,2.0,1.8,1.0);
|
|
colorResult = extraout_EAX;
|
|
goto LAB_0076fc8b;
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x22a,0);
|
|
if (bVar2 != 0) {
|
|
colorResult = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Color *>((&spriteColor)))->Color::__mul(colorResult);
|
|
}
|
|
(GHIDRA_CAST<Color *>((aCStackY_1d2c + 0x81)))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&spriteColor));
|
|
colorResult = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_color))))->Color::operator_assign(colorResult);
|
|
bVar2 = HasCollectible(pEVar33,0xd,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_color))))->Color::SetColorize(1.25,1.25,1.25,0.25);
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x15e,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_color))))->Color::SetColorize(0.0,1.0,0.0,0.5);
|
|
colorResult = (GHIDRA_CAST<Color *>((&toxicShockColor)))->Color::Color(1.0,1.0,1.0,0.0,0.2,0.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_color))))->Color::__mul(colorResult);
|
|
}
|
|
colorLerpAmount = 0.0;
|
|
pvVar11 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(299);
|
|
if ((pvVar11 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 8)) == 0)) {
|
|
taurusColorAmount = pEVar33->_taurusSpeedBonus * 0.5;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
colorLerpAmount = *pfVar10;
|
|
}
|
|
lustyBloodEffectNum =
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar33->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x19b);
|
|
if ((0 < pEVar33->_bloodLustCounter) || (0 < lustyBloodEffectNum)) {
|
|
bloodLustCount = GHIDRA_INT(pEVar33->_bloodLustCounter);
|
|
bloodLustCap = 6;
|
|
std::max<int>();
|
|
piVar13 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
bloodLustColorAmount = (float)*piVar13 * 0.125;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
colorLerpAmount = *pfVar10;
|
|
}
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(colorLerpAmount);
|
|
if (pEVar33->_playerType == 0x1b) {
|
|
berserkColorAmount = Math::clamp(0.0,1.0,(float)pEVar33->_samsonBerserkCharge / 100000.0);
|
|
puVar14 = GHIDRA_CAST<undefined4 *>(std)::max<float>();
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>(*puVar14);
|
|
}
|
|
colorLerpAmount = (float)local_470;
|
|
if (0.0 < (float)local_470) {
|
|
(GHIDRA_CAST<Color *>((&lerpTargetColor)))->Color::Color();
|
|
(GHIDRA_CAST<Color *>((aCStackY_1d2c + 0x81)))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&spriteColor));
|
|
colorResult = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
colorResult = Color::Lerp(&lerpedColor,&pEVar33->_color,colorResult,(float)local_470);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&pEVar33->_color))))->Color::operator_assign(colorResult);
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x1000);
|
|
if (local_47b != 0) {
|
|
pEVar33->ResetColor();
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x130,0);
|
|
if (((bVar2 != 0) || (iVar4 = GetZodiacEffect(pEVar33), iVar4 == 0x130)) &&
|
|
((pEVar33->_cacheFlags & 0x1b) != 0)) {
|
|
fVar30 = (pEVar33->_damage * 30.0) / (pEVar33->_maxfiredelay + 1.0);
|
|
FUN_00431260();
|
|
pow_wrapper();
|
|
local_470 = GHIDRA_CAST<ItemConfig_Item *>((fVar30 * 2.161616 - 2.0));
|
|
fVar30 = pEVar33->_movespeed;
|
|
FUN_009bfc00();
|
|
fVar32 = pEVar33->_tearrange;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(fVar30);
|
|
FUN_009bfd00();
|
|
pIVar20 = (ItemConfig_Item *)
|
|
((fVar32 + (float)local_460 + (float)local_470 + (float)local_470) * 0.25);
|
|
local_470 = pIVar20;
|
|
FUN_009bfc20();
|
|
pEVar33->_movespeed = (float)pIVar20;
|
|
pIVar20 = local_470;
|
|
FUN_009bfc80();
|
|
pEVar33->_maxfiredelay = (float)pIVar20;
|
|
pIVar20 = local_470;
|
|
FUN_009bfcd0();
|
|
pEVar33->_damage = (float)pIVar20;
|
|
auVar29 = ZEXT416(local_470);
|
|
FUN_009bfd20();
|
|
pEVar33->_tearrange = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar29)) + 0x0)));
|
|
pEVar33->_cacheFlags = pEVar33->_cacheFlags | 0x1b;
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x232,0);
|
|
pEVar21 = player;
|
|
if (((bVar2 != 0) && (isEffectsDisabled == 0)) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar33)) + 0x2ef4)))) == 0 && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar33)) + 0x2ef8)))) == 0)))) {
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
if ((uVar25 & 1) != 0) {
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar21->_rockBottomDamage = fVar30;
|
|
pEVar33->_damage = fVar30;
|
|
uVar25 = pEVar21->_cacheFlags;
|
|
pEVar33 = pEVar21;
|
|
}
|
|
if ((uVar25 & 2) != 0) {
|
|
fireRate = 30.0 / (pEVar33->_maxfiredelay + 1.0);
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fireRate = *pfVar10;
|
|
pEVar33->_rockBottomMaxFireDelay = fireRate;
|
|
pEVar33->_maxfiredelay = 30.0 / fireRate - 1.0;
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
}
|
|
pEVar21 = player;
|
|
if ((uVar25 & 8) != 0) {
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar21->_rockBottomTearRange = fVar30;
|
|
pEVar33->_tearrange = fVar30;
|
|
uVar25 = pEVar21->_cacheFlags;
|
|
pEVar33 = pEVar21;
|
|
}
|
|
pEVar21 = player;
|
|
if ((uVar25 & 0x10) != 0) {
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar21->_rockBottomMoveSpeed = fVar30;
|
|
pEVar33->_movespeed = fVar30;
|
|
uVar25 = pEVar21->_cacheFlags;
|
|
pEVar33 = pEVar21;
|
|
}
|
|
pEVar21 = player;
|
|
if ((uVar25 & 0x400) != 0) {
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar21->_rockBottomLuck = fVar30;
|
|
pEVar33->_luck = fVar30;
|
|
uVar25 = pEVar21->_cacheFlags;
|
|
pEVar33 = pEVar21;
|
|
}
|
|
pEVar21 = player;
|
|
if ((uVar25 & 4) != 0) {
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar21->_rockBottomShotSpeed = fVar30;
|
|
pEVar33->_shotspeed = fVar30;
|
|
pEVar33 = pEVar21;
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar33,0x279,0);
|
|
if ((bVar2 != 0) && ((pEVar33->_cacheFlags & 0x10) != 0)) {
|
|
dogmaMinSpeed = 0x3f8ccccd;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_movespeed = *pfVar10;
|
|
}
|
|
if ((pEVar33->_cacheFlags & 0x80000010U) != 0x10) goto LAB_00770492;
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>(GetOtherTwin(pEVar33));
|
|
if (pEVar21 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar21->_cacheFlags = pEVar21->_cacheFlags | 0x80000010;
|
|
EvaluateItems(pEVar21);
|
|
if ((pEVar33->_playerType == 0x13) || (pEVar33->_playerType == 0x14)) {
|
|
twinAverageSpeed = (pEVar33->_movespeed + pEVar21->_movespeed) * 0.5;
|
|
}
|
|
else {
|
|
parentPlayer = GetMainTwin(pEVar33);
|
|
if (parentPlayer != pEVar33) {
|
|
std::min<float>();
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar21->_movespeed = fVar30;
|
|
pEVar33->_movespeed = fVar30;
|
|
goto LAB_007703f8;
|
|
}
|
|
}
|
|
std::min<float>();
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar30 = *pfVar10;
|
|
pEVar33->_movespeed = fVar30;
|
|
pEVar21->_movespeed = fVar30;
|
|
}
|
|
LAB_007703f8:
|
|
if ((pEVar33->_parent == (EntityPtr)0x0) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar33->_parent))))->Entity::is_player(), bVar2 == 0)) {
|
|
fVar30 = 0.0;
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
pEVar21 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(fVar30));
|
|
parentPlayer = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar21))))->Entity)::Parent();
|
|
if ((parentPlayer == pEVar33) && (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar21))))->Entity::IsDead(), cVar3 == '\0'))
|
|
{
|
|
pEVar21->_cacheFlags = pEVar21->_cacheFlags | 0x10;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(&pEVar21->_temporaryeffects))))->Level::SetHeartPicked();
|
|
}
|
|
fVar30 = (float)(GHIDRA_INT(local_460) + 1);
|
|
local_460 = GHIDRA_CAST<ItemConfig_Item *>(fVar30);
|
|
fVar32 = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
} while (GHIDRA_UINT(fVar30) < GHIDRA_UINT(fVar32));
|
|
}
|
|
}
|
|
else {
|
|
pEVar33->_movespeed = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pEVar33->_parent) + 0x1568));
|
|
}
|
|
LAB_00770492:
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
if ((uVar25 & 0x2000) != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::InvalidatePickupVision();
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
}
|
|
if ((uVar25 & 0x10) != 0) {
|
|
std::min<float>();
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_movespeed = *pfVar10;
|
|
}
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_shotspeed = *pfVar10;
|
|
if (-5.0 < pEVar33->_tearheight) {
|
|
pEVar33->_tearheight = -5.0;
|
|
}
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_tearrange = *pfVar10;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_damage = *pfVar10;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pEVar33->_maxfiredelay = *pfVar10;
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
if ((uVar25 & 0xc) != 0) {
|
|
fVar30 = pEVar33->_tearheight;
|
|
FUN_0067da40();
|
|
pEVar33->_tearfallspeed = -fVar30;
|
|
uVar25 = pEVar33->_cacheFlags;
|
|
}
|
|
if (((uVar25 & 0x10) != 0) && (iVar4 = is_achievement_79_unlocked(pEVar33), 0 < iVar4)) {
|
|
iVar4 = is_achievement_79_unlocked(pEVar33);
|
|
pEVar33->_movespeed = (float)iVar4 * 0.2 + pEVar33->_movespeed;
|
|
}
|
|
pEVar33->_cacheFlags = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00770600
|
|
void Entity_Player::RespawnFamiliars()
|
|
{
|
|
this->_cacheFlags = this->_cacheFlags | 0x200;
|
|
EvaluateItems(this);
|
|
return;
|
|
}
|
|
|
|
// 00770610
|
|
void Entity_Player::GetNPCTarget()
|
|
{
|
|
int in_ECX;
|
|
|
|
if (((*GHIDRA_CAST<int *>((in_ECX + 0x1450)) == 0) && (*GHIDRA_CAST<int *>((in_ECX + 0x144c)) == 0)) &&
|
|
(*GHIDRA_CAST<Entity **>((in_ECX + 0x200c)) != GHIDRA_CAST<Entity *>(0x0))) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((in_ECX + 0x200c)))))->Entity::GetLastParent();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007706e0
|
|
byte Entity_Player::HasCollectible(int type, byte ignoreModifiers)
|
|
{
|
|
byte bVar1;
|
|
char cVar2;
|
|
ItemConfig_Item *collectible;
|
|
EntityPtr mainPlayer;
|
|
int iVar3;
|
|
PersistentGameData *userData;
|
|
int iVar4;
|
|
uint rollResult;
|
|
PersistentGameData *persistentData;
|
|
int extraout_ECX;
|
|
int extraout_ECX_00;
|
|
bool isMatch;
|
|
undefined8 userId;
|
|
int typeKey;
|
|
PersistentGameData *local_24;
|
|
ItemConfig_Item *savedCollectible;
|
|
NetplayManager *local_1c;
|
|
RNG local_18;
|
|
undefined4 local_8;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
typeKey = type;
|
|
collectible = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(type);
|
|
while( true ) {
|
|
if (collectible == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
return 0;
|
|
}
|
|
savedCollectible = collectible;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) != 1) ||
|
|
(((mainPlayer = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc)), mainPlayer == (EntityPtr)0x0 ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(mainPlayer) + 0x28)) != 1)) &&
|
|
(mainPlayer = (EntityPtr)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0), mainPlayer == (EntityPtr)0x0)))) break;
|
|
collectible = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(type);
|
|
this = GHIDRA_CAST<Entity_Player *>(mainPlayer);
|
|
}
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x20a9)) != '\0') && (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) &&
|
|
((collectible->tags & 0x8000) == 0)) {
|
|
return 0;
|
|
}
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ef4)) != 0) && (type == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ef4)))) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x2ef0)) != '\0')) {
|
|
return 1;
|
|
}
|
|
if (type < 0) {
|
|
bVar1 = collectible_set_has((void *)(GHIDRA_INT(this) + 0x1fc8),type);
|
|
return bVar1;
|
|
}
|
|
if (ignoreModifiers != 0) goto LAB_00770c3e;
|
|
if (((type == 0x147) || (type == 0x148)) && (bVar1 = HasTrinket(this,0x15,0), bVar1 != 0)) {
|
|
local_1c = GHIDRA_CAST<NetplayManager *>((g_game->_frameCount & 0x80000003));
|
|
if (GHIDRA_INT(local_1c) < 0) {
|
|
local_1c = GHIDRA_CAST<NetplayManager *>(((GHIDRA_UINT((GHIDRA_INT((local_1c + -1)) + 3)) | 0xfffffffc) + 1));
|
|
}
|
|
iVar3 = GetTrinketMultiplier(this,0x15);
|
|
if (iVar3 < 2) {
|
|
if (local_1c == GHIDRA_CAST<NetplayManager *>(0x0)) {
|
|
isMatch = type == 0x147;
|
|
goto LAB_00770856;
|
|
}
|
|
if (local_1c == GHIDRA_CAST<NetplayManager *>(0x1)) goto LAB_00770850;
|
|
}
|
|
else if ((local_1c == GHIDRA_CAST<NetplayManager *>(0x0)) || (local_1c == GHIDRA_CAST<NetplayManager *>(0x1))) {
|
|
if (type == 0x147) {
|
|
return 1;
|
|
}
|
|
LAB_00770850:
|
|
isMatch = type == 0x148;
|
|
LAB_00770856:
|
|
if (isMatch) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
if (type == 0x139) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 10) ||
|
|
((bVar1 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasNullEffect(0x70),
|
|
bVar1 != 0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x1f)))) {
|
|
local_1c = &g_manager->_netplayManager;
|
|
local_24 = &g_manager->_persistentGameData;
|
|
persistentData = local_24;
|
|
if (*local_1c != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
userId = FUN_00a23920();
|
|
local_18._shift3 = GHIDRA_INT(((ulonglong)userId >> 0x20));
|
|
local_18._shift2 = GHIDRA_INT(userId);
|
|
userData = GHIDRA_CAST<PersistentGameData *>(FUN_0090c300(&local_18._shift2));
|
|
persistentData = local_24;
|
|
if (userData != GHIDRA_CAST<PersistentGameData *>(0x0)) {
|
|
persistentData = userData;
|
|
}
|
|
}
|
|
if (persistentData->_achievements[0xfa] != 0) {
|
|
return 1;
|
|
}
|
|
if ((g_manager->_state == 2) && (g_game != GHIDRA_CAST<Game *>(0x0))) {
|
|
if ((g_game->_dailyChallenge)._id != 0) {
|
|
return 1;
|
|
}
|
|
bVar1 = g_game->_isDebug;
|
|
LAB_00770a3e:
|
|
if (bVar1 != 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (type == 9) {
|
|
bVar1 = HasTrinket(this,0x5d,0);
|
|
if (bVar1 != 0) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4));
|
|
local_18._seed = 0;
|
|
if (iVar3 != 0) {
|
|
local_18._seed = *GHIDRA_CAST<uint *>((iVar3 + 0x58));
|
|
}
|
|
local_18._shift1 = 1;
|
|
local_18._shift2 = 0xb;
|
|
local_18._shift3 = 6;
|
|
rollResult = (GHIDRA_CAST<RNG *>((&local_18)))->RNG::RandomInt(100);
|
|
if (rollResult < 0x21) {
|
|
return 1;
|
|
}
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
else if (type == 0x3b) {
|
|
cVar2 = FUN_007da770();
|
|
if (cVar2 != '\0') {
|
|
return 1;
|
|
}
|
|
}
|
|
else if (type == 0x131) {
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x2028)) & 0x10) != 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if (type == 0x101) {
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x2028)) & 8) != 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if (type == 0xe7) {
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x2028)) & 0x20) != 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if (type == 0xb6) {
|
|
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x2028)) & 0x40;
|
|
goto LAB_00770a3e;
|
|
}
|
|
iVar3 = get_seeded_variant(this);
|
|
if (type == 0x14a) {
|
|
if (iVar3 == 1) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if ((type == 0x99) && (iVar3 == 2)) {
|
|
return 1;
|
|
}
|
|
iVar4 = is_achievement_79_unlocked(this);
|
|
iVar3 = extraout_ECX;
|
|
if (8 < iVar4) {
|
|
rollResult = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::GetStartSeed();
|
|
iVar3 = is_achievement_79_unlocked(this);
|
|
local_18._shift1 = 1;
|
|
local_18._shift2 = 0x1b;
|
|
local_18._seed = 1;
|
|
if (1 < iVar3 + rollResult) {
|
|
local_18._seed = iVar3 + rollResult;
|
|
}
|
|
local_18._shift3 = 0x1b;
|
|
rollResult = (GHIDRA_CAST<RNG *>((&local_18)))->RNG::RandomInt(6);
|
|
if (type == *GHIDRA_CAST<int *>((&DAT_00b6bcd0 + rollResult * 4))) {
|
|
return 1;
|
|
}
|
|
iVar3 = extraout_ECX_00;
|
|
collectible = savedCollectible;
|
|
}
|
|
bVar1 = IsInnateCollectible(this,type,iVar3);
|
|
if (((bVar1 == 0) &&
|
|
((type != 0x76 ||
|
|
(bVar1 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),0x76), bVar1 == 0)))) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x170)) == '\0' ||
|
|
((((collectible == GHIDRA_CAST<ItemConfig_Item *>(0x0) ||
|
|
(bVar1 = (GHIDRA_CAST<Item *>((collectible)))->Item::HasTags(0x40000000), bVar1 == 0)) ||
|
|
(*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x1e6c)) == GHIDRA_CAST<Entity_Player *>(0x0))) ||
|
|
(bVar1 = HasCollectible(*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x1e6c)),type,0), bVar1 == 0)))))) {
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x202c)) != '\0') && (collectible != GHIDRA_CAST<ItemConfig_Item *>(0x0))) &&
|
|
((bVar1 = (GHIDRA_CAST<Item *>((collectible)))->Item::HasTags(0x8000), bVar1 == 0 && (type != 0x216)))) {
|
|
return 0;
|
|
}
|
|
if ((((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1f84)) == 0) ||
|
|
(std::set<int>::find(&local_24,&typeKey),
|
|
local_24 == *GHIDRA_CAST<PersistentGameData **>((GHIDRA_CAST<char *>(this) + 0x1f80)))) ||
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_24)) + 0x14)))) < 1)) &&
|
|
(((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1fb8)) == 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1fb8)) != type)) &&
|
|
(iVar3 = FUN_009e0650(type), iVar3 < 1)) &&
|
|
(((savedCollectible == GHIDRA_CAST<ItemConfig_Item *>(0x0) ||
|
|
(bVar1 = (GHIDRA_CAST<ItemConfig_Item *>((savedCollectible)))->ItemConfig_Item::is_mom_item(), bVar1 == 0)) ||
|
|
(bVar1 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),type), bVar1 == 0)))) &&
|
|
(iVar3 = GetActiveItemSlot(this,type), iVar3 < 0)))) &&
|
|
(((type == 0xbf || (bVar1 = HasCollectible(this,0xbf,0), bVar1 == 0)) ||
|
|
(type != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1390)))))) &&
|
|
((bVar1 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),0x1e8), bVar1 == 0 ||
|
|
(type != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 5000)))))) {
|
|
LAB_00770c3e:
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ef4)) == 0) ||
|
|
((type != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ef4)) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x2ef0)) != '\0')))) {
|
|
return 0 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16c8)) + type * 4));
|
|
}
|
|
return 1 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16c8)) + type * 4));
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00770ca0
|
|
int Entity_Player::GetCollectibleNum(int collectibleID, byte OnlyCountTrueItems)
|
|
{
|
|
byte isMomItem;
|
|
Entity_Player *mainPlayer;
|
|
ItemConfig_Item *collectible;
|
|
void *pvVar1;
|
|
uint uVar2;
|
|
ItemConfig_Item *extraout_ECX;
|
|
ItemConfig_Item *extraout_ECX_00;
|
|
ItemConfig_Item *unused;
|
|
int id;
|
|
int iVar3;
|
|
int count;
|
|
bool isNotGranted;
|
|
void *wispIter [2];
|
|
|
|
id = collectibleID;
|
|
if (-1 < collectibleID) {
|
|
while (id < GHIDRA_INT((this->_collectibleCounts)._end) - GHIDRA_INT((this->_collectibleCounts)._begin) >> 2)
|
|
{
|
|
if ((this->_variant != 1) ||
|
|
(mainPlayer = GetMainPlayer(this), mainPlayer == GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_INT((this->_collectibleCounts)._begin) + id * 4));
|
|
collectible = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(id);
|
|
if ((collectible != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (collectible->type == 3)) {
|
|
iVar3 = 0;
|
|
}
|
|
count = iVar3;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef4)))) != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef4)))) == id)) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
count = 0;
|
|
if (0 < iVar3 + -1) {
|
|
count = iVar3 + -1;
|
|
}
|
|
}
|
|
else {
|
|
count = iVar3 + 1;
|
|
}
|
|
}
|
|
if ((this->_isCoopGhost != 0) && ((collectible->tags & 0x8000) == 0)) {
|
|
return 0;
|
|
}
|
|
iVar3 = this->_activeDesc[0]._item;
|
|
if ((iVar3 != 0) && (iVar3 == id)) {
|
|
count = count + 1;
|
|
}
|
|
iVar3 = this->_activeDesc[1]._item;
|
|
if ((iVar3 != 0) && (iVar3 == id)) {
|
|
count = count + 1;
|
|
}
|
|
iVar3 = this->_activeDesc[2]._item;
|
|
if ((iVar3 != 0) && (iVar3 == id)) {
|
|
count = count + 1;
|
|
}
|
|
iVar3 = this->_activeDesc[3]._item;
|
|
if ((iVar3 != 0) && (iVar3 == id)) {
|
|
count = count + 1;
|
|
}
|
|
if (OnlyCountTrueItems != 0) {
|
|
return count;
|
|
}
|
|
if (((this->_hasCurseMistEffect != 0) && ((collectible->tags & 0x8000) == 0)) &&
|
|
(id != 0x216)) {
|
|
count = 0;
|
|
}
|
|
unused = collectible;
|
|
if (((id != 0x188) && (id != 0x19d)) && (id != 0x19c)) {
|
|
isMomItem = HasCollectible(this,0x188,0);
|
|
if ((isMomItem != 0) && (iVar3 = GetZodiacEffect(this), id == iVar3)) {
|
|
count = count + 1;
|
|
}
|
|
isMomItem = HasCollectible(this,0x19d,0);
|
|
unused = extraout_ECX;
|
|
if ((isMomItem != 0) ||
|
|
(isMomItem = HasCollectible(this,0x19c,0), unused = extraout_ECX_00, isMomItem != 0)) {
|
|
if (id < 0x117) {
|
|
if (id == 0x116) {
|
|
uVar2 = 2;
|
|
}
|
|
else {
|
|
switch(id) {
|
|
case 0x62:
|
|
uVar2 = 0x100;
|
|
break;
|
|
default:
|
|
goto switchD_00770e4b_caseD_63;
|
|
case 0x70:
|
|
uVar2 = 0x40;
|
|
break;
|
|
case 0x71:
|
|
uVar2 = 4;
|
|
break;
|
|
case 0xb2:
|
|
uVar2 = 0x80;
|
|
break;
|
|
case 0x10e:
|
|
uVar2 = 1;
|
|
break;
|
|
case 0x113:
|
|
uVar2 = 0x10;
|
|
}
|
|
}
|
|
}
|
|
else if (id < 0x1a2) {
|
|
if (id == 0x1a1) {
|
|
uVar2 = 0x20;
|
|
}
|
|
else if (id == 0x168) {
|
|
uVar2 = 8;
|
|
}
|
|
else if (id == 0x16b) {
|
|
uVar2 = 0x200;
|
|
}
|
|
else {
|
|
if (id != 0x186) goto switchD_00770e4b_caseD_63;
|
|
uVar2 = 0x400;
|
|
}
|
|
}
|
|
else if (id == 0x2a7) {
|
|
uVar2 = 0x800;
|
|
}
|
|
else {
|
|
if (id != 0x2ba) goto switchD_00770e4b_caseD_63;
|
|
uVar2 = 0x1000;
|
|
}
|
|
if ((this->_conceptionFamiliarFlags & uVar2) != 0) {
|
|
count = count + 1;
|
|
}
|
|
}
|
|
}
|
|
switchD_00770e4b_caseD_63:
|
|
isMomItem = IsInnateCollectible(this,id,GHIDRA_INT(unused));
|
|
if (isMomItem != 0) {
|
|
count = count + 1;
|
|
}
|
|
if (id == 0x3b) {
|
|
if ((this->_playerType != 3) && (this->_playerType != 0xc)) goto LAB_00770f59;
|
|
isMomItem = HasCollectible(this,0x26b,0);
|
|
isNotGranted = isMomItem == 0;
|
|
}
|
|
else if (id == 0x131) {
|
|
isNotGranted = (this->_grantedCollectibleFlags & 0x10) == 0;
|
|
}
|
|
else if (id == 0x101) {
|
|
isNotGranted = (this->_grantedCollectibleFlags & 8) == 0;
|
|
}
|
|
else if (id == 0xe7) {
|
|
isNotGranted = (this->_grantedCollectibleFlags & 0x20) == 0;
|
|
}
|
|
else {
|
|
if (id != 0x6c) goto LAB_00770f59;
|
|
isNotGranted = (this->_grantedCollectibleFlags & 0x40) == 0;
|
|
}
|
|
if (!isNotGranted) {
|
|
count = count + 1;
|
|
}
|
|
LAB_00770f59:
|
|
iVar3 = get_seeded_variant(this);
|
|
if (id == 0x14a) {
|
|
if (iVar3 == 1) {
|
|
count = count + 1;
|
|
}
|
|
}
|
|
else if (id == 0x99) {
|
|
if (iVar3 == 2) {
|
|
count = count + 3;
|
|
}
|
|
}
|
|
else if (id == 0x76) {
|
|
if (((this->_temporaryeffects)._disabled == 0) &&
|
|
(pvVar1 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x76),
|
|
pvVar1 != (void *)0x0)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4));
|
|
}
|
|
else {
|
|
iVar3 = 0;
|
|
}
|
|
count = count + iVar3;
|
|
}
|
|
if ((((this->_valid != 0) && (collectible != GHIDRA_CAST<ItemConfig_Item *>(0x0))) &&
|
|
((collectible->tags & 0x40000000) != 0)) &&
|
|
(this->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
iVar3 = GetCollectibleNum(this->_backupPlayer,id,0);
|
|
count = count + iVar3;
|
|
}
|
|
if (this->_hasCurseMistEffect == 0) {
|
|
if (((this->_itemWispsList)._size != 0) &&
|
|
(std::set<int>::find(wispIter,&collectibleID), id = collectibleID,
|
|
wispIter[0] != (this->_itemWispsList)._head)) {
|
|
count = count + *GHIDRA_CAST<int *>((GHIDRA_INT(wispIter[0]) + 0x14));
|
|
}
|
|
if ((this->_modelingClayEffect != 0) && (this->_modelingClayEffect == id)) {
|
|
count = count + 1;
|
|
}
|
|
pvVar1 = (this->_extraCollectibleCounts)._begin;
|
|
if (id < GHIDRA_INT((this->_extraCollectibleCounts)._end) - GHIDRA_INT(pvVar1)) {
|
|
uVar2 = GHIDRA_UINT(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pvVar1) + id)));
|
|
}
|
|
else {
|
|
uVar2 = 0;
|
|
}
|
|
count = count + uVar2;
|
|
if ((collectible != GHIDRA_CAST<ItemConfig_Item *>(0x0)) &&
|
|
(isMomItem = (GHIDRA_CAST<ItemConfig_Item *>((collectible)))->ItemConfig_Item::is_mom_item(), isMomItem != 0)) {
|
|
iVar3 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(id);
|
|
count = count + iVar3;
|
|
}
|
|
if ((((id != 0xbf) && (isMomItem = HasCollectible(this,0xbf,0), isMomItem != 0)) &&
|
|
(this->_threeDollarBillItem != 0)) && (id == this->_threeDollarBillItem)) {
|
|
count = count + 1;
|
|
}
|
|
isMomItem = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1e8);
|
|
if (((isMomItem != 0) && (this->_metronomeCollectibleID != 0)) &&
|
|
(id == this->_metronomeCollectibleID)) {
|
|
count = count + 1;
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
this = mainPlayer;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007711a0
|
|
byte Entity_Player::VoidHasCollectible(int id)
|
|
{
|
|
uint i;
|
|
int *voidedIt;
|
|
ActiveItemDesc *activeSlot;
|
|
uint voidedCount;
|
|
|
|
i = 0;
|
|
activeSlot = this->_activeDesc;
|
|
while (activeSlot->_item != 0x1dd) {
|
|
i = i + 1;
|
|
activeSlot = activeSlot + 1;
|
|
if (3 < i) {
|
|
return 0;
|
|
}
|
|
}
|
|
if (GHIDRA_INT(i) < 0) {
|
|
return 0;
|
|
}
|
|
i = 0;
|
|
voidedIt = (this->_voidedCollectibles)._begin;
|
|
voidedCount = GHIDRA_INT((this->_voidedCollectibles)._end) - GHIDRA_INT(voidedIt) >> 2;
|
|
if (voidedCount == 0) {
|
|
return 0;
|
|
}
|
|
do {
|
|
if (*voidedIt == id) {
|
|
return 1;
|
|
}
|
|
i = i + 1;
|
|
voidedIt = voidedIt + 1;
|
|
} while (i < voidedCount);
|
|
return 0;
|
|
}
|
|
|
|
// 00771200
|
|
byte Entity_Player::IsInnateCollectible(int collectibleId, int unused)
|
|
{
|
|
int iVar1;
|
|
PersistentGameData *peerData;
|
|
uint userIdLo;
|
|
uint userIdHi;
|
|
Manager *manager;
|
|
PersistentGameData *persistentData;
|
|
bool isInnate;
|
|
uint userIdKey;
|
|
uint uStack_1c;
|
|
undefined1 findResult [8];
|
|
int foundNode;
|
|
|
|
manager = g_manager;
|
|
persistentData = &g_manager->_persistentGameData;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e50))));
|
|
if (iVar1 == 0) {
|
|
uStack_1c = 0;
|
|
userIdKey = 0;
|
|
userIdLo = userIdKey;
|
|
userIdHi = uStack_1c;
|
|
}
|
|
else {
|
|
userIdLo = *GHIDRA_CAST<uint *>((iVar1 + 8));
|
|
userIdHi = *GHIDRA_CAST<uint *>((iVar1 + 0xc));
|
|
}
|
|
_userIdKey = CONCAT44(userIdHi,userIdLo);
|
|
FUN_00731ee0(findResult,&userIdKey);
|
|
if ((((*GHIDRA_CAST<char *>((foundNode + 0xd)) == '\0') && (*GHIDRA_CAST<uint *>((foundNode + 0x14)) <= userIdHi)) &&
|
|
((*GHIDRA_CAST<uint *>((foundNode + 0x14)) < userIdHi || (*GHIDRA_CAST<uint *>((foundNode + 0x10)) <= userIdLo)))) &&
|
|
((foundNode != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xc0)))) &&
|
|
(peerData = GHIDRA_CAST<PersistentGameData *>(FUN_00914150(&userIdKey)), manager = g_manager,
|
|
peerData != GHIDRA_CAST<PersistentGameData *>(0x0))))) {
|
|
persistentData = peerData;
|
|
}
|
|
}
|
|
iVar1 = this->_playerType;
|
|
if (iVar1 == 0xd) {
|
|
if (collectibleId == 0x168) {
|
|
return 1;
|
|
}
|
|
if (collectibleId == 0x19c) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if (iVar1 == 10) {
|
|
if (collectibleId == 0x139) {
|
|
if (persistentData->_achievements[0xfa] == 0) {
|
|
if (manager->_state != 2) {
|
|
return 0;
|
|
}
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar1 == 2) {
|
|
isInnate = collectibleId == 0x2e;
|
|
}
|
|
else if (iVar1 == 5) {
|
|
if (collectibleId == 0x7a) {
|
|
return 1;
|
|
}
|
|
isInnate = collectibleId == 0x75;
|
|
}
|
|
else if (iVar1 == 6) {
|
|
isInnate = collectibleId == 0x9d;
|
|
}
|
|
else if ((iVar1 == 8) || (iVar1 == 0xb)) {
|
|
if (collectibleId != 0xd6) {
|
|
return 0;
|
|
}
|
|
if (persistentData->_achievements[0x14b] == 0) {
|
|
if (manager->_state != 2) {
|
|
return 0;
|
|
}
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (((g_game->_dailyChallenge)._id == 0) && (g_game->_isDebug == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
if (iVar1 == 0xb) {
|
|
return 1;
|
|
}
|
|
isInnate = g_game->_challenge == 0;
|
|
}
|
|
else {
|
|
if (iVar1 != 0x12) {
|
|
return 0;
|
|
}
|
|
if (g_game->_challenge == 0x25) {
|
|
return 0;
|
|
}
|
|
if (g_game->_challenge == 0x26) {
|
|
return 0;
|
|
}
|
|
isInnate = collectibleId == 0x248;
|
|
}
|
|
if (isInnate) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00771410
|
|
void Entity_Player::apply_innate_collectibles()
|
|
{
|
|
Game *pGVar1;
|
|
byte bVar2;
|
|
ItemConfig_Item *collectibleConfig;
|
|
int unused;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *extraout_ECX_00;
|
|
Entity_Player *extraout_ECX_01;
|
|
Entity_Player *extraout_ECX_02;
|
|
Entity_Player *extraout_ECX_03;
|
|
Entity_Player *unused_00;
|
|
uint collectibleId;
|
|
void *collectiblesBegin;
|
|
uint *removedWord;
|
|
|
|
collectibleId = 0;
|
|
unused_00 = this;
|
|
do {
|
|
bVar2 = IsInnateCollectible(this,collectibleId,GHIDRA_INT(unused_00));
|
|
pGVar1 = g_game;
|
|
if (bVar2 == 0) {
|
|
IsInnateCollectible(this,collectibleId,unused);
|
|
bVar2 = HasCollectible(this,collectibleId,0);
|
|
unused_00 = extraout_ECX_00;
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(collectibleId);
|
|
unused_00 = extraout_ECX_01;
|
|
if (bVar2 == 0) {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectibleId);
|
|
unused_00 = extraout_ECX_02;
|
|
if (collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
RemoveCostume(this,collectibleConfig);
|
|
unused_00 = extraout_ECX_03;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (g_game->_challenge != 0x2b) {
|
|
if (collectibleId == 0x1e4) {
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,0x126,0,0);
|
|
}
|
|
if (collectibleId < (pGVar1->_itemPool)._removedCollectibles._size) {
|
|
removedWord = GHIDRA_CAST<uint *>((GHIDRA_INT((pGVar1->_itemPool)._removedCollectibles._begin) +
|
|
(collectibleId >> 5) * 4));
|
|
*removedWord = *removedWord | 1 << (collectibleId & 0x1f);
|
|
}
|
|
}
|
|
unused_00 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((GHIDRA_INT(collectibleId) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(unused_00) >> 2) &&
|
|
(collectibleConfig =
|
|
*(ItemConfig_Item **)
|
|
(GHIDRA_INT((&(unused_00->_sprite)._filename + -3)) + collectibleId * 4),
|
|
collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
AddCostume(this,collectibleConfig,0);
|
|
unused_00 = extraout_ECX;
|
|
}
|
|
}
|
|
collectibleId = collectibleId + 1;
|
|
} while (GHIDRA_INT(collectibleId) < 0x2dd);
|
|
if (this->_playerType == 5) {
|
|
collectiblesBegin = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectiblesBegin) &
|
|
0xfffffffcU)) < 0x1e9) {
|
|
RemoveCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
return;
|
|
}
|
|
RemoveCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(collectiblesBegin) + 0x1e8)));
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00771550
|
|
byte Entity_Player::HasTrinket(uint type, byte ignoreModifiers)
|
|
{
|
|
byte isHasExtraTrinketSlot;
|
|
int trinketMultiplier;
|
|
uint slot;
|
|
int *trinketId;
|
|
uint trinketSlotCount;
|
|
|
|
trinketSlotCount = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8))));
|
|
if (((trinketSlotCount != 0) && (trinketSlotCount == type)) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) != '\0')) {
|
|
return 1;
|
|
}
|
|
if (ignoreModifiers != 0) {
|
|
trinketSlotCount = 1;
|
|
isHasExtraTrinketSlot = HasCollectible(this,0x8b,0);
|
|
if ((isHasExtraTrinketSlot != 0) ||
|
|
(isHasExtraTrinketSlot = HasCollectible(this,0x1ca,0), isHasExtraTrinketSlot != 0)) {
|
|
trinketSlotCount = 2;
|
|
}
|
|
slot = 0;
|
|
trinketId = this->_trinketsID;
|
|
do {
|
|
if ((*trinketId & 0x7fffU) == type) {
|
|
return 1;
|
|
}
|
|
slot = slot + 1;
|
|
trinketId = trinketId + 1;
|
|
} while (slot < trinketSlotCount);
|
|
return 0;
|
|
}
|
|
if (((trinketSlotCount == 0) || (trinketSlotCount != type)) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) != '\0')) {
|
|
trinketMultiplier = GetTrinketMultiplier(this,type);
|
|
return 0 < trinketMultiplier;
|
|
}
|
|
trinketMultiplier = GetTrinketMultiplier(this,type);
|
|
return 1 < trinketMultiplier;
|
|
}
|
|
|
|
// 00771620
|
|
byte Entity_Player::HasGoldenTrinket(uint TrinketID)
|
|
{
|
|
byte isExtraSlotItem;
|
|
uint slot;
|
|
int *trinket;
|
|
uint trinketSlotCount;
|
|
|
|
trinketSlotCount = 1;
|
|
isExtraSlotItem = HasCollectible(this,0x8b,0);
|
|
if ((isExtraSlotItem != 0) ||
|
|
(isExtraSlotItem = HasCollectible(this,0x1ca,0), isExtraSlotItem != 0)) {
|
|
trinketSlotCount = 2;
|
|
}
|
|
trinket = this->_trinketsID;
|
|
slot = 0;
|
|
do {
|
|
if (((*trinket & 0x7fffU) == TrinketID) && ((*trinket & 0x8000U) != 0)) {
|
|
return 1;
|
|
}
|
|
slot = slot + 1;
|
|
trinket = trinket + 1;
|
|
} while (slot < trinketSlotCount);
|
|
if ((*GHIDRA_CAST<short *>((GHIDRA_INT((this->_smeltedTrinkets)._begin) + TrinketID * 4 + 2)) < 1) &&
|
|
(((*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) & 0x7fff) != TrinketID ||
|
|
((*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) & 0x8000) == 0)))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007716f0
|
|
byte Entity_Player::TryHoldTrinket(int trinketId)
|
|
{
|
|
byte isHasExtraTrinketSlot;
|
|
char cVar1;
|
|
uint extraout_ECX;
|
|
int *trinketIt;
|
|
uint uVar2;
|
|
uint slot;
|
|
bool bVar3;
|
|
bool isUnpickableTick;
|
|
|
|
slot = 0;
|
|
trinketIt = this->_trinketsID;
|
|
do {
|
|
uVar2 = 1;
|
|
isHasExtraTrinketSlot = HasCollectible(this,0x8b,0);
|
|
if ((isHasExtraTrinketSlot != 0) ||
|
|
(isHasExtraTrinketSlot = HasCollectible(this,0x1ca,0), isHasExtraTrinketSlot != 0)) {
|
|
uVar2 = 2;
|
|
}
|
|
if (uVar2 <= slot) {
|
|
return 0;
|
|
}
|
|
uVar2 = *trinketIt;
|
|
if (((uVar2 & 0x7fff) == 0x35) &&
|
|
(isHasExtraTrinketSlot = is_trinket_unpickable_id(trinketId), uVar2 = extraout_ECX,
|
|
isHasExtraTrinketSlot != 0)) {
|
|
isUnpickableTick = true;
|
|
}
|
|
else {
|
|
isUnpickableTick = false;
|
|
}
|
|
if (uVar2 == 0) {
|
|
return 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
if (uVar2 != 0x35) {
|
|
if (uVar2 != 0x40) {
|
|
return 1;
|
|
}
|
|
bVar3 = g_game->_challenge == 0x1c;
|
|
goto LAB_00771793;
|
|
}
|
|
}
|
|
else {
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((g_game->_deathmatchManager)._type) + 0x50))(this);
|
|
bVar3 = cVar1 == '\0';
|
|
LAB_00771793:
|
|
if (!bVar3) {
|
|
return 1;
|
|
}
|
|
}
|
|
if (isUnpickableTick) {
|
|
return 1;
|
|
}
|
|
slot = slot + 1;
|
|
trinketIt = trinketIt + 1;
|
|
} while( true );
|
|
}
|
|
|
|
// 007717c0
|
|
int Entity_Player::GetMaxTrinkets()
|
|
{
|
|
byte isHasCollectible;
|
|
|
|
isHasCollectible = HasCollectible(this,0x8b,0);
|
|
if ((isHasCollectible == 0) &&
|
|
(isHasCollectible = HasCollectible(this,0x1ca,0), isHasCollectible == 0)) {
|
|
return 1;
|
|
}
|
|
return 2;
|
|
}
|
|
|
|
// 00771800
|
|
Entity_Pickup * Entity_Player::DropTrinket(Vector *DropPos, byte ReplaceTick)
|
|
{
|
|
void *pvVar1;
|
|
Manager *pMVar2;
|
|
char cVar3;
|
|
NetplayManager userIter;
|
|
int gridY;
|
|
Entity *spawnedEffect;
|
|
int *effect;
|
|
Game *game;
|
|
uint userCount;
|
|
int iVar4;
|
|
uint uVar5;
|
|
Entity_Player *player;
|
|
int gridWidth;
|
|
Entity_Pickup *droppedPickup;
|
|
uint uVar6;
|
|
int *piVar7;
|
|
Entity_Pickup *pEStack_2c;
|
|
Entity_Player *savedThis;
|
|
float fStack_24;
|
|
Manager *pMStack_20;
|
|
float sfxVolume;
|
|
int *local_18;
|
|
Vector VStack_10;
|
|
float droppedTrinketType;
|
|
|
|
savedThis = this;
|
|
FlushQueueItem(this);
|
|
uVar6 = 0xffffffff;
|
|
uVar5 = 0;
|
|
piVar7 = this->_trinketsID;
|
|
game = g_game;
|
|
local_18 = piVar7;
|
|
do {
|
|
if (*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) {
|
|
if ((*piVar7 == 0x35) || ((*piVar7 == 0x40 && (game->_challenge == 0x1c)))) goto LAB_0077186b;
|
|
LAB_0077187d:
|
|
if (uVar6 != 0xffffffff) goto LAB_0077188b;
|
|
if (*piVar7 == 0) break;
|
|
uVar6 = uVar5;
|
|
}
|
|
else {
|
|
cVar3 = (**(code **)(*GHIDRA_CAST<int *>((game->_deathmatchManager)._type) + 0x50))(savedThis);
|
|
game = g_game;
|
|
if (cVar3 != '\0') goto LAB_0077187d;
|
|
LAB_0077186b:
|
|
if (((*piVar7 & 0x7fffU) == 0x35) && (ReplaceTick != 0)) goto LAB_0077187d;
|
|
LAB_0077188b:
|
|
if (*piVar7 == 0) break;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
piVar7 = piVar7 + 1;
|
|
} while (uVar5 < 2);
|
|
sfxVolume = 1.0;
|
|
if (ReplaceTick != 0) {
|
|
uVar5 = 0;
|
|
piVar7 = local_18;
|
|
do {
|
|
if (*piVar7 == 0x35) {
|
|
pMStack_20 = g_manager;
|
|
userIter = g_manager->_netplayManager;
|
|
if (userIter == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) goto LAB_0077191b;
|
|
userCount = GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(userIter) >> 2;
|
|
local_18 = GHIDRA_CAST<int *>(savedThis->_controllerIndex);
|
|
uVar6 = 0;
|
|
if (userCount == 0) goto LAB_0077191b;
|
|
goto LAB_00771900;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
piVar7 = piVar7 + 1;
|
|
} while (uVar5 < 2);
|
|
}
|
|
goto LAB_0077196b;
|
|
while( true ) {
|
|
uVar6 = uVar6 + 1;
|
|
userIter = (NetplayManager)(GHIDRA_INT(userIter) + 4);
|
|
if (userCount <= uVar6) break;
|
|
LAB_00771900:
|
|
if (*GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(userIter) + 0xc)) == local_18) {
|
|
cVar3 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(userIter) + 0x370)) + 0x14))();
|
|
if (cVar3 == '\0') {
|
|
fStack_24 = (float)(g_manager->_optionsConfig)._onlinePlayerVolume * 0.1;
|
|
goto LAB_00771923;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
LAB_0077191b:
|
|
fStack_24 = 1.0;
|
|
LAB_00771923:
|
|
pMVar2 = g_manager;
|
|
pEStack_2c = GHIDRA_CAST<Entity_Pickup *>(0x38f);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&pEStack_2c));
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar2->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(pEStack_2c),fStack_24,2,0,1.0,0.0);
|
|
uVar6 = uVar5;
|
|
LAB_0077196b:
|
|
player = savedThis;
|
|
pEStack_2c = GHIDRA_CAST<Entity_Pickup *>(0x0);
|
|
droppedPickup = GHIDRA_CAST<Entity_Pickup *>(0x0);
|
|
if (uVar6 != 0xffffffff) {
|
|
pMStack_20 = GHIDRA_CAST<Manager *>(savedThis->_trinketsID[uVar6]);
|
|
piVar7 = savedThis->_trinketsID + uVar6;
|
|
local_18 = GHIDRA_CAST<int *>(0x0);
|
|
fStack_24 = (float)(GHIDRA_UINT(pMStack_20) & 0x7fff);
|
|
if ((fStack_24 == 2.24208e-44) &&
|
|
(local_18 = GHIDRA_CAST<int *>(GetTrinketMultiplier(savedThis,0x10)), 3 < GHIDRA_INT(local_18))) {
|
|
local_18 = GHIDRA_CAST<int *>(0x3);
|
|
}
|
|
for (; (pMVar2 = pMStack_20, uVar6 == 0 && (*piVar7 != 0)); piVar7 = piVar7 + 1) {
|
|
uVar6 = 1;
|
|
*piVar7 = piVar7[1];
|
|
}
|
|
player->_trinketsID[uVar6] = 0;
|
|
if (pMStack_20 == GHIDRA_CAST<Manager *>(0x0)) {
|
|
droppedPickup = GHIDRA_CAST<Entity_Pickup *>(0x0);
|
|
}
|
|
else {
|
|
pvVar1 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT(fStack_24) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar1) >> 2) {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + GHIDRA_INT(fStack_24) * 4));
|
|
}
|
|
else {
|
|
iVar4 = 0;
|
|
}
|
|
player->_cacheFlags = player->_cacheFlags | *GHIDRA_CAST<uint *>((iVar4 + 0x54));
|
|
if (player->_variant == 0) {
|
|
uVar6 = Random();
|
|
pEStack_2c = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,0x15e,DropPos,&g_vectorZero,GHIDRA_CAST<Entity *>(player),
|
|
GHIDRA_UINT(pMVar2),uVar6,0);
|
|
if (pEStack_2c != GHIDRA_CAST<Entity_Pickup *>(0x0)) {
|
|
pEStack_2c->_collisionCooldown = 4;
|
|
pEStack_2c->_isTouched = 1;
|
|
}
|
|
}
|
|
TriggerTrinketRemoved(player,GHIDRA_UINT(pMVar2));
|
|
droppedTrinketType = fStack_24;
|
|
pvVar1 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((GHIDRA_INT(fStack_24) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar1) >> 2) &&
|
|
(VStack_10.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + GHIDRA_INT(fStack_24) * 4)),
|
|
GHIDRA_CAST<ItemConfig_Item *>(VStack_10.x) != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
if (((GHIDRA_CAST<ItemConfig_Item *>(VStack_10.x))->addCostumeOnPickup == 0) &&
|
|
((player->_temporaryeffects)._disabled == 0)) {
|
|
for (piVar7 = (player->_temporaryeffects)._effects._begin;
|
|
piVar7 != (player->_temporaryeffects)._effects._end; piVar7 = piVar7 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar7) == 2) && (GHIDRA_CAST<Manager *>((GHIDRA_CAST<int *>(*piVar7))[1]) == pMStack_20))
|
|
goto LAB_00771b15;
|
|
}
|
|
}
|
|
RemoveCostume(player,GHIDRA_CAST<ItemConfig_Item *>(VStack_10.x));
|
|
}
|
|
LAB_00771b15:
|
|
if (droppedTrinketType == 1.70958e-43) {
|
|
userIter = g_manager->_netplayManager;
|
|
if (userIter != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
VStack_10.x = (float)player->_controllerIndex;
|
|
uVar6 = 0;
|
|
uVar5 = GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(userIter) >> 2;
|
|
if (uVar5 != 0) {
|
|
do {
|
|
player = savedThis;
|
|
if (*GHIDRA_CAST<ItemConfig_Item **>((*GHIDRA_CAST<int *>(userIter) + 0xc)) == GHIDRA_CAST<ItemConfig_Item *>(VStack_10.x)) {
|
|
cVar3 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(userIter) + 0x370)) + 0x14))();
|
|
if (cVar3 == '\0') {
|
|
sfxVolume = (float)(g_manager->_optionsConfig)._onlinePlayerVolume * 0.1;
|
|
}
|
|
break;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
userIter = (NetplayManager)(GHIDRA_INT(userIter) + 4);
|
|
} while (uVar6 < uVar5);
|
|
}
|
|
}
|
|
pMVar2 = g_manager;
|
|
pMStack_20 = GHIDRA_CAST<Manager *>(0x385);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&pMStack_20));
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar2->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(pMStack_20),sfxVolume,2,0,1.0,0.0);
|
|
}
|
|
else if ((droppedTrinketType == 2.24208e-44) &&
|
|
(pvVar1 = g_game->_room, (*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4)) + 0x44)) & 1) == 0)) {
|
|
iVar4 = GHIDRA_INT((((pEStack_2c->_pos).x - 40.0) / 40.0 + 0.5));
|
|
if ((iVar4 < 0) ||
|
|
(((gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xc)), gridWidth <= iVar4 ||
|
|
(gridY = GHIDRA_INT((((pEStack_2c->_pos).y - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x10)) <= gridY)))) {
|
|
gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xc));
|
|
iVar4 = -1;
|
|
}
|
|
else {
|
|
iVar4 = gridY * gridWidth + iVar4;
|
|
}
|
|
VStack_10.x = (float)(iVar4 % gridWidth) * 40.0 + 40.0;
|
|
VStack_10.y = (float)(iVar4 / gridWidth) * 40.0 + 120.0;
|
|
if (0 < GHIDRA_INT(local_18)) {
|
|
uVar6 = 0;
|
|
piVar7 = local_18;
|
|
do {
|
|
uVar5 = Random();
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x1d,&VStack_10,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar6,uVar5,0);
|
|
effect = GHIDRA_CAST<int *>(__RTDynamicCast(spawnedEffect,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::
|
|
RTTI_Type_Descriptor,0));
|
|
effect[0xcd] = GHIDRA_INT(VStack_10.x);
|
|
effect[0xce] = GHIDRA_INT(VStack_10.y);
|
|
(**(code **)(*effect + 0xc))();
|
|
uVar6 = uVar6 + 0x1e;
|
|
piVar7 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar7) + -1));
|
|
} while (piVar7 != GHIDRA_CAST<int *>(0x0));
|
|
}
|
|
}
|
|
droppedPickup = pEStack_2c;
|
|
}
|
|
}
|
|
if (player->_cacheFlags != 0) {
|
|
EvaluateItems(player);
|
|
}
|
|
return droppedPickup;
|
|
}
|
|
|
|
// 00771d30
|
|
void Entity_Player::AddTrinket(int type, byte firsttime)
|
|
{
|
|
byte isExtraSlotItemHeld;
|
|
char cVar1;
|
|
int *trinketSlot;
|
|
uint slot;
|
|
void *pvVar2;
|
|
uint uVar3;
|
|
undefined4 uVar4;
|
|
undefined4 slot;
|
|
void *trinketName [4];
|
|
uint trinketNameSize;
|
|
uint trinketNameCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
Game *game;
|
|
ItemConfig_Item *trinketConfig;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00aff10d;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((trinketName + 10));
|
|
ExceptionList = &local_10;
|
|
pvVar2 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((GHIDRA_INT((type & 0x7fffU)) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar2) >> 2) &&
|
|
(trinketConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + (type & 0x7fffU) * 4)),
|
|
trinketConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
if (trinketConfig->addCostumeOnPickup != 0) {
|
|
AddCostume(this,trinketConfig,0);
|
|
}
|
|
uVar3 = 1;
|
|
isExtraSlotItemHeld = HasCollectible(this,0x8b,0);
|
|
if ((isExtraSlotItemHeld != 0) ||
|
|
(isExtraSlotItemHeld = HasCollectible(this,0x1ca,0), isExtraSlotItemHeld != 0)) {
|
|
uVar3 = 2;
|
|
}
|
|
slot = 0;
|
|
trinketSlot = this->_trinketsID;
|
|
do {
|
|
if (*trinketSlot == 0) {
|
|
this->_cacheFlags = this->_cacheFlags | trinketConfig->cacheFlags;
|
|
this->_trinketsID[slot] = type;
|
|
break;
|
|
}
|
|
slot = slot + 1;
|
|
trinketSlot = trinketSlot + 1;
|
|
} while (slot < uVar3);
|
|
(GHIDRA_CAST<ItemConfig_Item *>((trinketConfig)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(trinketName),0);
|
|
local_8 = (void *)0x0;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Adding trinket %d (%s) to player %d (%s)\n"));
|
|
local_8 = (void *)0xffffffff;
|
|
if (0xf < trinketNameCapacity) {
|
|
uVar3 = trinketNameCapacity + 1;
|
|
pvVar2 = trinketName[0];
|
|
if (0xfff < uVar3) {
|
|
pvVar2 = *(void **)(GHIDRA_INT(trinketName[0]) + -4);
|
|
uVar3 = trinketNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(trinketName[0]) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar3);
|
|
}
|
|
trinketNameSize = 0;
|
|
trinketNameCapacity = 0xf;
|
|
trinketName[0] = (void *)(GHIDRA_UINT(trinketName[0]) & 0xffffff00);
|
|
TriggerTrinketAdded(this,type,firsttime);
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
slot = 0;
|
|
uVar4 = 0x10;
|
|
cVar1 = ItemConfig::trinket_has_tags(0x10,0);
|
|
if ((cVar1 != '\0') && (uVar3 = FUN_0075f020(0x10,0,uVar4,slot), 2 < uVar3)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x16f);
|
|
}
|
|
InvalidateCoPlayerItems(this);
|
|
}
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
if (this->_parent != (EntityPtr)0x0) {
|
|
DropTrinket(this,&this->_pos,1);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00771f60
|
|
byte Entity_Player::TryRemoveTrinket(uint id)
|
|
{
|
|
byte bVar1;
|
|
int iVar2;
|
|
uint uVar3;
|
|
uint uVar4;
|
|
void *pvVar5;
|
|
int *piVar6;
|
|
int *piVar7;
|
|
int *local_30;
|
|
void *trinketName [5];
|
|
uint trinketNameCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
Entity_Player *procItemOwner;
|
|
ItemConfig_Item *queuedItem;
|
|
ItemConfig_Item *trinketConfig;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00af32ed;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((trinketName + 10));
|
|
ExceptionList = &local_10;
|
|
uVar3 = id & 0x7fff;
|
|
pvVar5 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((GHIDRA_INT(uVar3) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar5) >> 2) &&
|
|
(trinketConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + uVar3 * 4)),
|
|
trinketConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
InvalidateCoPlayerItems(this);
|
|
}
|
|
queuedItem = (this->_queuedItem)._item;
|
|
if ((queuedItem != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (queuedItem == trinketConfig)) {
|
|
ClearQueueItem(this);
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
piVar7 = GHIDRA_CAST<int *>(0x1);
|
|
local_30 = GHIDRA_CAST<int *>(0x1);
|
|
bVar1 = HasCollectible(this,0x8b,0);
|
|
if ((bVar1 != 0) || (bVar1 = HasCollectible(this,0x1ca,0), bVar1 != 0)) {
|
|
piVar7 = GHIDRA_CAST<int *>(0x2);
|
|
local_30 = GHIDRA_CAST<int *>(0x2);
|
|
}
|
|
uVar4 = 0;
|
|
piVar6 = this->_trinketsID;
|
|
do {
|
|
if ((*piVar6 == id) || ((*piVar6 & 0x7fffU) == id)) {
|
|
if (uVar4 < GHIDRA_INT(piVar7) - 1U) {
|
|
iVar2 = (GHIDRA_INT(piVar7) - 1U) - uVar4;
|
|
piVar7 = this->_trinketsID + uVar4 + 1;
|
|
piVar6 = this->_trinketsID + uVar4;
|
|
for (; iVar2 != 0; iVar2 = iVar2 + -1) {
|
|
*piVar6 = *piVar7;
|
|
piVar7 = piVar7 + 1;
|
|
piVar6 = piVar6 + 1;
|
|
}
|
|
piVar7 = local_30;
|
|
}
|
|
this->_trinketsID[GHIDRA_INT(piVar7) - 1] = 0;
|
|
(GHIDRA_CAST<ItemConfig_Item *>((trinketConfig)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(trinketName),0);
|
|
local_8 = (void *)0x0;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Removing trinket %d (%s) from player %d (%s)\n"));
|
|
local_8 = (void *)0xffffffff;
|
|
if (0xf < trinketNameCapacity) {
|
|
uVar4 = trinketNameCapacity + 1;
|
|
pvVar5 = trinketName[0];
|
|
if (0xfff < uVar4) {
|
|
pvVar5 = *(void **)(GHIDRA_INT(trinketName[0]) + -4);
|
|
uVar4 = trinketNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(trinketName[0]) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar4);
|
|
}
|
|
TriggerTrinketRemoved(this,id);
|
|
pvVar5 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((GHIDRA_INT(uVar3) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar5) >> 2) &&
|
|
(trinketConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + uVar3 * 4)),
|
|
trinketConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
if ((trinketConfig->addCostumeOnPickup == 0) && ((this->_temporaryeffects)._disabled == 0)
|
|
) {
|
|
for (piVar7 = (this->_temporaryeffects)._effects._begin;
|
|
piVar7 != (this->_temporaryeffects)._effects._end; piVar7 = piVar7 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar7) == 2) && ((GHIDRA_CAST<int *>(*piVar7))[1] == id)) {
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
RemoveCostume(this,trinketConfig);
|
|
}
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
piVar6 = piVar6 + 1;
|
|
} while (uVar4 < piVar7);
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
bVar1 = TryRemoveSmeltedTrinket(this,id);
|
|
ExceptionList = local_10;
|
|
return bVar1;
|
|
}
|
|
piVar7 = (this->_proceduralItems)._itemIds._head;
|
|
local_30 = GHIDRA_CAST<int *>(*piVar7);
|
|
if (local_30 != piVar7) {
|
|
do {
|
|
uVar3 = ~local_30[4];
|
|
if ((local_30[4] < 0) &&
|
|
(GHIDRA_INT(uVar3) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) -
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._begin) >> 2)) {
|
|
piVar7 = (this->_proceduralItems)._itemIds._head;
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._begin) + uVar3 * 4
|
|
));
|
|
if ((iVar2 != 0) &&
|
|
(((piVar6 = *GHIDRA_CAST<int **>((iVar2 + 0x10)), piVar6 != GHIDRA_CAST<int *>(0x0) && (*piVar6 == 2)) &&
|
|
(piVar6[1] == id)))) {
|
|
if (local_30[4] == 0) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
procItemOwner = (this->_proceduralItems)._player;
|
|
if (procItemOwner == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
RemoveCollectible(procItemOwner,local_30[4],0,0,1);
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
}
|
|
std::
|
|
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
*)&local_30);
|
|
} while (local_30 != piVar7);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
|
|
// 00772260
|
|
byte Entity_Player::TryRemoveSmeltedTrinket(uint id)
|
|
{
|
|
byte isRemoved;
|
|
void *pvVar1;
|
|
uint uVar2;
|
|
uint trinketID;
|
|
int historyEntry;
|
|
void *local_30;
|
|
uint uStack_2c;
|
|
char acStack_28 [12];
|
|
uint uStack_1c;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
short *smeltedCount;
|
|
std_vector *smeltedTrinkets;
|
|
ItemConfig_Item *trinketConfig;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff155;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((acStack_28 + 0x24));
|
|
ExceptionList = &local_10;
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
InvalidateCoPlayerItems(this);
|
|
}
|
|
trinketID = id & 0x7fff;
|
|
pvVar1 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((GHIDRA_INT(trinketID) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar1) >> 2) &&
|
|
(trinketConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + trinketID * 4)),
|
|
trinketConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
smeltedTrinkets = &this->_smeltedTrinkets;
|
|
if (((id >> 0xf & 1) == 0) && (0 < *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(smeltedTrinkets->_begin) + trinketID * 4)))) {
|
|
(GHIDRA_CAST<ItemConfig_Item *>((trinketConfig)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(&local_30),0);
|
|
local_8 = 0;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Removing smelted trinket %d (%s) from player %d (%s)\n"));
|
|
local_8 = 0xffffffff;
|
|
if (0xf < uStack_1c) {
|
|
uVar2 = uStack_1c + 1;
|
|
pvVar1 = local_30;
|
|
if (0xfff < uVar2) {
|
|
pvVar1 = *(void **)(GHIDRA_CAST<char *>(local_30) + -4);
|
|
uVar2 = uStack_1c + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_30) + (-4 - GHIDRA_INT(pvVar1))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar1,uVar2);
|
|
}
|
|
smeltedCount = GHIDRA_CAST<short *>((trinketID * 4 + GHIDRA_INT(smeltedTrinkets->_begin)));
|
|
*smeltedCount = *smeltedCount + -1;
|
|
TriggerTrinketRemoved(this,trinketID);
|
|
local_30 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_30)) + 0x1))),'\x01');
|
|
historyEntry = g_game->_frameCount;
|
|
acStack_28[0] = '\x01';
|
|
acStack_28[1] = '\0';
|
|
acStack_28[2] = '\0';
|
|
acStack_28[3] = '\0';
|
|
acStack_28[4] = '\0';
|
|
acStack_28[5] = '\0';
|
|
acStack_28[6] = '\0';
|
|
acStack_28[7] = '\0';
|
|
acStack_28[8] = '\x01';
|
|
acStack_28[9] = '\0';
|
|
acStack_28[10] = '\0';
|
|
acStack_28[0xb] = '\0';
|
|
uStack_1c = 0;
|
|
uStack_2c = trinketID;
|
|
FUN_00721b70(&historyEntry);
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(smeltedTrinkets->_begin) + trinketID * 4 + 2)) < 1) goto LAB_00772509;
|
|
(GHIDRA_CAST<ItemConfig_Item *>((trinketConfig)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(&local_30),0);
|
|
local_8 = 1;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Removing smelted trinket %d (%s) from player %d (%s)\n"));
|
|
local_8 = 0xffffffff;
|
|
if (0xf < uStack_1c) {
|
|
uVar2 = uStack_1c + 1;
|
|
pvVar1 = local_30;
|
|
if (0xfff < uVar2) {
|
|
pvVar1 = *(void **)(GHIDRA_CAST<char *>(local_30) + -4);
|
|
uVar2 = uStack_1c + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_30) + (-4 - GHIDRA_INT(pvVar1))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar1,uVar2);
|
|
}
|
|
smeltedCount = GHIDRA_CAST<short *>((GHIDRA_INT(smeltedTrinkets->_begin) + trinketID * 4 + 2));
|
|
*smeltedCount = *smeltedCount + -1;
|
|
TriggerTrinketRemoved(this,trinketID | 0x8000);
|
|
local_30 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_30)) + 0x1))),'\x01');
|
|
historyEntry = g_game->_frameCount;
|
|
acStack_28[0] = '\x01';
|
|
acStack_28[1] = '\0';
|
|
acStack_28[2] = '\0';
|
|
acStack_28[3] = '\0';
|
|
acStack_28[4] = '\0';
|
|
acStack_28[5] = '\0';
|
|
acStack_28[6] = '\0';
|
|
acStack_28[7] = '\0';
|
|
acStack_28[8] = '\x01';
|
|
acStack_28[9] = '\0';
|
|
acStack_28[10] = '\0';
|
|
acStack_28[0xb] = '\0';
|
|
uStack_1c = 0;
|
|
uStack_2c = trinketID | 0x8000;
|
|
FUN_00721b70(&historyEntry);
|
|
}
|
|
if ((*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(smeltedTrinkets->_begin) + trinketID * 4)) < 1) &&
|
|
(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(smeltedTrinkets->_begin) + trinketID * 4 + 2)) < 1)) {
|
|
TryRemoveTrinketCostume(this,trinketID);
|
|
}
|
|
isRemoved = 1;
|
|
}
|
|
else {
|
|
KAGE_LogMessage(4,GHIDRA_CAST<byte *>("Tried to remove smelted trinket with invalid trinket type (%d) \n"));
|
|
LAB_00772509:
|
|
isRemoved = 0;
|
|
}
|
|
ExceptionList = local_10;
|
|
return isRemoved;
|
|
}
|
|
|
|
// 00772530
|
|
byte Entity_Player::replace_trinket(int unused0, int unused1, int unused2)
|
|
{
|
|
ItemConfig_Item *pIVar1;
|
|
byte bVar2;
|
|
uint index;
|
|
int *piVar3;
|
|
void *pvVar4;
|
|
short *smeltedGoldenCount;
|
|
uint index;
|
|
ItemConfig_Item *storeCredit;
|
|
void *oldName [5];
|
|
uint oldNameCapacity;
|
|
void *newName [4];
|
|
uint newNameSize;
|
|
uint newNameCapacity;
|
|
void *smeltedOldName [4];
|
|
uint smeltedOldNameSize;
|
|
uint smeltedOldNameCapacity;
|
|
void *smeltedNewName [4];
|
|
uint smeltedNewNameSize;
|
|
uint smeltedNewNameCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
short goldenCount;
|
|
short *smeltedCount;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00aff1a5;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((smeltedNewName + 10));
|
|
ExceptionList = &local_10;
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
InvalidateCoPlayerItems(this);
|
|
}
|
|
pvVar4 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar4) >> 2 < 0xe) {
|
|
storeCredit = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
storeCredit = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar4) + 0x34));
|
|
}
|
|
pIVar1 = (this->_queuedItem)._item;
|
|
if (((pIVar1 == GHIDRA_CAST<ItemConfig_Item *>(0x0)) || (pIVar1 != storeCredit)) ||
|
|
(bVar2 = (this->_queuedItem)._flags, (bVar2 & 2) == 0)) {
|
|
index = 1;
|
|
bVar2 = HasCollectible(this,0x8b,0);
|
|
if ((bVar2 != 0) || (bVar2 = HasCollectible(this,0x1ca,0), bVar2 != 0)) {
|
|
index = 2;
|
|
}
|
|
index = 0;
|
|
piVar3 = this->_trinketsID;
|
|
do {
|
|
if (*piVar3 == 0x800d) {
|
|
this->_trinketsID[index] = 0xd;
|
|
(GHIDRA_CAST<ItemConfig_Item *>((storeCredit)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(oldName),0);
|
|
local_8 = (void *)0x0;
|
|
(GHIDRA_CAST<ItemConfig_Item *>((storeCredit)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(newName),0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
KAGE_LogMessage(1,(byte *)
|
|
"Replacing trinket %d (%s) from player %d (%s) with trinket %d (%s)\n");
|
|
local_8 = (void *)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8);
|
|
if (0xf < newNameCapacity) {
|
|
index = newNameCapacity + 1;
|
|
pvVar4 = newName[0];
|
|
if (0xfff < index) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(newName[0]) + -4);
|
|
index = newNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(newName[0]) + (-4 - GHIDRA_INT(pvVar4))))) goto LAB_00772920;
|
|
}
|
|
operator_delete(pvVar4,index);
|
|
}
|
|
local_8 = (void *)0xffffffff;
|
|
newNameSize = 0;
|
|
newNameCapacity = 0xf;
|
|
newName[0] = (void *)(GHIDRA_UINT(newName[0]) & 0xffffff00);
|
|
if (0xf < oldNameCapacity) {
|
|
index = oldNameCapacity + 1;
|
|
pvVar4 = oldName[0];
|
|
if (0xfff < index) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(oldName[0]) + -4);
|
|
index = oldNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(oldName[0]) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
LAB_00772920:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,index);
|
|
}
|
|
TriggerTrinketRemoved(this,0x800d);
|
|
pvVar4 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (((0x34 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar4) & 0xfffffffcU))
|
|
) && (pIVar1 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar4) + 0x34)),
|
|
pIVar1 != GHIDRA_CAST<ItemConfig_Item *>(0x0))) &&
|
|
((pIVar1->addCostumeOnPickup != 0 ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasTrinketEffect(0x800d), bVar2 == 0
|
|
)))) {
|
|
RemoveCostume(this,pIVar1);
|
|
}
|
|
TriggerTrinketAdded(this,0xd,0);
|
|
if (storeCredit->addCostumeOnPickup != 0) {
|
|
AddCostume(this,storeCredit,0);
|
|
}
|
|
goto LAB_007729a1;
|
|
}
|
|
index = index + 1;
|
|
piVar3 = piVar3 + 1;
|
|
} while (index < index);
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
pvVar4 = (this->_history)._historyItems._begin;
|
|
index = 0;
|
|
index = (GHIDRA_INT((this->_history)._historyItems._end) - GHIDRA_INT(pvVar4)) / 0x1c;
|
|
if (index != 0) {
|
|
piVar3 = GHIDRA_CAST<int *>((GHIDRA_INT(pvVar4) + 8));
|
|
do {
|
|
if (((char)piVar3[-1] != '\0') && (*piVar3 == 0x800d)) {
|
|
smeltedGoldenCount =
|
|
GHIDRA_CAST<short *>((GHIDRA_INT((this->_smeltedTrinkets)._begin) + storeCredit->id * 4 + 2));
|
|
smeltedCount = GHIDRA_CAST<short *>((GHIDRA_INT((this->_smeltedTrinkets)._begin) + storeCredit->id * 4));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + index * 0x1c + 8)) = 0xd;
|
|
goldenCount = *smeltedGoldenCount;
|
|
if (0 < goldenCount) {
|
|
*smeltedGoldenCount = goldenCount + -1;
|
|
TriggerTrinketRemoved(this,0x800d);
|
|
pvVar4 = (this->_smeltedTrinkets)._begin;
|
|
if ((*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar4) + storeCredit->id * 4)) < 1) &&
|
|
(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar4) + storeCredit->id * 4 + 2)) < 1)) {
|
|
TryRemoveTrinketCostume(this,0x800d);
|
|
}
|
|
*smeltedCount = *smeltedCount + 1;
|
|
TriggerTrinketAdded(this,0xd,0);
|
|
if (storeCredit->addCostumeOnPickup != 0) {
|
|
AddCostume(this,storeCredit,0);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ItemConfig_Item *>((storeCredit)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(smeltedOldName),0);
|
|
local_8 = (void *)0x2;
|
|
(GHIDRA_CAST<ItemConfig_Item *>((storeCredit)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(smeltedNewName),0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
KAGE_LogMessage(1,(byte *)
|
|
"Replacing smelted trinket %d (%s) from player %d (%s) with trinket %d (%s)\n"
|
|
);
|
|
local_8 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
if (0xf < smeltedNewNameCapacity) {
|
|
index = smeltedNewNameCapacity + 1;
|
|
pvVar4 = smeltedNewName[0];
|
|
if (0xfff < index) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(smeltedNewName[0]) + -4);
|
|
index = smeltedNewNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(smeltedNewName[0]) + (-4 - GHIDRA_INT(pvVar4))))) goto LAB_007727f2;
|
|
}
|
|
operator_delete(pvVar4,index);
|
|
}
|
|
local_8 = (void *)0xffffffff;
|
|
smeltedNewNameSize = 0;
|
|
smeltedNewNameCapacity = 0xf;
|
|
smeltedNewName[0] = (void *)(GHIDRA_UINT(smeltedNewName[0]) & 0xffffff00);
|
|
if (0xf < smeltedOldNameCapacity) {
|
|
index = smeltedOldNameCapacity + 1;
|
|
pvVar4 = smeltedOldName[0];
|
|
if (0xfff < index) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(smeltedOldName[0]) + -4);
|
|
index = smeltedOldNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(smeltedOldName[0]) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
LAB_007727f2:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,index);
|
|
}
|
|
smeltedOldNameSize = 0;
|
|
smeltedOldNameCapacity = 0xf;
|
|
smeltedOldName[0] = (void *)(GHIDRA_UINT(smeltedOldName[0]) & 0xffffff00);
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
goto LAB_007729a1;
|
|
}
|
|
index = index + 1;
|
|
piVar3 = piVar3 + 7;
|
|
} while (index < index);
|
|
}
|
|
}
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
(this->_queuedItem)._item = storeCredit;
|
|
(this->_queuedItem)._flags = bVar2 & 0xfd;
|
|
LAB_007729a1:
|
|
bVar2 = 1;
|
|
}
|
|
ExceptionList = local_10;
|
|
return bVar2;
|
|
}
|
|
|
|
// 007791f0
|
|
void Entity_Player::SetFullHearts()
|
|
{
|
|
int iVar1;
|
|
HUD *playerHud;
|
|
uint hudIdx;
|
|
int extraout_EDX;
|
|
int effectiveHearts;
|
|
Entity_Player *subPlayer;
|
|
|
|
iVar1 = this->_playerType;
|
|
while ((iVar1 == 0x11 &&
|
|
(subPlayer = GHIDRA_CAST<Entity_Player *>(this->_subPlayer), subPlayer != GHIDRA_CAST<Entity_Player *>(0x0)))) {
|
|
iVar1 = subPlayer->_playerType;
|
|
this = subPlayer;
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
if ((iVar1 == 1) || (iVar1 == 2)) {
|
|
iVar1 = this->_maxHearts;
|
|
}
|
|
else {
|
|
iVar1 = this->_maxHearts + this->_boneHearts * 2;
|
|
}
|
|
this->_redHearts = iVar1;
|
|
if (extraout_EDX <= iVar1) {
|
|
playerHud = &g_game->_hud;
|
|
hudIdx = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<Entity_Player **>(playerHud->_playerHUD) == this) {
|
|
playerHud->_playerHUD[0xc] = 4;
|
|
break;
|
|
}
|
|
hudIdx = hudIdx + 1;
|
|
playerHud = GHIDRA_CAST<HUD *>((playerHud->_playerHUD + 0x6dc));
|
|
} while (hudIdx < 8);
|
|
}
|
|
UpdateHeartDependentEffects(this);
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (this->_dead == 0)) &&
|
|
(iVar1 = this->_goldenHearts, 0 < iVar1)) {
|
|
effectiveHearts = this->_redHearts;
|
|
if (this->_maxHearts < this->_redHearts) {
|
|
effectiveHearts = this->_maxHearts;
|
|
}
|
|
effectiveHearts = (effectiveHearts + 1) / 2 + (this->_soulHearts + 1) / 2 + this->_boneHearts;
|
|
if (effectiveHearts < iVar1) {
|
|
BreakGoldenHearts(this,iVar1 - effectiveHearts);
|
|
this->_goldenHearts = effectiveHearts;
|
|
}
|
|
}
|
|
update_bone_hearts(this);
|
|
return;
|
|
}
|
|
|
|
// 00779320
|
|
Entity * Entity_Player::GetFocusEntity()
|
|
{
|
|
Entity *target;
|
|
uint weaponIdx;
|
|
void **weaponSlot;
|
|
|
|
target = this->_markedTarget;
|
|
if (target == GHIDRA_CAST<Entity *>(0x0)) {
|
|
weaponIdx = 0;
|
|
weaponSlot = this->_weapons;
|
|
do {
|
|
weaponSlot = weaponSlot + 1;
|
|
if ((*weaponSlot != GHIDRA_CAST<int *>(0x0)) &&
|
|
(target = GHIDRA_CAST<Entity *>((**(code **)(*GHIDRA_CAST<int *>(*weaponSlot) + 0x24))()), target != GHIDRA_CAST<Entity *>(0x0)))
|
|
{
|
|
return target;
|
|
}
|
|
weaponIdx = weaponIdx + 1;
|
|
} while (weaponIdx < 4);
|
|
target = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
return target;
|
|
}
|
|
|
|
// 00779360
|
|
Vector * Entity_Player::GetMovementJoystick(Vector *outJoystick)
|
|
{
|
|
byte bVar1;
|
|
uint curses;
|
|
EntityPtr extraout_ECX;
|
|
EntityPtr unused;
|
|
int unused_00;
|
|
int unused_01;
|
|
int unused_02;
|
|
void *seedEffectsEnd;
|
|
float fVar2;
|
|
float rightValue;
|
|
float cardinalPositive;
|
|
float resultX;
|
|
float minusOne;
|
|
float joystickX;
|
|
float cardinalY;
|
|
float joystickY;
|
|
undefined4 seedKey;
|
|
undefined1 seedIter [8];
|
|
void *seedNode;
|
|
Game *game;
|
|
int playerType;
|
|
EntityPtr twin;
|
|
|
|
playerType = this->_playerType;
|
|
unused = (EntityPtr)this;
|
|
if ((((playerType == 0x14) ||
|
|
((unused = this->_parent, unused != (EntityPtr)0x0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(unused) + 0x28)) == 1))))
|
|
|| (((playerType == 0x1d || (playerType == 0x26)) &&
|
|
((((twin = this->_twinPlayer, twin != (EntityPtr)0x0 &&
|
|
(unused = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(twin) + 0x161c)), unused != (EntityPtr)0xffffffff)) &&
|
|
(GHIDRA_INT(unused) < this->_playerIndex)) && (twin != (EntityPtr)this)))))) &&
|
|
((this->_isControlsEnabled != 0 && (this->_controlsCooldown < 1)))) {
|
|
bVar1 = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(0x0),GHIDRA_INT(unused));
|
|
fVar2 = g_vectorZero.y;
|
|
unused = extraout_ECX;
|
|
if (bVar1 != 0) {
|
|
outJoystick->x = g_vectorZero.x;
|
|
outJoystick->y = fVar2;
|
|
return outJoystick;
|
|
}
|
|
}
|
|
fVar2 = InputManager::GetActionValue(0,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),GHIDRA_INT(unused));
|
|
cardinalY = 0.0;
|
|
rightValue = InputManager::GetActionValue(1,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_00);
|
|
joystickX = rightValue + (0.0 - fVar2);
|
|
fVar2 = InputManager::GetActionValue(2,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_01);
|
|
joystickY = InputManager::GetActionValue(3,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_02);
|
|
game = g_game;
|
|
joystickY = joystickY + (0.0 - fVar2);
|
|
minusOne = (float)&DAT_bf800000;
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && ((this->_flags & 0x200) != 0)) {
|
|
joystickX = joystickX * -1.0;
|
|
joystickY = joystickY * -1.0;
|
|
}
|
|
seedKey = 0xc;
|
|
resultX = joystickX;
|
|
fVar2 = joystickY;
|
|
std::set<int>::find_node(seedIter,&seedKey);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)) < 0xd)) {
|
|
seedEffectsEnd = (game->_seedEffects)._seedEffects;
|
|
if (seedNode != seedEffectsEnd) {
|
|
resultX = resultX * minusOne;
|
|
fVar2 = fVar2 * minusOne;
|
|
joystickX = resultX;
|
|
joystickY = fVar2;
|
|
}
|
|
}
|
|
else {
|
|
seedEffectsEnd = (game->_seedEffects)._seedEffects;
|
|
}
|
|
seedKey = 0x4c;
|
|
std::set<int>::find_node(seedIter,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)) < 0x4d)) &&
|
|
(seedNode != seedEffectsEnd)) {
|
|
cardinalPositive = 0.0;
|
|
if (ABS(resultX) <= ABS(fVar2)) {
|
|
joystickX = 0.0;
|
|
if (0.0 <= fVar2) {
|
|
cardinalPositive = 1.0;
|
|
goto LAB_00779591;
|
|
}
|
|
cardinalY = minusOne;
|
|
}
|
|
else if (0.0 <= resultX) {
|
|
joystickX = 1.0;
|
|
LAB_00779591:
|
|
cardinalY = cardinalPositive;
|
|
}
|
|
else {
|
|
joystickX = minusOne;
|
|
}
|
|
fVar2 = sqrtf(fVar2 * fVar2 + resultX * resultX);
|
|
joystickY = cardinalY * fVar2;
|
|
resultX = joystickX * fVar2;
|
|
joystickX = resultX;
|
|
}
|
|
if ((game->_currentDimensionIdx != 1) || ((game->_stageType != 4 && (game->_stageType != 5))))
|
|
goto LAB_00779606;
|
|
if (game->_stage != 2) {
|
|
if (game->_stage != 1) goto LAB_00779606;
|
|
curses = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetCurses();
|
|
resultX = joystickX;
|
|
if ((curses & 2) == 0) goto LAB_00779606;
|
|
}
|
|
resultX = resultX * -1.0;
|
|
LAB_00779606:
|
|
outJoystick->x = resultX;
|
|
outJoystick->y = joystickY;
|
|
return outJoystick;
|
|
}
|
|
|
|
// 00779620
|
|
Vector * Entity_Player::GetShootingJoystick(Vector *outJoystick)
|
|
{
|
|
byte isTimedSetActive;
|
|
Vector *movementJoystick;
|
|
uint curses;
|
|
int unused;
|
|
int unused_00;
|
|
int unused_01;
|
|
int unused_02;
|
|
Game *game;
|
|
void *seedEffectsHead;
|
|
undefined1 *puVar1;
|
|
float fVar2;
|
|
undefined1 *snappedX;
|
|
undefined1 *snappedY;
|
|
undefined4 seedEffect;
|
|
Vector local_20;
|
|
void *seedNode;
|
|
undefined1 seedFindResult [8];
|
|
void *seedNode2;
|
|
int controllerIndex;
|
|
float joystickX;
|
|
|
|
game = g_game;
|
|
snappedY = GHIDRA_CAST<undefined1 *>(0x0);
|
|
outJoystick->y = 0.0;
|
|
outJoystick->x = 0.0;
|
|
seedEffect = 0x4a;
|
|
std::set<int>::find_node(&local_20,&seedEffect);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)) < 0x4b)) {
|
|
seedEffectsHead = (game->_seedEffects)._seedEffects;
|
|
if (seedNode == seedEffectsHead) goto LAB_00779739;
|
|
movementJoystick = GetMovementJoystick(this,&local_20);
|
|
game = g_game;
|
|
fVar2 = movementJoystick->y;
|
|
outJoystick->x = movementJoystick->x;
|
|
outJoystick->y = fVar2;
|
|
}
|
|
else {
|
|
seedEffectsHead = (game->_seedEffects)._seedEffects;
|
|
LAB_00779739:
|
|
seedEffect = 0x4b;
|
|
std::set<int>::find_node(&local_20,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)) < 0x4c)) &&
|
|
(seedNode != seedEffectsHead)) {
|
|
movementJoystick = GetMovementJoystick(this,&local_20);
|
|
game = g_game;
|
|
fVar2 = movementJoystick->y * -1.0;
|
|
outJoystick->x = movementJoystick->x * -1.0;
|
|
outJoystick->y = fVar2;
|
|
}
|
|
else {
|
|
fVar2 = InputManager::GetActionValue(4,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused);
|
|
controllerIndex = this->_controllerIndex;
|
|
outJoystick->x = outJoystick->x - fVar2;
|
|
fVar2 = InputManager::GetActionValue(5,controllerIndex,GHIDRA_CAST<Entity *>(this),unused_00);
|
|
controllerIndex = this->_controllerIndex;
|
|
outJoystick->x = fVar2 + outJoystick->x;
|
|
fVar2 = InputManager::GetActionValue(6,controllerIndex,GHIDRA_CAST<Entity *>(this),unused_01);
|
|
controllerIndex = this->_controllerIndex;
|
|
outJoystick->y = outJoystick->y - fVar2;
|
|
fVar2 = InputManager::GetActionValue(7,controllerIndex,GHIDRA_CAST<Entity *>(this),unused_02);
|
|
game = g_game;
|
|
fVar2 = fVar2 + outJoystick->y;
|
|
outJoystick->y = fVar2;
|
|
isTimedSetActive = (GHIDRA_CAST<Game *>((game)))->Game::IsInTimedSet(0xc);
|
|
if (isTimedSetActive != 0) {
|
|
fVar2 = fVar2 * -1.0;
|
|
outJoystick->x = outJoystick->x * -1.0;
|
|
outJoystick->y = fVar2;
|
|
}
|
|
}
|
|
}
|
|
puVar1 = &DAT_bf800000;
|
|
seedEffect = 0x4c;
|
|
std::set<int>::find_node(seedFindResult,&seedEffect);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode2) + 0xd)) != '\0') || (0x4c < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode2) + 0x10)))) ||
|
|
(seedNode2 == (game->_seedEffects)._seedEffects)) goto LAB_007798af;
|
|
joystickX = outJoystick->x;
|
|
if (ABS(joystickX) <= ABS(fVar2)) {
|
|
snappedX = GHIDRA_CAST<undefined1 *>(0x0);
|
|
if (0.0 <= fVar2) {
|
|
puVar1 = GHIDRA_CAST<undefined1 *>(0x3f800000);
|
|
}
|
|
LAB_00779872:
|
|
snappedY = puVar1;
|
|
}
|
|
else {
|
|
if (0.0 <= joystickX) {
|
|
snappedX = GHIDRA_CAST<undefined1 *>(0x3f800000);
|
|
puVar1 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
goto LAB_00779872;
|
|
}
|
|
snappedX = puVar1;
|
|
}
|
|
fVar2 = sqrtf(joystickX * joystickX + fVar2 * fVar2);
|
|
outJoystick->x = (float)snappedX * fVar2;
|
|
outJoystick->y = (float)snappedY * fVar2;
|
|
LAB_007798af:
|
|
if (((game->_currentDimensionIdx == 1) && ((game->_stageType == 4 || (game->_stageType == 5)))) &&
|
|
((game->_stage == 2 ||
|
|
((game->_stage == 1 && (curses = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetCurses(), (curses & 2) != 0)))))) {
|
|
outJoystick->x = outJoystick->x * -1.0;
|
|
}
|
|
return outJoystick;
|
|
}
|
|
|
|
// 00779900
|
|
void Entity_Player::GetBodyMoveDirection(Vector *buffer)
|
|
{
|
|
byte isMontezumasRevenge;
|
|
void *weapon;
|
|
void *pvVar1;
|
|
float fVar2;
|
|
Vector moveDirection;
|
|
|
|
moveDirection.x = (this->_recentMovementVector).x;
|
|
pvVar1 = this->_weapons[0];
|
|
moveDirection.y = (this->_recentMovementVector).y;
|
|
if (pvVar1 == (void *)0x0) {
|
|
if (this->_weapons[1] != (void *)0x0) {
|
|
weapon = this->_weapons[1];
|
|
goto LAB_00779944;
|
|
}
|
|
}
|
|
else {
|
|
weapon = pvVar1;
|
|
LAB_00779944:
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(weapon) + 0x3c)) != g_vectorZero.x) ||
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(weapon) + 0x40)) != g_vectorZero.y)) {
|
|
if (pvVar1 == (void *)0x0) {
|
|
pvVar1 = this->_weapons[1];
|
|
}
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x40));
|
|
buffer->x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x3c));
|
|
buffer->y = fVar2;
|
|
return;
|
|
}
|
|
}
|
|
isMontezumasRevenge = HasCollectible(this,0x2a8,0);
|
|
if (isMontezumasRevenge != 0) {
|
|
pvVar1 = this->_montezumaLaser;
|
|
if ((pvVar1 == (void *)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x28)) != 7)) {
|
|
if (this->_montezumaChargeTimer < 1) goto LAB_007799dd;
|
|
fVar2 = this->_bodyAngle;
|
|
}
|
|
else {
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x41c)) + 180.0;
|
|
}
|
|
moveDirection.x = cos(fVar2 * 0.017453292);
|
|
moveDirection.y = sin(fVar2 * 0.017453292);
|
|
}
|
|
LAB_007799dd:
|
|
buffer->x = moveDirection.x;
|
|
buffer->y = moveDirection.y;
|
|
return;
|
|
}
|
|
|
|
// 00779a20
|
|
int Entity_Player::GetWeaponModifiers()
|
|
{
|
|
byte isHasItem;
|
|
uint finalModifiers;
|
|
uint modifiers;
|
|
|
|
isHasItem = HasCollectible(this,0x45,0);
|
|
modifiers = GHIDRA_UINT((isHasItem != 0));
|
|
isHasItem = HasCollectible(this,0x13c,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 2;
|
|
}
|
|
isHasItem = HasCollectible(this,0x76,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 4;
|
|
}
|
|
isHasItem = HasCollectible(this,0xe5,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 8;
|
|
}
|
|
isHasItem = HasCollectible(this,0x149,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 0x10;
|
|
}
|
|
isHasItem = HasCollectible(this,0xde,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 0x20;
|
|
}
|
|
isHasItem = HasCollectible(this,0x18d,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 0x40;
|
|
}
|
|
isHasItem = HasCollectible(this,0x255,0);
|
|
if (isHasItem != 0) {
|
|
modifiers = modifiers | 0x100;
|
|
}
|
|
isHasItem = HasCollectible(this,0x14a,0);
|
|
if ((isHasItem != 0) || (isHasItem = HasCollectible(this,0x231,0), isHasItem != 0)) {
|
|
modifiers = modifiers | 0x80;
|
|
}
|
|
finalModifiers = modifiers | 0x200;
|
|
if (this->_playerType != 0x1c) {
|
|
finalModifiers = modifiers;
|
|
}
|
|
isHasItem = HasCollectible(this,0x2a6,0);
|
|
if (isHasItem != 0) {
|
|
finalModifiers = finalModifiers | 0x800;
|
|
}
|
|
return finalModifiers;
|
|
}
|
|
|
|
// 00779b40
|
|
void Entity_Player::update_body_animations()
|
|
{
|
|
byte bVar1;
|
|
Vector *vecResult;
|
|
int nextCooldown;
|
|
int iVar2;
|
|
float *pfVar3;
|
|
char *headAnimName;
|
|
uint uVar4;
|
|
void *pvVar5;
|
|
Entity *spawnedEffect;
|
|
ColorMod *color;
|
|
byte extraout_CL;
|
|
byte isUnused;
|
|
byte isUnused_00;
|
|
byte isUnused_01;
|
|
byte isUnused_02;
|
|
byte isUnused_03;
|
|
EntityPtr EVar6;
|
|
byte *blinkAnimName;
|
|
uint uVar7;
|
|
float fVar8;
|
|
float normalDot;
|
|
float fVar9;
|
|
float fVar10;
|
|
Vector local_70;
|
|
float local_68;
|
|
float local_64;
|
|
float local_60;
|
|
float moveX;
|
|
byte *local_58;
|
|
float local_54;
|
|
undefined1 local_50 [40];
|
|
float local_28;
|
|
int moveActions [2];
|
|
Vector VStack_1c;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
int local_8;
|
|
qword flags;
|
|
float gridVelocityX;
|
|
bool isSlippery;
|
|
TemporaryEffects *tempEffects;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff2ed;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((moveActions + 8));
|
|
if (this->_heightVelocity <= 0.0 && this->_heightVelocity != 0.0) {
|
|
return;
|
|
}
|
|
pfVar3 = &(this->_posOffset).y;
|
|
if (*pfVar3 <= 0.0 && *pfVar3 != 0.0) {
|
|
return;
|
|
}
|
|
EVar6 = this->_target;
|
|
if (EVar6 != (EntityPtr)0x0) {
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar6) + 0x340));
|
|
fVar9 = (this->_pos).y;
|
|
(this->_velocity).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar6) + 0x33c)) - (this->_pos).x;
|
|
(this->_velocity).y = fVar8 - fVar9;
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
(this->_lastVelocity).x = (this->_velocity).x;
|
|
(this->_lastVelocity).y = (this->_velocity).y;
|
|
moveX = g_vectorZero.x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = g_vectorZero.x;
|
|
local_54 = g_vectorZero.y;
|
|
local_28 = g_vectorZero.y;
|
|
if ((this->_isControlsEnabled != 0) && (this->_controlsCooldown < 1)) {
|
|
vecResult = GetMovementJoystick(this,&VStack_1c);
|
|
moveX = vecResult->x;
|
|
local_54 = vecResult->y;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = moveX;
|
|
local_28 = local_54;
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x8000);
|
|
if ((bVar1 != 0) && (this->_canFly == 0)) {
|
|
local_54 = 0.0;
|
|
local_28 = 0.0;
|
|
}
|
|
fVar8 = sqrtf(moveX * moveX + local_54 * local_54);
|
|
if (1.0 < fVar8) {
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_50 + 0x24)))))->Vector::Normalize();
|
|
local_54 = local_28;
|
|
moveX = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_50)) + 0x24)));
|
|
}
|
|
}
|
|
iVar2 = this->_playerType;
|
|
if ((((iVar2 == 0x23) && (this->_isCoopGhost == 0)) || (this->_suplexState != 0)) ||
|
|
(this->_darkArtsBlastPending != 0)) {
|
|
moveX = g_vectorZero.x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = g_vectorZero.x;
|
|
local_54 = g_vectorZero.y;
|
|
local_28 = g_vectorZero.y;
|
|
}
|
|
if (((((iVar2 == 0x13) || (iVar2 == 0x14)) || ((iVar2 == 0x1d || (iVar2 == 0x26)))) &&
|
|
(this->_twinPlayer != (EntityPtr)0x0)) || (iVar2 == 0x1a)) {
|
|
EVar6 = this->_twinPlayer;
|
|
if (((EVar6 == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar6) + 0x161c)) == -1)) ||
|
|
(this->_playerIndex <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar6) + 0x161c)))) {
|
|
EVar6 = (EntityPtr)this;
|
|
}
|
|
vecResult = GetMovementJoystick(GHIDRA_CAST<Entity_Player *>(EVar6),&VStack_1c);
|
|
if ((vecResult->x != g_vectorZero.x) || (vecResult->y != g_vectorZero.y)) {
|
|
this->_actionHoldDrop = 0;
|
|
}
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x3f);
|
|
if (bVar1 == 0) {
|
|
this->_reverseChariotMoveCooldown = 0;
|
|
fVar8 = moveX;
|
|
fVar9 = local_54;
|
|
}
|
|
else {
|
|
fVar8 = sqrtf(moveX * moveX + local_54 * local_54);
|
|
if (fVar8 <= 0.25) {
|
|
iVar2 = this->_reverseChariotMoveCooldown + -1;
|
|
}
|
|
else if (this->_reverseChariotMoveCooldown < 1) {
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_50 + 0x24)))))->Vector::Normalized(&VStack_1c);
|
|
fVar8 = this->_speedMultiplier;
|
|
fVar9 = vecResult->y;
|
|
(this->_velocity).x = (vecResult->x + vecResult->x) * fVar8 + (this->_velocity).x;
|
|
(this->_velocity).y = (fVar9 + fVar9) * fVar8 + (this->_velocity).y;
|
|
iVar2 = 5;
|
|
}
|
|
else {
|
|
nextCooldown = this->_reverseChariotMoveCooldown + -1;
|
|
iVar2 = 1;
|
|
if (1 < nextCooldown) {
|
|
iVar2 = nextCooldown;
|
|
}
|
|
}
|
|
this->_reverseChariotMoveCooldown = iVar2;
|
|
fVar8 = g_vectorZero.x;
|
|
fVar9 = g_vectorZero.y;
|
|
}
|
|
fVar10 = 0.6;
|
|
if (0 < this->_ponyCharge) {
|
|
vecResult = Vector::ToCardinal(GHIDRA_CAST<Vector *>((local_50 + 0x24)),&this->_movementVector);
|
|
fVar8 = fVar8 + (vecResult->x - fVar8) * fVar10;
|
|
fVar9 = fVar9 + (vecResult->y - fVar9) * fVar10;
|
|
}
|
|
(this->_movementVector).x = fVar8;
|
|
(this->_movementVector).y = fVar9;
|
|
if ((fVar8 != g_vectorZero.x) || (fVar9 != g_vectorZero.y)) {
|
|
(this->_recentMovementVector).x = fVar8;
|
|
(this->_recentMovementVector).y = fVar9;
|
|
}
|
|
this->_moveDirection = -1;
|
|
fVar10 = this->_movespeed * 0.25 + 0.75;
|
|
fVar8 = fVar8 * fVar10;
|
|
fVar10 = fVar10 * fVar9;
|
|
local_68 = fVar10;
|
|
if (ABS(fVar8) <= ABS(fVar10)) {
|
|
if (0.0 <= fVar10) {
|
|
iVar2 = -1;
|
|
if (0.0 < fVar10) {
|
|
this->_moveDirection = 3;
|
|
iVar2 = 3;
|
|
}
|
|
}
|
|
else {
|
|
this->_moveDirection = 1;
|
|
iVar2 = 1;
|
|
}
|
|
}
|
|
else {
|
|
iVar2 = 0;
|
|
if (0.0 <= fVar8) {
|
|
iVar2 = 2;
|
|
}
|
|
this->_moveDirection = iVar2;
|
|
}
|
|
moveX = fVar8;
|
|
if (this->_suplexState == 1) {
|
|
iVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::get_velocity_direction();
|
|
this->_moveDirection = iVar2;
|
|
}
|
|
if (iVar2 != -1) {
|
|
fVar8 = atan2f(fVar10,fVar8);
|
|
fVar8 = LerpAngleDeg(this->_bodyAngle,fVar8 * 57.295776,0.3);
|
|
this->_bodyAngle = fVar8;
|
|
fVar8 = moveX;
|
|
fVar10 = local_68;
|
|
}
|
|
local_60 = (this->_velocity).x;
|
|
local_58 = GHIDRA_CAST<byte *>((this->_velocity).y);
|
|
local_54 = ((float)this->_slipperyTimer - 0.0) / 60.0;
|
|
if ((this->_playerType == 0x23) && (this->_isCoopGhost == 0)) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000000000);
|
|
fVar8 = local_60;
|
|
if (bVar1 == 0) {
|
|
local_64 = local_54 * 0.51 + 0.45;
|
|
}
|
|
else {
|
|
local_64 = 0.97;
|
|
}
|
|
}
|
|
else {
|
|
local_64 = 1.0;
|
|
fVar8 = local_60;
|
|
}
|
|
}
|
|
else {
|
|
fVar9 = *GHIDRA_CAST<float *>(&this->_flags);
|
|
uVar7 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
if ((GHIDRA_UINT(fVar9) & 0x80) != 0) {
|
|
local_54 = 0.0;
|
|
}
|
|
if (((fVar8 != 0.0) || ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = fVar9, fVar10 != 0.0)) &&
|
|
(((GHIDRA_UINT(fVar9) & 0x8000) == 0 || ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = fVar9, this->_canFly != 0)))) {
|
|
local_64 = (this->_velocity).x;
|
|
local_70.y = (float)local_58 * fVar10 + local_64 * fVar8;
|
|
local_60 = fVar8 * local_70.y;
|
|
local_70.y = local_70.y * fVar10;
|
|
fVar8 = sqrtf(local_54 * 0.19999999 + 0.8);
|
|
(this->_velocity).x = (local_64 - local_60) * fVar8 + local_60;
|
|
(this->_velocity).y = ((float)local_58 - local_70.y) * fVar8 + local_70.y;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = *GHIDRA_CAST<undefined4 *>(&this->_flags);
|
|
uVar7 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
fVar8 = moveX;
|
|
}
|
|
local_58 = GHIDRA_CAST<byte *>((this->_velocity).y);
|
|
local_60 = (this->_velocity).x;
|
|
local_64 = 0.0;
|
|
local_70.y = (local_54 * 0.7 - 0.2) * (local_60 * fVar8 + (float)local_58 * local_68);
|
|
pfVar3 = &local_70.y;
|
|
if (local_70.y <= 0.0) {
|
|
pfVar3 = &local_64;
|
|
}
|
|
local_70.y = (*pfVar3 / this->_movespeed + 3.0) * 0.4;
|
|
if ((uVar7 & 0x4000000) == 0) {
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x3f);
|
|
if (((bVar1 == 0) && (this->_suplexState < 2)) &&
|
|
((this->_playerType != 0x23 || (this->_isCoopGhost != 0)))) {
|
|
fVar8 = local_54 * 0.185 + 0.775;
|
|
}
|
|
else {
|
|
fVar8 = local_54 * 0.51 + 0.45;
|
|
}
|
|
}
|
|
else {
|
|
fVar8 = 1.0;
|
|
}
|
|
local_64 = sqrtf(fVar8);
|
|
fVar10 = this->_movespeed * 4.41;
|
|
fVar9 = (local_70.y * 0.25 - local_70.y) * local_54 + local_70.y;
|
|
fVar8 = moveX * 0.5 * fVar9 + local_60;
|
|
local_28 = local_68 * 0.5 * fVar9 + (this->_velocity).y;
|
|
(this->_velocity).y = local_28;
|
|
isSlippery = 0.0 < local_54;
|
|
local_54 = fVar8;
|
|
if ((isSlippery) &&
|
|
(local_70.y = fVar8 * fVar8 + local_28 * local_28, fVar10 * fVar10 < local_70.y)) {
|
|
VStack_1c.y = sqrtf(local_60 * local_60 + (float)local_58 * (float)local_58);
|
|
fVar9 = sqrtf(local_70.y);
|
|
fVar8 = local_54;
|
|
if (0.0 < fVar9) {
|
|
fVar8 = local_54 * (VStack_1c.y / fVar9);
|
|
(this->_velocity).x = fVar8;
|
|
(this->_velocity).y = (VStack_1c.y / fVar9) * local_28;
|
|
}
|
|
}
|
|
}
|
|
flags = this->_flags;
|
|
local_28 = fVar8 * local_64;
|
|
(this->_velocity).x = local_28;
|
|
if (((flags & 0x8000) == 0) || (this->_canFly != 0)) {
|
|
(this->_velocity).y = local_64 * (this->_velocity).y;
|
|
}
|
|
else {
|
|
(this->_velocity).y = (this->_velocity).y + 0.225;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x32);
|
|
if (bVar1 != 0) {
|
|
bVar1 = this->_collidesWithGrid;
|
|
(this->_velocity).x = local_60 * 0.05 + local_28;
|
|
(this->_velocity).y = (float)local_58 * 0.05 + (this->_velocity).y;
|
|
if (bVar1 != 0) {
|
|
fVar8 = (this->_gridCollisionNormal).y;
|
|
fVar9 = (this->_gridCollisionNormal).x;
|
|
fVar10 = (this->_gridCollisionVelocity).y;
|
|
gridVelocityX = (this->_gridCollisionVelocity).x;
|
|
normalDot = fVar9 * gridVelocityX + fVar8 * fVar10;
|
|
fVar9 = fVar9 * normalDot * 0.8;
|
|
fVar8 = fVar8 * normalDot * 0.8;
|
|
(this->_velocity).x = gridVelocityX - (fVar9 + fVar9);
|
|
(this->_velocity).y = fVar10 - (fVar8 + fVar8);
|
|
}
|
|
}
|
|
if ((this->_flags & 0x4000) != 0) goto LAB_0077ae15;
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x5d);
|
|
if (bVar1 != 0) {
|
|
switch(this->_moveDirection) {
|
|
case 0:
|
|
case 1:
|
|
bVar1 = 0x4c;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = 1.12104e-44;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 1.6631262e+22;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x18))) = 7.301531e+31;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x1c))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x1c))) & 0xffffff00;
|
|
local_8 = 1;
|
|
break;
|
|
default:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = 1.26117e-44;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 1.6631262e+22;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x18))) = 4.371238e+24;
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x1c))) = 0x74;
|
|
local_8 = 0;
|
|
bVar1 = extraout_CL;
|
|
}
|
|
local_28 = 2.10195e-44;
|
|
PlayCollectibleAnim(this,0x5d,0,local_50 + 0x14,-1,bVar1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar7 = GHIDRA_INT(local_28) + 1;
|
|
pvVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x14)));
|
|
if (0xfff < uVar7) {
|
|
pvVar5 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4);
|
|
uVar7 = GHIDRA_INT(local_28) + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_0077a500;
|
|
}
|
|
operator_delete(pvVar5,uVar7);
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x12a);
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(299);
|
|
if ((bVar1 == 0) ||
|
|
(pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(299),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 8)) < 1)) {
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x3a);
|
|
if (bVar1 != 0) {
|
|
switch(this->_moveDirection) {
|
|
case 0:
|
|
local_58 = GHIDRA_CAST<byte *>(0xb1da88);
|
|
break;
|
|
case 1:
|
|
local_58 = GHIDRA_CAST<byte *>(&DAT_00b1e020);
|
|
break;
|
|
case 2:
|
|
local_58 = GHIDRA_CAST<byte *>(0xb1dac0);
|
|
break;
|
|
default:
|
|
local_58 = GHIDRA_CAST<byte *>(0xb1e044);
|
|
}
|
|
pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(0x3a);
|
|
blinkAnimName = GHIDRA_CAST<byte *>("Blink");
|
|
if (0x59 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 8))) {
|
|
blinkAnimName = local_58;
|
|
}
|
|
(GHIDRA_CAST<std::string *>((local_50 + 0x14)))->std::string::string_from_cstr(blinkAnimName);
|
|
local_8 = 5;
|
|
PlayCollectibleAnim(this,0x3a,1,local_50 + 0x14,-1,isUnused_02);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar7 = GHIDRA_INT(local_28) + 1;
|
|
pvVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x14)));
|
|
if (0xfff < uVar7) {
|
|
pvVar5 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4);
|
|
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(pvVar5));
|
|
goto joined_r0x0077a7e1;
|
|
}
|
|
goto LAB_0077a7e7;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
switch(this->_moveDirection) {
|
|
case 0:
|
|
headAnimName = "HeadLeft";
|
|
break;
|
|
case 1:
|
|
headAnimName = "HeadUp";
|
|
break;
|
|
case 2:
|
|
headAnimName = "HeadRight";
|
|
break;
|
|
default:
|
|
headAnimName = "HeadDown";
|
|
}
|
|
(GHIDRA_CAST<std::string *>((local_50 + 0x14)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>(headAnimName));
|
|
local_8 = 4;
|
|
PlayCollectibleAnim(this,299,0,local_50 + 0x14,0,isUnused_01);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar7 = GHIDRA_INT(local_28) + 1;
|
|
pvVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x14)));
|
|
if (0xfff < uVar7) {
|
|
pvVar5 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4);
|
|
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(pvVar5));
|
|
goto joined_r0x0077a7e1;
|
|
}
|
|
goto LAB_0077a7e7;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
switch(this->_moveDirection) {
|
|
case 0:
|
|
headAnimName = "HeadLeft";
|
|
break;
|
|
case 1:
|
|
headAnimName = "HeadUp";
|
|
break;
|
|
case 2:
|
|
headAnimName = "HeadRight";
|
|
break;
|
|
default:
|
|
headAnimName = "HeadDown";
|
|
}
|
|
(GHIDRA_CAST<std::string *>((local_50 + 0x14)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>(headAnimName));
|
|
local_8 = 3;
|
|
PlayCollectibleAnim(this,0x12a,0,local_50 + 0x14,-1,isUnused_00);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar7 = GHIDRA_INT(local_28) + 1;
|
|
pvVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x14)));
|
|
if (0xfff < uVar7) {
|
|
pvVar5 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4);
|
|
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(pvVar5));
|
|
goto joined_r0x0077a7e1;
|
|
}
|
|
goto LAB_0077a7e7;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
switch(this->_moveDirection) {
|
|
case 0:
|
|
headAnimName = "HeadLeft";
|
|
break;
|
|
case 1:
|
|
headAnimName = "HeadUp";
|
|
break;
|
|
case 2:
|
|
headAnimName = "HeadRight";
|
|
break;
|
|
default:
|
|
headAnimName = "HeadDown";
|
|
}
|
|
(GHIDRA_CAST<std::string *>((local_50 + 0x14)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>(headAnimName));
|
|
local_8 = 2;
|
|
PlayCollectibleAnim(this,0x4d,0,local_50 + 0x14,-1,isUnused);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar7 = GHIDRA_INT(local_28) + 1;
|
|
pvVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x14)));
|
|
if (0xfff < uVar7) {
|
|
pvVar5 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4);
|
|
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(pvVar5));
|
|
joined_r0x0077a7e1:
|
|
uVar7 = GHIDRA_INT(local_28) + 0x24;
|
|
if (0x1f < uVar4) goto LAB_0077a500;
|
|
}
|
|
LAB_0077a7e7:
|
|
local_8 = 0xffffffff;
|
|
operator_delete(pvVar5,uVar7);
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x139);
|
|
if (bVar1 != 0) {
|
|
local_28 = 2.10195e-44;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = 9.80909e-45;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 4.514758e+27;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x18))) = 1.0505631e-38;
|
|
local_8 = 6;
|
|
PlayCollectibleAnim(this,0x139,1,local_50 + 0x14,-1,isUnused_03);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar7 = GHIDRA_INT(local_28) + 1;
|
|
pvVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x14)));
|
|
if (0xfff < uVar7) {
|
|
pvVar5 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4);
|
|
uVar7 = GHIDRA_INT(local_28) + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
LAB_0077a500:
|
|
local_8 = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar7);
|
|
}
|
|
}
|
|
bVar1 = HasCollectible(this,0x252,0);
|
|
if (bVar1 == 0) {
|
|
this->_jupiterCharge = 0.0;
|
|
}
|
|
else {
|
|
local_54 = this->_jupiterCharge;
|
|
if ((moveX == g_vectorZero.x) && (local_68 == g_vectorZero.y)) {
|
|
fVar8 = (this->_velocity).y;
|
|
fVar9 = (this->_velocity).x;
|
|
if (fVar9 * fVar9 + fVar8 * fVar8 < 1.0) {
|
|
fVar8 = this->_speedMultiplier / 60.0 + local_54;
|
|
if (1.0 <= fVar8) {
|
|
fVar8 = 1.0;
|
|
}
|
|
this->_jupiterCharge = fVar8;
|
|
}
|
|
}
|
|
else {
|
|
local_28 = local_54 - this->_speedMultiplier / 60.0;
|
|
if (local_28 <= 0.0) {
|
|
local_28 = 0.0;
|
|
}
|
|
this->_jupiterCharge = local_28;
|
|
if (0.0 < local_28) {
|
|
local_60 = 2.0;
|
|
iVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar2 != 0) {
|
|
if (0.3 < local_28) {
|
|
uVar7 = Random();
|
|
play_sound_with_fart_seed(0x25,this->_jupiterCharge,(uVar7 & 7) + 5,0,1.0);
|
|
}
|
|
fVar8 = (this->_recentMovementVector).y;
|
|
fVar9 = (this->_recentMovementVector).x;
|
|
if (fVar9 * fVar9 + fVar8 * fVar8 <= 0.01) {
|
|
iVar2 = this->_moveDirection;
|
|
if (iVar2 == -1) {
|
|
iVar2 = 3;
|
|
}
|
|
vecResult = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_1c,iVar2);
|
|
}
|
|
else {
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_recentMovementVector)))->Vector::Normalized(GHIDRA_CAST<Vector *>((local_50 + 0x24)))
|
|
;
|
|
}
|
|
local_68 = -vecResult->x;
|
|
local_58 = GHIDRA_CAST<byte *>((GHIDRA_UINT(vecResult->y) ^ 0x80000000));
|
|
uVar7 = Random();
|
|
uVar4 = Random();
|
|
local_28 = ((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 40.0 - 20.0) * 0.017453292;
|
|
VStack_1c.y = cos(local_28);
|
|
local_28 = sin(local_28);
|
|
uVar4 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 20.0 + 6.0;
|
|
local_70.x = local_68 * 4.0 + (this->_pos).x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = (VStack_1c.y * local_68 - local_28 * (float)local_58) * fVar8;
|
|
local_28 = (local_28 * local_68 + VStack_1c.y * (float)local_58) * fVar8;
|
|
local_70.y = (float)local_58 * 4.0 + (this->_pos).y;
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,99,&local_70,GHIDRA_CAST<Vector *>((local_50 + 0x24)),GHIDRA_CAST<Entity *>(0x0),1,
|
|
uVar7);
|
|
uVar7 = Random();
|
|
fVar9 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 1.5 + 1.0;
|
|
fVar8 = (spawnedEffect->_sprite)._scale.x;
|
|
(spawnedEffect->_sprite)._scale.y = fVar9 * (spawnedEffect->_sprite)._scale.y;
|
|
(spawnedEffect->_sprite)._scale.x = fVar9 * fVar8;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_50))))->Color::Color(0.3,0.42,0.25,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&spawnedEffect->_sprite))))->Sprite::SetColor(color);
|
|
spawnedEffect->Update();
|
|
uVar7 = Random();
|
|
local_28 = ((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 40.0 - 20.0) * 0.017453292;
|
|
VStack_1c.y = cos(local_28);
|
|
local_28 = sin(local_28);
|
|
uVar7 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 10.0 + 10.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = (VStack_1c.y * local_68 - local_28 * (float)local_58) * fVar8;
|
|
local_28 = (local_28 * local_68 + VStack_1c.y * (float)local_58) * fVar8;
|
|
uVar7 = Random();
|
|
uVar4 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0;
|
|
VStack_1c.y = fVar8 * (float)local_58 + (this->_pos).y;
|
|
VStack_1c.x = fVar8 * local_68 + (this->_pos).x;
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x8d,&VStack_1c,GHIDRA_CAST<Vector *>((local_50 + 0x24)),GHIDRA_CAST<Entity *>(this),0,
|
|
uVar7);
|
|
uVar7 = Random();
|
|
iVar2 = uVar7 % 0x1e + 0x3c;
|
|
*GHIDRA_CAST<int *>((spawnedEffect[1]._sprite._filename._buf + 4)) = iVar2;
|
|
*GHIDRA_CAST<int *>((spawnedEffect[1]._sprite._filename._buf + 8)) = iVar2;
|
|
bVar1 = HasTrinket(this,0x86,0);
|
|
if (bVar1 == 0) {
|
|
local_60 = 1.0;
|
|
}
|
|
uVar7 = Random();
|
|
fVar9 = ((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.4 + 0.6) * local_60;
|
|
fVar8 = fVar9 * g_vectorOne.x;
|
|
(spawnedEffect->_sprite)._scale.y = fVar9 * g_vectorOne.y;
|
|
(spawnedEffect->_sprite)._scale.x = fVar8;
|
|
spawnedEffect->SetCollisionDamage(this->_meleeDamage * 0.5);
|
|
spawnedEffect->Update();
|
|
}
|
|
}
|
|
}
|
|
if (this->_jupiterCharge != local_54) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x10;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
LAB_0077ae15:
|
|
bVar1 = HasCollectible(this,0x251,0);
|
|
if ((bVar1 != 0) && (this->_isControlsEnabled != 0)) {
|
|
iVar2 = 0;
|
|
moveActions[0] = 0;
|
|
moveActions[1] = 1;
|
|
VStack_1c.x = 2.8026e-45;
|
|
VStack_1c.y = 4.2039e-45;
|
|
do {
|
|
bVar1 = input_is_action_triggered
|
|
(g_manager,moveActions[iVar2],this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar1 != 0) {
|
|
if ((((this->_marsLastTapDirection == iVar2) && (this->_marsTapFrames < 0xb)) &&
|
|
(bVar1 = HasCollectible(this,0x251,0), bVar1 != 0)) && (this->_marsCooldown < 1)) {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x944 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) &
|
|
0xfffffffcU))) && (fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x944)), fVar8 != 0.0)
|
|
) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x24))) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar8) + 0x78));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x20))) = 0.0;
|
|
local_28 = 0.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x1c))) = fVar8;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(local_50 + 0x1c,0,1);
|
|
}
|
|
this->_marsUnk2 = this->_marsLastTapDirection;
|
|
this->_marsCooldown = this->_marsUnk1;
|
|
this->_marsUnkBool = 0;
|
|
}
|
|
this->_marsLastTapDirection = iVar2;
|
|
this->_marsTapFrames = 0;
|
|
}
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < 4);
|
|
}
|
|
iVar2 = this->_marsTapFrames + 1;
|
|
if (10000 < iVar2) {
|
|
iVar2 = 10000;
|
|
}
|
|
this->_marsTapFrames = iVar2;
|
|
bVar1 = HasTrinket(this,0x6d,0);
|
|
if ((bVar1 == 0) || (iVar2 = GetTrinketMultiplier(this,0x6d), iVar2 < 2)) {
|
|
this->_ductTapeMode = 0;
|
|
}
|
|
else if ((this->_isControlsEnabled != 0) &&
|
|
(bVar1 = input_is_action_triggered(g_manager,0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0),
|
|
bVar1 != 0)) {
|
|
uVar7 = this->_ductTapeMode + 1U & 0x80000003;
|
|
if (GHIDRA_INT(uVar7) < 0) {
|
|
uVar7 = (uVar7 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
this->_ductTapeMode = uVar7;
|
|
if (uVar7 == 0) {
|
|
this->_ductTapeMode = 1;
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0077b020
|
|
void Entity_Player::update_shooting()
|
|
{
|
|
TemporaryEffects *this_00;
|
|
longlong lVar1;
|
|
longlong lVar2;
|
|
Vector direction;
|
|
Vector velocity;
|
|
Vector position;
|
|
Vector position_00;
|
|
ANM2 *pAVar3;
|
|
byte bVar4;
|
|
char cVar5;
|
|
undefined2 uVar6;
|
|
undefined2 extraout_var;
|
|
Vector *pVVar7;
|
|
void *pvVar8;
|
|
uint uVar9;
|
|
Entity *tmpEntity;
|
|
BitSet128 *pBVar10;
|
|
EntityPtr EVar11;
|
|
undefined4 extraout_EAX;
|
|
undefined4 *clampedCharge;
|
|
RNG *rng;
|
|
Vector *pVVar12;
|
|
char *pcVar13;
|
|
ItemConfig *itemConfig;
|
|
ItemConfig_Item *nullItem;
|
|
EntityPtr *tmpEntity;
|
|
Vector *posOffset;
|
|
Entity_Laser *laser;
|
|
Weapon *weapon;
|
|
int *piVar15;
|
|
Entity_Effect *effect;
|
|
ColorMod *entityColor;
|
|
Room *room;
|
|
EntityList *pEVar16;
|
|
Entity_Familiar *this_01;
|
|
Entity_Player *tmpPlayer;
|
|
std_string *animString;
|
|
Vector *other;
|
|
Entity_Tear *tear;
|
|
Vector *posOffset_00;
|
|
Vector *other_00;
|
|
Vector *other_01;
|
|
EntityConfig *this_02;
|
|
EntityConfig_Entity *entityConfigEntry;
|
|
Entity_Knife *knife;
|
|
void *otherTwin;
|
|
Vector *other_02;
|
|
Vector *other_03;
|
|
Vector *vector;
|
|
Vector *vector_00;
|
|
Vector *this_03;
|
|
Vector *vec;
|
|
ColorMod *color;
|
|
Sprite *this_04;
|
|
LayerState *costumeLayer;
|
|
void **ppvVar17;
|
|
int iVar18;
|
|
int iVar19;
|
|
Game *game;
|
|
uint uVar20;
|
|
undefined1 *puVar21;
|
|
bool bVar22;
|
|
float10 fVar23;
|
|
float fVar24;
|
|
EntityPtr EVar25;
|
|
float fVar26;
|
|
float fVar27;
|
|
float fVar28;
|
|
ulonglong uVar29;
|
|
undefined4 uVar30;
|
|
TypeDescriptor *pTVar31;
|
|
TypeDescriptor *pTVar32;
|
|
BitSet128 *pBVar33;
|
|
undefined4 uVar34;
|
|
BitSet128 *pBVar35;
|
|
Vector inheritedVelocity;
|
|
Vector cardinalDirection;
|
|
EntityPtr cleanupFlags;
|
|
Vector local_308;
|
|
Vector local_300;
|
|
void **local_2f8;
|
|
Vector local_2f4;
|
|
Vector local_2ec;
|
|
Vector local_2e4;
|
|
uint local_2dc;
|
|
Vector local_2d8;
|
|
Vector local_2d0;
|
|
byte isOpposingDirections;
|
|
byte isDirectionHeld;
|
|
Vector local_2c4;
|
|
Vector local_2bc;
|
|
EntityPtr local_2b4;
|
|
Vector local_2b0;
|
|
EntityPtr local_2a8;
|
|
Vector shootDirection;
|
|
Vector local_29c;
|
|
Entity_Player *local_294;
|
|
Vector local_290;
|
|
char isInputAllowed;
|
|
byte local_286;
|
|
char local_285;
|
|
EntityPtr local_284;
|
|
byte isShooting;
|
|
TearParams bagTearParams;
|
|
TearParams knifeTearParams;
|
|
Color particleColor;
|
|
TearParams hitParams;
|
|
char overlayAnimName [24];
|
|
char hemoptysisHeadLeft [24];
|
|
char hemoptysisHeadUp [24];
|
|
char hemoptysisHeadRight [24];
|
|
char mawHeadDown [8];
|
|
BitSet128 local_b0;
|
|
char local_a0 [24];
|
|
char mawHeadRight [8];
|
|
EntityList_EL local_80;
|
|
undefined1 local_70 [52];
|
|
undefined1 local_3c [4];
|
|
float fStack_38;
|
|
Vector VStack_34;
|
|
char mawHeadLeft [4];
|
|
int enemyType;
|
|
undefined1 auStack_24 [8];
|
|
float fStack_1c;
|
|
int iStack_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
qword buttBombFlagsHi;
|
|
qword buttBombFlagsLo;
|
|
Manager *manager;
|
|
code *virtualFn;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff3d7;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((auStack_24 + 0x20));
|
|
ExceptionList = &local_10;
|
|
local_29c.y = 0.0;
|
|
cleanupFlags = (EntityPtr)0x0;
|
|
shootDirection.x = g_vectorZero.x;
|
|
shootDirection.y = g_vectorZero.y;
|
|
isShooting = 0;
|
|
isOpposingDirections = 0;
|
|
if (((this->_isControlsEnabled == 0) || (0 < this->_controlsCooldown)) ||
|
|
(isInputAllowed = '\x01', (this->_flags & 0x800) != 0)) {
|
|
isInputAllowed = '\0';
|
|
}
|
|
local_294 = this;
|
|
if ((this->_target != (EntityPtr)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_target) + 0x173)) != '\0')) {
|
|
this->_entityCollisionClass = 4;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
if ((this->_playerType == 0x28) && (this->_itemState == 0)) {
|
|
isInputAllowed = '\0';
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
}
|
|
else if (isInputAllowed != '\0') {
|
|
if ((((this->_isPlayingExtraAnimation == 0) && (this->_isPlayingItemAnimation == 0)) ||
|
|
(bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST<byte *>("LiftItem")), bVar4 != 0)) &&
|
|
((((this->_entityCollisionClass != 0 || (this->_suplexState == 2)) ||
|
|
((this->_isCoopGhost != 0 ||
|
|
(((this->_flags & 0x200000000000000) != 0 ||
|
|
(bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x11a),
|
|
bVar4 != 0)))))) || (bVar4 = IsHologram(this), bVar4 != 0)))) {
|
|
local_286 = '\0';
|
|
local_285 = '\0';
|
|
bVar4 = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4a);
|
|
if ((bVar4 == 0) && (bVar4 = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4b), bVar4 == 0)) {
|
|
bVar4 = input_is_action_pressed(4,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar4 != 0) {
|
|
isShooting = 1;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x1))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = isShooting;
|
|
bVar4 = input_is_action_pressed(5,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar4 != 0) {
|
|
local_285 = '\x01';
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = 1;
|
|
}
|
|
bVar4 = input_is_action_pressed(6,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar4 != 0) {
|
|
local_286 = '\x01';
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = 1;
|
|
}
|
|
iVar19 = this->_controllerIndex;
|
|
iVar18 = 7;
|
|
}
|
|
else {
|
|
bVar4 = input_is_action_pressed(0,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
uVar6 = CONCAT11(isShooting,bVar4);
|
|
if (bVar4 != 0) {
|
|
isShooting = 1;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x1))) = SUB43(CONCAT22(extraout_var,uVar6) >> 8,0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = isShooting;
|
|
bVar4 = input_is_action_pressed(1,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar4 != 0) {
|
|
local_285 = '\x01';
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = 1;
|
|
}
|
|
bVar4 = input_is_action_pressed(2,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar4 != 0) {
|
|
local_286 = '\x01';
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = 1;
|
|
}
|
|
iVar19 = this->_controllerIndex;
|
|
iVar18 = 3;
|
|
}
|
|
bVar4 = input_is_action_pressed(iVar18,iVar19,GHIDRA_CAST<Entity *>(this),0);
|
|
if (((bVar4 != 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = 1, local_286 != '\0')) ||
|
|
((isShooting != 0 && (local_285 != '\0')))) {
|
|
isOpposingDirections = 1;
|
|
}
|
|
bVar4 = GetMouseAimTarget(this,&shootDirection,0);
|
|
if ((bVar4 == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0)) {
|
|
isShooting = 0;
|
|
LAB_0077b373:
|
|
pVVar7 = GetShootingJoystick(this,&local_29c);
|
|
shootDirection.x = shootDirection.x + pVVar7->x;
|
|
shootDirection.y = shootDirection.y + pVVar7->y;
|
|
}
|
|
else {
|
|
isShooting = 1;
|
|
if (bVar4 == 0) goto LAB_0077b373;
|
|
}
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && ((this->_flags & 0x200) != 0)) {
|
|
shootDirection.x = shootDirection.x * -1.0;
|
|
shootDirection.y = shootDirection.y * -1.0;
|
|
}
|
|
if (0.001 < shootDirection.y * shootDirection.y + shootDirection.x * shootDirection.x) {
|
|
uVar29 = GetTimeNs();
|
|
local_2bc.y = (float)(uVar29 >> 0x20);
|
|
lVar1 = (uVar29 & 0xffffffff) * 0x431bde82;
|
|
local_2a8 = SUB84((ulonglong)lVar1 >> 0x20,0);
|
|
local_2f8 = (void **)((ulonglong)GHIDRA_UINT(local_2bc.y) * 0xd7b634db >> 0x20);
|
|
lVar2 = (ulonglong)GHIDRA_UINT(local_2bc.y) * 0x431bde82;
|
|
uVar29 = (ulonglong)GHIDRA_UINT(local_2bc.y) * 0xd7b634db +
|
|
((uVar29 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar20 = GHIDRA_UINT((uVar29 >> 0x20));
|
|
lVar1 = lVar1 + (uVar29 & 0xffffffff);
|
|
local_29c.x = (float)lVar1;
|
|
uVar9 = GHIDRA_UINT(((ulonglong)lVar1 >> 0x20));
|
|
lVar1 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar20,uVar9),uVar20 + uVar9);
|
|
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1f90)))) =
|
|
GHIDRA_UINT(lVar1) >> 0x12 | GHIDRA_INT(((ulonglong)lVar1 >> 0x20)) * 0x4000;
|
|
this = local_294;
|
|
}
|
|
local_2c4.y = (float)((ulonglong)lVar2 >> 0x20);
|
|
local_290.y = (float)lVar2;
|
|
piVar15 = this->_weapons[0];
|
|
if ((piVar15 == GHIDRA_CAST<int *>(0x0)) && (piVar15 = this->_weapons[1], piVar15 == GHIDRA_CAST<int *>(0x0)))
|
|
goto LAB_0077b57e;
|
|
fVar23 = (float10)(**(code **)(*piVar15 + 0x18))();
|
|
local_2f8 = (void **)(float)fVar23;
|
|
if ((0.0 < (float)local_2f8) && ((0.0 < (float)piVar15[5] && (isOpposingDirections == 0)))) {
|
|
fVar24 = sqrtf(shootDirection.y * shootDirection.y + shootDirection.x * shootDirection.x);
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
if (fVar24 < 0.5) {
|
|
shootDirection.x = g_vectorZero.x;
|
|
shootDirection.y = g_vectorZero.y;
|
|
isShooting = 0;
|
|
goto LAB_0077b57e;
|
|
}
|
|
}
|
|
}
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
}
|
|
LAB_0077b57e:
|
|
local_2c4.y = (float)((ulonglong)lVar2 >> 0x20);
|
|
local_290.y = (float)lVar2;
|
|
if ((this->_variant == 1) && (this->_babySkin == 7)) {
|
|
if (shootDirection.x < 0.0) {
|
|
fVar27 = -shootDirection.x * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1af8))));
|
|
fVar24 = -shootDirection.x * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1afc))));
|
|
}
|
|
else {
|
|
fVar27 = shootDirection.x * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1af0))));
|
|
fVar24 = shootDirection.x * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1af4))));
|
|
}
|
|
if (shootDirection.y < 0.0) {
|
|
fVar28 = -shootDirection.y * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b08))));
|
|
fVar26 = -shootDirection.y * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b0c))));
|
|
}
|
|
else {
|
|
fVar28 = shootDirection.y * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b00))));
|
|
fVar26 = shootDirection.y * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b04))));
|
|
}
|
|
shootDirection.x = fVar27 + 0.0 + fVar28;
|
|
shootDirection.y = fVar24 + 0.0 + fVar26;
|
|
}
|
|
local_2ec.y = shootDirection.y;
|
|
local_284 = (EntityPtr)shootDirection.x;
|
|
local_286 = 0;
|
|
if (0 < this->_peeBurstCooldown) {
|
|
if (this->_peeBurstCooldown < this->_maxPeeBurstCooldown + -5) {
|
|
isShooting = 1;
|
|
local_286 = 1;
|
|
if ((shootDirection.x == g_vectorZero.x) && (shootDirection.y == g_vectorZero.y)) {
|
|
shootDirection.x = (this->_lastDirection).x;
|
|
shootDirection.y = (this->_lastDirection).y;
|
|
}
|
|
if ((shootDirection.x == g_vectorZero.x) && (shootDirection.y == g_vectorZero.y)) {
|
|
pVVar7 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_29c,this->_headDirection);
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
shootDirection.x = pVVar7->x;
|
|
shootDirection.y = pVVar7->y;
|
|
}
|
|
}
|
|
local_2c4.y = (float)((ulonglong)lVar2 >> 0x20);
|
|
local_290.y = (float)lVar2;
|
|
if ((this->_flags & 0x4000) == 0) {
|
|
this->_peeBurstCooldown = this->_peeBurstCooldown + -1;
|
|
this->_cacheFlags = this->_cacheFlags | 2;
|
|
EvaluateItems(this);
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
}
|
|
this->_blinkTime = 8;
|
|
}
|
|
local_2c4.y = (float)((ulonglong)lVar2 >> 0x20);
|
|
local_290.y = (float)lVar2;
|
|
if ((((this->_isPlayingExtraAnimation != 0) || (this->_isPlayingItemAnimation != 0)) &&
|
|
(this->_heldEntity != (void *)0x0)) &&
|
|
((this->_itemState != 0x25c && (this->_itemState != 0x2c5)))) {
|
|
local_29c.x = (this->_velocity).x * 0.1;
|
|
local_29c.y = (this->_velocity).y * 0.1;
|
|
ThrowHeldEntity(this,&local_29c);
|
|
lVar2 = CONCAT44(local_2c4.y,local_290.y);
|
|
}
|
|
local_2c4.y = (float)((ulonglong)lVar2 >> 0x20);
|
|
local_290.y = (float)lVar2;
|
|
this_00 = &this->_temporaryeffects;
|
|
local_2e4.y = (float)this_00;
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((this_00)))->TemporaryEffects::HasCollectibleEffect(0x5d);
|
|
if (((bVar4 != 0) || (bVar4 = (GHIDRA_CAST<TemporaryEffects *>((this_00)))->TemporaryEffects::HasCollectibleEffect(0x4d), bVar4 != 0))
|
|
|| ((bVar4 = (GHIDRA_CAST<TemporaryEffects *>((this_00)))->TemporaryEffects::HasCollectibleEffect(0x12a), bVar4 != 0 ||
|
|
(((bVar4 = (GHIDRA_CAST<TemporaryEffects *>((this_00)))->TemporaryEffects::HasCollectibleEffect(299), bVar4 != 0 &&
|
|
(pvVar8 = (GHIDRA_CAST<TemporaryEffects *>((this_00)))->TemporaryEffects::GetCollectibleEffect(299),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 8)) != 0)) || (0 < this->_fireBlockCooldown)))))) {
|
|
shootDirection.x = g_vectorZero.x;
|
|
shootDirection.y = g_vectorZero.y;
|
|
isShooting = 0;
|
|
local_286 = 0;
|
|
}
|
|
iVar19 = this->_itemStateCooldown;
|
|
if (iVar19 < 1) {
|
|
LAB_0077b892:
|
|
if (iVar19 != 0) goto LAB_0077b894;
|
|
}
|
|
else {
|
|
if ((this->_flags & 0x4000) == 0) {
|
|
iVar19 = iVar19 + -1;
|
|
this->_itemStateCooldown = iVar19;
|
|
if (iVar19 < 1) {
|
|
cVar5 = FUN_00730910();
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<TemporaryEffects *>((this_00)))->TemporaryEffects::RemoveCollectibleEffect(this->_itemState,1);
|
|
TryRemoveCollectibleCostume(this,this->_itemState,0);
|
|
}
|
|
ResetItemState(this);
|
|
iVar19 = this->_itemStateCooldown;
|
|
goto LAB_0077b892;
|
|
}
|
|
}
|
|
LAB_0077b894:
|
|
shootDirection.x = g_vectorZero.x;
|
|
shootDirection.y = g_vectorZero.y;
|
|
}
|
|
local_2dc = 0;
|
|
if (iVar19 == 0) {
|
|
local_2dc = GHIDRA_UINT(local_286);
|
|
}
|
|
local_2bc.y = (float)GHIDRA_CAST<Entity *>(0x0);
|
|
if (iVar19 == 0) {
|
|
local_2bc.y = (float)GHIDRA_UINT(isShooting);
|
|
}
|
|
if ((shootDirection.x == 0.0) && (shootDirection.y == 0.0)) {
|
|
isDirectionHeld = 0;
|
|
if (SUB41(local_2bc.y,0) != '\0') {
|
|
shootDirection.x = (float)(GHIDRA_UINT((this->_lastDirection).x) ^ 0x80000000);
|
|
shootDirection.y = (float)(GHIDRA_UINT((this->_lastDirection).y) ^ 0x80000000);
|
|
}
|
|
}
|
|
else {
|
|
isDirectionHeld = 1;
|
|
}
|
|
if ((shootDirection.x != 0.0) || (local_286 = '\0', shootDirection.y != 0.0)) {
|
|
local_286 = '\x01';
|
|
}
|
|
if ((this->_isCoopGhost == 0) && (this->_canShoot == 0)) {
|
|
isShooting = 0;
|
|
}
|
|
else {
|
|
isShooting = 1;
|
|
}
|
|
EVar11 = (EntityPtr)this->_suplexState;
|
|
local_2f8 = this->_weapons + 1;
|
|
local_2d0.y = 0.0;
|
|
local_308.x = shootDirection.x;
|
|
local_308.y = shootDirection.y;
|
|
local_2b4 = EVar11;
|
|
if (*local_2f8 != GHIDRA_CAST<int *>(0x0)) {
|
|
local_2d0.y = (float)(**(code **)(*GHIDRA_CAST<int *>(*local_2f8) + 0x30))();
|
|
}
|
|
piVar15 = this->_markedTarget;
|
|
if (EVar11 == (EntityPtr)0x2) {
|
|
local_2d0.y = 4.2039e-44;
|
|
LAB_0077b9dc:
|
|
if (((piVar15 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(bVar4 = input_is_action_triggered(g_manager,0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0),
|
|
bVar4 != 0)) && (local_2b4 != (EntityPtr)0x2)) {
|
|
ppvVar17 = &this->_markedTarget;
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_markedTarget) + 0x28))();
|
|
if (*ppvVar17 != (void *)0x0) {
|
|
local_2a8 = (EntityPtr)ppvVar17;
|
|
std::multiset<unsigned_int>::erase(&local_2a8);
|
|
}
|
|
*ppvVar17 = (void *)0x0;
|
|
}
|
|
if ((this->_flags & 0x4000) == 0) {
|
|
piVar15 = this->_markedTarget;
|
|
ppvVar17 = &this->_markedTarget;
|
|
if (piVar15 != GHIDRA_CAST<int *>(0x0)) {
|
|
if (GHIDRA_CAST<Entity *>(piVar15[0xb]) == GHIDRA_CAST<Entity *>(local_2d0.y)) goto LAB_0077bba3;
|
|
(**(code **)(*piVar15 + 0x28))();
|
|
if (*ppvVar17 != (void *)0x0) {
|
|
local_2a8 = (EntityPtr)ppvVar17;
|
|
std::multiset<unsigned_int>::erase(&local_2a8);
|
|
}
|
|
*ppvVar17 = (void *)0x0;
|
|
}
|
|
if ((((float)local_284 != g_vectorZero.x) || (local_2ec.y != g_vectorZero.y)) ||
|
|
(local_2b4 == (EntityPtr)0x2)) {
|
|
uVar9 = Random();
|
|
local_29c.x = (float)local_284 * 5.0 + (this->_pos).x;
|
|
local_29c.y = local_2ec.y * 5.0 + (this->_pos).y;
|
|
local_2d0.y = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,GHIDRA_UINT(local_2d0.y),&local_29c,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
if ((GHIDRA_CAST<Entity *>(local_2d0.y) == GHIDRA_CAST<Entity *>(0x0)) || ((GHIDRA_CAST<Entity *>(local_2d0.y))->_type != 1000)) {
|
|
local_2d0.y = 0.0;
|
|
}
|
|
pAVar3 = &(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_2d0.y) + 0x410)))->_sprite;
|
|
(pAVar3->_filename)._buf[4] = '\0';
|
|
(pAVar3->_filename)._buf[5] = '\0';
|
|
(pAVar3->_filename)._buf[6] = '\0';
|
|
(pAVar3->_filename)._buf[7] = '\0';
|
|
pAVar3 = &(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_2d0.y) + 0x410)))->_sprite;
|
|
(pAVar3->_filename)._buf[8] = '\0';
|
|
(pAVar3->_filename)._buf[9] = '\0';
|
|
(pAVar3->_filename)._buf[10] = '\0';
|
|
(pAVar3->_filename)._buf[0xb] = '\0';
|
|
if (*ppvVar17 != (void *)0x0) {
|
|
local_2a8 = (EntityPtr)ppvVar17;
|
|
std::multiset<unsigned_int>::erase(&local_2a8);
|
|
}
|
|
*ppvVar17 = (void *)local_2d0.y;
|
|
std::multiset<unsigned_int>::insert(ppvVar17);
|
|
}
|
|
}
|
|
LAB_0077bba3:
|
|
EVar11 = local_2b4;
|
|
bVar4 = SUB41(local_2bc.y,0);
|
|
pvVar8 = this->_markedTarget;
|
|
local_285 = (char)local_2dc;
|
|
if ((pvVar8 != (void *)0x0) && ((this->_itemState == 0 || (local_2b4 == (EntityPtr)0x2)))) {
|
|
if (bVar4 != 0) {
|
|
local_29c.x = (float)local_284;
|
|
local_29c.y = local_2ec.y;
|
|
if (1.0 < local_2ec.y * local_2ec.y + (float)local_284 * (float)local_284) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = bVar4;
|
|
(GHIDRA_CAST<Vector *>((&local_29c)))->Vector::Normalize();
|
|
pvVar8 = this->_markedTarget;
|
|
bVar4 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0)));
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = bVar4;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x360)) = local_29c.x * 8.0 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x360));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x364)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x364)) + local_29c.y * 8.0;
|
|
bVar4 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0)));
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = bVar4;
|
|
if (EVar11 == (EntityPtr)0x2) {
|
|
local_290.y = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_markedTarget) + 0x340));
|
|
local_2a8 = (EntityPtr)((this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_markedTarget) + 0x33c)));
|
|
fVar24 = sqrtf(local_290.y * local_290.y + (float)local_2a8 * (float)local_2a8);
|
|
if (60.0 < fVar24) {
|
|
pvVar8 = this->_markedTarget;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x360)) =
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x360)) + ((float)local_2a8 / fVar24) * (fVar24 - 60.0) * 0.1
|
|
;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x364)) =
|
|
(fVar24 - 60.0) * (local_290.y / fVar24) * 0.1 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x364));
|
|
}
|
|
}
|
|
bVar4 = HasCollectible(this,0xd2,0);
|
|
if (bVar4 != 0) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2bc.y)) + 0x0)));
|
|
local_285 = (char)local_2dc;
|
|
bVar4 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0)));
|
|
if (this->_mass == 1000.0) goto LAB_0077be15;
|
|
}
|
|
local_285 = '\x01';
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = 1;
|
|
goto LAB_0077be0f;
|
|
}
|
|
}
|
|
else {
|
|
if (GHIDRA_CAST<Entity *>(local_2d0.y) != GHIDRA_CAST<Entity *>(0x0)) goto LAB_0077b9dc;
|
|
bVar4 = SUB41(local_2bc.y,0);
|
|
local_285 = (char)local_2dc;
|
|
if (piVar15 == GHIDRA_CAST<int *>(0x0)) goto LAB_0077be15;
|
|
if ((this->_flags & 0x4000) != 0) {
|
|
goto LAB_0077be15;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = bVar4;
|
|
(**(code **)(*piVar15 + 0x28))();
|
|
if (this->_markedTarget != (void *)0x0) {
|
|
local_2a8 = (EntityPtr)&this->_markedTarget;
|
|
std::multiset<unsigned_int>::erase(&local_2a8);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2bc.y)) + 0x0)));
|
|
local_285 = (char)local_2dc;
|
|
this->_markedTarget = (void *)0x0;
|
|
LAB_0077be0f:
|
|
bVar4 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0)));
|
|
}
|
|
LAB_0077be15:
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) = bVar4;
|
|
bVar4 = HasCollectible(this,0x17a,0);
|
|
game = g_game;
|
|
if ((((bVar4 != 0) && (*GHIDRA_CAST<int *>(&g_game->_stageTransition) == 0)) && (isInputAllowed != '\0')) &&
|
|
(this->_fireBlockCooldown < 1)) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18b8)))) = 0;
|
|
}
|
|
else {
|
|
iVar19 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18b8)))) + 1;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18b8)))) = iVar19;
|
|
if (iVar19 == 0x96) {
|
|
GetBombFlags(this,GHIDRA_CAST<BitSet128 *>(local_3c),0);
|
|
uVar9 = Random();
|
|
local_29c.x = (this->_velocity).x * 0.1;
|
|
local_29c.y = (this->_velocity).y * 0.1;
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,9,&this->_pos,&local_29c,GHIDRA_CAST<Entity *>(local_294),0,uVar9);
|
|
iVar19 = __RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34);
|
|
pBVar10 = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>(auStack_24),GHIDRA_CAST<BitSet128 *>(local_3c),&g_tearFlagButtBomb);
|
|
local_2bc.y = 5.1848e-44;
|
|
buttBombFlagsLo = pBVar10->_l;
|
|
uVar30 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar10->_l) + 4));
|
|
buttBombFlagsHi = pBVar10->_h;
|
|
uVar34 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar10->_h) + 4));
|
|
*GHIDRA_CAST<undefined1 *>((iVar19 + 0x463)) = 1;
|
|
*GHIDRA_CAST<int *>((iVar19 + 0x438)) = GHIDRA_INT(buttBombFlagsLo);
|
|
*GHIDRA_CAST<undefined4 *>((iVar19 + 0x43c)) = uVar30;
|
|
*GHIDRA_CAST<int *>((iVar19 + 0x440)) = GHIDRA_INT(buttBombFlagsHi);
|
|
*GHIDRA_CAST<undefined4 *>((iVar19 + 0x444)) = uVar34;
|
|
manager = g_manager;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_2bc.y));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_2bc.y),1.0,2,0,1.0,0.0);
|
|
uVar9 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x22,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar9);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x3c);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::SetTint(1.8,0.7,1.5,1.0);
|
|
(*virtualFn)(local_70,0xffffffff,0xff,0,1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
this = local_294;
|
|
ShootCandle(local_294,&g_vectorZero);
|
|
game = g_game;
|
|
}
|
|
}
|
|
}
|
|
if ((game->_dailyChallenge)._specialDailyId == 0x29) {
|
|
if (*GHIDRA_CAST<int *>(&game->_stageTransition) == 0) {
|
|
if ((isInputAllowed != '\0') && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) != 0)) {
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar4 != 0) && (uVar9 = Random(), (uVar9 & 3) == 0)) {
|
|
Game::ButterBeanFart(g_game,&this->_pos,120.0,GHIDRA_CAST<Entity *>(this),1,0);
|
|
}
|
|
game = g_game;
|
|
}
|
|
goto LAB_0077c05c;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0077c05c:
|
|
if (((*GHIDRA_CAST<int *>(&game->_stageTransition) == 0) && (isInputAllowed != '\0')) &&
|
|
(this->_fireBlockCooldown < 1)) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18f0)))) = 0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18f0)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18f0)))) + 1;
|
|
}
|
|
}
|
|
}
|
|
tmpPlayer = local_294;
|
|
if ((0 < this->_megaBlastDuration) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f00)))) != 0)) {
|
|
isShooting = 0;
|
|
}
|
|
iVar19 = this->_fireBlockCooldown;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(EVar11)) + 0x1))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(EVar11)) + 0x0))) = isShooting;
|
|
local_2b4 = (EntityPtr)0xf;
|
|
local_2a8 = (EntityPtr)0x0;
|
|
if (iVar19 < 1) {
|
|
local_2a8 = EVar11;
|
|
}
|
|
isShooting = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2a8)) + 0x0)));
|
|
if (((this->_isUrethraBlocked != 0) && (iVar19 < 1)) && (isInputAllowed != '\0')) {
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) ||
|
|
((local_285 != '\0' && (this->_maxBladderCharge <= this->_bladderCharge)))) {
|
|
if ((*GHIDRA_CAST<char *>(game->_room) != '\0') &&
|
|
(5 < game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x11f0)))) {
|
|
if (this->_maxBladderCharge <= this->_bladderCharge) {
|
|
TryForgottenThrow(local_294,&this->_lastDirection);
|
|
game = g_game;
|
|
tmpPlayer->_isUrethraBlocked = 0;
|
|
tmpPlayer->_blinkTime = 10;
|
|
iVar19 = game->_frameCount;
|
|
uVar9 = Random();
|
|
local_294->_maxPeeBurstCooldown = 0xb4;
|
|
local_294->_peeBurstCooldown = 0xb4;
|
|
local_294->_nextUrethraBlockFrame = iVar19 + (uVar9 % GHIDRA_UINT(local_2b4) + 0xf) * 0x1e;
|
|
local_29c.y = (this->_lastDirection).y * 15.0 * local_294->_shotspeed;
|
|
local_29c.x = (this->_lastDirection).x * 15.0 * local_294->_shotspeed;
|
|
velocity.y = local_29c.y;
|
|
velocity.x = local_29c.x;
|
|
tear = FireTear(local_294,&local_294->_pos,velocity,0x45,GHIDRA_CAST<Entity *>(0x0),1.0);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ChangeVariant(0x16);
|
|
tear->SetCollisionDamage(tear->_collisionDamage * 10.0);
|
|
local_2a8 = (EntityPtr)tear->_fScale;
|
|
uVar9 = Random();
|
|
local_290.y = 0.01;
|
|
local_2a8 = (EntityPtr)
|
|
(((float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)])
|
|
* 2.3283064e-10 * 0.3 + 1.2) * (float)local_2a8);
|
|
tmpEntity = &local_2a8;
|
|
if ((float)local_2a8 <= 0.01) {
|
|
tmpEntity = GHIDRA_CAST<EntityPtr *>(&local_290.y);
|
|
}
|
|
EVar11 = *tmpEntity;
|
|
tear->_baseScale = (float)EVar11;
|
|
tear->_fScale = (float)EVar11;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
local_3c = *(undefined1 (*) [4])&(tear->_tearFlags)._l;
|
|
fStack_38 = *GHIDRA_CAST<float *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4));
|
|
VStack_34.x = *GHIDRA_CAST<float *>(&(tear->_tearFlags)._h);
|
|
VStack_34.y = *GHIDRA_CAST<float *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4));
|
|
pBVar33 = &g_tearFlagSpectral;
|
|
pBVar10 = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>(auStack_24),GHIDRA_CAST<BitSet128 *>(local_3c),&g_tearFlagPiercing);
|
|
pBVar10 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(&local_80),pBVar10,pBVar33);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*pBVar10);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::set_falling_accel(0.0);
|
|
FUN_00444c70(0xc0400000);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight(-10.0);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(tear) + 0x3c);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::Color();
|
|
(*virtualFn)(extraout_EAX,0xffffffff,0xff,0,1);
|
|
tear->Update();
|
|
this = local_294;
|
|
}
|
|
this->_bladderCharge = 0;
|
|
}
|
|
}
|
|
else if (this->_bladderCharge < this->_maxBladderCharge) {
|
|
this->_bladderCharge = this->_bladderCharge + 1;
|
|
}
|
|
iVar19 = this->_fireBlockCooldown;
|
|
isShooting = '\0';
|
|
}
|
|
if (this->_ibsCharge < 1.0) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a8))) = 1;
|
|
LAB_0077c4aa:
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a4)))) = 0;
|
|
}
|
|
else if (((iVar19 < 1) && (isInputAllowed != '\0')) && (this->_itemState == 0)) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) {
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at(0x2d5));
|
|
uVar9 = (GHIDRA_CAST<RNG *>((rng)))->RNG::RandomInt(0xb);
|
|
UsePoopSpell(this,uVar9 + 1);
|
|
this->_ibsCharge = (float)&DAT_bf800000;
|
|
goto LAB_0077c4aa;
|
|
}
|
|
local_2a8 = (EntityPtr)(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a4)))) + 0.033333335);
|
|
local_290.y = 1.0;
|
|
clampedCharge = GHIDRA_CAST<undefined4 *>(std)::min<float>();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a4)))) = *clampedCharge;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a8))) != '\0') {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20a8))) = 0;
|
|
SoundEffects::PlayWithFartOverride(0x360,1.0,2,0,1.0);
|
|
}
|
|
}
|
|
if (this->_headDirectionTime < 0) {
|
|
tmpEntity = GetFocusEntity(this);
|
|
local_2bc.y = (float)tmpEntity;
|
|
if (tmpEntity != GHIDRA_CAST<Entity *>(0x0)) {
|
|
FUN_004172b0(&local_29c);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 != 0) {
|
|
pVVar7 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::Position(&local_2b0);
|
|
pVVar12 = GHIDRA_CAST<Vector *>(FUN_004172b0(&local_290));
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(&local_2c4,pVVar12);
|
|
local_2a8 = (EntityPtr)0x3f000000;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__mul(&local_2d0,GHIDRA_CAST<float *>(&local_2a8));
|
|
(GHIDRA_CAST<Vector *>((&local_29c)))->Vector::operator_assign(pVVar7);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_2bc.y);
|
|
}
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_29c)))->Vector::__sub(&local_2b0,&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&local_308)))->Vector::operator_assign(pVVar7);
|
|
if ((tmpEntity == this->_markedTarget) && (this->_itemState == 0)) {
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::operator_assign(&local_308);
|
|
isDirectionHeld = (GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::operator_ne(&g_vectorZero);
|
|
}
|
|
}
|
|
if ((local_308.x != 0.0) || (local_308.y != 0.0)) {
|
|
EVar11 = (EntityPtr)local_308.x;
|
|
Math::abs();
|
|
EVar25 = (EntityPtr)local_308.y;
|
|
local_2a8 = EVar11;
|
|
Math::abs();
|
|
if ((float)local_2a8 <= (float)EVar25) {
|
|
if (0.0 <= local_308.y) {
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),"HeadDown");
|
|
this->_headDirection = 3;
|
|
}
|
|
else {
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),"HeadUp");
|
|
this->_headDirection = 1;
|
|
}
|
|
}
|
|
else {
|
|
if (0.0 <= local_308.x) {
|
|
local_2bc.y = 2.8026e-45;
|
|
pcVar13 = "HeadRight";
|
|
}
|
|
else {
|
|
local_2bc.y = 0.0;
|
|
pcVar13 = "HeadLeft";
|
|
}
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),pcVar13);
|
|
this->_headDirection = GHIDRA_INT(local_2bc.y);
|
|
}
|
|
}
|
|
}
|
|
if (this->_fireBlockCooldown < 1) {
|
|
this->_fireDirection = -1;
|
|
EVar25 = (EntityPtr)shootDirection.y;
|
|
Math::abs();
|
|
EVar11 = (EntityPtr)shootDirection.x;
|
|
local_2a8 = EVar25;
|
|
Math::abs();
|
|
if (0.01 < (float)local_2a8 + (float)EVar11) {
|
|
iVar19 = vector_to_direction(&shootDirection);
|
|
this->_fireDirection = iVar19;
|
|
}
|
|
}
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
FUN_00428b50();
|
|
cVar5 = FUN_0082ee30();
|
|
if ((cVar5 == '\0') && (isInputAllowed != '\0')) {
|
|
bVar4 = HasCollectible(this,399,0);
|
|
if (bVar4 != 0) {
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) ||
|
|
((local_285 != '\0' && (0x96 < this->_mawOfTheVoidChargeTimer)))) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar19 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (5 < iVar19) {
|
|
if (0x96 < this->_mawOfTheVoidChargeTimer) {
|
|
laser = SpawnMawOfVoid(this,0x3c);
|
|
laser->Update();
|
|
if (local_285 == '\0') {
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
this->_fireBlockCooldown = *piVar15;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
nullItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x13);
|
|
RemoveCostume(this,nullItem);
|
|
(GHIDRA_CAST<std::string *>((mawHeadDown)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadDownShoot"));
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<std::string *>((mawHeadRight)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadRightShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<std::string *>((local_70 + 0x2c)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadUpShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<std::string *>((mawHeadLeft)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadLeftShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
pVVar7 = Vector::ToCardinal(&local_29c,&this->_lastDirection);
|
|
pvVar8 = string_from_direction
|
|
(local_a0,*pVVar7,mawHeadLeft,local_70 + 0x2c,mawHeadRight,
|
|
mawHeadDown);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
PlayCollectibleAnim(this,399,0,pvVar8,-1,0);
|
|
(GHIDRA_CAST<std::string *>((local_a0)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((mawHeadLeft)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((local_70 + 0x2c)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((mawHeadRight)))->std::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((mawHeadDown)))->std::string::_Tidy_deallocate();
|
|
this->_fireDirection = -1;
|
|
}
|
|
this->_mawOfTheVoidChargeTimer = 0;
|
|
}
|
|
}
|
|
else {
|
|
this->_mawOfTheVoidChargeTimer = this->_mawOfTheVoidChargeTimer + 1;
|
|
if (this->_mawOfTheVoidChargeTimer == 0x96) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar4 = 0;
|
|
nullItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x13);
|
|
AddCostume(this,nullItem,bVar4);
|
|
}
|
|
}
|
|
}
|
|
bVar4 = HasCollectible(this,0x283,0);
|
|
if (bVar4 != 0) {
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) || ((local_285 != '\0' && (0x96 < this->_revelationChargeTimer)))
|
|
) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar19 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (5 < iVar19) {
|
|
if (0x96 < this->_revelationChargeTimer) {
|
|
tmpEntity = GHIDRA_CAST<EntityPtr *>(FUN_00753940());
|
|
local_29c.x = *GHIDRA_CAST<float *>(tmpEntity);
|
|
local_29c.y = *GHIDRA_CAST<float *>((tmpEntity + 1));
|
|
GetLaserOffset(this,&local_2b0,4,&local_29c);
|
|
local_2a8 = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_29c)))->Vector::GetAngleDegrees();
|
|
laser = Entity_Laser::ShootAngle
|
|
(5,&this->_pos,(float)local_2a8,0x1e,posOffset,GHIDRA_CAST<Entity *>(this),0);
|
|
laser->SetCollisionDamage(this->_meleeDamage);
|
|
FUN_00456830(GHIDRA_INT((this->_tearFlags)._l),
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)),
|
|
GHIDRA_INT((this->_tearFlags)._h),
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)));
|
|
if (local_308.y <= -0.5) {
|
|
fVar24 = -10.0;
|
|
}
|
|
else {
|
|
fVar24 = 3000.0;
|
|
}
|
|
set_field_358(laser,fVar24);
|
|
if (local_285 == '\0') {
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
this->_fireBlockCooldown = *piVar15;
|
|
}
|
|
this->_fireDirection = -1;
|
|
}
|
|
this->_revelationChargeTimer = 0;
|
|
}
|
|
}
|
|
else {
|
|
this->_revelationChargeTimer = this->_revelationChargeTimer + 1;
|
|
}
|
|
}
|
|
bVar4 = HasCollectible(this,0x2a8,0);
|
|
if (bVar4 != 0) {
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) || ((local_285 != '\0' && (0x96 < this->_montezumaChargeTimer))))
|
|
{
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar19 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (5 < iVar19) {
|
|
if (0x96 < this->_montezumaChargeTimer) {
|
|
Vector::FromAngle(&local_2b0,this->_bodyAngle + 180.0);
|
|
GetLaserOffset(this,&local_29c,-1,&local_2b0);
|
|
local_29c.y = local_29c.y - (this->_bodyScale).y * 4.0;
|
|
laser = Entity_Laser::ShootAngle
|
|
(0xc,&this->_pos,this->_bodyAngle + 180.0,0x1e,&local_29c,
|
|
GHIDRA_CAST<Entity *>(this),0);
|
|
laser->SetCollisionDamage(this->_meleeDamage);
|
|
pBVar10 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagWait)))->BitSet128::__bnot(GHIDRA_CAST<BitSet128 *>(auStack_24));
|
|
pBVar10 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(local_3c),&this->_tearFlags,pBVar10);
|
|
FUN_00456830(GHIDRA_INT(pBVar10->_l),*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar10->_l) + 4)),GHIDRA_INT(pBVar10->_h),
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar10->_h) + 4)));
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::SetMaxDistance(120.0);
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&this->_montezumaLaser))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(laser));
|
|
if (local_2b0.y <= -0.5) {
|
|
fVar24 = -10.0;
|
|
}
|
|
else {
|
|
fVar24 = 3000.0;
|
|
}
|
|
set_field_358(laser,fVar24);
|
|
if (local_285 == '\0') {
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
this->_fireBlockCooldown = *piVar15;
|
|
}
|
|
this->_fireDirection = -1;
|
|
}
|
|
this->_montezumaChargeTimer = 0;
|
|
}
|
|
}
|
|
else {
|
|
this->_montezumaChargeTimer = this->_montezumaChargeTimer + 1;
|
|
}
|
|
}
|
|
if ((this->_playerType == 0x1a) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar4 == 0)) {
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) || (cVar5 = FUN_007dac30(), cVar5 == '\0')) {
|
|
this->_eveSumptoriumCharge = 0;
|
|
}
|
|
else {
|
|
this->_eveSumptoriumCharge = this->_eveSumptoriumCharge + 1;
|
|
if (0x3b < this->_eveSumptoriumCharge) {
|
|
this->_eveSumptoriumCharge = 0;
|
|
SpawnClot(this,&this->_pos,0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_2d0.y = (float)GetWeaponModifiers(this);
|
|
if (this->_itemState == 0x2f) {
|
|
if (this->_weapons[0] != GHIDRA_CAST<Entity *>(0x0)) {
|
|
iVar19 = (GHIDRA_CAST<Entity *>((this->_weapons[0])))->Entity::SubType();
|
|
if (iVar19 == 6) goto LAB_0077cde3;
|
|
if (this->_weapons[0] != (void *)0x0) {
|
|
Isaac::DestoryWeapon(this->_weapons);
|
|
}
|
|
}
|
|
weapon = Isaac::CreateWeapon(6,GHIDRA_CAST<Entity *>(this));
|
|
this->_weapons[0] = weapon;
|
|
}
|
|
else {
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x93);
|
|
if (bVar4 == 0) {
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x280);
|
|
pvVar8 = this->_weapons[0];
|
|
if (bVar4 == 0) {
|
|
if (this->_playerType != 0x20) {
|
|
if (pvVar8 != (void *)0x0) {
|
|
Isaac::DestoryWeapon(this->_weapons);
|
|
}
|
|
goto LAB_0077cde3;
|
|
}
|
|
if (pvVar8 == (void *)0x0) {
|
|
LAB_0077cdbc:
|
|
weapon = Isaac::CreateWeapon(GHIDRA_INT(local_2b4),GHIDRA_CAST<Entity *>(this));
|
|
this->_weapons[0] = weapon;
|
|
}
|
|
else {
|
|
iVar19 = (GHIDRA_CAST<Entity *>(()))->Entity::SubType();
|
|
if (iVar19 != 0xf) {
|
|
if (this->_weapons[0] != (void *)0x0) {
|
|
Isaac::DestoryWeapon(this->_weapons);
|
|
}
|
|
goto LAB_0077cdbc;
|
|
}
|
|
}
|
|
isShooting = '\x01';
|
|
}
|
|
else {
|
|
if (pvVar8 != (void *)0x0) {
|
|
iVar19 = (GHIDRA_CAST<Entity *>(()))->Entity::SubType();
|
|
if (iVar19 == 0xc) goto LAB_0077cd7e;
|
|
if (this->_weapons[0] != (void *)0x0) {
|
|
Isaac::DestoryWeapon(this->_weapons);
|
|
}
|
|
}
|
|
weapon = Isaac::CreateWeapon(0xc,GHIDRA_CAST<Entity *>(this));
|
|
this->_weapons[0] = weapon;
|
|
LAB_0077cd7e:
|
|
isShooting = '\x01';
|
|
}
|
|
}
|
|
else {
|
|
if (this->_weapons[0] != GHIDRA_CAST<Entity *>(0x0)) {
|
|
iVar19 = (GHIDRA_CAST<Entity *>((this->_weapons[0])))->Entity::SubType();
|
|
if (iVar19 == 0xb) goto LAB_0077cd7e;
|
|
if (this->_weapons[0] != (void *)0x0) {
|
|
Isaac::DestoryWeapon(this->_weapons);
|
|
}
|
|
}
|
|
weapon = Isaac::CreateWeapon(0xb,GHIDRA_CAST<Entity *>(this));
|
|
this->_weapons[0] = weapon;
|
|
isShooting = '\x01';
|
|
}
|
|
}
|
|
LAB_0077cde3:
|
|
local_2bc.y = (float)(this->_weapons + 1);
|
|
local_2b4 = (EntityPtr)&DAT_00000004;
|
|
do {
|
|
if (*(void **)local_2bc.y != (void *)0x0) {
|
|
FUN_004316c0();
|
|
FUN_004316b0(local_2d0.y);
|
|
}
|
|
local_2bc.y = (float)(GHIDRA_INT(local_2bc.y) + 4);
|
|
local_2b4 = (EntityPtr)(GHIDRA_INT(local_2b4) + -1);
|
|
} while (local_2b4 != (EntityPtr)0x0);
|
|
if (this->_weapons[0] == (void *)0x0) {
|
|
local_2bc.y = (float)(this->_weapons + 1);
|
|
local_2b4 = (EntityPtr)&DAT_00000004;
|
|
do {
|
|
local_2a8 = *GHIDRA_CAST<EntityPtr *>(local_2bc.y);
|
|
if (local_2a8 != (EntityPtr)0x0) {
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(local_2a8) + 8);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
(*virtualFn)(bVar4);
|
|
}
|
|
local_2bc.y = (float)(GHIDRA_INT(local_2bc.y) + 4);
|
|
local_2b4 = (EntityPtr)(GHIDRA_INT(local_2b4) + -1);
|
|
} while (local_2b4 != (EntityPtr)0x0);
|
|
}
|
|
else {
|
|
FUN_004316c0();
|
|
FUN_004316b0(GHIDRA_UINT(local_2d0.y) | 0x80000000);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(this->_weapons[0]) + 8);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_294))))->Entity::HasEntityFlags(0x4000);
|
|
(*virtualFn)(bVar4);
|
|
this = local_294;
|
|
}
|
|
if ((this->_itemState == 0x31) && (local_286 != '\0')) {
|
|
this->_blinkTime = 10;
|
|
}
|
|
local_2a8 = (EntityPtr)this->_blinkTime;
|
|
local_2dc = 2;
|
|
if (GHIDRA_INT(local_2a8) < 9) {
|
|
local_2dc = 0;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 == 0) {
|
|
if (-1 < this->_blinkTime) {
|
|
this->_blinkTime = this->_blinkTime + -1;
|
|
}
|
|
if (-1 < this->_headDirectionTime) {
|
|
this->_headDirectionTime = this->_headDirectionTime + -1;
|
|
}
|
|
}
|
|
local_290.y = (GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::LengthSquared();
|
|
if (1.0 < local_290.y) {
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::Normalize();
|
|
}
|
|
Vector::ToCardinal(&cardinalDirection,&shootDirection);
|
|
bVar4 = HasCollectible(this,0x220,0);
|
|
if ((bVar4 != 0) ||
|
|
((this->_playerType == 0xd && (bVar4 = HasCollectible(this,0x26b,0), bVar4 != 0)))) {
|
|
local_290.y = 9.80909e-45;
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
this->_blinkTime = *piVar15;
|
|
}
|
|
bVar4 = HasCollectible(this,0xf3,0);
|
|
piVar15 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428))));
|
|
puVar21 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)));
|
|
local_290.y = (float)puVar21;
|
|
if (bVar4 == 0) {
|
|
if (piVar15 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*piVar15 + 0x28))();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(puVar21))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else {
|
|
if (piVar15 == GHIDRA_CAST<int *>(0x0)) {
|
|
uVar9 = Random();
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2f,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar9);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(local_290.y))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(effect));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_294));
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_rotation(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1404)))));
|
|
FUN_0043eea0(*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1404)))));
|
|
pVVar7 = Vector::FromAngle(&local_29c,*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1404)))) + 90.0);
|
|
local_290.y = 30.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__mul(&local_2b0,&local_290.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_2c4,pVVar7);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetPosition(pVVar7);
|
|
this = local_294;
|
|
effect->SetColor(&local_294->_tearColor,0xffffffff,0xff,0,1);
|
|
effect->Update();
|
|
}
|
|
else {
|
|
EVar11 = (EntityPtr)
|
|
__RTDynamicCast(piVar15,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0);
|
|
local_2b4 = EVar11;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) {
|
|
local_2bc.y = 0.8;
|
|
}
|
|
else {
|
|
local_29c.x = shootDirection.x;
|
|
local_29c.y = shootDirection.y;
|
|
if ((shootDirection.y == 0.0) && (shootDirection.x == 0.0)) {
|
|
switch(this->_headDirection) {
|
|
case 0:
|
|
local_29c.x = (float)&DAT_bf800000;
|
|
break;
|
|
case 1:
|
|
local_29c.y = (float)&DAT_bf800000;
|
|
break;
|
|
case 2:
|
|
local_29c.x = 1.0;
|
|
break;
|
|
case 3:
|
|
local_29c.y = 1.0;
|
|
}
|
|
}
|
|
fVar24 = (GHIDRA_CAST<Vector *>((&local_29c)))->Vector::GetAngleDegrees();
|
|
local_290.y = fVar24 - 90.0;
|
|
local_290.y = normalize_angle_degrees(local_290.y);
|
|
(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(EVar11))))->Entity_Effect::set_rotation(local_290.y);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1404)))) = local_290.y;
|
|
local_2bc.y = 0.5;
|
|
}
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(EVar11))))->Entity_Effect::Rotation();
|
|
local_290.y = (float)fVar23;
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar11))))->Entity::SpriteRotation();
|
|
local_2c4.y = (float)fVar23;
|
|
local_290.y = LerpAngleDeg(local_2c4.y,local_290.y,local_2bc.y);
|
|
FUN_0043eea0(local_290.y);
|
|
pVVar7 = Vector::FromAngle(&local_29c,local_290.y + 90.0);
|
|
local_290.y = 30.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__mul(&local_2b0,&local_290.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_2c4,pVVar7);
|
|
EVar11 = local_2b4;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_2b4))))->Entity::SetPosition(pVVar7);
|
|
(**(code **)(*GHIDRA_CAST<int *>(EVar11) + 0x3c))(&this->_tearColor,0xffffffff,0xff,0,1);
|
|
local_290.y = (float)&DAT_00000007;
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
this->_blinkTime = *piVar15;
|
|
}
|
|
cVar5 = FUN_00423960();
|
|
if (cVar5 != '\0') {
|
|
pVVar7 = GHIDRA_CAST<Vector *>(0x3f800000);
|
|
local_2bc.y = 1.0;
|
|
bVar4 = IsLocalPlayer(this);
|
|
if (bVar4 == 0) {
|
|
FUN_00417900();
|
|
FUN_00925df0();
|
|
local_2bc.y = (float)pVVar7;
|
|
}
|
|
entityColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)))))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::operator_assign(entityColor);
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_70))))->Font::SetLineHeightModifier(local_2bc.y);
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1428)))) + 0x3c))(local_70,0xffffffff,0xff,0,1);
|
|
}
|
|
}
|
|
bVar4 = HasCollectible(this,0x195,0);
|
|
if (((((bVar4 != 0) || (bVar4 = HasCollectible(this,0x238,0), bVar4 != 0)) ||
|
|
(bVar4 = HasCollectible(this,0x2d6,0), bVar4 != 0)) ||
|
|
(bVar4 = HasCollectible(this,0x2a9,0), bVar4 != 0)) && (this->_isControlsEnabled != 0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x0))) = 4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x4))) = 6;
|
|
fStack_1c = 7.00649e-45;
|
|
iStack_18 = 7;
|
|
local_2bc.y = 0.0;
|
|
do {
|
|
pVVar7 = GHIDRA_CAST<Vector *>(local_2bc.y);
|
|
bVar4 = input_is_action_triggered
|
|
(g_manager,*GHIDRA_CAST<int *>((auStack_24 + GHIDRA_INT(local_2bc.y) * 4)),
|
|
this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (bVar4 != 0) {
|
|
if ((*GHIDRA_CAST<Vector **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f94)))) == pVVar7) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f98)))) < 0xb)) {
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&local_29c,GHIDRA_INT(pVVar7));
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::IsMirrorWorld();
|
|
if (bVar4 != 0) {
|
|
local_29c.x = local_29c.x * -1.0;
|
|
}
|
|
local_290.y = 3.25101e-43;
|
|
local_2c4.y = 9.54284e-43;
|
|
pVVar7 = GHIDRA_CAST<Vector *>(FUN_005cbfa0(&local_290.y));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_3c))))->Vector::operator_assign(pVVar7);
|
|
local_290.y = 1.30321e-43;
|
|
local_2c4.y = 5.67526e-43;
|
|
pVVar7 = GHIDRA_CAST<Vector *>(FUN_005cbfa0(&local_290.y));
|
|
(GHIDRA_CAST<Vector *>((&VStack_34)))->Vector::operator_assign(pVVar7);
|
|
local_2b4 = (EntityPtr)0x0;
|
|
local_290.y = 0.0;
|
|
do {
|
|
puVar21 = GHIDRA_CAST<undefined1 *>(local_290.y);
|
|
bVar4 = HasCollectible(this,*GHIDRA_CAST<int *>((local_3c + GHIDRA_INT(local_290.y) * 8)),0);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
pEVar16 = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist
|
|
(pEVar16,&local_80,3,*GHIDRA_CAST<int *>((local_3c + GHIDRA_INT(puVar21) * 8 + 4)),-1,0,0);
|
|
local_8 = 5;
|
|
fVar24 = 0.0;
|
|
local_2c4.y = 0.0;
|
|
iVar19 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(&local_80))))->EntityList::Size();
|
|
if (iVar19 != 0) {
|
|
local_2d0.y = (float)(GHIDRA_INT(local_2b4) * 0xc);
|
|
do {
|
|
std::vector<int>::operator_index(fVar24);
|
|
this_01 = GHIDRA_CAST<Entity_Familiar *>(FUN_00435de0());
|
|
if (((this_01 != GHIDRA_CAST<Entity_Familiar *>(0x0)) &&
|
|
(tmpPlayer = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Familiar *>((this_01)))->Entity_Familiar)::Player(),
|
|
tmpPlayer == this)) &&
|
|
((iVar19 = FUN_00753d30(), -1 < iVar19 &&
|
|
(iVar19 = FUN_00753d30(), iVar19 <= GHIDRA_INT(local_2d0.y))))) {
|
|
FUN_00753d40(local_2d0.y);
|
|
position.y = local_29c.y;
|
|
position.x = local_29c.x;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this_01))))->Entity::SetTargetPosition(position);
|
|
local_2b4 = (EntityPtr)(GHIDRA_INT(local_2b4) + 1);
|
|
local_2d0.y = (float)(GHIDRA_INT(local_2d0.y) + 0xc);
|
|
}
|
|
fVar24 = (float)(GHIDRA_INT(local_2c4.y) + 1);
|
|
local_2c4.y = fVar24;
|
|
fVar27 = (float)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(&local_80))))->EntityList::Size();
|
|
} while (GHIDRA_UINT(fVar24) < GHIDRA_UINT(fVar27));
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&local_80)))->EntityList_Query::~EntityList_Query();
|
|
puVar21 = GHIDRA_CAST<undefined1 *>(local_290.y);
|
|
}
|
|
local_290.y = (float)(puVar21 + 1);
|
|
} while (puVar21 + 1 < GHIDRA_CAST<undefined1 *>(0x2));
|
|
bVar4 = HasCollectible(this,0x238,0);
|
|
if ((bVar4 != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f9c)))) < 1)) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f9c)))) = 0x5a;
|
|
play_sound_with_fart_seed(0x238,1.0,2,0,1.0);
|
|
puVar21 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)));
|
|
local_290.y = (float)puVar21;
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1fa0)))) + 0x28))();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(puVar21))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
uVar9 = Random();
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xbc,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar9);
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(local_290.y))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(effect));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_294));
|
|
fVar24 = (GHIDRA_CAST<Vector *>((&local_29c)))->Vector::GetAngleDegrees();
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_rotation(fVar24);
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::Rotation();
|
|
Vector::FromAngle(&local_2b0,(float)fVar23);
|
|
local_290.y = 10.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2b0)))->Vector::__mul(&local_300,&local_290.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_2f4,pVVar7);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetPosition(pVVar7);
|
|
local_290.y = 10.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2b0)))->Vector::__mul(&local_2d8,&local_290.y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetVelocity(pVVar7);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x1e);
|
|
effect->Update();
|
|
this = local_294;
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(local_294) + 0x3c);
|
|
uVar30 = (GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0,0,0,0,0x3f99999a,0x3f99999a,0x3f800000);
|
|
(*virtualFn)(uVar30,8,2,1,1);
|
|
}
|
|
bVar4 = HasCollectible(this,0x2d6,0);
|
|
if ((bVar4 != 0) &&
|
|
(bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x2d6),
|
|
bVar4 == 0)) {
|
|
local_2ec.y = (float)Isaac::CreateWeapon(2,GHIDRA_CAST<Entity *>(this));
|
|
FUN_004316c0();
|
|
uVar9 = GetWeaponModifiers(this);
|
|
FUN_004316b0(uVar9 | 0x200);
|
|
(GHIDRA_CAST<Weapon_Brimstone *>((GHIDRA_CAST<Weapon_Brimstone *>(local_2ec.y))))->Weapon_Brimstone::fire((float)&local_29c,0);
|
|
Isaac::DestoryWeapon(GHIDRA_CAST<Weapon **>(&local_2ec.y));
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x2d6,1,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x75,1,1);
|
|
(GHIDRA_CAST<std::string *>((local_a0)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadDownShoot"));
|
|
local_8 = 6;
|
|
(GHIDRA_CAST<std::string *>((hemoptysisHeadRight)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadRightShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
|
|
(GHIDRA_CAST<std::string *>((hemoptysisHeadUp)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadUpShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
|
|
(GHIDRA_CAST<std::string *>((hemoptysisHeadLeft)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadLeftShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
|
|
direction.y = local_29c.y;
|
|
direction.x = local_29c.x;
|
|
animString = string_from_direction
|
|
(local_70 + 0x14,direction,hemoptysisHeadLeft,hemoptysisHeadUp,
|
|
hemoptysisHeadRight,local_a0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 10;
|
|
play_null_costume_anim(this,0x75,0,animString,-1,0);
|
|
(GHIDRA_CAST<std::string *>((local_70 + 0x14)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((hemoptysisHeadLeft)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((hemoptysisHeadUp)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((hemoptysisHeadRight)))->std::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((local_a0)))->std::string::_Tidy_deallocate();
|
|
}
|
|
pVVar7 = GHIDRA_CAST<Vector *>(local_2bc.y);
|
|
}
|
|
*GHIDRA_CAST<Vector **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f94)))) = pVVar7;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f98)))) = 0;
|
|
}
|
|
local_2bc.y = (float)(GHIDRA_INT(&pVVar7->x) + 1);
|
|
} while (GHIDRA_INT(local_2bc.y) < 4);
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f98)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f98)))) + 1;
|
|
bVar4 = HasCollectible(this,400,0);
|
|
piVar15 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c))));
|
|
puVar21 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x142c)));
|
|
local_290.y = (float)puVar21;
|
|
if (bVar4 == 0) {
|
|
if (piVar15 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*piVar15 + 0x28))();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(puVar21))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else if (piVar15 == GHIDRA_CAST<int *>(0x0)) {
|
|
uVar9 = Random();
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x53,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(local_290.y))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(effect));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_294));
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_rotation(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1408)))));
|
|
FUN_0043eea0(*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1408)))));
|
|
Vector::FromAngle(&local_29c,*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_294)) + 0x1408)))) + 90.0);
|
|
local_290.y = 45.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_29c)))->Vector::__mul(&local_2d8,&local_290.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_2f4,pVVar7);
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((&local_29c)))->Vector::Rotated(&local_300,90.0);
|
|
local_2c4.y = 10.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&inheritedVelocity,&local_2c4.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(GHIDRA_CAST<Vector *>(&local_b0._h),pVVar12);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetPosition(pVVar7);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2d8)))->Vector::Vector(0.0,-15.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetPositionOffset(pVVar7);
|
|
effect->SetColor(&local_294->_tearColor,0xffffffff,0xff,0,1);
|
|
effect->Update();
|
|
this = local_294;
|
|
}
|
|
else {
|
|
EVar11 = (EntityPtr)
|
|
__RTDynamicCast(piVar15,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0);
|
|
local_2b4 = EVar11;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) {
|
|
local_290.y = 0.8;
|
|
}
|
|
else {
|
|
local_29c.x = shootDirection.x;
|
|
local_29c.y = shootDirection.y;
|
|
if ((shootDirection.y == 0.0) && (shootDirection.x == 0.0)) {
|
|
switch(this->_headDirection) {
|
|
case 0:
|
|
local_29c.x = (float)&DAT_bf800000;
|
|
break;
|
|
case 1:
|
|
local_29c.y = (float)&DAT_bf800000;
|
|
break;
|
|
case 2:
|
|
local_29c.x = 1.0;
|
|
break;
|
|
case 3:
|
|
local_29c.y = 1.0;
|
|
}
|
|
}
|
|
fVar24 = (GHIDRA_CAST<Vector *>((&local_29c)))->Vector::GetAngleDegrees();
|
|
local_290.y = fVar24 - 90.0;
|
|
local_290.y = normalize_angle_degrees(local_290.y);
|
|
(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(EVar11))))->Entity_Effect::set_rotation(local_290.y);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1408)))) = local_290.y;
|
|
local_290.y = 0.5;
|
|
}
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(EVar11))))->Entity_Effect::Rotation();
|
|
local_2c4.y = (float)fVar23;
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar11))))->Entity::SpriteRotation();
|
|
local_2bc.y = (float)fVar23;
|
|
local_290.y = LerpAngleDeg(local_2bc.y,local_2c4.y,local_290.y);
|
|
FUN_0043eea0(local_290.y);
|
|
Vector::FromAngle(&local_2b0,local_290.y + 90.0);
|
|
local_290.y = 45.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2b0)))->Vector::__mul(&local_2d8,&local_290.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_2f4,pVVar7);
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((&local_2b0)))->Vector::Rotated(&local_300,90.0);
|
|
local_2c4.y = 10.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&inheritedVelocity,&local_2c4.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(GHIDRA_CAST<Vector *>(&local_b0._h),pVVar12);
|
|
EVar11 = local_2b4;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_2b4))))->Entity::SetPosition(pVVar7);
|
|
(**(code **)(*GHIDRA_CAST<int *>(EVar11) + 0x3c))(&this->_tearColor,0xffffffff,0xff,0,1);
|
|
local_290.y = (float)&DAT_00000007;
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
this->_blinkTime = *piVar15;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (((((bVar4 == 0) && (bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0), bVar4 != 0)) &&
|
|
((bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x145), bVar4 != 0
|
|
|| ((bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000), bVar4 != 0 &&
|
|
((this->_entityRef2)._entity == this)))))) &&
|
|
(bVar4 = IsFullSpriteRendering(this), bVar4 == 0)) && (iVar19 = Isaac::Random(2), iVar19 == 0)
|
|
) {
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_29c))))->EntityPtr::clear();
|
|
fVar24 = this->_meleeDamage * 0.75;
|
|
local_2c4.y = fVar24;
|
|
FUN_00431260();
|
|
local_2d0.y = (fVar24 * 0.15 + local_2c4.y * 0.04 + 0.6) * 0.9;
|
|
iVar19 = Isaac::Random(2);
|
|
local_290.y = (float)((double)iVar19 + __uint_to_double_fixup[-(iVar19 >> 0x1f)]) * 0.4 + 0.9;
|
|
fVar24 = random_float();
|
|
local_290.y = fVar24 * 0.05 + local_290.y;
|
|
(GHIDRA_CAST<Vector *>((&local_308)))->Vector::Normalized(&local_2b0);
|
|
if (local_286 != '\0') {
|
|
local_2bc.y = 8.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2b0)))->Vector::__mul(&local_2d8,&local_2bc.y);
|
|
(GHIDRA_CAST<Vector *>((&local_29c)))->Vector::operator_add_assign(pVVar7);
|
|
}
|
|
pVVar7 = MusicManager::RandomVector(&local_2d8);
|
|
local_2bc.y = random_float();
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__mul(&local_2f4,&local_2bc.y);
|
|
local_2b4 = (EntityPtr)0x40000000;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__mul(&local_300,GHIDRA_CAST<float *>(&local_2b4));
|
|
(GHIDRA_CAST<Vector *>((&local_29c)))->Vector::operator_add_assign(pVVar7);
|
|
GetTearMovementInheritance(this,&inheritedVelocity,&local_2b0,1);
|
|
(GHIDRA_CAST<Vector *>((&local_29c)))->Vector::operator_add_assign(other);
|
|
uVar9 = Random();
|
|
tear = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Game *>((g_game)))->Game)::Spawn(2,1,&this->_pos,&local_29c,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale(local_290.y * local_2d0.y);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight(-12.0);
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::FallingAcceleration();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::set_falling_accel((float)(fVar23 + (float10)0.5));
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::FallingSpeed();
|
|
local_2bc.y = (float)fVar23;
|
|
fVar24 = random_float();
|
|
FUN_00444c70((local_2bc.y - fVar24 * 10.0) - 4.0);
|
|
tear->SetCollisionDamage(local_290.y * local_2c4.y);
|
|
tear->Update();
|
|
}
|
|
EVar11 = (EntityPtr)this->_luck;
|
|
local_2b4 = EVar11;
|
|
local_29c.y = (float)EVar11;
|
|
bVar4 = HasTrinket(this,0x8b,0);
|
|
if (bVar4 != 0) {
|
|
iVar19 = GetTrinketMultiplier(this,0x8b);
|
|
EVar11 = (EntityPtr)((float)iVar19 + (float)iVar19 + 2.0 + (float)local_2b4);
|
|
this->_luck = (float)EVar11;
|
|
local_2b4 = EVar11;
|
|
}
|
|
iVar19 = this->_itemState;
|
|
if (iVar19 < 0x1e2) {
|
|
if (iVar19 == 0x1e1) {
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar4 != 0) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0)) goto LAB_0077fc4f;
|
|
(GHIDRA_CAST<TearParams *>((&knifeTearParams)))->TearParams::constructor();
|
|
uVar9 = Random();
|
|
pVVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Position(&local_2d8);
|
|
knife = GHIDRA_CAST<Entity_Knife *>((GHIDRA_CAST<Game *>((g_game)))->Game)::Spawn(8,8,pVVar7,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2f4)))->Vector::Vector(6.0,0.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetTargetPosition(*pVVar7);
|
|
fVar24 = (GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::GetAngleDegrees();
|
|
FUN_005b15d0(fVar24);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_300)))->Vector::Vector(0.0,-14.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetPositionOffset(pVVar7);
|
|
pVVar7 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity)::SpriteScale();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetSpriteScale(pVVar7);
|
|
(GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::SetAttackAnimation();
|
|
FUN_00665bc0(1);
|
|
FUN_00753770(0);
|
|
knife->SetCollisionDamage(0x42da0000);
|
|
knife->Update();
|
|
this->_itemStateCooldown = 5;
|
|
uVar9 = GetActiveItemSlot(this,0x1e1);
|
|
if (-1 < GHIDRA_INT(uVar9)) {
|
|
DischargeActiveItem(this,uVar9,0);
|
|
}
|
|
this->_blinkTime = 1;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
fVar24 = random_float();
|
|
play_sound_with_fart_seed(0xfc,1.0,2,0,fVar24 * 0.2 + 0.9);
|
|
}
|
|
else if (iVar19 < 0xa5) {
|
|
if (iVar19 == 0xa4) {
|
|
switchD_0077e14f_caseD_2a:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) goto LAB_0077fc4f;
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 != 0) goto switchD_0077f19d_caseD_2c5;
|
|
local_2bc.y = (float)&this->_lastVelocity;
|
|
if (this->_itemState == 0xa4) {
|
|
bVar4 = HasCollectible(this,0x164,0);
|
|
local_2e4.x = 14.0;
|
|
local_2e4.y = 7.0;
|
|
local_290.y = (float)&local_2e4;
|
|
local_2c4.y = (float)((bVar4 != 0) + 1);
|
|
do {
|
|
fVar24 = local_290.y;
|
|
uVar9 = Random();
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&cardinalDirection)))->Vector::__mul(&local_2d8,GHIDRA_CAST<float *>(fVar24));
|
|
local_2d0.y = 0.5;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_2bc.y))))->Vector::__mul(&local_2f4,&local_2d0.y);
|
|
local_2ec.y = 2.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&local_300,&local_2ec.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(&inheritedVelocity,pVVar12);
|
|
this = local_294;
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,10,&local_294->_pos,pVVar7,GHIDRA_CAST<Entity *>(local_294),0,
|
|
uVar9);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x3c);
|
|
effect->SetCollisionDamage(0x41b80000);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = DeathmatchManager::is_active();
|
|
if (cVar5 != '\0') {
|
|
pEVar16 = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((pEVar16)))->EntityList)::Size();
|
|
(**(code **)(*piVar15 + 0x44))(effect);
|
|
}
|
|
bVar4 = IsLocalPlayer(this);
|
|
if (bVar4 == 0) {
|
|
entityColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::operator_assign(entityColor);
|
|
FUN_00417900();
|
|
FUN_00925df0();
|
|
local_2b0.y = (float)EVar11;
|
|
fVar24 = (GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::A();
|
|
EVar11 = (EntityPtr)local_2b0.y;
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_70))))->Font::SetLineHeightModifier(fVar24 * local_2b0.y);
|
|
effect->SetColor(local_70,0xffffffff,0xff,0,1);
|
|
}
|
|
effect->Update();
|
|
local_290.y = (float)(GHIDRA_INT(local_290.y) + 4);
|
|
local_2c4.y = (float)(GHIDRA_INT(local_2c4.y) + -1);
|
|
} while (local_2c4.y != 0.0);
|
|
LAB_0077e64e:
|
|
iVar19 = 0x1d7;
|
|
}
|
|
else {
|
|
if (this->_itemState == 0x121) {
|
|
bVar4 = HasCollectible(this,0x164,0);
|
|
local_2e4.x = 14.0;
|
|
local_2e4.y = 7.0;
|
|
local_290.y = (float)&local_2e4;
|
|
local_2c4.y = (float)((bVar4 != 0) + 1);
|
|
do {
|
|
fVar24 = local_290.y;
|
|
uVar9 = Random();
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&cardinalDirection)))->Vector::__mul(&local_2d8,GHIDRA_CAST<float *>(fVar24));
|
|
local_2b0.y = 0.5;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_2bc.y))))->Vector::__mul(&local_2f4,&local_2b0.y);
|
|
local_2d0.y = 2.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&local_300,&local_2d0.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(&inheritedVelocity,pVVar12);
|
|
this = local_294;
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x34,&local_294->_pos,pVVar7,GHIDRA_CAST<Entity *>(local_294),0
|
|
,uVar9);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x40))(0x41b80000);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = DeathmatchManager::is_active();
|
|
if (cVar5 != '\0') {
|
|
pEVar16 = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((pEVar16)))->EntityList)::Size();
|
|
(**(code **)(*piVar15 + 0x44))(tmpEntity);
|
|
}
|
|
bVar4 = IsLocalPlayer(this);
|
|
if (bVar4 == 0) {
|
|
entityColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::operator_assign(entityColor);
|
|
FUN_00417900();
|
|
FUN_00925df0();
|
|
local_2ec.y = (float)EVar11;
|
|
fVar24 = (GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::A();
|
|
EVar11 = (EntityPtr)local_2ec.y;
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_70))))->Font::SetLineHeightModifier(fVar24 * local_2ec.y);
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x3c))(local_70,0xffffffff,0xff,0,1);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
local_290.y = (float)(GHIDRA_INT(local_290.y) + 4);
|
|
local_2c4.y = (float)(GHIDRA_INT(local_2c4.y) + -1);
|
|
} while (local_2c4.y != 0.0);
|
|
local_2c4.y = 0.0;
|
|
goto LAB_0077e64e;
|
|
}
|
|
uVar9 = Random();
|
|
local_2b0.y = 14.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&cardinalDirection)))->Vector::__mul(&local_2d8,&local_2b0.y);
|
|
local_290.y = 0.5;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_2bc.y))))->Vector::__mul(&local_2f4,&local_290.y);
|
|
local_2c4.y = 2.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&local_300,&local_2c4.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(&inheritedVelocity,pVVar12);
|
|
this = local_294;
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,4,&local_294->_pos,pVVar7,GHIDRA_CAST<Entity *>(local_294),0,uVar9);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
tmpEntity = GHIDRA_CAST<Entity *>(0x0);
|
|
iVar19 = Isaac::Random(2);
|
|
GetTearHitParams(this,&hitParams,5,1.0,iVar19 * 2 + -1,tmpEntity);
|
|
pBVar35 = &g_tearFlagPoison;
|
|
pBVar33 = &g_tearFlagExplosive;
|
|
pBVar10 = GetBombFlags(this,GHIDRA_CAST<BitSet128 *>(auStack_24),0);
|
|
pBVar10 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(local_3c),&hitParams._flags,pBVar10);
|
|
pBVar10 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(&local_80),pBVar10,pBVar33);
|
|
pBVar10 = BitSet128::operator_or(&local_b0,pBVar10,pBVar35);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*pBVar10);
|
|
tear->SetCollisionDamage(this->_damage + 185.0);
|
|
fVar24 = random_float();
|
|
FUN_00444c70(fVar24 * 0.2 + 1.2);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight(-33.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
tear->Update();
|
|
iVar19 = 0xfc;
|
|
}
|
|
play_sound_with_fart_seed(iVar19,1.0,2,0,1.0);
|
|
goto LAB_0077e9ef;
|
|
}
|
|
switch(iVar19) {
|
|
case 0:
|
|
Vector::ToCardinal(&local_2b0,&local_308);
|
|
bVar4 = HasCollectible(this,0x1d1,0);
|
|
if ((bVar4 != 0) || (this->_markedTarget != (void *)0x0)) {
|
|
(GHIDRA_CAST<Vector *>((&local_2b0)))->Vector::operator_assign(&local_308);
|
|
}
|
|
if (((isShooting != '\0') || (this->_playerType == 0xd)) || (this->_playerType == 0x20)) {
|
|
bVar4 = HasCollectible(this,0xf4,0);
|
|
if (bVar4 != 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1468)))) < 1) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1468)))) = 0xf;
|
|
if (((local_286 != '\0') || (this->_markedTarget != (void *)0x0)) &&
|
|
(iVar19 = Isaac::Random(3), iVar19 != 0)) {
|
|
laser = FireTechLaser(this,&this->_pos,2,&local_2b0,0,1,GHIDRA_CAST<Entity *>(0x0),1.0);
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::set_scale(0.8);
|
|
laser->Update();
|
|
this->_blinkTime = 5;
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1468)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1468)))) + -1;
|
|
}
|
|
}
|
|
if ((isShooting != '\0') && (bVar4 = IsExtraAnimationFinished(this), bVar4 != 0)) {
|
|
FUN_00428b50();
|
|
cVar5 = FUN_0082ee30();
|
|
if ((cVar5 == '\0') && (isInputAllowed != '\0')) {
|
|
trigger_fire_item_effects(this,&shootDirection,(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))));
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
goto switchD_0077e14f_caseD_1;
|
|
case 0x2a:
|
|
goto switchD_0077e14f_caseD_2a;
|
|
case 0x2f:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
trigger_fire_item_effects(this,&shootDirection,1);
|
|
if (this->_itemState == 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
}
|
|
break;
|
|
case 0x31:
|
|
if ((local_286 == '\0') ||
|
|
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar4 != 0)) break;
|
|
this->_itemStateCooldown = 0x1e;
|
|
play_sound_with_fart_seed(5,1.0,2,0,1.0);
|
|
GetLaserOffset(this,&local_2d8,3,&cardinalDirection);
|
|
fVar24 = cardinalDirection.y;
|
|
FUN_00456230();
|
|
laser = Entity_Laser::ShootAngle
|
|
(3,&this->_pos,fVar24 * 57.295776,0xf,posOffset_00,GHIDRA_CAST<Entity *>(this),0);
|
|
laser->SetCollisionDamage(this->_damage + this->_damage);
|
|
if (cardinalDirection.y <= -0.5) {
|
|
fVar24 = -50.0;
|
|
}
|
|
else {
|
|
fVar24 = 3000.0;
|
|
}
|
|
set_field_358(laser,fVar24);
|
|
laser->Update();
|
|
DischargeActiveItem(this,0,0);
|
|
piVar15 = &this->_blinkTime;
|
|
*piVar15 = 0x1e;
|
|
goto LAB_0077fc55;
|
|
}
|
|
}
|
|
else {
|
|
switch(iVar19) {
|
|
case 0x121:
|
|
goto switchD_0077e14f_caseD_2a;
|
|
default:
|
|
switchD_0077e14f_caseD_1:
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("No Such State %d\n"));
|
|
break;
|
|
case 0x152:
|
|
if ((local_286 != '\0') &&
|
|
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar4 == 0)) {
|
|
this->_itemStateCooldown = 0xf;
|
|
local_2b0.y = 15.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&cardinalDirection)))->Vector::__mul(&local_2d8,&local_2b0.y);
|
|
local_290.y = 0.5;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((&this->_lastVelocity)))->Vector::__mul(&local_2f4,&local_290.y);
|
|
local_2c4.y = 2.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&local_300,&local_2c4.y);
|
|
(GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(&local_2ec,pVVar12);
|
|
uVar9 = Random();
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3c,&this->_pos,&local_2ec,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(GHIDRA_INT((-this->_tearheight * 0.75)));
|
|
effect->SetCollisionDamage(this->_damage + this->_damage);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
effect->Update();
|
|
SoundEffects::PlayWithFartOverride(0x344,1.0,2,0,1.0);
|
|
this->_blinkTime = 0xf;
|
|
DischargeActiveItem(this,0,0);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
itemConfig = Isaac::GetItemConfig();
|
|
nullItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x1e);
|
|
RemoveCostume(this,nullItem);
|
|
}
|
|
break;
|
|
case 0x160:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) goto LAB_0077fc4f;
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 == 0) {
|
|
local_2b0.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::__mul(&local_2e4,&local_2b0.y);
|
|
GetTearMovementInheritance(this,&local_2d8,&shootDirection,0);
|
|
(GHIDRA_CAST<Vector *>((&local_2e4)))->Vector::operator_add_assign(other_00);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2e4)))->Vector::__mul(&local_2f4,&this->_shotspeed);
|
|
tear = FireTear(this,&this->_pos,*pVVar7,1,GHIDRA_CAST<Entity *>(0x0),1.0);
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::Scale();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale((float)(fVar23 * (float10)5.0));
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(tear) + 0x40);
|
|
fVar23 = (float10)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::CollisionDamage();
|
|
local_2b0.y = (float)((float10)10.0 + fVar23 * (float10)10.0);
|
|
(*virtualFn)(local_2b0.y);
|
|
pBVar35 = &g_tearFlagSpectral;
|
|
pBVar33 = &g_tearFlagPiercing;
|
|
pBVar10 = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::TearFlags(GHIDRA_CAST<BitSet128 *>(auStack_24));
|
|
pBVar10 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(local_3c),pBVar10,pBVar33);
|
|
pBVar10 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(&local_80),pBVar10,pBVar35);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*pBVar10);
|
|
this = local_294;
|
|
play_sound_with_fart_seed(0x1e2,1.0,2,0,1.0);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2e4)))->Vector::__unm(&local_300);
|
|
bVar4 = 0;
|
|
local_2b0.y = 0.5;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__mul(&local_2d8,&local_2b0.y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity_divided(pVVar7,bVar4);
|
|
goto LAB_0077ed69;
|
|
}
|
|
break;
|
|
case 0x17e:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
SoundEffects::PlayWithFartOverride(0x3fe,1.0,2,0,1.0);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) goto LAB_0077fc4f;
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 == 0) {
|
|
local_2b0.y = 15.0;
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::__mul(&local_2c4,&local_2b0.y);
|
|
GetTearMovementInheritance(this,&local_2d8,&shootDirection,0);
|
|
(GHIDRA_CAST<Vector *>((&local_2c4)))->Vector::operator_add_assign(other_01);
|
|
iVar19 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar19 == 0x21) {
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at(0x17e));
|
|
uVar9 = (GHIDRA_CAST<RNG *>((rng)))->RNG::RandomInt(2);
|
|
if (uVar9 == 0) {
|
|
FUN_00417910();
|
|
local_290.y = (float)FUN_006ef3f0();
|
|
}
|
|
else {
|
|
FUN_00417910();
|
|
local_290.y = (float)FUN_005cd4e0();
|
|
}
|
|
iVar19 = FUN_0060c6e0();
|
|
if (iVar19 != 0) {
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at(0x17e));
|
|
uVar9 = FUN_0060c6e0();
|
|
uVar9 = (GHIDRA_CAST<RNG *>((rng)))->RNG::RandomInt(uVar9);
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0060c6c0(uVar9));
|
|
enemyType = *piVar15;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x0))) = piVar15[1];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x4))) = piVar15[2];
|
|
fStack_1c = (float)piVar15[3];
|
|
iStack_18 = piVar15[4];
|
|
bVar4 = Entity_NPC::Redirect(&enemyType,GHIDRA_CAST<int *>(auStack_24));
|
|
if (bVar4 != 0) {
|
|
this_02 = GHIDRA_CAST<EntityConfig *>(FUN_00417910());
|
|
entityConfigEntry = (GHIDRA_CAST<EntityConfig *>((this_02)))->EntityConfig::GetEntity(enemyType,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x0))),0);
|
|
if (entityConfigEntry != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_005cd4b0(entityConfigEntry->id,entityConfigEntry->variant,
|
|
entityConfigEntry->subtype,entityConfigEntry->baseHP
|
|
,0));
|
|
enemyType = *piVar15;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x0))) = piVar15[1];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x4))) = piVar15[2];
|
|
fStack_1c = (float)piVar15[3];
|
|
}
|
|
}
|
|
(this->_friendBallEnemy)._maxHealth = fStack_1c;
|
|
(this->_friendBallEnemy)._type = enemyType;
|
|
(this->_friendBallEnemy)._variant = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x0)));
|
|
(this->_friendBallEnemy)._health = fStack_1c * 0.5;
|
|
(this->_friendBallEnemy)._subtype = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_24)) + 0x4)));
|
|
}
|
|
uVar9 = Random();
|
|
uVar20 = 1;
|
|
}
|
|
else {
|
|
iVar19 = (this->_friendBallEnemy)._type;
|
|
uVar9 = Random();
|
|
uVar20 = GHIDRA_UINT((iVar19 != 0));
|
|
}
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x51,&this->_pos,&local_2c4,GHIDRA_CAST<Entity *>(this),uVar20,
|
|
uVar9);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
SoundEffects::PlayWithFartOverride(0x400,1.0,2,0,1.0);
|
|
goto LAB_0077ed69;
|
|
}
|
|
}
|
|
}
|
|
goto switchD_0077f19d_caseD_2c5;
|
|
}
|
|
switch(iVar19) {
|
|
case 0x200:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) break;
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 != 0) goto switchD_0077f19d_caseD_2c5;
|
|
uVar9 = Random();
|
|
local_2b0.y = 34.0;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&cardinalDirection)))->Vector::__mul(&local_2d8,&local_2b0.y);
|
|
local_290.y = 0.5;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((&local_294->_lastVelocity)))->Vector::__mul(&local_2f4,&local_290.y);
|
|
local_2c4.y = 2.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar12)))->Vector::__mul(&local_300,&local_2c4.y);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar7)))->Vector::__add(&inheritedVelocity,pVVar12);
|
|
this = local_294;
|
|
uVar34 = 0;
|
|
pTVar32 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar31 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar30 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6b,&local_294->_pos,pVVar7,GHIDRA_CAST<Entity *>(local_294),0,uVar9);
|
|
piVar15 = GHIDRA_CAST<int *>(__RTDynamicCast(tmpEntity,uVar30,pTVar31,pTVar32,uVar34));
|
|
(**(code **)(*piVar15 + 0xc))();
|
|
SoundEffects::PlayWithFartOverride(0x42c,1.0,2,0,1.0);
|
|
LAB_0077e9ef:
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
this->_itemStateCooldown = 5;
|
|
DischargeActiveItem(this,0,0);
|
|
piVar15 = &this->_blinkTime;
|
|
*piVar15 = 1;
|
|
goto LAB_0077fc55;
|
|
default:
|
|
goto switchD_0077e14f_caseD_1;
|
|
case 0x25c:
|
|
FUN_00420ae0();
|
|
cVar5 = FUN_0082ee30();
|
|
if (cVar5 == '\0') {
|
|
LAB_0077f304:
|
|
if (((this->_isPlayingItemAnimation == 0) && (this->_isPlayingExtraAnimation == 0)) &&
|
|
(this->_heldEntity != (void *)0x0)) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
}
|
|
}
|
|
else {
|
|
FUN_00420ae0();
|
|
cVar5 = FUN_0082eb90();
|
|
if (cVar5 == '\0') goto LAB_0077f304;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 != 0) goto switchD_0077f19d_caseD_2c5;
|
|
if ((this->_playerType == 0x28) && (this->_heldEntity != (void *)0x0)) {
|
|
pvVar8 = this->_heldEntity;
|
|
otherTwin = (void *)GetOtherTwin(this);
|
|
if ((pvVar8 != otherTwin) ||
|
|
((iVar19 = FUN_0042d040(), iVar19 == 0 || (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x18f8))))))
|
|
goto LAB_0077f3b7;
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0042d040());
|
|
cVar5 = (**(code **)(*piVar15 + 0x40))();
|
|
if (((cVar5 == '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar8) + 0x1908)) == '\0')) || (this->_canShoot == 0))
|
|
goto LAB_0077f3b7;
|
|
LAB_0077f493:
|
|
if (this->_heldEntity != (void *)0x0) break;
|
|
}
|
|
else {
|
|
LAB_0077f3b7:
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) goto LAB_0077f493;
|
|
if (this->_heldEntity != (void *)0x0) {
|
|
local_2b0.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::__mul(&local_290,&local_2b0.y);
|
|
GetTearMovementInheritance(this,&local_2d8,&shootDirection,0);
|
|
(GHIDRA_CAST<Vector *>((&local_290)))->Vector::operator_add_assign(other_02);
|
|
local_2b0.y = 1.2;
|
|
(GHIDRA_CAST<Vector *>((&local_290)))->Vector::operator_mul_assign(&local_2b0.y);
|
|
ThrowHeldEntity(this,&local_290);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
this->_blinkTime = 1;
|
|
this->_itemStateCooldown = 5;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
if (this->_activeDesc[0]._item == 0x25c) {
|
|
DischargeActiveItem(this,0,0);
|
|
}
|
|
goto switchD_0077f19d_caseD_2c5;
|
|
}
|
|
}
|
|
if (this->_itemStateCooldown == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
this->_itemStateCooldown = 5;
|
|
goto LAB_0077ed7e;
|
|
}
|
|
break;
|
|
case 0x26f:
|
|
case 0x27e:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 == 0) {
|
|
if (((this->_itemState == 0x26f) && (this->_numKeys < 1)) && (this->_itemStateCooldown == 0))
|
|
{
|
|
this->_itemStateCooldown = 5;
|
|
goto LAB_0077ed7e;
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) break;
|
|
local_2b0.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::__mul(&local_2bc,&local_2b0.y);
|
|
GetTearMovementInheritance(this,&local_2d8,&shootDirection,0);
|
|
(GHIDRA_CAST<Vector *>((&local_2bc)))->Vector::operator_add_assign(other_03);
|
|
uVar9 = 0x2d;
|
|
local_290.y = 6.30584e-44;
|
|
if (this->_itemState == 0x26f) {
|
|
local_2b0.y = this->_shotspeed * 1.5;
|
|
uVar9 = 0x2c;
|
|
local_290.y = (float)&DAT_0000002c;
|
|
(GHIDRA_CAST<Vector *>((&local_2bc)))->Vector::operator_mul_assign(&local_2b0.y);
|
|
}
|
|
GetTearHitParams(this,&hitParams,1,1.0,0,GHIDRA_CAST<Entity *>(this));
|
|
uVar20 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,uVar9,&this->_pos,&local_2bc,GHIDRA_CAST<Entity *>(this),1,uVar20);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight(hitParams._tearHeight);
|
|
if (GHIDRA_CAST<Vector *>(local_290.y) == GHIDRA_CAST<Vector *>(0x2d)) {
|
|
tear->SetCollisionDamage(0x41700000);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = DeathmatchManager::is_active();
|
|
if (cVar5 == '\0') {
|
|
fVar24 = hitParams._tearDamage * 5.0 + 30.0;
|
|
}
|
|
else {
|
|
fVar24 = hitParams._tearDamage * 4.0 + 5.0;
|
|
}
|
|
tear->SetCollisionDamage(fVar24);
|
|
pBVar10 = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>(auStack_24),&hitParams._flags,&g_tearFlagPiercing);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*pBVar10);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
tear->Update();
|
|
this->_itemStateCooldown = 5;
|
|
DischargeActiveItem(this,0,0);
|
|
this->_blinkTime = 1;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
fVar24 = random_float();
|
|
play_sound_with_fart_seed(0xfc,1.0,2,0,fVar24 * 0.2 + 0.9);
|
|
if (this->_itemState == 0x26f) {
|
|
AddKeys(this,-1);
|
|
}
|
|
}
|
|
case 0x2c5:
|
|
switchD_0077f19d_caseD_2c5:
|
|
break;
|
|
case 0x2c6:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar4 == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) != 0)) {
|
|
(GHIDRA_CAST<TearParams *>((&bagTearParams)))->TearParams::constructor();
|
|
uVar9 = Random();
|
|
pVVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Position(&local_2d8);
|
|
knife = GHIDRA_CAST<Entity_Knife *>((GHIDRA_CAST<Game *>((g_game)))->Game)::Spawn(8,4,pVVar7,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2f4)))->Vector::Vector(6.0,0.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetTargetPosition(*pVVar7);
|
|
fVar24 = (GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::GetAngleDegrees();
|
|
FUN_005b15d0(fVar24);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_300)))->Vector::Vector(0.0,-14.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetPositionOffset(pVVar7);
|
|
pVVar7 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity)::SpriteScale();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(knife))))->Entity::SetSpriteScale(pVVar7);
|
|
(GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::SetAttackAnimation();
|
|
FUN_00665bc0(1);
|
|
FUN_00753770(0);
|
|
knife->SetCollisionDamage(0x3f800000);
|
|
knife->Update();
|
|
this->_itemStateCooldown = 5;
|
|
uVar9 = GetActiveItemSlot(this,0x2c6);
|
|
if (-1 < GHIDRA_INT(uVar9)) {
|
|
DischargeActiveItem(this,uVar9,0);
|
|
}
|
|
this->_blinkTime = 1;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
fVar24 = random_float();
|
|
play_sound_with_fart_seed(2,1.0,2,0,fVar24 * 0.2 + 0.9);
|
|
goto switchD_0077f19d_caseD_2c5;
|
|
}
|
|
break;
|
|
case 0x2d8:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar4 == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) != 0)) {
|
|
bVar4 = HasCollectible(this,0x164,0);
|
|
local_2d0.x = 0.0;
|
|
local_2d0.y = 0.0;
|
|
local_2bc.y = (float)((bVar4 != 0) + 1);
|
|
if (bVar4 != 0) {
|
|
local_2d0.x = -10.0;
|
|
local_2d0.y = 10.0;
|
|
}
|
|
local_290.y = 0.0;
|
|
do {
|
|
fVar24 = local_290.y;
|
|
local_2b0.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::__mul(&local_2e4,&local_2b0.y);
|
|
GetTearMovementInheritance(this,&local_2d8,&shootDirection,0);
|
|
local_2c4.y = 0.4;
|
|
pVVar7 = Vector::operator_mul(&local_2f4,&local_2c4.y,vector);
|
|
(GHIDRA_CAST<Vector *>((&local_2e4)))->Vector::operator_add_assign(pVVar7);
|
|
(GHIDRA_CAST<Vector *>((&local_2e4)))->Vector::Normalize();
|
|
(GHIDRA_CAST<Vector *>((&local_2e4)))->Vector::Rotate((&local_2d0.x)[GHIDRA_INT(fVar24)]);
|
|
uVar9 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xf0,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::ClearEntityFlags(4);
|
|
position_00.y = local_2e4.y;
|
|
position_00.x = local_2e4.x;
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetTargetPosition(position_00);
|
|
FUN_005b18f0(1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
local_290.y = (float)(GHIDRA_INT(GHIDRA_CAST<float *>(local_290.y)) + 1);
|
|
} while (GHIDRA_UINT(local_290.y) < GHIDRA_UINT(local_2bc.y));
|
|
play_sound_with_fart_seed(0x1ee,1.0,2,0,1.0);
|
|
LAB_0077ed69:
|
|
this->_itemStateCooldown = 5;
|
|
DischargeActiveItem(this,0,0);
|
|
LAB_0077ed7e:
|
|
this->_blinkTime = 1;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
goto switchD_0077f19d_caseD_2c5;
|
|
}
|
|
break;
|
|
case 0x2d9:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bodySprite))))->Sprite::SetLastFrame();
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar4 == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) != 0)) {
|
|
local_2b0.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&shootDirection)))->Vector::__mul(&local_2d0,&local_2b0.y);
|
|
GetTearMovementInheritance(this,&local_2d8,&shootDirection,0);
|
|
local_2b0.y = 0.4;
|
|
pVVar7 = Vector::operator_mul(&local_2f4,&local_2b0.y,vector_00);
|
|
(GHIDRA_CAST<Vector *>((&local_2d0)))->Vector::operator_add_assign(pVVar7);
|
|
uVar9 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xf3,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_294),0,uVar9);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::ClearEntityFlags(4);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::AddEntityFlags(0x400000000000000);
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_300)))->Vector::Vector(-24.0,-7.0);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetTargetPosition(*pVVar7);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetVelocity(&local_2d0);
|
|
FUN_005b18f0(1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
uVar9 = Random();
|
|
local_2b0.y = 0.35;
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((&local_2d0)))->Vector::__mul(&local_2d8,&local_2b0.y);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,&this->_pos,pVVar7,GHIDRA_CAST<Entity *>(0x0),2,uVar9);
|
|
(**(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0xc))();
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(local_2e4.y))))->TemporaryEffects::AddCollectibleEffect(0x2d9,1,2);
|
|
this = local_294;
|
|
play_sound_with_fart_seed(0x417,1.0,2,0,1.0);
|
|
goto LAB_0077ed69;
|
|
}
|
|
}
|
|
LAB_0077fc4f:
|
|
piVar15 = &this->_blinkTime;
|
|
LAB_0077fc55:
|
|
EVar11 = (EntityPtr)this->_luck;
|
|
if (this->_luck == (float)local_2b4) {
|
|
this->_luck = local_29c.y;
|
|
EVar11 = (EntityPtr)local_29c.y;
|
|
}
|
|
if ((((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) && (*piVar15 < 0)) && (this->_headDirectionTime < 0)) {
|
|
FUN_00420ae0();
|
|
cVar5 = FUN_0082ee30();
|
|
if (cVar5 == '\0') {
|
|
iVar19 = this->_moveDirection;
|
|
GetBodyMoveDirection(this,&local_2d8);
|
|
bVar4 = (GHIDRA_CAST<Vector *>((this_03)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar4 != 0) {
|
|
GetBodyMoveDirection(this,&local_2d8);
|
|
iVar19 = vector_to_direction(vec);
|
|
}
|
|
switch(iVar19) {
|
|
case 0:
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),"HeadLeft");
|
|
this->_headDirection = 0;
|
|
break;
|
|
case 1:
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),"HeadUp");
|
|
this->_headDirection = 1;
|
|
break;
|
|
case 2:
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),"HeadRight");
|
|
this->_headDirection = 2;
|
|
break;
|
|
default:
|
|
SimpleString::operator=(GHIDRA_CAST<SimpleString *>(&this->_headAnim),"HeadDown");
|
|
this->_headDirection = 3;
|
|
}
|
|
}
|
|
}
|
|
bVar4 = IsFullSpriteRendering(this);
|
|
if (bVar4 == 0) {
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
bVar4 = HasCollectible(this,0x2ab,0);
|
|
if ((bVar4 != 0) &&
|
|
((iVar19 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetOverlayFrame(), iVar19 == 0 &&
|
|
(8 < GHIDRA_INT(local_2a8))))) {
|
|
local_29c.y = (this->_posOffset).y;
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
fVar24 = random_float();
|
|
Game::SpawnParticles(g_game,&this->_pos,0x23,1,fVar24 * 3.0 + 2.0,color,local_29c.y,1);
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetOverlayFrame(&this->_headAnim,local_2dc);
|
|
local_294 = GHIDRA_CAST<Entity_Player *>(&this->_playerCostumeMap[0]._isBodyLayer);
|
|
local_290.y = 2.10195e-44;
|
|
do {
|
|
if ((((-1 < (GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(local_294) + -0xc)))->_index) &&
|
|
(*GHIDRA_CAST<byte *>(local_294) == 0)) &&
|
|
(this_04 = GHIDRA_CAST<Sprite *>(FUN_005cbd10((GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(local_294) + -0xc)))->_index))
|
|
, this_04[1]._filename._buf[8] == '\0')) &&
|
|
(iVar19 = FUN_0040bcb0(&this->_headAnim), iVar19 != 0)) {
|
|
if (*GHIDRA_CAST<char *>((iVar19 + 0x34)) == '\0') {
|
|
if (GHIDRA_INT(local_2a8) < 9) {
|
|
uVar30 = FUN_00421620("_Idle");
|
|
local_8 = 0xb;
|
|
cleanupFlags = (EntityPtr)(GHIDRA_UINT(cleanupFlags) | 1);
|
|
local_29c.y = (float)cleanupFlags;
|
|
iVar19 = FUN_0040bcb0(uVar30);
|
|
local_286 = '\x01';
|
|
if (iVar19 == 0) goto LAB_0077ff13;
|
|
}
|
|
else {
|
|
LAB_0077ff13:
|
|
local_286 = '\0';
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((GHIDRA_UINT(cleanupFlags) & 1) != 0) {
|
|
cleanupFlags = (EntityPtr)(GHIDRA_UINT(cleanupFlags) & 0xfffffffe);
|
|
(GHIDRA_CAST<std::string *>((local_70 + 0x14)))->std::string::_Tidy_deallocate();
|
|
}
|
|
if (local_286 == '\0') {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(this_04))))->ANM2::SetFrame(&this->_headAnim,local_2dc);
|
|
}
|
|
else {
|
|
animString = GHIDRA_CAST<std_string *>(FUN_00421620("_Idle"));
|
|
local_8 = 0xc;
|
|
(GHIDRA_CAST<Sprite *>((this_04)))->Sprite::Play(animString,0);
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((local_70 + 0x14)))->std::string::_Tidy_deallocate();
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Sprite *>((this_04)))->Sprite::Play(&this->_headAnim,0);
|
|
costumeLayer = (GHIDRA_CAST<Sprite *>((this_04)))->Sprite::GetLayer(*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(local_294) + -8)));
|
|
(costumeLayer->_pos).y = (float)GHIDRA_INT(local_2dc) * (costumeLayer->_size).y;
|
|
}
|
|
if (this_04[1]._filename._buf[10] != '\0') {
|
|
uVar30 = FUN_00421620("_Overlay");
|
|
local_8 = 0xd;
|
|
local_29c.y = (float)FUN_0040bcb0(uVar30);
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((local_70 + 0x14)))->std::string::_Tidy_deallocate();
|
|
if ((EntityPtr)local_29c.y != (EntityPtr)0x0) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_29c.y) + 0x34)) == '\0') {
|
|
animString = GHIDRA_CAST<std_string *>(FUN_00421620("_Overlay"));
|
|
local_8 = 0xf;
|
|
(GHIDRA_CAST<Sprite *>((this_04)))->Sprite::SetOverlayFrame(animString,local_2dc);
|
|
pcVar13 = overlayAnimName;
|
|
}
|
|
else {
|
|
uVar30 = FUN_00421620("_Overlay");
|
|
local_8 = 0xe;
|
|
Sprite::PlayOverlay(uVar30,0);
|
|
pcVar13 = local_a0;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((pcVar13)))->std::string::_Tidy_deallocate();
|
|
}
|
|
}
|
|
}
|
|
local_294 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_294) + 0x10));
|
|
local_290.y = (float)(GHIDRA_INT(local_290.y) + -1);
|
|
} while (local_290.y != 0.0);
|
|
local_290.y = 0.0;
|
|
}
|
|
else {
|
|
uVar9 = 0;
|
|
ppvVar17 = this->_weapons + 1;
|
|
do {
|
|
if (*ppvVar17 != (void *)0x0) {
|
|
FUN_004e46b0();
|
|
if (0.0 < (float)EVar11) goto LAB_007800b3;
|
|
ppvVar17 = local_2f8;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
ppvVar17 = ppvVar17 + 1;
|
|
local_2f8 = ppvVar17;
|
|
} while (uVar9 < 4);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetFrame(&this->_headAnim,local_2dc);
|
|
}
|
|
}
|
|
LAB_007800b3:
|
|
bVar4 = IsExtraAnimationFinished(this);
|
|
if (bVar4 != 0) {
|
|
FUN_00428b50();
|
|
cVar5 = FUN_0082ee30();
|
|
if (((cVar5 == '\0') && (isInputAllowed != '\0')) &&
|
|
(bVar4 = HasCollectible(this,0x170,0), bVar4 != 0)) {
|
|
if (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8))))) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) + -1;
|
|
}
|
|
bVar4 = HasWeaponType(this,10);
|
|
if (bVar4 == 0) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) = 0;
|
|
}
|
|
else if ((((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18ac)))) == -1)) ||
|
|
(iVar19 = vector_to_direction(&shootDirection), iVar19 == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18ac)))))
|
|
) {
|
|
iVar19 = FUN_00505ca0();
|
|
if (0 < iVar19) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) = 10;
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) != 0) {
|
|
iVar19 = vector_to_direction(&shootDirection);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18ac)))) = iVar19;
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) = 0xffffffff;
|
|
iVar19 = vector_to_direction(&shootDirection);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18ac)))) = iVar19;
|
|
}
|
|
iVar19 = vector_to_direction(&this->_aimDirection);
|
|
iVar18 = vector_to_direction(&shootDirection);
|
|
if ((iVar18 == iVar19) ||
|
|
(bVar4 = (GHIDRA_CAST<Vector *>((&this->_aimDirection)))->Vector::operator_ne(&g_vectorZero), bVar4 == 0)) {
|
|
bVar22 = false;
|
|
}
|
|
else {
|
|
bVar22 = true;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) < 0) ||
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18a8)))) == 0 && (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))) == 0 || (bVar22)))))) {
|
|
iVar19 = this->_fireBlockCooldown;
|
|
bVar22 = iVar19 == 0;
|
|
if (!bVar22) goto LAB_007802cb;
|
|
this->_cacheFlags = this->_cacheFlags | 2;
|
|
this->_epiphoraCharge = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18ac)))) = 0xffffffff;
|
|
EvaluateItems(this);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (((bVar4 != 0) && (isShooting != '\0')) &&
|
|
(bVar4 = IsExtraAnimationFinished(this), bVar4 != 0)) {
|
|
FUN_00428b50();
|
|
cVar5 = FUN_0082ee30();
|
|
if (cVar5 == '\0') {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x4000);
|
|
trigger_fire_item_effects(this,&shootDirection,(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_284)) + 0x0))));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddEntityFlags(0x4000);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar4 == 0) && (this->_epiphoraCharge < 0xb4)) {
|
|
this->_cacheFlags = this->_cacheFlags | 2;
|
|
this->_epiphoraCharge = this->_epiphoraCharge + 1;
|
|
EvaluateItems(this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
iVar19 = this->_fireBlockCooldown;
|
|
bVar22 = iVar19 == 0;
|
|
LAB_007802cb:
|
|
if (bVar22 || iVar19 < 0) {
|
|
(GHIDRA_CAST<Vector *>((&this->_aimDirection)))->Vector::operator_assign(&shootDirection);
|
|
this->_areOpposingShootDirectionsPressed = isOpposingDirections;
|
|
if (isDirectionHeld == 0) {
|
|
std::deque<ptr>::_Tidy();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Vector *>((&this->_lastDirection)))->Vector::operator_assign(&shootDirection);
|
|
FUN_007dc7b0(&shootDirection);
|
|
uVar9 = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1668)))))))->Room::GetGridHeight();
|
|
while (3 < uVar9) {
|
|
FUN_00499560();
|
|
uVar9 = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1668)))))))->Room::GetGridHeight();
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00780560
|
|
BitSet128 * Entity_Player::GetBombFlags(BitSet128 *outFlags, byte isRollChances)
|
|
{
|
|
byte isHasCollectible;
|
|
uint uVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
uint uVar4;
|
|
uint uVar5;
|
|
bool bVar6;
|
|
bool bVar7;
|
|
uint flagsLowHiWord;
|
|
BitSet128 nancyBombFlags [16];
|
|
qword flagsHigh;
|
|
uint *flagsWord;
|
|
|
|
*GHIDRA_CAST<undefined4 *>(&outFlags->_l) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&outFlags->_l) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&outFlags->_h) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&outFlags->_h) + 4)) = 0;
|
|
isHasCollectible = HasCollectible(this,0x7d,0);
|
|
if (isHasCollectible != 0) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagHoming._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagHoming._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x8c,0);
|
|
if (isHasCollectible != 0) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagPoison._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagPoison._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0xd1,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 0x12 - GHIDRA_INT((this->_luck * -3.0)))))) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagButtBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagButtBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagButtBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagButtBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x100,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 0x19 - GHIDRA_INT((this->_luck * -6.0)))))) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagBurn._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagBurn._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0xdc,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 10 - GHIDRA_INT((this->_luck * -3.0)))))) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagSadBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSadBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagSadBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSadBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x16e,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 0x21 - GHIDRA_INT((this->_luck * -8.0)))))) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagScatterBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagScatterBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagScatterBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagScatterBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x16f,0);
|
|
if (isHasCollectible != 0) {
|
|
uVar4 = GHIDRA_UINT(g_tearFlagSticky._l) | GHIDRA_UINT(g_tearFlagEgg._l);
|
|
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSticky._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagEgg._l)) + 0x4)));
|
|
uVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSticky._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagEgg._h)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagSticky._h) | GHIDRA_UINT(g_tearFlagEgg._h)
|
|
;
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | uVar4;
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | uVar1;
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | uVar5;
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x1b0,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 10 - GHIDRA_INT((this->_luck * -3.0)))))) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagGlitterBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlitterBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagGlitterBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlitterBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x13b,0);
|
|
if (isHasCollectible != 0) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagAttractor._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAttractor._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagAttractor._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAttractor._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x161,0);
|
|
if (isHasCollectible != 0) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagCrossBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCrossBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagCrossBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCrossBomb._h)) + 0x4)));
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x47)) {
|
|
iVar3 = GetTrinketMultiplier(this,0x47);
|
|
bVar7 = false;
|
|
bVar6 = iVar3 == 0;
|
|
LAB_007808cb:
|
|
if (bVar6 || bVar7 != iVar3 < 0) {
|
|
flagsLowHiWord = *GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
goto LAB_00780901;
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x47);
|
|
bVar7 = SBORROW4(iVar2,1);
|
|
iVar3 = iVar2 + -1;
|
|
bVar6 = iVar2 == 1;
|
|
goto LAB_007808cb;
|
|
}
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagCreepTrail._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCreepTrail._l)) + 0x4)));
|
|
flagsLowHiWord = *GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagCreepTrail._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCreepTrail._h)) + 0x4)));
|
|
LAB_00780901:
|
|
uVar1 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
flagsHigh = outFlags->_h;
|
|
if ((this->_hasGoldenBomb != 0) && (isRollChances == 0)) {
|
|
uVar4 = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagGoldenBomb._l);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGoldenBomb._l)) + 0x4))) | flagsLowHiWord;
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = uVar4;
|
|
uVar1 = uVar1 | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGoldenBomb._h)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(flagsHigh) | GHIDRA_UINT(g_tearFlagGoldenBomb._h);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4)) = uVar1;
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x205,0);
|
|
if ((isHasCollectible != 0) && (isRollChances == 0)) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagFastBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFastBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagFastBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFastBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x266,0);
|
|
if (isHasCollectible != 0) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagBloodBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBloodBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagBloodBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBloodBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x286,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 10 - GHIDRA_INT((this->_luck * -3.0)))))) {
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagBrimstoneBomb._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBrimstoneBomb._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(g_tearFlagBrimstoneBomb._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBrimstoneBomb._h)) + 0x4)));
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x2d7,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 0x21 - GHIDRA_INT((this->_luck * -8.0)))))) {
|
|
uVar5 = GHIDRA_UINT(g_tearFlagGhostBomb._h) | GHIDRA_UINT(g_tearFlagSpectral._h);
|
|
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGhostBomb._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4)));
|
|
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGhostBomb._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) =
|
|
GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(g_tearFlagGhostBomb._l) | GHIDRA_UINT(g_tearFlagSpectral._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | uVar1;
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | uVar5;
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | uVar4;
|
|
}
|
|
isHasCollectible = HasCollectible(this,0x233,0);
|
|
if ((isHasCollectible != 0) &&
|
|
((isRollChances == 0 ||
|
|
(uVar1 = Random(), GHIDRA_INT((uVar1 % 100)) <= 0x32 - GHIDRA_INT((this->_luck * -8.0)))))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagHoming._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagHoming._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[1]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagPoison._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[1]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[1]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagPoison._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[1]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[2]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagButtBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[2]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagButtBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[2]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagButtBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[2]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagButtBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[3]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagBurn._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[3]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[3]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagBurn._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[3]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[4]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagSadBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[4]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSadBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[4]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagSadBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[4]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSadBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[5]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagScatterBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[5]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagScatterBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[5]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagScatterBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[6]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSticky._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagEgg._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[5]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagScatterBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[6]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagSticky._l) | GHIDRA_UINT(g_tearFlagEgg._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[6]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagSticky._h) | GHIDRA_UINT(g_tearFlagEgg._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[6]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSticky._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagEgg._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[7]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagGlitterBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[7]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlitterBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[7]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagGlitterBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[7]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlitterBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[8]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagAttractor._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[8]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAttractor._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[8]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagAttractor._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[8]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAttractor._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[9]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagCrossBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[9]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCrossBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[9]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagCrossBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[9]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCrossBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[10]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagCreepTrail._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[10]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCreepTrail._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[10]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagCreepTrail._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[10]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCreepTrail._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xb]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagGoldenBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xb]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGoldenBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xb]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagGoldenBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xb]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGoldenBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xc]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagFastBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xc]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFastBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xc]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagFastBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xc]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFastBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xd]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagBloodBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xd]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBloodBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xd]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagBloodBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xd]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBloodBomb._h)) + 0x4)));
|
|
uVar1 = GHIDRA_UINT((15.0 - this->_luck));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xe]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagBrimstoneBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xe]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBrimstoneBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xe]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagBrimstoneBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xe]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBrimstoneBomb._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xf]._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagGhostBomb._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xf]._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGhostBomb._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xf]._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagGhostBomb._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(nancyBombFlags[0xf]._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGhostBomb._h)) + 0x4)));
|
|
if (uVar1 == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
uVar4 = Random();
|
|
uVar4 = uVar4 % uVar1;
|
|
}
|
|
iVar3 = (GHIDRA_INT(uVar4) < 5) + 2;
|
|
if (2 < GHIDRA_INT(uVar4)) {
|
|
iVar3 = (GHIDRA_INT(uVar4) < 5) + 1;
|
|
}
|
|
iVar2 = iVar3 + 1;
|
|
if (uVar4 != 0) {
|
|
iVar2 = iVar3;
|
|
}
|
|
do {
|
|
uVar1 = Random();
|
|
uVar1 = uVar1 & 0xf;
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = GHIDRA_UINT(outFlags->_l) | GHIDRA_UINT(nancyBombFlags[uVar1]._l);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
*flagsWord = *flagsWord | *GHIDRA_CAST<uint *>((GHIDRA_INT(&nancyBombFlags[uVar1]._l) + 4));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(outFlags->_h) | GHIDRA_UINT(nancyBombFlags[uVar1]._h);
|
|
flagsWord = GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*flagsWord = *flagsWord | *GHIDRA_CAST<uint *>((GHIDRA_INT(&nancyBombFlags[uVar1]._h) + 4));
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
}
|
|
uVar1 = GHIDRA_UINT(outFlags->_l);
|
|
uVar4 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4));
|
|
if (((uVar1 & GHIDRA_UINT(g_tearFlagGhostBomb._l)) != 0 || (uVar4 & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGhostBomb._l)) + 0x4)))) != 0)
|
|
|| ((GHIDRA_UINT(outFlags->_h) & GHIDRA_UINT(g_tearFlagGhostBomb._h)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGhostBomb._h)) + 0x4)))) != 0)) {
|
|
uVar4 = uVar4 | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4)));
|
|
flagsHigh = outFlags->_h;
|
|
uVar5 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_l) = uVar1 | GHIDRA_UINT(g_tearFlagSpectral._l);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_l) + 4)) = uVar4;
|
|
uVar5 = uVar5 | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&outFlags->_h) = GHIDRA_UINT(flagsHigh) | GHIDRA_UINT(g_tearFlagSpectral._h);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&outFlags->_h) + 4)) = uVar5;
|
|
}
|
|
return outFlags;
|
|
}
|
|
|
|
// 00780eb0
|
|
undefined4 Entity_Player::GetBombVariant()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
// 00780ec0
|
|
float Entity_Player::check_bomb_tearflags(BitSet128 tearFlags)
|
|
{
|
|
byte isHasCollectible;
|
|
|
|
isHasCollectible = HasCollectible(this,0x6a,0);
|
|
if (isHasCollectible == 0) {
|
|
if (((GHIDRA_UINT(tearFlags._l) & GHIDRA_UINT(g_tearFlagPersistent._l)) == 0 &&
|
|
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPersistent._l)) + 0x4))) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)))) == 0) &&
|
|
((GHIDRA_UINT(tearFlags._h) & GHIDRA_UINT(g_tearFlagPersistent._h)) == 0 &&
|
|
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPersistent._h)) + 0x4))) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)))) == 0)) {
|
|
isHasCollectible = HasCollectible(this,0x1a4,0);
|
|
if (isHasCollectible == 0) {
|
|
return 1.0;
|
|
}
|
|
}
|
|
}
|
|
return 1.5;
|
|
}
|
|
|
|
// 00780f40
|
|
void Entity_Player::update_bomb_input()
|
|
{
|
|
BitSet128 tearFlags;
|
|
uint uVar1;
|
|
uint uVar2;
|
|
uint uVar3;
|
|
byte bVar4;
|
|
char isDamaged;
|
|
undefined3 extraout_var;
|
|
EntityRef *sourceRef;
|
|
float *extraout_EAX;
|
|
uint rngResult;
|
|
Entity *pEVar5;
|
|
int iVar6;
|
|
Entity_Player *self;
|
|
int iVar7;
|
|
int *gigaBombsLeft;
|
|
undefined4 extraout_EDX;
|
|
undefined4 rngResult;
|
|
Manager *manager;
|
|
bool bVar9;
|
|
bool bVar10;
|
|
float fVar11;
|
|
float fVar12;
|
|
float fVar13;
|
|
void *bombRadius;
|
|
undefined4 damageAmount;
|
|
float fVar14;
|
|
float fVar15;
|
|
float fStack_d0;
|
|
char isPartnerGigaBomb;
|
|
char isRocket;
|
|
byte isFreeBomb;
|
|
undefined3 uStack_c7;
|
|
float fStack_c4;
|
|
Entity *pEStack_c0;
|
|
float fStack_bc;
|
|
Vector launchVelocity;
|
|
int bombIndex;
|
|
uint bombVariant;
|
|
int bombCount;
|
|
float bombScale;
|
|
Vector aimDir;
|
|
Vector bombVelocity;
|
|
Vector inheritedVelocity;
|
|
BitSet128 bombFlags;
|
|
BitSet128 bombFlagsCopy;
|
|
EntityRef damageSource;
|
|
Game *game;
|
|
bool isGigaBomb;
|
|
undefined1 lerpT [16];
|
|
EntityPtr partnerPlayer;
|
|
code *takeDamageFn;
|
|
|
|
if (((this->_isCoopGhost == 0) && (bVar4 = IsHologram(this), bVar4 == 0)) &&
|
|
(this->_playerType != 0x28)) {
|
|
if (this->_playerType == 0x19) {
|
|
if (((this->_isControlsEnabled != 0) && (this->_controlsCooldown < 1)) &&
|
|
((bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::HasEntityFlags(0x800), bVar4 == 0 &&
|
|
((bVar4 = input_is_action_triggered(g_manager,8,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0),
|
|
bVar4 != 0 &&
|
|
(this->_lastActionTriggers = this->_lastActionTriggers | 1, 0 < this->_poopMana)))))) {
|
|
UsePoopSpell(this,this->_poopSpellQueue[0]);
|
|
this->_poopSpellQueue[0] = this->_poopSpellQueue[1];
|
|
this->_poopSpellQueue[1] = this->_poopSpellQueue[2];
|
|
this->_poopSpellQueue[2] = this->_poopSpellQueue[3];
|
|
this->_poopSpellQueue[3] = this->_poopSpellQueue[4];
|
|
this->_poopSpellQueue[4] = this->_poopSpellQueue[5];
|
|
this->_poopSpellQueue[5] = 0;
|
|
poop_spell_roll(this);
|
|
AddPoopMana(this,-1);
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
iVar7 = this->_bombPlaceDelay;
|
|
if (iVar7 < 1) {
|
|
bVar4 = AreControlsEnabled(self);
|
|
if (((bVar4 != 0) && (bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x800), bVar4 == 0)) &&
|
|
(bVar4 = input_is_action_triggered(g_manager,8,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0),
|
|
bVar4 != 0)) {
|
|
this->_lastActionTriggers = this->_lastActionTriggers | 1;
|
|
isFreeBomb = this->_hasGoldenBomb;
|
|
partnerPlayer = this->_twinPlayer;
|
|
isGigaBomb = 0 < this->_numGigaBombs;
|
|
isPartnerGigaBomb = '\0';
|
|
uStack_c7 = extraout_var;
|
|
if (partnerPlayer != (EntityPtr)0x0) {
|
|
bVar4 = HasCollectible(GHIDRA_CAST<Entity_Player *>(partnerPlayer),0x205,0);
|
|
iVar7 = 0x1e;
|
|
if (bVar4 != 0) {
|
|
iVar7 = 1;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(partnerPlayer) + 0x1610)) == iVar7) &&
|
|
(isFreeBomb = 1, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(partnerPlayer) + 0x1dd8)) != '\0')) {
|
|
isGigaBomb = true;
|
|
isPartnerGigaBomb = '\x01';
|
|
}
|
|
}
|
|
partnerPlayer = this->_parent;
|
|
if ((partnerPlayer != (EntityPtr)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(partnerPlayer) + 0x28)) == 1)) {
|
|
bVar4 = HasCollectible(GHIDRA_CAST<Entity_Player *>(partnerPlayer),0x205,0);
|
|
iVar7 = 0x1e;
|
|
if (bVar4 != 0) {
|
|
iVar7 = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(partnerPlayer) + 0x1610)) == iVar7) {
|
|
isFreeBomb = 1;
|
|
uStack_c7 = 0;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(partnerPlayer) + 0x1dd8)) != '\0') {
|
|
isGigaBomb = true;
|
|
isPartnerGigaBomb = '\x01';
|
|
}
|
|
}
|
|
}
|
|
if (((this->_numBombs < 1) && (isFreeBomb == 0)) && (this->_bombPlaceDelay < 1)) {
|
|
bVar4 = HasCollectible(this,0x266,0);
|
|
game = g_game;
|
|
if (bVar4 != 0) {
|
|
if ((this->_playerType == 0x24) && (0 < this->_effectiveBloodCharge)) {
|
|
AddBloodCharge(this,-1);
|
|
isFreeBomb = 1;
|
|
uStack_c7 = 0;
|
|
}
|
|
else {
|
|
this->_damageCooldown = 0;
|
|
takeDamageFn = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
if (*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) {
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((&damageSource)))->EntityRef::EntityRef();
|
|
damageAmount = 0x3f800000;
|
|
rngResult = 0;
|
|
}
|
|
else {
|
|
damageAmount = 0x41000000;
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((&damageSource)))->EntityRef::EntityRef();
|
|
rngResult = extraout_EDX;
|
|
}
|
|
isDamaged = (*takeDamageFn)(damageAmount,0x42820,rngResult,sourceRef,0x1e);
|
|
if (isDamaged != '\0') {
|
|
isFreeBomb = 1;
|
|
}
|
|
uStack_c7 = 0;
|
|
}
|
|
}
|
|
}
|
|
if (((0 < this->_numBombs) || (isFreeBomb != 0)) && (this->_bombPlaceDelay < 1)) {
|
|
bVar4 = HasCollectible(this,0x205,0);
|
|
game = g_game;
|
|
iVar7 = 0x1e;
|
|
if (bVar4 != 0) {
|
|
iVar7 = 1;
|
|
}
|
|
this->_bombPlaceDelay = iVar7;
|
|
if ((1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) &&
|
|
(iVar7 = (**(code **)(*GHIDRA_CAST<int *>((game->_deathmatchManager)._type) + 4))(), iVar7 == 3))
|
|
{
|
|
this->_bombPlaceDelay = 0xf;
|
|
}
|
|
bombCount = 1;
|
|
bVar4 = HasTrinket(this,0xa4,0);
|
|
if (bVar4 != 0) {
|
|
bombCount = GetTrinketMultiplier(this,0xa4);
|
|
bombCount = bombCount + 1;
|
|
}
|
|
bombIndex = 0;
|
|
if (0 < bombCount) {
|
|
do {
|
|
GetBombFlags(this,&bombFlags,0);
|
|
uVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bombFlags._h)) + 0x4)));
|
|
uVar2 = GHIDRA_UINT(bombFlags._h);
|
|
fVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bombFlags._l)) + 0x4)));
|
|
uVar1 = GHIDRA_UINT(bombFlags._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bombFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = GHIDRA_UINT(bombFlags._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = GHIDRA_UINT(bombFlags._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bombFlags._h)) + 0x4)));
|
|
bombScale = check_bomb_tearflags(this,tearFlags);
|
|
launchVelocity.x = (this->_velocity).x * 0.1;
|
|
launchVelocity.y = (this->_velocity).y * 0.1;
|
|
bombVelocity.x = launchVelocity.x;
|
|
bombVelocity.y = launchVelocity.y;
|
|
bVar4 = HasCollectible(this,0x247,0);
|
|
if (bVar4 == 0) {
|
|
LAB_00781520:
|
|
iVar7 = 0;
|
|
bombVariant = 0;
|
|
isRocket = '\0';
|
|
fStack_d0 = 0.0;
|
|
if (isGigaBomb) {
|
|
LAB_00781539:
|
|
bombScale = 1.0;
|
|
bombVariant = 0x11;
|
|
if (iVar7 == 0x13) {
|
|
bombVariant = 0x14;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
fStack_c4 = 0.0;
|
|
pEStack_c0 = GHIDRA_CAST<Entity *>(0x0);
|
|
if ((this->_fireDirection != -1) &&
|
|
((pEVar5 = GHIDRA_CAST<Entity *>((this->_aimDirection).x), (float)pEVar5 != g_vectorZero.x
|
|
|| ((this->_aimDirection).y != g_vectorZero.y)))) {
|
|
fStack_c4 = (this->_aimDirection).y;
|
|
pEStack_c0 = pEVar5;
|
|
}
|
|
if (((float)pEStack_c0 == g_vectorZero.x) && (fStack_c4 == g_vectorZero.y))
|
|
goto LAB_00781520;
|
|
aimDir.x = (float)pEStack_c0;
|
|
aimDir.y = fStack_c4;
|
|
fVar11 = sqrtf((float)pEStack_c0 * (float)pEStack_c0 + fStack_c4 * fStack_c4);
|
|
if (0.0 < fVar11) {
|
|
pEStack_c0 = GHIDRA_CAST<Entity *>(((float)pEStack_c0 * (1.0 / fVar11)));
|
|
fStack_c4 = fStack_c4 * (1.0 / fVar11);
|
|
aimDir.x = (float)pEStack_c0;
|
|
aimDir.y = fStack_c4;
|
|
}
|
|
GetTearMovementInheritance(this,&inheritedVelocity,&aimDir,0);
|
|
launchVelocity.x = (float)pEStack_c0 * 10.0 + *extraout_EAX;
|
|
launchVelocity.y = fStack_c4 * 10.0 + extraout_EAX[1];
|
|
bombVelocity.x = launchVelocity.x;
|
|
bombVelocity.y = launchVelocity.y;
|
|
fStack_d0 = atan2f(fStack_c4,(float)pEStack_c0);
|
|
iVar7 = 0x13;
|
|
fStack_d0 = fStack_d0 * 57.295776;
|
|
bombVariant = 0x13;
|
|
isRocket = '\x01';
|
|
if (isGigaBomb) {
|
|
(this->_velocity).x = (this->_velocity).x - (float)pEStack_c0 * 5.0;
|
|
(this->_velocity).y = (this->_velocity).y - fStack_c4 * 5.0;
|
|
goto LAB_00781539;
|
|
}
|
|
}
|
|
rngResult = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(4,bombVariant,&this->_pos,&bombVelocity,GHIDRA_CAST<Entity *>(this)
|
|
,0,rngResult,0);
|
|
pEStack_c0 = pEVar5;
|
|
if (1 < bombCount) {
|
|
if (isRocket == '\0') {
|
|
rngResult = Random();
|
|
fStack_bc = (float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
fStack_bc = fStack_bc + fStack_bc;
|
|
fVar13 = cos(fStack_bc);
|
|
fVar11 = (this->_pos).x;
|
|
fVar14 = sin(fStack_bc);
|
|
fVar12 = (this->_pos).y;
|
|
(pEVar5->_pos).x = fVar13 * 8.0 + fVar11;
|
|
(pEVar5->_pos).y = fVar14 * 8.0 + fVar12;
|
|
}
|
|
else {
|
|
fVar11 = sqrtf(launchVelocity.x * launchVelocity.x +
|
|
launchVelocity.y * launchVelocity.y);
|
|
if (0.0 < fVar11) {
|
|
launchVelocity.x = launchVelocity.x * (1.0 / fVar11);
|
|
launchVelocity.y = launchVelocity.y * (1.0 / fVar11);
|
|
}
|
|
fVar12 = launchVelocity.x * 80.0;
|
|
fVar11 = (this->_pos).x;
|
|
fStack_c4 = (float)bombCount * 3.0;
|
|
fStack_bc = (this->_pos).y - launchVelocity.y * 80.0;
|
|
fVar13 = -fStack_c4;
|
|
if ((float)(bombCount + -1) == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Start and End parameters cannot be the same!"));
|
|
}
|
|
fVar14 = ((float)bombIndex - 0.0) / ((float)(bombCount + -1) - 0.0);
|
|
lerpT = ZEXT416(GHIDRA_UINT(fVar14));
|
|
if (fVar14 <= 0.0) {
|
|
lerpT = ZEXT816(0);
|
|
}
|
|
if (1.0 <= (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(lerpT)) + 0x0)))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(lerpT)) + 0x0))) = 0x3f800000;
|
|
}
|
|
fStack_c4 = ((fStack_c4 - fVar13) * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(lerpT)) + 0x0))) + fVar13) * 0.017453292;
|
|
fVar13 = cos(fStack_c4);
|
|
fVar14 = sin(fStack_c4);
|
|
(pEVar5->_pos).y =
|
|
(launchVelocity.x * fVar14 + launchVelocity.y * fVar13) * 80.0 + fStack_bc;
|
|
(pEVar5->_pos).x =
|
|
(launchVelocity.x * fVar13 - launchVelocity.y * fVar14) * 80.0 +
|
|
(fVar11 - fVar12);
|
|
}
|
|
}
|
|
pEVar5[1]._collisionIndex = GHIDRA_INT(bombScale);
|
|
*GHIDRA_CAST<float *>(&pEVar5[1]._pendingDamageFlags) = fStack_d0;
|
|
pEVar5[1]._type = uVar1;
|
|
pEVar5[1]._variant = GHIDRA_INT(fVar15);
|
|
pEVar5[1]._subtype = uVar2;
|
|
pEVar5[1]._spawnerType = uVar3;
|
|
pEVar5[1]._sprite._filename._buf[0xb] = '\x01';
|
|
manager = g_manager;
|
|
fStack_bc = (float)(uVar3 & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlitterBomb._h)) + 0x4))));
|
|
fStack_c4 = fVar15;
|
|
if (((uVar1 & GHIDRA_UINT(g_tearFlagGlitterBomb._l)) != 0 ||
|
|
(GHIDRA_UINT(fVar15) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlitterBomb._l)) + 0x4)))) != 0) ||
|
|
((uVar2 & GHIDRA_UINT(g_tearFlagGlitterBomb._h)) != 0 || fStack_bc != 0.0)) {
|
|
fStack_d0 = 1.21493e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&fStack_d0));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(fStack_d0),1.0,2,0,1.0,0.0);
|
|
pEVar5 = pEStack_c0;
|
|
}
|
|
if (1.5 <= bombScale) {
|
|
pEVar5[1]._damageEvents._begin =
|
|
(void *)((float)pEVar5[1]._damageEvents._begin + 85.0);
|
|
}
|
|
if (isGigaBomb) {
|
|
if ((pEVar5->_sprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::AdvancePosition
|
|
(&(pEVar5->_sprite)._animState,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((pEVar5->_sprite)._animState._animData) + 0x30)) + -1);
|
|
}
|
|
*GHIDRA_CAST<int *>((pEVar5 + 1)) = 0x2d;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pEVar5[1])) + 0x4)))) = 0x2d;
|
|
}
|
|
if (bombIndex == 0) {
|
|
if (isPartnerGigaBomb == '\0') {
|
|
fStack_bc = (float)(this->_numGigaBombs - 1);
|
|
gigaBombsLeft = GHIDRA_CAST<int *>(&fStack_bc);
|
|
if (this->_numBombs <= GHIDRA_INT(fStack_bc)) {
|
|
gigaBombsLeft = &this->_numBombs;
|
|
}
|
|
iVar7 = 0;
|
|
if (0 < *gigaBombsLeft) {
|
|
iVar7 = *gigaBombsLeft;
|
|
}
|
|
this->_numGigaBombs = iVar7;
|
|
ConsumableCountChanged(this,0x40);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
}
|
|
if (isFreeBomb == 0) {
|
|
iVar6 = this->_numBombs + -1;
|
|
iVar7 = 99;
|
|
if (iVar6 < 99) {
|
|
iVar7 = iVar6;
|
|
}
|
|
iVar6 = 0;
|
|
if (0 < iVar7) {
|
|
iVar6 = iVar7;
|
|
}
|
|
this->_numBombs = iVar6;
|
|
ConsumableCountChanged(this,4);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x85)) {
|
|
iVar7 = GetTrinketMultiplier(this,0x85);
|
|
bVar10 = false;
|
|
bVar9 = iVar7 == 0;
|
|
LAB_007819da:
|
|
if (!bVar9 && bVar10 == iVar7 < 0) goto LAB_007819e1;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar6 = GetTrinketMultiplier(this,0x85);
|
|
bVar10 = SBORROW4(iVar6,1);
|
|
iVar7 = iVar6 + -1;
|
|
bVar9 = iVar6 == 1;
|
|
goto LAB_007819da;
|
|
}
|
|
LAB_007819e1:
|
|
*GHIDRA_CAST<int *>((pEVar5 + 1)) = 0x16;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pEVar5[1])) + 0x4)))) = 0x16;
|
|
iVar7 = GetTrinketMultiplier(this,0x85);
|
|
if (iVar7 == 1) {
|
|
bombRadius = (void *)((float)pEVar5[1]._damageEvents._begin + 15.000001);
|
|
}
|
|
else if (iVar7 == 2) {
|
|
bombRadius = (void *)((float)pEVar5[1]._damageEvents._begin + 30.000002);
|
|
}
|
|
else {
|
|
if (iVar7 != 3) goto LAB_00781a4c;
|
|
bombRadius = (void *)((float)pEVar5[1]._damageEvents._begin + 50.0);
|
|
}
|
|
pEVar5[1]._damageEvents._begin = bombRadius;
|
|
}
|
|
LAB_00781a4c:
|
|
if (((uVar1 & GHIDRA_UINT(g_tearFlagFastBomb._l)) != 0 ||
|
|
(GHIDRA_UINT(fStack_c4) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFastBomb._l)) + 0x4)))) != 0) ||
|
|
((uVar2 & GHIDRA_UINT(g_tearFlagFastBomb._h)) != 0 ||
|
|
(uVar3 & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFastBomb._h)) + 0x4)))) != 0)) {
|
|
rngResult = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEStack_c0->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&pEStack_c0->_flags) = GHIDRA_UINT(pEStack_c0->_flags) | 0x4000000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEStack_c0->_flags) + 4)) = rngResult;
|
|
}
|
|
manager = g_manager;
|
|
if (bombIndex == 0) {
|
|
if (isRocket == '\0') {
|
|
fStack_d0 = 5.60519e-44;
|
|
LAB_00781b30:
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&fStack_d0));
|
|
fVar15 = 1.0;
|
|
}
|
|
else {
|
|
if (bombVariant != 0x14) {
|
|
fStack_d0 = 7.52497e-43;
|
|
goto LAB_00781b30;
|
|
}
|
|
fStack_d0 = 6.75426e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&fStack_d0));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(fStack_d0),1.0,4,0,1.0,0.0);
|
|
manager = g_manager;
|
|
fStack_d0 = 7.52497e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&fStack_d0));
|
|
fVar15 = 0.8;
|
|
}
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(fStack_d0),1.0,4,0,fVar15,0.0);
|
|
}
|
|
pEStack_c0->Update();
|
|
bombIndex = bombIndex + 1;
|
|
} while (bombIndex < bombCount);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar4 == 0) {
|
|
this->_bombPlaceDelay = iVar7 + -1;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00782630
|
|
void Entity_Player::GetFlyingOffset(Vector *outOffset)
|
|
{
|
|
float zeroX;
|
|
|
|
zeroX = g_vectorZero.x;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x10) {
|
|
outOffset->y = g_vectorZero.y;
|
|
outOffset->x = zeroX;
|
|
return;
|
|
}
|
|
if (this->_canFly == 0) {
|
|
outOffset->y = g_vectorZero.y;
|
|
outOffset->x = zeroX;
|
|
return;
|
|
}
|
|
outOffset->y = -4.0;
|
|
outOffset->x = 0.0;
|
|
return;
|
|
}
|
|
|
|
// 007826d0
|
|
void Entity_Player::trigger_fire_item_effects(Vector *direction, byte isShotFired)
|
|
{
|
|
char isLocalPlayer;
|
|
byte bVar1;
|
|
uint uVar2;
|
|
Entity *deadToothRing;
|
|
undefined4 isInputDisabledArg;
|
|
int remaining;
|
|
void **weaponSlot;
|
|
float ringScaleY;
|
|
undefined3 in_stack_00000009;
|
|
Entity_Player *apEStack_c [2];
|
|
undefined1 *deadToothRingRef;
|
|
Game *game;
|
|
EntityPtr *parentRef;
|
|
code *weaponFireFn;
|
|
|
|
apEStack_c[0] = this;
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) ||
|
|
(isLocalPlayer = (**(code **)(*GHIDRA_CAST<int *>((g_game->_deathmatchManager)._type) + 0x48))(this),
|
|
isLocalPlayer != '\0')) {
|
|
bVar1 = HasCollectible(this,0x1be,0);
|
|
if ((bVar1 != 0) &&
|
|
((isShotFired != 0 &&
|
|
(deadToothRingRef = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438))), *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1438)))) == 0)))) {
|
|
uVar2 = Random();
|
|
deadToothRing =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x6a,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar2,0);
|
|
ringScaleY = g_vectorOne.y * 0.8;
|
|
(deadToothRing->_sprite)._scale.x = g_vectorOne.x * 0.8;
|
|
(deadToothRing->_sprite)._scale.y = ringScaleY;
|
|
if (*GHIDRA_CAST<int *>(deadToothRingRef) != 0) {
|
|
apEStack_c[0] = GHIDRA_CAST<Entity_Player *>(deadToothRingRef);
|
|
std::multiset<unsigned_int>::erase(apEStack_c);
|
|
}
|
|
*GHIDRA_CAST<Entity **>(deadToothRingRef) = deadToothRing;
|
|
if (deadToothRing != GHIDRA_CAST<Entity *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(deadToothRingRef);
|
|
}
|
|
parentRef = &deadToothRing->_parent;
|
|
if (deadToothRing->_parent != (EntityPtr)0x0) {
|
|
apEStack_c[0] = GHIDRA_CAST<Entity_Player *>(parentRef);
|
|
std::multiset<unsigned_int>::erase(apEStack_c);
|
|
}
|
|
*parentRef = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(parentRef);
|
|
deadToothRing->Update();
|
|
}
|
|
bVar1 = HasCollectible(this,0x1f6,0);
|
|
game = g_game;
|
|
if ((((bVar1 != 0) && (isShotFired != 0)) && ((this->_flags & 0x4000) == 0)) &&
|
|
(((bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar1 == 0 && (game->_frameCount % 0x1e == 0)) &&
|
|
(uVar2 = Random(), uVar2 % 3 == 0)))) {
|
|
DoZitEffect(this,direction);
|
|
}
|
|
if (this->_weapons[0] != GHIDRA_CAST<int *>(0x0)) {
|
|
weaponFireFn = *(code **)(*GHIDRA_CAST<int *>(this->_weapons[0]) + 0xc);
|
|
uVar2 = GHIDRA_UINT(this->_flags) & 0x4000;
|
|
if (uVar2 == 0) {
|
|
(*weaponFireFn)(direction,_isShotFired,0);
|
|
return;
|
|
}
|
|
(*weaponFireFn)(direction,_isShotFired,CONCAT31((int3)(uVar2 >> 8),1));
|
|
return;
|
|
}
|
|
weaponSlot = this->_weapons;
|
|
remaining = 4;
|
|
do {
|
|
weaponSlot = weaponSlot + 1;
|
|
if (*weaponSlot != GHIDRA_CAST<int *>(0x0)) {
|
|
apEStack_c[0] = *GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>(*weaponSlot) + 0xc));
|
|
uVar2 = GHIDRA_UINT(this->_flags) & 0x4000;
|
|
if (uVar2 == 0) {
|
|
isInputDisabledArg = 0;
|
|
}
|
|
else {
|
|
isInputDisabledArg = CONCAT31((int3)(uVar2 >> 8),1);
|
|
}
|
|
(*(code *)apEStack_c[0])(direction,_isShotFired,isInputDisabledArg);
|
|
}
|
|
remaining = remaining + -1;
|
|
} while (remaining != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007828f0
|
|
byte * Entity_Player::GetDeathAnimName()
|
|
{
|
|
byte isLostCurse;
|
|
int effectNum;
|
|
char *animName;
|
|
int playerType;
|
|
|
|
playerType = this->_playerType;
|
|
if ((((playerType != 10) && (playerType != 0x1f)) && (playerType != 0x27)) &&
|
|
((playerType != 0x28 && (playerType != 0x11)))) {
|
|
effectNum = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2a5);
|
|
if (effectNum != 1) {
|
|
effectNum = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetNullEffectNum(0x65);
|
|
if (effectNum != 1) {
|
|
isLostCurse = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x70);
|
|
if (((isLostCurse == 0) && ((this->_variant != 1 || (this->_babySkin != 0x3b)))) &&
|
|
(this->_isCoopGhost == 0)) {
|
|
if (playerType == 0x23) {
|
|
return GHIDRA_CAST<byte *>("ForgottenDeath");
|
|
}
|
|
animName = "HoleDeath";
|
|
if (this->_pitfallState == 0) {
|
|
animName = "Death";
|
|
}
|
|
return GHIDRA_CAST<byte *>(animName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return GHIDRA_CAST<byte *>("LostDeath");
|
|
}
|
|
|
|
// 00782a40
|
|
Entity * Entity_Player::GetActiveWeaponEntity()
|
|
{
|
|
Entity *weaponEntity;
|
|
int *weapon;
|
|
|
|
weapon = this->_weapons[0];
|
|
if ((weapon == GHIDRA_CAST<int *>(0x0)) && (weapon = this->_weapons[1], weapon == GHIDRA_CAST<int *>(0x0))) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
/* WARNING: Could not recover jumptable at 0x00782a58. Too many branches */
|
|
/* WARNING: Treating indirect jump as call */
|
|
weaponEntity = GHIDRA_CAST<Entity *>((**(code **)(*weapon + 0x28))());
|
|
return weaponEntity;
|
|
}
|
|
|
|
// 00782a60
|
|
uint Entity_Player::CanTurnHead()
|
|
{
|
|
return GHIDRA_UINT(this->_headDirectionTime) >> 0x1f;
|
|
}
|
|
|
|
// 00782a70
|
|
float Entity_Player::FireDelay()
|
|
{
|
|
void *weapon;
|
|
|
|
weapon = this->_weapons[0];
|
|
if ((weapon == (void *)0x0) && (weapon = this->_weapons[1], weapon == (void *)0x0)) {
|
|
return 0.0;
|
|
}
|
|
return *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(weapon) + 0xc));
|
|
}
|
|
|
|
// 00782af0
|
|
void Entity_Player::Update()
|
|
{
|
|
byte bVar1;
|
|
BitSet128 tearFlags;
|
|
byte bVar2;
|
|
char cVar3;
|
|
short sVar4;
|
|
int iVar5;
|
|
Entity_Player *otherPlayer;
|
|
Entity *tmpEntity;
|
|
Vector *vecResult;
|
|
Room *room;
|
|
int iVar6;
|
|
EntityPtr *pEVar7;
|
|
PlayerManager *playerManager;
|
|
uint uVar8;
|
|
Vector *vecResult2;
|
|
EntityPtr EVar9;
|
|
float *pfVar10;
|
|
SoundEffects *sfx;
|
|
undefined4 *puVar11;
|
|
Entity_Effect *spawnedEffect;
|
|
Vector *other;
|
|
PauseScreen *pauseScreen;
|
|
uint *puVar12;
|
|
RNG *rng;
|
|
ColorMod *color;
|
|
BitSet128 *pBVar13;
|
|
Level *pLVar14;
|
|
int *piVar15;
|
|
void *pvVar16;
|
|
byte *pbVar17;
|
|
void *layerFrame;
|
|
ColorMod *color_00;
|
|
TemporaryEffects *tempEffects;
|
|
int numPlayers;
|
|
Entity_NPC *tractorBeam;
|
|
Vector *offset;
|
|
ItemConfig *itemConfig;
|
|
ItemConfig_Item *itemCfg;
|
|
Entity_Projectile *projectile;
|
|
Sprite *sprite;
|
|
ColorMod *color_01;
|
|
AnimationState *animState;
|
|
ColorMod *other_00;
|
|
ColorMod *other_01;
|
|
ColorMod *from;
|
|
LayerState *layer;
|
|
byte *layerCount;
|
|
ColorMod *extraout_EAX;
|
|
EntityList *entityList;
|
|
std_string *anim;
|
|
char *walkAnim;
|
|
EntityPtr EVar18;
|
|
undefined1 *puVar19;
|
|
ColorMod *Color;
|
|
ColorMod *color_02;
|
|
Entity_Player *deathAnimPlayer;
|
|
MusicManager *musicManager;
|
|
GridEntity *gridEntity;
|
|
int noHalfHpFloors;
|
|
PersistentGameData *persistentData;
|
|
Color *colorBuf;
|
|
ActiveItemDesc *activeDesc;
|
|
char *pcVar20;
|
|
ANM2 *pAVar21;
|
|
PlayerCostumeMap *costumeMap;
|
|
bool bVar22;
|
|
float10 projectileAngle;
|
|
float in_XMM0_Da;
|
|
float fVar23;
|
|
undefined1 auVar24 [12];
|
|
undefined1 auVar25 [12];
|
|
undefined1 auVar26 [16];
|
|
BitSet128 BVar27;
|
|
undefined1 extraout_var [12];
|
|
undefined1 extraout_var_00 [12];
|
|
undefined1 extraout_var_01 [12];
|
|
undefined1 extraout_var_02 [12];
|
|
undefined1 extraout_var_03 [12];
|
|
undefined1 extraout_var_04 [12];
|
|
undefined1 extraout_var_05 [12];
|
|
undefined1 auVar28 [12];
|
|
ulonglong uVar29;
|
|
EntityList aEStackY_5708 [128];
|
|
BitSet128 tearFlags_00;
|
|
Vector *in_stack_fffffdbc;
|
|
undefined4 uVar30;
|
|
uint uVar31;
|
|
float fVar32;
|
|
BitSet128 *pBVar33;
|
|
undefined4 uVar34;
|
|
undefined1 **src;
|
|
EntityRef *other_02;
|
|
Vector local_228 [3];
|
|
Vector local_210 [14];
|
|
BitSet128 local_1a0;
|
|
Vector local_190;
|
|
float local_188;
|
|
Vector scratchVec;
|
|
Vector local_17c;
|
|
Vector local_174;
|
|
Vector local_16c;
|
|
Vector local_164;
|
|
EntityPtr local_15c;
|
|
Vector local_158;
|
|
Vector local_150;
|
|
std_string *local_148;
|
|
Vector local_144;
|
|
Vector local_13c;
|
|
Entity_Player *player;
|
|
EntityPtr local_130;
|
|
byte local_12a;
|
|
byte local_129;
|
|
undefined4 local_128;
|
|
byte local_122;
|
|
char local_121;
|
|
EntityPtr local_120;
|
|
Color local_11c;
|
|
undefined1 local_f0 [88];
|
|
undefined1 local_98 [48];
|
|
undefined1 local_68 [20];
|
|
undefined1 *puStack_54;
|
|
float fStack_50;
|
|
float local_4c;
|
|
int local_48;
|
|
void *local_44;
|
|
char tmpString [8];
|
|
undefined1 local_24 [12];
|
|
int iStack_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
longlong elapsedMs;
|
|
Game *game;
|
|
ColorMod *tmpColor;
|
|
code *vfunc;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff534;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((local_24 + 0x20));
|
|
ExceptionList = &local_10;
|
|
local_158.y = 0.0;
|
|
local_15c = (EntityPtr)0x0;
|
|
player = this;
|
|
if (((this->_parent != (EntityPtr)0x0) && (this->_variant == 0)) &&
|
|
(this->_playerHUD == (void *)0x0)) {
|
|
PlayerHUD::make_ref(&g_game->_hud,GHIDRA_CAST<int *>(&local_16c),this);
|
|
local_8 = 0;
|
|
FUN_007dd3d0();
|
|
local_8 = 0xffffffff;
|
|
FUN_007dc660();
|
|
}
|
|
if (this->_playerHUD != GHIDRA_CAST<PlayerHUD *>(0x0)) {
|
|
(GHIDRA_CAST<PlayerHUD *>((this->_playerHUD)))->PlayerHUD::Update();
|
|
}
|
|
ItemUseAnim::update();
|
|
EVar9 = this->_salvationEffect;
|
|
if (EVar9 != (EntityPtr)0x0) {
|
|
get_salvation_scale();
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar9) + 0x478)) = in_XMM0_Da * 1.2;
|
|
EVar9 = this->_salvationEffect;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar9) + 0x34c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar9) + 0x350)) = 0xc1700000;
|
|
if ((this->_flags & 0x4000) == 0) {
|
|
in_XMM0_Da = 0.0;
|
|
}
|
|
else {
|
|
in_XMM0_Da = 0.5;
|
|
}
|
|
in_XMM0_Da = (float)((g_game->_frameCount - this->_spawnFrame) % 0x168) + in_XMM0_Da;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_salvationEffect) + 0xec)) = in_XMM0_Da;
|
|
}
|
|
if ((this->_playerType == 0x1d) || (this->_playerType == 0x26)) {
|
|
if (((this->_backupPlayer == (void *)0x0) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x170)) != '\0')) ||
|
|
((bVar2 = HasCollectible(this,0x26b,0), bVar2 == 0 &&
|
|
(bVar2 = HasCollectible(this->_backupPlayer,0x26b,0), bVar2 == 0)))) {
|
|
iVar5 = EntityPtr::Ref();
|
|
if ((iVar5 != 0) && (bVar2 = HasCollectible(this,0x26b,0), bVar2 == 0)) {
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
bVar2 = HasCollectible(otherPlayer,0x26b,0);
|
|
if ((bVar2 == 0) && (bVar2 = IsHologram(this), bVar2 == 0)) {
|
|
pvVar16 = (void *)EntityPtr::Ref();
|
|
this->_backupPlayer = pvVar16;
|
|
iVar5 = EntityPtr::Ref();
|
|
tmpEntity = GHIDRA_CAST<Entity *>(0x0);
|
|
*GHIDRA_CAST<Entity_Player **>((iVar5 + 0x1e6c)) = this;
|
|
iVar5 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((iVar5 + 0x1e68)))))->EntityPtr::Set(tmpEntity);
|
|
(GHIDRA_CAST<EntityPtr *>((&this->_twinPlayer)))->EntityPtr::Set(GHIDRA_CAST<Entity *>(0x0));
|
|
room_exit(this->_backupPlayer,0);
|
|
FUN_004173a0();
|
|
game = g_game;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x172)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x161c)) = 0xffffffff;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(local_24),3,-1,-1,0,0);
|
|
local_8 = 1;
|
|
uVar31 = 0;
|
|
iVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_24))))->EntityList::Size();
|
|
if (iVar5 != 0) {
|
|
do {
|
|
pEVar7 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
|
|
local_120 = *pEVar7;
|
|
pvVar16 = (void *)(GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(local_120))))->Entity_Familiar::Player();
|
|
if (pvVar16 == this->_backupPlayer) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(local_120) + 0x28))();
|
|
}
|
|
uVar31 = uVar31 + 1;
|
|
uVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_24))))->EntityList::Size();
|
|
} while (uVar31 < uVar8);
|
|
}
|
|
uVar31 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((this->_backupPlayer)))->Entity::Position(&local_16c);
|
|
in_stack_fffffdbc = &g_vectorZero;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar31);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
FUN_009b9fc0();
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_24)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
local_150.y = (float)&this->_twinPlayer;
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(local_150.y))))->EntityPtr::Set(this->_backupPlayer);
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(this->_backupPlayer) + 0x1e68)))))->EntityPtr::Set(GHIDRA_CAST<Entity *>(this));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x1e6c)) = 0;
|
|
local_120 = (EntityPtr)this->_controllerIndex;
|
|
this->_backupPlayer = (void *)0x0;
|
|
iVar5 = EntityPtr::Ref();
|
|
if (*GHIDRA_CAST<char *>((iVar5 + 0x20e8)) != '\0') {
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
iVar5 = EntityPtr::Ref();
|
|
RestoreGameState(otherPlayer,GHIDRA_CAST<GameStatePlayer *>((iVar5 + 0x20ec)));
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
iVar5 = EntityPtr::Ref();
|
|
spawn_dark_esau(otherPlayer,(void *)(iVar5 + 0x20ec));
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x20e8)) = 0;
|
|
}
|
|
SetControllerIndex(this,GHIDRA_INT(local_120),1);
|
|
iVar5 = EntityPtr::Ref();
|
|
if (*GHIDRA_CAST<char *>((iVar5 + 0x1824)) == '\0') {
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
InitPostLevelInitStats(otherPlayer);
|
|
}
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x172)) = 1;
|
|
tmpEntity = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
|
|
this = player;
|
|
vecResult = MusicManager::RandomVector(&local_16c);
|
|
local_120 = (EntityPtr)0x41700000;
|
|
vecResult = Vector::operator_mul(&scratchVec,GHIDRA_CAST<float *>(&local_120),vecResult);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_17c,vecResult);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetPosition(vecResult);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetVelocity(&this->_velocity);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
EntityPtr::Ref();
|
|
FUN_009b9f60();
|
|
uVar31 = 0xffffffff;
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
SyncConsumables(this,otherPlayer,uVar31);
|
|
iVar5 = EntityPtr::Ref();
|
|
in_XMM0_Da = 0.0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x13f0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x13f4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x13f8)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x13fc)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x1400)) = 0;
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1574)) = 0xffff;
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
EvaluateItems(otherPlayer);
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x410)) = 1;
|
|
iVar5 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar5 + 0x41c)))))->ANM2::Reset();
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x139a)) = 0;
|
|
iVar5 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((iVar5 + 0x48)))))->Sprite::SetLastFrame();
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x1398)) = 0;
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
if (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x1d94)) != *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x1d96))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 1;
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x1d96)) = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x1d94));
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>((GHIDRA_INT(this) + 0x1508)))))->Level::SetHeartPicked();
|
|
}
|
|
cVar3 = FUN_00417390();
|
|
if (cVar3 != '\0') {
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if ((cVar3 == '\0') && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1fc4)) != 0)) {
|
|
level_start(this,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cVar3 = FUN_00417390();
|
|
if ((cVar3 == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x34)) == 0x388)) {
|
|
cVar3 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x41c)))))->Sprite::IsLoaded();
|
|
if (cVar3 == '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::Update();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::HasCurseMist();
|
|
if (bVar2 != *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x202c))) {
|
|
if (bVar2 == 0) {
|
|
RemoveCurseMistEffect(this);
|
|
}
|
|
else {
|
|
AddCurseMistEffect(this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) && (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDead(), cVar3 == '\0'))
|
|
{
|
|
bVar2 = HasTrinket(this,0x67,0);
|
|
if (bVar2 == 0) {
|
|
LAB_007831dd:
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasTrinketEffect(0x67);
|
|
if (bVar2 == 0) goto LAB_0078320d;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::RemoveTrinketEffect(0x67,1);
|
|
}
|
|
else {
|
|
iVar5 = GetNumBombs(this);
|
|
iVar6 = GetNumCoins(this);
|
|
if (iVar5 != iVar6) goto LAB_007831dd;
|
|
iVar5 = GetNumCoins(this);
|
|
iVar6 = GetNumKeys(this);
|
|
if (iVar5 != iVar6) goto LAB_007831dd;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasTrinketEffect(0x67);
|
|
if (bVar2 != 0) goto LAB_0078320d;
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x7831db);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddTrinketEffect(0x67,1,1);
|
|
}
|
|
AddCacheFlags(this,2);
|
|
EvaluateItems(this);
|
|
}
|
|
LAB_0078320d:
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 2) {
|
|
FUN_00417920();
|
|
cVar3 = FUN_004178f0();
|
|
if (cVar3 == '\0') {
|
|
LAB_0078328a:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3c4)) != (EntityPtr)0x0) {
|
|
local_150.y = (GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x334)))->x + 0.1;
|
|
local_120 = (EntityPtr)0x3f800000;
|
|
pEVar7 = GHIDRA_CAST<EntityPtr *>(std)::min<float>();
|
|
EVar9 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3c4));
|
|
local_120 = *pEVar7;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x334)))->x = (float)local_120;
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar9))))->Entity::Position(&local_16c);
|
|
vecResult = vector_lerp(&scratchVec,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),vecResult,0,
|
|
(float)local_120);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::operator_assign(vecResult);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_130 = (EntityPtr)(GHIDRA_CAST<Room *>((room)))->Room::GetEntities();
|
|
uVar31 = 0;
|
|
iVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_130))))->EntityList::Size();
|
|
if (iVar5 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
do {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(FUN_00417610());
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::to_npc_or_coop_player();
|
|
if (local_120 != (EntityPtr)0x0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::is_valid_target();
|
|
EVar9 = local_120;
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(local_120));
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar9))))->Entity::Position(&local_16c);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::operator_assign(vecResult);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x334)))->x = 1.0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
uVar31 = uVar31 + 1;
|
|
uVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_130))))->EntityList::Size();
|
|
} while (uVar31 < uVar8);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&local_17c,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1618)));
|
|
local_8 = 2;
|
|
iVar5 = EntityPtr::Ref();
|
|
if (iVar5 != 0) {
|
|
EntityPtr::Ref();
|
|
cVar3 = QueueItemData::Touched();
|
|
if (cVar3 != '\0') {
|
|
local_8 = 0xffffffff;
|
|
FUN_004242b0();
|
|
goto LAB_0078328a;
|
|
}
|
|
}
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::RemoveCoPlayer(this,0);
|
|
FUN_004242b0();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x1dd8)) = 0;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
if (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x26d4)) == '\0') {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x26d0)) = 0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x26d0)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x26d0)) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x26d4)) = 0;
|
|
}
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x172)) == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x131c)) != '\0') {
|
|
FUN_007829a0();
|
|
}
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c));
|
|
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x143c)) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x143c)))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x143c)))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1440)) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1440)))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1440)))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
local_120 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1444));
|
|
if (local_120 != (EntityPtr)0x0) {
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((&local_16c)))->Vector::Vector(0.0,-15.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::SetPositionOffset(vecResult2);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1444))))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1444))))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e78)) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e78)))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e78)))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e7c)) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e7c)))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e7c)))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e80)) != (EntityPtr)0x0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e80))))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e80))))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
iVar5 = EntityPtr::Ref();
|
|
if (iVar5 != 0) {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
|
|
EVar9 = (EntityPtr)(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::Target();
|
|
if (EVar9 == (EntityPtr)this) {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetPosition(vecResult);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetVelocity(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)));
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e88)) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e88)))))->Entity::SetPosition(vecResult);
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x1e88)))))->Entity::SetVelocity(&g_vectorZero);
|
|
}
|
|
FUN_00757a10();
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x39c)) = in_XMM0_Da;
|
|
local_12a = IsExtraAnimationFinished(this);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x200000000000000);
|
|
if (bVar2 == 0) {
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) <= 0.0 && *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) != 0.0) ||
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) <= 0.0 && *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) != 0.0)) {
|
|
if (((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1570)) == 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x184)) == 5)) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000000000), bVar2 != 0)) {
|
|
fVar32 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f88)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f88)) = fVar32;
|
|
if (0.0 < fVar32) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f8c)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f8c)) - fVar32 * 0.2;
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) =
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350));
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000000000);
|
|
if (bVar2 == 0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) + 1.1;
|
|
}
|
|
else {
|
|
fVar32 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) + 0.6;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) = fVar32;
|
|
if ((fVar32 < 0.0) ||
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) <= -26.0 && *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) != -26.0)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x184)) = 3;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x184)) = GHIDRA_UINT((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1570)) == 0)) * 2 + 3;
|
|
}
|
|
}
|
|
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350))) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) = 0.0;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000000000);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x400000000000000);
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if ((cVar3 == '\0') &&
|
|
(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x410)) = 1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(4);
|
|
play_sound_with_fart_seed(499,1.0,2,0,1.0);
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x1d3);
|
|
play_sound_with_fart_seed(0x1d3,1.0,2,0,1.0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) = 0.0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1e70)) = 0.0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23) {
|
|
fVar32 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f8c));
|
|
fVar23 = fVar32 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f88));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f88)) = fVar23;
|
|
if ((fVar23 < 0.0) || (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f88)) = 0.0, fVar32 <= 0.0)) {
|
|
fVar32 = fVar32 + 0.6;
|
|
}
|
|
else if (2.0 <= fVar32) {
|
|
fVar32 = fVar32 * -0.45;
|
|
}
|
|
else {
|
|
fVar32 = 0.0;
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f8c)) = fVar32;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
bVar2 = HasCollectible(this,0x278,0);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),0x278), bVar2 == 0)) {
|
|
local_16c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1c));
|
|
}
|
|
else {
|
|
local_16c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1c));
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x18)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x18)) & 0xffff7fff;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1c)) = local_16c.y;
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x18)) & 0x8000) == 0) {
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8))) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(3,0), bVar2 != 0)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) = 0;
|
|
sfx = MusicManager::SFXManager();
|
|
(GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::Stop(0x24e);
|
|
}
|
|
}
|
|
else {
|
|
local_144.y = (float)(GHIDRA_UINT(local_144.y) & 0xffffff00);
|
|
std::iterator_copy(GHIDRA_CAST<std_vector *>((GHIDRA_INT(this) + 8)),&local_128);
|
|
FUN_00456190();
|
|
cVar3 = FUN_0042c710();
|
|
if (cVar3 != '\0') {
|
|
do {
|
|
pfVar10 = GHIDRA_CAST<float *>(EntityPtr)::Ref();
|
|
if ((*pfVar10 == 0.0) && (iVar5 = EntityPtr::Ref(), (*GHIDRA_CAST<uint *>((iVar5 + 8)) & 0x8000) != 0))
|
|
{
|
|
iVar5 = EntityPtr::Ref();
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x10)) != 0) {
|
|
iVar5 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::operator_(GHIDRA_CAST<EntityRef *>((iVar5 + 0x10)));
|
|
}
|
|
iVar5 = EntityPtr::Ref();
|
|
local_144.y = (float)(GHIDRA_UINT(local_144.y) & 0xff);
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x18)) == 0x3b6) {
|
|
local_144.y = 1.4013e-45;
|
|
}
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::vector<DamageInfo>::erase();
|
|
local_128 = GHIDRA_CAST<RNG *>(*pfVar10);
|
|
}
|
|
else {
|
|
FUN_004a11b0();
|
|
}
|
|
FUN_00456190();
|
|
cVar3 = FUN_0042c710();
|
|
} while (cVar3 != '\0');
|
|
this = player;
|
|
}
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x18)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x18)) & 0xffff7fff;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) + 1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1c));
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_144.y)) + 0x0))) == '\0') {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddEntityFlags(0x40);
|
|
sfx = MusicManager::SFXManager();
|
|
bVar2 = (GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::IsPlaying(0x24e);
|
|
if (bVar2 == 0) {
|
|
sfx = MusicManager::SFXManager();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x1);
|
|
(GHIDRA_CAST<SoundEffects *>((sfx)))->SoundEffects::Play(0x24e,1.0,1,0,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8))) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x173)) == 0)) {
|
|
local_150.y = 1.0;
|
|
local_164.y = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) / 30.0;
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::min<float>();
|
|
local_148 = GHIDRA_CAST<std_string *>(*puVar11);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x40);
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
if (bVar2 == 0) {
|
|
local_150.y = Math::lerp((float)local_148,0.0,0.2,0);
|
|
local_164.y = Math::lerp((float)local_148,0.0,0.5,0);
|
|
Math::lerp((float)local_148,0.0,0.5,0);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x2);
|
|
(*vfunc)();
|
|
if (0x14 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8))) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
goto joined_r0x00783ce0;
|
|
}
|
|
}
|
|
else {
|
|
Math::lerp((float)local_148,0.0,0.5,0);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x2);
|
|
(*vfunc)();
|
|
if (0x14 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8))) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
joined_r0x00783ce0:
|
|
if (bVar2 != 0) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x3);
|
|
(*vfunc)();
|
|
}
|
|
}
|
|
}
|
|
if (0x1e < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13bc)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) + -0x1e;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x40);
|
|
if (bVar2 == 0) {
|
|
uVar31 = Random();
|
|
in_stack_fffffdbc = &g_vectorZero;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x13,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),0,uVar31);
|
|
FUN_004316b0();
|
|
FUN_004b7070();
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetSprite();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetFrame_1(3);
|
|
tmpEntity->Update();
|
|
}
|
|
else {
|
|
this->TakeDamage();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x24f);
|
|
play_sound_with_fart_seed(0x24f,1.0,2,0,1.0);
|
|
}
|
|
}
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x31c))) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if ((cVar3 != '\0') && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) == 0)) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x3);
|
|
(*vfunc)();
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (((cVar3 == '\0') && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x40), bVar2 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ea8)) < 1)) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x40);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::Update();
|
|
bVar2 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::IsEventTriggered(&DAT_00b64ba4);
|
|
if (bVar2 != 0) {
|
|
uVar31 = Random();
|
|
in_stack_fffffdbc = &g_vectorZero;
|
|
spawnedEffect =
|
|
(Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xc,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),10,
|
|
uVar31);
|
|
(GHIDRA_CAST<Entity_Effect *>((spawnedEffect)))->Entity_Effect::FollowParent(GHIDRA_CAST<Entity *>(player));
|
|
set_field_358(spawnedEffect,-10.0);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite)::Scale();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity::SetSpriteScale(vecResult);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity)::SpriteScale();
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((&local_16c)))->Vector::Vector(0.0,-20.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Mul(&scratchVec,vecResult2);
|
|
GetFlyingOffset(player,&local_17c);
|
|
(GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&local_174,other);
|
|
FUN_004563c0();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity::AddEntityFlags(0x100000000000);
|
|
spawnedEffect->Update();
|
|
(GHIDRA_CAST<Entity_Effect *>((spawnedEffect)))->Entity_Effect::set_rotation(0.0);
|
|
this = player;
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::is_device_connected(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1618)));
|
|
if (bVar2 == 0) {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Controller %d has disconnected.\n"));
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) || (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc)) != (EntityPtr)0x0)
|
|
) {
|
|
pauseScreen = GHIDRA_CAST<PauseScreen *>(func_0x00753cf0());
|
|
(GHIDRA_CAST<PauseScreen *>((pauseScreen)))->PauseScreen::Show();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::RemoveCoPlayer(this,0);
|
|
uVar31 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(player))))->Entity::Position(&local_16c);
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::Vector(0.0,-10.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&local_17c,vecResult2);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar31);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1398)) != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::IsFinishedImpl(&s_empty), bVar2 != 0)) {
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1398)) = 0;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if ((cVar3 != '\0') &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::IsFinishedImpl(GHIDRA_CAST<byte *>("LightTravel")), bVar2 != 0)) {
|
|
FUN_0044bf90();
|
|
}
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1399)) != 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1398)) == 0)) {
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1399)) = 0;
|
|
bVar2 = HasCollectible(this,0x23f,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasNullEffect(0x37),
|
|
bVar2 == 0)) {
|
|
local_150.y = 1.4013e-45;
|
|
local_120 = (EntityPtr)GHIDRA_INT((5.0 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x156c))));
|
|
puVar12 = GHIDRA_CAST<uint *>(std)::max<int>();
|
|
uVar31 = *puVar12;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) < 2) {
|
|
uVar31 = 1;
|
|
}
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar31 = (GHIDRA_CAST<RNG *>((rng)))->RNG::RandomInt(uVar31);
|
|
if (uVar31 == 0) {
|
|
play_sound_with_fart_seed(0xb5,1.0,0x14,0,1.0);
|
|
play_sound_with_fart_seed(0x1e,1.0,2,0,1.0);
|
|
fVar32 = 1.0;
|
|
vecResult = &g_vectorZero;
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_f0 + 0x2c)))))->Color::Color();
|
|
spawn_gibs(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),0xe,40.0,GHIDRA_CAST<uint *>(&DAT_00b6bc94),GHIDRA_CAST<Entity *>(this),color
|
|
,vecResult,fVar32);
|
|
iVar5 = Isaac::Random(3);
|
|
iVar5 = iVar5 + 1;
|
|
if (0 < iVar5) {
|
|
do {
|
|
ThrowBlueSpider(this,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero);
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
}
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x784279);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddNullEffect(0x37,1,1);
|
|
EvaluateItems(this);
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = HasCollectible(this,0x281,0);
|
|
if (((bVar2 != 0) && (iVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetAliveEnemiesCount(), 0 < iVar5)) &&
|
|
(iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(3.0,0.0), iVar5 != 0)) {
|
|
local_130 = (EntityPtr)(GHIDRA_CAST<Room *>((room)))->Room::GetEntities();
|
|
local_144.y = 0.0;
|
|
uVar31 = 0;
|
|
iVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_130))))->EntityList::Size();
|
|
if (iVar5 == 0) {
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
LAB_0078438c:
|
|
iVar5 = Isaac::Random(2);
|
|
if (iVar5 != 0) goto LAB_0078439a;
|
|
}
|
|
else {
|
|
do {
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar11))))->Entity::ToTear();
|
|
if (local_120 != (EntityPtr)0x0) {
|
|
pBVar33 = &g_tearFlagChain;
|
|
pBVar13 = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_120))))->Entity_Tear::TearFlags(GHIDRA_CAST<BitSet128 *>(local_24));
|
|
pBVar13 = BitSet128::operator_and(&local_1a0,pBVar13,pBVar33);
|
|
bVar2 = (GHIDRA_CAST<BitSet128 *>((pBVar13)))->BitSet128::IsNonZero();
|
|
if ((bVar2 != 0) &&
|
|
(EVar9 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Parent(), EVar9 == (EntityPtr)this)) {
|
|
local_144.y = (float)((GHIDRA_CAST<std_string *>(local_144.y))->_buf + 1);
|
|
}
|
|
}
|
|
uVar31 = uVar31 + 1;
|
|
uVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_130))))->EntityList::Size();
|
|
} while (uVar31 < uVar8);
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(local_144.y);
|
|
if (GHIDRA_UINT(local_144.y) < GHIDRA_CAST<ANM2 *>(0xc)) goto LAB_0078438c;
|
|
LAB_0078439a:
|
|
if ((GHIDRA_CAST<ANM2 *>(&DAT_00000013) < pAVar21) || (iVar5 = Isaac::Random(5), iVar5 != 0))
|
|
goto LAB_007845eb;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1624)) == -1) {
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Vector(0.0,1.0);
|
|
}
|
|
else {
|
|
vecResult = Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1624)))
|
|
;
|
|
}
|
|
local_16c.x = vecResult->x;
|
|
local_16c.y = vecResult->y;
|
|
uVar31 = Random();
|
|
this = player;
|
|
local_120 = (EntityPtr)0x40400000;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_16c)))->Vector::__mul(&scratchVec,GHIDRA_CAST<float *>(&local_120));
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::__add(&local_17c,vecResult);
|
|
EVar9 = (EntityPtr)(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&this->_pos,vecResult,GHIDRA_CAST<Entity *>(this),0,uVar31);
|
|
local_130 = EVar9;
|
|
FUN_00753720();
|
|
fVar32 = this->_poisonTickDamage - 3.5;
|
|
if (fVar32 < 0.0) {
|
|
fVar32 = fVar32 * -10.0;
|
|
FUN_00431260();
|
|
fVar32 = -fVar32 / 10.0;
|
|
}
|
|
else {
|
|
fVar32 = fVar32 + fVar32;
|
|
FUN_00431260();
|
|
fVar32 = fVar32 * 0.5;
|
|
}
|
|
local_164.y = fVar32 + 3.5;
|
|
local_150.y = 1.0;
|
|
std::max<float>();
|
|
(**(code **)(*GHIDRA_CAST<int *>(EVar9) + 0x40))();
|
|
pBVar13 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(local_24),&g_tearFlagChain,&g_tearFlagSpectral);
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(EVar9))))->Entity_Tear::SetTearFlags(*pBVar13);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar9))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
fVar32 = random_float();
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(EVar9))))->Entity_Tear::SetScale(fVar32 * 0.2 + 0.9);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar9))))->Entity_Projectile::SetHeight(-6.0);
|
|
FUN_00444c70();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar9))))->Entity_Projectile::set_falling_accel(-0.03);
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(EVar9) + 0x3c);
|
|
random_float();
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0xff);
|
|
(*vfunc)();
|
|
(**(code **)(*GHIDRA_CAST<int *>(local_130) + 0xc))();
|
|
}
|
|
}
|
|
LAB_007845eb:
|
|
if (((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x139a)) != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::IsFinishedImpl(&s_empty), bVar2 != 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::IsFinishedImpl(GHIDRA_CAST<byte *>("LiftItem")), bVar2 == 0)) {
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x139a)) = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::Reset();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0xff8)))))->ANM2::Reset();
|
|
}
|
|
update_pitfall(this);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
update_suplex(this);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x13b6)) == 0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13b8)) != 0) {
|
|
FUN_00424510();
|
|
local_8 = 3;
|
|
local_128 = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
FUN_00424510();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
local_129 = 0;
|
|
iVar5 = 0;
|
|
local_122 = 0;
|
|
iVar6 = GetTrinketMultiplier(this,0xac);
|
|
if (iVar6 == 2) {
|
|
iVar5 = 0x19;
|
|
}
|
|
else if (iVar6 == 3) {
|
|
iVar5 = 0x32;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13b8));
|
|
if (iVar6 == 1) {
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
local_120 = (EntityPtr)0x1;
|
|
if (iVar5 + 0x32U <= uVar31) {
|
|
local_122 = 1;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x2;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x4;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x5;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x6;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x9;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xb;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xc;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xd;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x14;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x15;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x16;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x18;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x12;
|
|
}
|
|
FUN_007dc620();
|
|
local_129 = 1;
|
|
}
|
|
else if (iVar6 == 2) {
|
|
local_129 = 1;
|
|
local_122 = 1;
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
if (uVar31 < iVar5 + 0x32U) {
|
|
local_120 = (EntityPtr)0x2;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x4;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x9;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xb;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xc;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x18;
|
|
}
|
|
else {
|
|
local_120 = (EntityPtr)0x1;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x5;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x6;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xd;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x14;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x15;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x16;
|
|
LAB_00784aac:
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x12;
|
|
}
|
|
LAB_007852a3:
|
|
FUN_007dc620();
|
|
}
|
|
else {
|
|
if (iVar6 == 3) {
|
|
local_129 = 1;
|
|
local_122 = 1;
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
if (uVar31 < iVar5 + 0x19U) {
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
if (uVar31 < 0x32) {
|
|
pLVar14 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar14)))->Level::InitializeDevilAngelRoom(1,0);
|
|
local_120 = (EntityPtr)0xffffffff;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
else {
|
|
pLVar14 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar14)))->Level::InitializeDevilAngelRoom(0,1);
|
|
local_120 = (EntityPtr)0xffffffff;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
goto LAB_007852b2;
|
|
}
|
|
local_120 = (EntityPtr)0x1;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x2;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x4;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x5;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x6;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x9;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xa;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xb;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xc;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xd;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x14;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x15;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x18;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x12;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xfffffffe;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
else {
|
|
if (iVar6 == 5) {
|
|
local_129 = 1;
|
|
local_122 = 1;
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
if (uVar31 < iVar5 + 0x32U) {
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
goto LAB_007852a3;
|
|
}
|
|
local_120 = (EntityPtr)0x1;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x2;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x4;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x5;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x6;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x9;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xb;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xc;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xd;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x14;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x15;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x18;
|
|
LAB_00785224:
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x12;
|
|
}
|
|
else {
|
|
if (iVar6 != 4) {
|
|
if (iVar6 == 7) {
|
|
local_129 = 1;
|
|
local_122 = 1;
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
if (iVar5 + 10U <= uVar31) {
|
|
local_120 = (EntityPtr)0x1;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x2;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x4;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x5;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x6;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x9;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xb;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xc;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xd;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x18;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x14;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x15;
|
|
goto LAB_00785224;
|
|
}
|
|
local_120 = (EntityPtr)0xfffffffe;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
else if (iVar6 == 6) {
|
|
local_129 = 1;
|
|
local_122 = 1;
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
local_120 = (EntityPtr)0xa;
|
|
if (0x31 < uVar31) {
|
|
local_120 = (EntityPtr)0x5;
|
|
}
|
|
goto LAB_007852a3;
|
|
}
|
|
goto LAB_007852b2;
|
|
}
|
|
local_129 = 1;
|
|
local_122 = 1;
|
|
uVar31 = (GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(100);
|
|
if (uVar31 < iVar5 + 0x32U) {
|
|
local_120 = (EntityPtr)0x14;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x15;
|
|
goto LAB_00784aac;
|
|
}
|
|
local_120 = (EntityPtr)0x1;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x2;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x4;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x5;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x6;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x9;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xb;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xc;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0xd;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x18;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x7;
|
|
FUN_007dc620();
|
|
local_120 = (EntityPtr)0x8;
|
|
}
|
|
FUN_007dc620();
|
|
}
|
|
local_120 = (EntityPtr)0xfffffffa;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
LAB_007852b2:
|
|
FUN_005cbe20();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
local_158.y = 0.0;
|
|
pLVar14 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
iVar5 = (GHIDRA_CAST<Level *>((pLVar14)))->Level::GetRoomCount();
|
|
if (0 < iVar5) {
|
|
iVar5 = 0;
|
|
do {
|
|
room = GHIDRA_CAST<Room *>(Config)::GetCollectibles();
|
|
iVar6 = (GHIDRA_CAST<Room *>((room)))->Room::GetTopLeftPos();
|
|
EVar9 = (EntityPtr)(iVar5 + iVar6);
|
|
local_130 = EVar9;
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x10 + iVar6)) != 0) {
|
|
Config::GetCollectibles();
|
|
pvVar16 = (void *)FUN_004f8930();
|
|
if (*(void **)(GHIDRA_CAST<char *>(EVar9) + 0xc) == pvVar16) {
|
|
uVar31 = 0;
|
|
iVar6 = (GHIDRA_CAST<std::vector *>((local_24 + 4)))->std::vector::size();
|
|
if (iVar6 != 0) {
|
|
do {
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(local_130) + 0x10)) + 8)) == *piVar15) {
|
|
local_144.y = *GHIDRA_CAST<float *>(local_130);
|
|
std::set<int>::find();
|
|
std::iterator_copy(&local_17c,&local_120);
|
|
cVar3 = FUN_00557bb0();
|
|
if (cVar3 != '\0') {
|
|
std::set<int>::insert();
|
|
EVar9 = local_130;
|
|
cVar3 = (GHIDRA_CAST<RoomDescriptor *>((GHIDRA_CAST<RoomDescriptor *>(local_130))))->RoomDescriptor::Clear();
|
|
if (((cVar3 != '\0') && (local_122 != 0)) ||
|
|
((cVar3 = (GHIDRA_CAST<RoomDescriptor *>((GHIDRA_CAST<RoomDescriptor *>(EVar9))))->RoomDescriptor::Clear(),
|
|
cVar3 == '\0' && (local_129 != 0)))) {
|
|
bVar2 = local_122;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar9) + 0x40)) == 0) {
|
|
bVar2 = local_129;
|
|
}
|
|
if (bVar2 != 0) {
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
uVar31 = uVar31 + 1;
|
|
uVar8 = (GHIDRA_CAST<std::vector *>((local_24 + 4)))->std::vector::size();
|
|
} while (uVar31 < uVar8);
|
|
}
|
|
}
|
|
}
|
|
iVar5 = iVar5 + 0xb8;
|
|
puVar19 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(local_158.y) + 1));
|
|
local_158.y = (float)puVar19;
|
|
pLVar14 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
iVar6 = (GHIDRA_CAST<Level *>((pLVar14)))->Level::GetRoomCount();
|
|
} while (GHIDRA_INT(puVar19) < iVar6);
|
|
this = player;
|
|
}
|
|
iVar5 = 0;
|
|
iVar6 = (GHIDRA_CAST<std::vector *>(((void *)(GHIDRA_INT(&local_1a0._l) + 4))))->std::vector::size();
|
|
if (iVar6 != 0) {
|
|
uVar31 = (GHIDRA_CAST<std::vector *>(((void *)(GHIDRA_INT(&local_1a0._l) + 4))))->std::vector::size();
|
|
(GHIDRA_CAST<RNG *>((local_128)))->RNG::RandomInt(uVar31);
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
iVar5 = *piVar15;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13b8)) == 6) &&
|
|
(piVar15 = GHIDRA_CAST<int *>(FUN_0042c810()), *piVar15 == 10)) {
|
|
if (iVar5 == 0) {
|
|
pLVar14 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
iVar5 = (GHIDRA_CAST<Level *>((pLVar14)))->Level::QueryRoomTypeIndex(5,0,local_128,0);
|
|
goto LAB_007854cf;
|
|
}
|
|
LAB_007854d3:
|
|
Config::GetCollectibles();
|
|
FUN_00428ae0();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0xffffffff);
|
|
Game::StartRoomTransition(g_game,iVar5,-1,3,this,-1);
|
|
}
|
|
else {
|
|
LAB_007854cf:
|
|
if (iVar5 != 0) goto LAB_007854d3;
|
|
iVar5 = GetTrinketMultiplier(this,4);
|
|
if ((float)iVar5 <= 1.0) {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(&DAT_0000002c);
|
|
}
|
|
else {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x1a3);
|
|
}
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_128) + 2)),GHIDRA_INT(in_stack_fffffdbc),1,-1,0);
|
|
}
|
|
FUN_00424420();
|
|
FID_conflict__Tidy(local_24 + 4);
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Tidy((void *)(GHIDRA_INT(&local_1a0._l) + 4));
|
|
}
|
|
}
|
|
else {
|
|
iVar5 = GetTrinketMultiplier(this,4);
|
|
if ((float)iVar5 <= 1.0) {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(&DAT_0000002c);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_128) + 2)),0x2c,1,-1,0);
|
|
}
|
|
else {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x1a3);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_128) + 2)),0x1a3,1,-1,0);
|
|
}
|
|
}
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x13b6)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13b8)) = 0;
|
|
}
|
|
}
|
|
}
|
|
activeDesc = GHIDRA_CAST<ActiveItemDesc *>((GHIDRA_INT(this) + 0x15a0));
|
|
local_120 = (EntityPtr)activeDesc;
|
|
if ((((GHIDRA_CAST<ActiveItemDesc *>((GHIDRA_INT(this) + 0x15a0)))->_item != 0) &&
|
|
(bVar2 = HasCollectible(this,0x216,0), bVar2 == 0)) &&
|
|
(cVar3 = IsCoopGhost(this), cVar3 == '\0')) {
|
|
FUN_005b19d0();
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar8 = (GHIDRA_CAST<RNG *>((rng)))->RNG::Next();
|
|
uVar31 = *GHIDRA_CAST<uint *>(local_120);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(room,&local_16c,&player->_pos,40.0,0,0,0);
|
|
this = player;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(player),uVar31,uVar8);
|
|
__RTDynamicCast();
|
|
FUN_005b1990();
|
|
FUN_005b1920();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(this->_activeDesc[1]._item);
|
|
activeDesc = this->_activeDesc + 1;
|
|
RemoveCollectible(this,GHIDRA_UINT(in_stack_fffffdbc),0,1,1);
|
|
FUN_005b19d0();
|
|
}
|
|
bVar2 = HasCollectible(this,0x3b,0);
|
|
if ((bVar2 != 0) && (cVar3 = FUN_007da770(), cVar3 == '\0')) {
|
|
local_120 = (EntityPtr)(GHIDRA_INT(this) + 0x16c8);
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
*puVar11 = 0;
|
|
local_130 = (EntityPtr)0x1;
|
|
do {
|
|
if (activeDesc->_item == 0x3b) {
|
|
activeDesc->_item = 0x22;
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0042c810());
|
|
*piVar15 = *piVar15 + 1;
|
|
}
|
|
this = player;
|
|
local_130 = (EntityPtr)(GHIDRA_INT(local_130) + -1);
|
|
activeDesc = activeDesc + -1;
|
|
} while (-1 < GHIDRA_INT(local_130));
|
|
UpdateBookOfVirtues(player,0);
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (((cVar3 != '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0)) &&
|
|
((bVar2 = HasCollectible(this,0x1f1,0), bVar2 != 0 &&
|
|
(bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),0x1f1), bVar2 == 0)))) {
|
|
uVar29 = get_time_ms();
|
|
elapsedMs = uVar29 - (longlong)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1f90));
|
|
local_16c.y = (float)((ulonglong)elapsedMs >> 0x20);
|
|
if ((local_16c.y != 0.0) || (15000 < GHIDRA_UINT(elapsedMs))) {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x78577d);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddCollectibleEffect(0x1f1,1,1);
|
|
uVar31 = 0;
|
|
pvVar16 = (void *)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
iVar5 = (GHIDRA_CAST<std::vector *>((pvVar16)))->std::vector::size();
|
|
if (iVar5 != 0) {
|
|
do {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
local_130 = (EntityPtr)(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::GetPlayer(uVar31);
|
|
if ((local_130 != (EntityPtr)this) &&
|
|
(EVar9 = (EntityPtr)EntityPtr::Ref(), local_130 != EVar9)) {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x7857e1);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_130))))->Entity::AddConfusion(GHIDRA_CAST<EntityRef *>(local_68),0x5a,0);
|
|
}
|
|
uVar31 = uVar31 + 1;
|
|
pvVar16 = (void *)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
uVar8 = (GHIDRA_CAST<std::vector *>((pvVar16)))->std::vector::size();
|
|
} while (uVar31 < uVar8);
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x34);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddEntityFlags(0x8000000);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x8000000);
|
|
if (bVar2 == 0) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x165c)) + -1;
|
|
if (iVar5 < 0) {
|
|
iVar5 = 0;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x165c)) = iVar5;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x165c)) = 0x3c;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1378)) = 0;
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x173)) == 0) {
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1b18)) != 0)) &&
|
|
(bVar2 = IsExtraAnimationFinished(this), bVar2 != 0)) {
|
|
pcVar20 = "Appear";
|
|
Config::GetPillEffects();
|
|
pbVar17 = GHIDRA_CAST<byte *>(_string_holder_c_str());
|
|
do {
|
|
bVar2 = *pbVar17;
|
|
bVar22 = bVar2 < (byte)*pcVar20;
|
|
if (bVar2 != *pcVar20) {
|
|
LAB_007858c0:
|
|
uVar31 = -GHIDRA_UINT(bVar22) | 1;
|
|
goto LAB_007858c5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar17[1];
|
|
bVar22 = bVar2 < (byte)pcVar20[1];
|
|
if (bVar2 != pcVar20[1]) goto LAB_007858c0;
|
|
pbVar17 = pbVar17 + 2;
|
|
pcVar20 = pcVar20 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar31 = 0;
|
|
LAB_007858c5:
|
|
if (uVar31 == 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Glitch"));
|
|
}
|
|
else {
|
|
pcVar20 = "Glitch";
|
|
Config::GetPillEffects();
|
|
pbVar17 = GHIDRA_CAST<byte *>(_string_holder_c_str());
|
|
do {
|
|
bVar2 = *pbVar17;
|
|
bVar22 = bVar2 < (byte)*pcVar20;
|
|
if (bVar2 != *pcVar20) {
|
|
LAB_00785910:
|
|
uVar31 = -GHIDRA_UINT(bVar22) | 1;
|
|
goto LAB_00785915;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar17[1];
|
|
bVar22 = bVar2 < (byte)pcVar20[1];
|
|
if (bVar2 != pcVar20[1]) goto LAB_00785910;
|
|
pbVar17 = pbVar17 + 2;
|
|
pcVar20 = pcVar20 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar31 = 0;
|
|
LAB_00785915:
|
|
if (uVar31 == 0) {
|
|
InitBabySkin(this);
|
|
}
|
|
}
|
|
}
|
|
if (*(void **)(GHIDRA_CAST<char *>(this) + 0x1410) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*(void **)(GHIDRA_CAST<char *>(this) + 0x1410))))->Entity::SetPosition(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)));
|
|
(GHIDRA_CAST<Entity *>((*(void **)(GHIDRA_CAST<char *>(this) + 0x1410))))->Entity::SetVelocity(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)));
|
|
bVar2 = (GHIDRA_CAST<Entity *>((*(void **)(GHIDRA_CAST<char *>(this) + 0x1410))))->Entity::is_player();
|
|
if (bVar2 != 0) {
|
|
pvVar16 = *(void **)(GHIDRA_CAST<char *>(this) + 0x1410);
|
|
layerFrame = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::GetLayerFrame(0);
|
|
if ((layerFrame != (void *)0x0) ||
|
|
((1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1f2c)) &&
|
|
(layerFrame = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::GetLayerFrame(0),
|
|
layerFrame != (void *)0x0)))) {
|
|
FUN_0067f2e0();
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar16) + 0x350)) = local_16c.y * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14f4));
|
|
}
|
|
}
|
|
}
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508));
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x1f1);
|
|
if (bVar2 != 0) {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x7859db);
|
|
cVar3 = FUN_00a20920();
|
|
if (cVar3 == '\0') {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x7859f3);
|
|
cVar3 = FUN_00a20920();
|
|
if (cVar3 != '\0') goto LAB_00785a2e;
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x785a0b);
|
|
cVar3 = FUN_00a20920();
|
|
if (cVar3 != '\0') goto LAB_00785a2e;
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x785a23);
|
|
cVar3 = FUN_00a20920();
|
|
local_121 = '\0';
|
|
if (cVar3 != '\0') goto LAB_00785a2e;
|
|
}
|
|
else {
|
|
LAB_00785a2e:
|
|
local_121 = '\x01';
|
|
}
|
|
FUN_00417900();
|
|
cVar3 = FUN_007538d0();
|
|
if (cVar3 == '\0') {
|
|
joined_r0x00785a7e:
|
|
if (local_121 == '\0') goto LAB_00785b62;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_16c))))->EntityPtr::clear();
|
|
bVar2 = GetMouseAimTarget(this,&local_16c,0);
|
|
if (bVar2 == 0) goto joined_r0x00785a7e;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x1f1,1);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (6 < iVar5) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveNullEffect(0x30,-1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddNullEffect(0x30,0,0x1e);
|
|
play_sound_with_fart_seed(0x50,1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(10);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_f0 + 0x2c)))))->Color::Color();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::MakeGroundPoofAtSelf(color_00,0.8);
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(g_tearFlagsNone._l);
|
|
Game::DamageRadius(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),GHIDRA_CAST<Entity *>(this),0,0,0,50.0,g_tearFlagsNone,
|
|
15.0,80.0);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | tempEffects->_cacheFlags;
|
|
EvaluateItems(this);
|
|
FUN_00753790();
|
|
}
|
|
}
|
|
LAB_00785b62:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
LAB_00785bc0:
|
|
update_body_animations(this);
|
|
update_bomb_input(this);
|
|
ControlActiveItem(this,0);
|
|
pocket_use_input(this);
|
|
update_shooting(this);
|
|
pockets_rotate();
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x218));
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x1de);
|
|
if (((bVar2 == 0) || (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) != 0)) && (iVar5 == 0))
|
|
goto LAB_00785bc0;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
|
|
}
|
|
EVar9 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc))))))->Entity::ToPlayer();
|
|
local_158.y = (float)EVar9;
|
|
bVar2 = IsHologram(this);
|
|
if (bVar2 != 0) {
|
|
EVar9 = (EntityPtr)EntityPtr::Ref();
|
|
local_158.y = (float)EVar9;
|
|
}
|
|
if (EVar9 != (EntityPtr)0x0) {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_17c))))->EntityPtr::clear();
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
local_144.y = 0.0;
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar5 != 0) {
|
|
do {
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(pAVar21));
|
|
if (local_120 != (EntityPtr)this) {
|
|
if (local_120 != (EntityPtr)local_158.y) {
|
|
EVar9 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Parent();
|
|
if (EVar9 != (EntityPtr)local_158.y) goto LAB_00785d5e;
|
|
}
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Position(&local_16c);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::__sub(&scratchVec,vecResult);
|
|
local_130 = (EntityPtr)(GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::LengthSquared();
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::operator_ne(&g_vectorZero);
|
|
if ((bVar2 != 0) && ((float)local_130 < 144.0)) {
|
|
local_150.y = 0.5;
|
|
vecResult = Vector::operator_mul(&local_174,&local_150.y,&scratchVec);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__div(&local_13c,GHIDRA_CAST<float *>(&local_130));
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::operator_add_assign(vecResult);
|
|
}
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(local_144.y);
|
|
}
|
|
LAB_00785d5e:
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(((pAVar21->_filename)._buf + 1));
|
|
local_144.y = (float)pAVar21;
|
|
numPlayers = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
} while (pAVar21 < GHIDRA_UINT(numPlayers));
|
|
}
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Length();
|
|
if (2.0 < (float)local_120) {
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Resize(2.0);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity(&local_17c,0);
|
|
}
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)) {
|
|
bVar2 = HasCollectible(this,0x18d,0);
|
|
if ((bVar2 == 0) ||
|
|
((*(void **)(GHIDRA_CAST<char *>(this) + 0x13e0) == GHIDRA_CAST<int *>(0x0) ||
|
|
(cVar3 = (**(code **)(*GHIDRA_CAST<int *>(*(void **)(GHIDRA_CAST<char *>(this) + 0x13e0)) + 0x34))(), cVar3 == '\0'))))
|
|
{
|
|
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x1430)) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x1430)) + 0x28))();
|
|
}
|
|
}
|
|
else {
|
|
local_174.x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1630)))->x;
|
|
local_174.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1634));
|
|
iVar5 = FUN_007826c0();
|
|
if ((iVar5 == 0) &&
|
|
((bVar2 = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::operator_eq(&g_vectorZero), bVar2 != 0 ||
|
|
(bVar2 = HasCollectible(this,0x1d1,0), bVar2 == 0)))) {
|
|
vecResult = Isaac::GetAxisAlignedUnitVectorFromDir
|
|
(&local_16c,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1628)));
|
|
(GHIDRA_CAST<Vector *>((&local_174)))->Vector::operator_assign(vecResult);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Vector *>((&local_174)))->Vector::Normalize();
|
|
}
|
|
tractorBeam = GHIDRA_CAST<Entity_NPC *>(__RTDynamicCast());
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1430)) == 0) {
|
|
uVar31 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(7,7,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar31);
|
|
tractorBeam = GHIDRA_CAST<Entity_NPC *>(__RTDynamicCast());
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tractorBeam))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
tractorBeam->Update();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(this) + 0x1430)))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(tractorBeam));
|
|
}
|
|
local_120 = (EntityPtr)0x41400000;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::__mul(&local_16c,GHIDRA_CAST<float *>(&local_120));
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x785f36);
|
|
GetLaserOffset(this,&scratchVec,6,vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tractorBeam))))->Entity::SetPositionOffset(offset);
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_174)))->Vector::GetAngleDegrees();
|
|
fVar32 = normalize_angle_degrees((float)local_120);
|
|
(GHIDRA_CAST<Entity_NPC *>((tractorBeam)))->Entity_NPC::SetAimAngle(fVar32);
|
|
if (local_174.y <= -0.5) {
|
|
fVar32 = -10.0;
|
|
}
|
|
else {
|
|
fVar32 = 3000.0;
|
|
}
|
|
set_field_358(tractorBeam,fVar32);
|
|
bVar2 = IsExtraAnimationFinished(this);
|
|
if (bVar2 != 0) {
|
|
IsHoldingItem(this);
|
|
}
|
|
FUN_0044bf90();
|
|
local_120 = (EntityPtr)&DAT_00000005;
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1338)) = *piVar15;
|
|
}
|
|
local_144.y = (float)(GHIDRA_UINT(local_144.y) & 0xffffff00);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if ((cVar3 != '\0') && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) != 0)) {
|
|
sVar4 = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) + -1;
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) = sVar4;
|
|
local_144.y = (float)(GHIDRA_UINT(local_144.y) & 0xff);
|
|
if (sVar4 == 0) {
|
|
local_144.y = 1.4013e-45;
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x1de);
|
|
if (((bVar2 != 0) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x162c)) != -1 || ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1378)) & 4) != 0)))) ||
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_144.y)) + 0x0))) != '\0')) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x1de,1);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
FUN_00821940();
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) = 0;
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1624)) != -1) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1378)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1378)) | 2;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x162c)) != -1) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1378)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1378)) | 4;
|
|
}
|
|
bVar2 = HasCollectible(this,0xd2,0);
|
|
if ((bVar2 == 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1378)) != 0)) {
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) == 1000.0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
itemCfg = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(4);
|
|
RemoveCostume(this,itemCfg);
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) = *GHIDRA_CAST<float *>((GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(this) + 0x330)) + 0x44));
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1374)) = 0;
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1374));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1374)) = iVar5 + 1;
|
|
if (0x3c < iVar5) {
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) != 1000.0) {
|
|
SoundEffects::PlayWithFartOverride(0x35a,1.0,2,0,1.0);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
itemCfg = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(4);
|
|
AddCostume(this,itemCfg,bVar2);
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) = 1000.0;
|
|
uVar31 = Random();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,GHIDRA_CAST<Entity *>(this),2,
|
|
uVar31);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
this = player;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_16c)))->Vector::Vector(0.0,-10.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_posOffset)))->Vector::__add(&scratchVec,vecResult);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetPositionOffset(vecResult);
|
|
set_field_358(tmpEntity,(this->_posOffset).y + 1.0);
|
|
tmpEntity->Update();
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) || (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) != 0)) {
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::SetColorize(1.0,1.0,1.0,1.0);
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x2);
|
|
this->SetColor();
|
|
}
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) != 1000.0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) = *GHIDRA_CAST<float *>((GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(this) + 0x330)) + 0x44));
|
|
}
|
|
pLVar14 = GHIDRA_CAST<Level *>((GHIDRA_INT(this) + 0x1508));
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pLVar14))))->TemporaryEffects::HasCollectibleEffect(0x251);
|
|
if (((bVar2 == 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1888)) < 1)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pLVar14))))->TemporaryEffects::HasCollectibleEffect(0x2ca),
|
|
bVar2 == 0)) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x40000000);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddEntityFlags(0x40000000);
|
|
}
|
|
cVar3 = (GHIDRA_CAST<Level *>((pLVar14)))->Level::GetHeartPicked();
|
|
if (cVar3 != '\0') {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | pLVar14->_stage;
|
|
EvaluateItems(this);
|
|
}
|
|
FUN_00753790();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pLVar14))))->TemporaryEffects::Update();
|
|
update_effects(this);
|
|
}
|
|
if (*(void **)(GHIDRA_CAST<char *>(this) + 0x1ee4) != (void *)0x0) {
|
|
projectile = GHIDRA_CAST<Entity_Projectile *>(FUN_00435df0());
|
|
if (projectile != GHIDRA_CAST<Entity_Projectile *>(0x0)) {
|
|
projectileAngle = (float10)(GHIDRA_CAST<Entity_Projectile *>((projectile)))->Entity_Projectile::Damage();
|
|
Vector::FromAngle(&local_13c,(float)projectileAngle);
|
|
local_120 = (EntityPtr)0xc1600000;
|
|
Vector::operator_mul(&local_16c,GHIDRA_CAST<float *>(&local_120),&local_13c);
|
|
FUN_00753750();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x7863f7);
|
|
GetLaserOffset(this,&local_174,-1,&local_13c);
|
|
local_120 = (EntityPtr)0x41500000;
|
|
vecResult = Vector::operator_mul(&scratchVec,GHIDRA_CAST<float *>(&local_120),&local_13c);
|
|
(GHIDRA_CAST<Vector *>((&local_174)))->Vector::operator_add_assign(vecResult);
|
|
local_174.y = local_174.y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14fc)) * 4.0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(projectile))))->Entity::SetPositionOffset(&local_174);
|
|
if (local_13c.y <= -0.5) {
|
|
fVar32 = -40.0;
|
|
}
|
|
else {
|
|
fVar32 = 3000.0;
|
|
}
|
|
set_field_358(projectile,fVar32);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
local_164.y = (float)Random();
|
|
fVar32 = random_float();
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Rotated(&local_16c,fVar32 * 90.0 - 45.0);
|
|
fVar32 = random_float();
|
|
local_120 = (EntityPtr)(fVar32 * 10.0 + 6.0);
|
|
in_stack_fffffdbc = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&scratchVec,GHIDRA_CAST<float *>(&local_120));
|
|
local_130 = (EntityPtr)&player->_pos;
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_130))))->Vector::__add(&local_17c,&local_174);
|
|
local_150.y = 14.0;
|
|
vecResult2 = Vector::operator_mul(&local_144,&local_150.y,&local_13c);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__sub(&local_158,vecResult2);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,99,vecResult,in_stack_fffffdbc,GHIDRA_CAST<Entity *>(0x0),1,
|
|
GHIDRA_UINT(local_164.y));
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::SpriteScale();
|
|
fVar32 = random_float();
|
|
local_164.y = fVar32 * 1.5 + 1.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&local_190,&local_164.y);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetSpriteScale(vecResult);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetSprite();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_f0 + 0x2c)))))->Color::Color(0.6,0.34,0.26,1.0);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color_01);
|
|
set_field_358(tmpEntity,20.0);
|
|
tmpEntity->Update();
|
|
iVar5 = Isaac::Random(5);
|
|
if (iVar5 == 0) {
|
|
local_164.y = (float)Random();
|
|
fVar32 = random_float();
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Rotated(&local_16c,fVar32 * 90.0 - 45.0);
|
|
fVar32 = random_float();
|
|
local_120 = (EntityPtr)(fVar32 * 3.0 + 2.0);
|
|
in_stack_fffffdbc = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&scratchVec,GHIDRA_CAST<float *>(&local_120));
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_130))))->Vector::__add(&local_17c,&local_174);
|
|
local_150.y = 14.0;
|
|
vecResult2 = Vector::operator_mul(&local_144,&local_150.y,&local_13c);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__sub(&local_158,vecResult2);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3a,vecResult,in_stack_fffffdbc,GHIDRA_CAST<Entity *>(0x0),0,
|
|
GHIDRA_UINT(local_164.y));
|
|
tmpEntity->Update();
|
|
}
|
|
iVar5 = Isaac::Random(5);
|
|
if (iVar5 == 0) {
|
|
local_164.y = (float)Random();
|
|
fVar32 = random_float();
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Rotated(&local_16c,fVar32 * 30.0 - 15.0);
|
|
fVar32 = random_float();
|
|
local_120 = (EntityPtr)(fVar32 * 5.0 + 6.0);
|
|
in_stack_fffffdbc = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&scratchVec,GHIDRA_CAST<float *>(&local_120));
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Vector(local_174.x,0.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_130))))->Vector::__add(&local_144,vecResult);
|
|
local_150.y = 14.0;
|
|
vecResult2 = Vector::operator_mul(&local_158,&local_150.y,&local_13c);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__sub(&local_190,vecResult2);
|
|
projectile = (Entity_Projectile *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(9,5,vecResult,in_stack_fffffdbc,GHIDRA_CAST<Entity *>(player),0,
|
|
GHIDRA_UINT(local_164.y));
|
|
uVar31 = 0x80;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
uVar31 = 0x80000080;
|
|
}
|
|
(GHIDRA_CAST<Entity_Projectile *>((projectile)))->Entity_Projectile::set_projectile_flags((ulonglong)uVar31);
|
|
projectile->Update();
|
|
}
|
|
this = player;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0xff8)))))->ANM2::Update();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x530)))))->ANM2::Update();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x644)))))->ANM2::Update();
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x758));
|
|
iVar5 = 7;
|
|
do {
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::Update();
|
|
this = player;
|
|
pAVar21 = pAVar21 + 1;
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
(GHIDRA_CAST<ANM2 *>((&player->_bloodGushSprite)))->ANM2::Update();
|
|
}
|
|
local_120 = (EntityPtr)(GHIDRA_INT(this) + 0x48);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_120))))->Sprite)::Scale();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x530)))))->Sprite::SetScale(vecResult);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite)::Scale();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x644)))))->Sprite::SetScale(vecResult);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite)::Scale();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0xee4)))))->Sprite::SetScale(vecResult);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x0))) = ZEXT812(0x42700000);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
local_150.y = (float)BVar27._l;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::SetScale(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x14f0)));
|
|
cVar3 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x41c)))))->Sprite::IsLoaded();
|
|
if ((cVar3 != '\0') &&
|
|
((bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::IsPlaying(&s_empty), bVar2 != 0 &&
|
|
(pvVar16 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x41c)))))->Sprite::GetNullFrame(GHIDRA_CAST<byte *>("ItemWalk")),
|
|
pvVar16 != (void *)0x0)))) {
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite)::Scale();
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Mul(&local_13c,GHIDRA_CAST<Vector *>((GHIDRA_INT(pvVar16) + 0x10)));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::SetScale(vecResult);
|
|
}
|
|
local_16c.x = g_vectorOne.x;
|
|
local_16c.y = g_vectorOne.y;
|
|
if ((-1 < (GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(this) + 0x126c)))->_index) &&
|
|
((iVar5 = FUN_005cbd10(), *GHIDRA_CAST<int *>((iVar5 + 0x114)) == 0 ||
|
|
((iVar5 = FUN_005cbd10(), *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 0x114)) + 4)) != 0x256 &&
|
|
(iVar5 = FUN_005cbd10(), *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 0x114)) + 4)) != 0x2b0)))))) {
|
|
FUN_005cbd10();
|
|
Config::GetPillEffects();
|
|
cVar3 = FUN_004073a0();
|
|
if (cVar3 == '\0') {
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
pvVar16 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetLayerFrame(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1270)));
|
|
if (pvVar16 != (void *)0x0) {
|
|
spawnedEffect = *GHIDRA_CAST<Entity_Effect **>((GHIDRA_CAST<char *>(pvVar16) + 0x1c));
|
|
Math::abs();
|
|
fVar32 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar16) + 0x18));
|
|
local_164.y = (float)spawnedEffect;
|
|
Math::abs();
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Vector(fVar32,local_164.y);
|
|
(GHIDRA_CAST<Vector *>((&local_16c)))->Vector::operator_assign(vecResult);
|
|
}
|
|
}
|
|
}
|
|
local_148 = GHIDRA_CAST<std_string *>(g_vectorOne.x);
|
|
local_188 = g_vectorOne.x;
|
|
local_128 = GHIDRA_CAST<RNG *>(g_vectorOne.y);
|
|
local_190.y = g_vectorOne.y;
|
|
local_158.y = 0.0;
|
|
bVar2 = HasCollectible(this,0x1ed,0);
|
|
if (((bVar2 != 0) ||
|
|
(bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),0x1ed), bVar2 != 0)) &&
|
|
(bVar2 = IsExtraAnimationFinished(this), bVar2 != 0)) {
|
|
uVar31 = ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2 - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344))) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340))) / 2;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
uVar31 = uVar31 >> 2;
|
|
}
|
|
local_164.y = (float)GHIDRA_INT(uVar31) / 24.0;
|
|
local_190.y = 1.0 - (1.0 - local_164.y) * (1.0 - local_164.y);
|
|
fVar32 = local_164.y * 9.0 * local_164.y + 1.0;
|
|
local_144.y = ((fVar32 + fVar32) * 3.1415927) / 30.0;
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
local_130 = (EntityPtr)(local_190.y * 0.5);
|
|
auVar26 = ZEXT416(GHIDRA_UINT(((float)iVar5 * local_144.y)));
|
|
FUN_00417150();
|
|
fVar32 = ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar26)) + 0x0))) * 0.5 + 0.5) * 1.2;
|
|
pow_wrapper();
|
|
local_158.y = (fVar32 - 0.2) * (float)local_130 + 1.0;
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
auVar26 = ZEXT416(GHIDRA_UINT(((float)(iVar5 + -3) * local_144.y)));
|
|
FUN_00417150();
|
|
fVar32 = ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar26)) + 0x0))) * 0.5 + 0.5) * 1.2;
|
|
pow_wrapper();
|
|
fVar32 = (fVar32 - 0.2) * local_164.y * local_164.y;
|
|
local_148 = GHIDRA_CAST<std_string *>(((1.0 / local_158.y - 1.0) * 0.5 + 1.0 + fVar32));
|
|
local_128 = GHIDRA_CAST<RNG *>((fVar32 * 0.5 + local_158.y));
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
auVar26 = ZEXT416(GHIDRA_UINT(((float)(iVar5 + 10) * local_144.y)));
|
|
FUN_00417150();
|
|
fVar32 = ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar26)) + 0x0))) * 0.5 + 0.5) * 1.2;
|
|
pow_wrapper();
|
|
local_158.y = (fVar32 - 0.2) * (float)local_130;
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
auVar26 = ZEXT416(GHIDRA_UINT(((float)(iVar5 + 0x14) * local_144.y)));
|
|
FUN_00417150();
|
|
fVar32 = ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar26)) + 0x0))) * 0.5 + 0.5) * 1.2;
|
|
pow_wrapper();
|
|
local_190.y = (fVar32 - 0.2) * local_190.y * 0.1 + 1.0;
|
|
local_188 = 1.0 / local_190.y;
|
|
}
|
|
scratchVec.x = g_vectorOne.x;
|
|
local_174.x = g_vectorZero.x;
|
|
scratchVec.y = g_vectorOne.y;
|
|
local_174.y = g_vectorZero.y;
|
|
if (-1 < (GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(this) + 0x123c)))->_index) {
|
|
sprite = GHIDRA_CAST<Sprite *>(FUN_005cbd10());
|
|
vecResult = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetNullFrame(GHIDRA_CAST<byte *>("HeadTransform"));
|
|
if ((vecResult != GHIDRA_CAST<Vector *>(0x0)) && (*GHIDRA_CAST<char *>(&vecResult[1].y) != '\0')) {
|
|
(GHIDRA_CAST<Vector *>((&local_174)))->Vector::operator_assign(vecResult);
|
|
(GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::operator_assign(vecResult + 2);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x20) {
|
|
iVar6 = 0;
|
|
iVar5 = FUN_0042d040();
|
|
if (iVar5 != 0) {
|
|
FUN_0042d040();
|
|
iVar6 = FUN_0067efb0();
|
|
}
|
|
local_174.y = local_174.y - ((float)iVar6 + (float)iVar6);
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + 0x48)))))->Entity::AddFlagsLow();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::Color();
|
|
bVar2 = HasCollectible(this,0xca,0);
|
|
if ((bVar2 != 0) &&
|
|
(((bVar2 = HasCollectible(this,0xd2,0), bVar2 != 0 &&
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x37c)) == 1000.0)) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasNullEffect(0x3b),
|
|
bVar2 != 0)))) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c811c8) &&
|
|
(_Init_thread_header(), DAT_00c811c8 == -1)) {
|
|
local_8 = 6;
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x3f800000);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
local_8 = 0xffffffff;
|
|
_Init_thread_footer();
|
|
}
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(GHIDRA_CAST<ColorMod *>(&DAT_00c811cc));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::__mul(GHIDRA_CAST<ColorMod *>(&DAT_00c811cc));
|
|
}
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1900));
|
|
if (iVar5 < 1) {
|
|
local_164.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x20a4));
|
|
if (0.0 < local_164.y) {
|
|
if (1.0 <= local_164.y) {
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
sinf_wrapper((float)iVar5 * 0.2);
|
|
}
|
|
colorBuf = &local_11c;
|
|
goto LAB_00786ffb;
|
|
}
|
|
}
|
|
else {
|
|
local_164.y = (float)iVar5 / (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1904));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1904)) <= iVar5) {
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
sinf_wrapper((float)iVar5 * 0.2);
|
|
}
|
|
colorBuf = GHIDRA_CAST<Color *>((local_f0 + 0x2c));
|
|
LAB_00786ffb:
|
|
::(GHIDRA_CAST<Color *>((colorBuf)))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(other_00);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ae8))) ||
|
|
(iVar5 = TemporaryEffects::GetCollectibleEffectNum
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),699), iVar5 == 4)) {
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
sinf_wrapper((float)iVar5 * 0.2);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_98 + 0x2c)))))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(other_01);
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef8))) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef8)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef8)) + -1;
|
|
}
|
|
local_130 = (EntityPtr)&DAT_00000006;
|
|
local_164.y = (float)(8 - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef8)));
|
|
std::min<int>();
|
|
local_144.y = 0.0;
|
|
piVar15 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
fVar32 = *GHIDRA_CAST<float *>((&DAT_00b6bc98 + *piVar15 * 4));
|
|
local_188 = (2.0 - fVar32) * local_188;
|
|
local_148 = GHIDRA_CAST<std_string *>(((2.0 - fVar32) * (float)local_148));
|
|
local_128 = GHIDRA_CAST<RNG *>((fVar32 * (float)local_128));
|
|
local_190.y = fVar32 * local_190.y;
|
|
local_158.y = (fVar32 - 1.0) * 4.0 + local_158.y;
|
|
}
|
|
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1efc))) {
|
|
local_164.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1efc)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x39c));
|
|
local_130 = (EntityPtr)0x0;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
fVar32 = *pfVar10;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1efc)) = fVar32;
|
|
fVar32 = sinf_wrapper(((fVar32 + fVar32) * 3.1415927) / 10.0);
|
|
fVar23 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1efc)) + 1.0;
|
|
local_164.y = 1.0 - (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1efc)) / 20.0) * fVar32 * 0.4;
|
|
fVar32 = sinf_wrapper(((fVar23 + fVar23) * 3.1415927) / 10.0);
|
|
fVar32 = 1.0 - ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1efc)) + 1.0) / 20.0) * fVar32 * 0.4;
|
|
local_128 = GHIDRA_CAST<RNG *>((local_164.y * (float)local_128));
|
|
local_148 = GHIDRA_CAST<std_string *>(((2.0 - local_164.y) * (float)local_148));
|
|
local_188 = (2.0 - fVar32) * local_188;
|
|
local_190.y = fVar32 * local_190.y;
|
|
local_158.y = (fVar32 - 1.0) * 3.0 + local_158.y;
|
|
}
|
|
bVar2 = HasCollectible(this,0x251,0);
|
|
if (((bVar2 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1e90)) < 1)) &&
|
|
(iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount(), iVar5 % 0x1e < 2)) {
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x3f800000);
|
|
tmpColor = (ColorMod *)::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(tmpColor);
|
|
}
|
|
pvVar16 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::GetNullEffect(0x3f);
|
|
if ((pvVar16 != (void *)0x0) && (uVar31 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar16) + 8)), GHIDRA_INT(uVar31) < 0x5a)) {
|
|
fVar32 = (float)(uVar31 & 0x8000000f);
|
|
if (GHIDRA_INT(fVar32) < 0) {
|
|
fVar32 = (float)((GHIDRA_INT(fVar32) - 1U | 0xfffffff0) + 1);
|
|
}
|
|
local_164.y = (float)(uVar31 & 0x80000007);
|
|
if (GHIDRA_INT(local_164.y) < 0) {
|
|
local_164.y = (float)((GHIDRA_INT(local_164.y) - 1U | 0xfffffff8) + 1);
|
|
}
|
|
if (0x17 < GHIDRA_INT(uVar31)) {
|
|
local_164.y = fVar32;
|
|
}
|
|
if (GHIDRA_INT(local_164.y) < 5) {
|
|
tmpColor = (ColorMod *)::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((&local_11c)))->Color::Color();
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>((local_98 + 0x2c));
|
|
::Color::Lerp(GHIDRA_CAST<ColorMod *>(in_stack_fffffdbc),from,tmpColor,(float)GHIDRA_INT(local_164.y) * 0.25);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(GHIDRA_CAST<ColorMod *>((local_98 + 0x2c)));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::__mul(GHIDRA_CAST<ColorMod *>((local_98 + 0x2c)));
|
|
}
|
|
}
|
|
auVar24 = ZEXT812(0);
|
|
local_130 = (EntityPtr)0x0;
|
|
if (1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ed0))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_68)) + 0xc))) = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_68)) + 0x10))) = (void *)0xbf000000;
|
|
puStack_54 = &DAT_bf800000;
|
|
fStack_50 = 0.5;
|
|
local_4c = 2.0;
|
|
local_48 = 0x3f800000;
|
|
local_44 = (void *)0x0;
|
|
local_164.y = 8.40779e-45;
|
|
piVar15 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
local_130 = *GHIDRA_CAST<EntityPtr *>((local_68 + *piVar15 * 4 + 0xc));
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar24)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar24)) + 0x0))) = local_130;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x0))) = auVar24;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasCollectibleEffect(0x2c0);
|
|
if (bVar2 != 0) {
|
|
fVar32 = sinf_wrapper(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x3a4)) * 1.5707964);
|
|
local_174.x = fVar32 + local_174.x;
|
|
fVar32 = sinf_wrapper(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x3a4)) * 1.2566371);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) =
|
|
GHIDRA_CAST<Entity_Effect *>(((SUB124(ZEXT812(0x3f800000),0) - (fVar32 * 0.5 + 0.5)) * 0.4));
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = SUB128(ZEXT812(0x3f800000),4);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
in_stack_fffffdbc = GHIDRA_CAST<Vector *>(0x0);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(GHIDRA_CAST<ColorMod *>((local_98 + 0x2c)));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::__mul(GHIDRA_CAST<ColorMod *>((local_98 + 0x2c)));
|
|
}
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar5 == 0x2a) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_13c.y = (float)(GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x6a);
|
|
costumeMap = GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(this) + 0x122c));
|
|
local_164.y = 0.0;
|
|
do {
|
|
if (((-1 < costumeMap->_index) && (costumeMap->_isBodyLayer == 0)) &&
|
|
(local_144.y = (float)FUN_005cbd10(),
|
|
*GHIDRA_CAST<Entity **>(((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_144.y) + 0x114)))->_filename)._buf) ==
|
|
GHIDRA_CAST<Entity *>(local_13c.y))) {
|
|
FUN_0041e470();
|
|
cVar3 = FUN_004073a0();
|
|
fVar32 = local_144.y;
|
|
if (cVar3 == '\0') {
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1398)) == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x139a)) == 0)) {
|
|
cVar3 = FUN_0040aa70();
|
|
if (cVar3 != '\0') {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(fVar32))))->ANM2::PlayOverlay(GHIDRA_CAST<byte *>("Pulse"),1);
|
|
pBVar13 = GHIDRA_CAST<BitSet128 *>(local_24);
|
|
uVar30 = 0x7876a1;
|
|
pBVar33 = GetBombFlags(this,pBVar13,0);
|
|
uVar34 = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(&pBVar33->_l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar33->_l) + 4));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x8))) = SUB84(pBVar33->_h,0);
|
|
iStack_18 = *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar33->_h) + 4));
|
|
FUN_00435bc0();
|
|
GetBombVariant();
|
|
FUN_00435bc0();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = uVar30;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = GHIDRA_CAST<ColorMod *>(in_stack_fffffdbc);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = pBVar13;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = uVar34;
|
|
fVar32 = check_bomb_tearflags(this,tearFlags);
|
|
if (1.5 <= fVar32) {
|
|
local_150.y = 110.0;
|
|
}
|
|
tmpColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity)::GetColor();
|
|
otherPlayer = player;
|
|
vecResult = MusicManager::RandomVector(&local_13c);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&otherPlayer->_pos)))->Vector::__add(&local_164,vecResult);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags_00._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags_00._l)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags_00._h)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x8)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags_00._h)) + 0x4))) = iStack_18;
|
|
Game::BombExplosionEffects
|
|
(g_game,vecResult,local_150.y,tearFlags_00,tmpColor,
|
|
GHIDRA_CAST<Entity *>(otherPlayer),1.25,1,4,1);
|
|
(GHIDRA_CAST<Vector *>((&otherPlayer->_velocity)))->Vector::operator_assign(&g_vectorZero);
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(otherPlayer) + 0x54);
|
|
vecResult = MusicManager::RandomVector(&local_150);
|
|
fVar32 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>((fVar32 * 3.0 + 2.0));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var;
|
|
local_13c.y = (float)GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
(GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&local_164,&local_13c.y);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(0x0));
|
|
(*vfunc)();
|
|
this = player;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_144.y))))->Sprite::RemoveOverlay();
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_144.y))))->ANM2::PlayOverlay(GHIDRA_CAST<byte *>("Pulse"),0);
|
|
}
|
|
FUN_0041e470();
|
|
cVar3 = FUN_004073a0();
|
|
if (cVar3 == '\0') {
|
|
animState = GHIDRA_CAST<AnimationState *>(FUN_0041e470());
|
|
vecResult = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("HeadAnim"));
|
|
if (vecResult != GHIDRA_CAST<Vector *>(0x0)) {
|
|
FUN_00a10570();
|
|
(GHIDRA_CAST<Vector *>((&local_174)))->Vector::operator_add_assign(vecResult);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(GHIDRA_CAST<ColorMod *>((vecResult + 3)));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::__mul(GHIDRA_CAST<ColorMod *>((vecResult + 3)));
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
local_164.y = (float)(GHIDRA_INT(local_164.y) + 1);
|
|
costumeMap = costumeMap + 1;
|
|
} while (GHIDRA_UINT(local_164.y) < 0xf);
|
|
goto LAB_0078784d;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0078784d:
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23) {
|
|
local_174.y = local_174.y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f88));
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_174.y));
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000);
|
|
if (((bVar2 != 0) && (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x28c)) == (EntityPtr)this)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x138c)) < 0x96)) {
|
|
fVar32 = (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x138c)) / 150.0;
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_98 + 0x2c)))))->Color::Color(1.0,fVar32,fVar32,1.0);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::__mul(GHIDRA_CAST<ColorMod *>((local_98 + 0x2c)));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::__mul(GHIDRA_CAST<ColorMod *>((local_98 + 0x2c)));
|
|
}
|
|
bVar2 = IsLocalPlayer(this);
|
|
if (bVar2 == 0) {
|
|
FUN_00417900();
|
|
FUN_00925df0();
|
|
local_150.y = (float)BVar27._l;
|
|
fVar32 = ::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_f0))))->Color::A();
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_f0))))->Font::SetLineHeightModifier(fVar32 * local_150.y);
|
|
fVar32 = ::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::A();
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_98))))->Font::SetLineHeightModifier(fVar32 * local_150.y);
|
|
}
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1398)) == 0) {
|
|
LAB_00787961:
|
|
local_121 = '\0';
|
|
}
|
|
else {
|
|
bVar2 = IsCollectibleCostumeVisible(this,0x271,-1);
|
|
local_121 = '\x01';
|
|
if (bVar2 != 0) goto LAB_00787961;
|
|
}
|
|
local_164.y = (float)(GHIDRA_INT(this) + 0x48);
|
|
pbVar17 = GHIDRA_CAST<byte *>(0x0);
|
|
local_150.y = (float)(GHIDRA_INT(this) + 0x1238);
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((void **))local_150.y == '\0') {
|
|
tmpColor = GHIDRA_CAST<ColorMod *>(local_f0);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(tmpColor);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1500));
|
|
if (local_121 == '\0') {
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::Mul(&local_144,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x14f8)));
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_pos)))->Vector::operator_assign(vecResult);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::Mul(GHIDRA_CAST<Vector *>(&local_1a0._h),GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1500)));
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Mul(GHIDRA_CAST<Vector *>((local_24 + 8)),&local_16c);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_size)))->Vector::operator_assign(vecResult);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(layer->_size).x = local_188 * (layer->_size).x;
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(layer->_size).y = local_190.y * (layer->_size).y;
|
|
local_13c.y = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1504)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14fc))) * 2.5 +
|
|
local_158.y * 8.0;
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(layer->_pos).y = local_13c.y + (layer->_pos).y;
|
|
goto LAB_00787b47;
|
|
}
|
|
LAB_00787a31:
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_size)))->Vector::operator_assign(vecResult);
|
|
vecResult = &g_vectorZero;
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_pos)))->Vector::operator_assign(vecResult);
|
|
}
|
|
else {
|
|
tmpColor = GHIDRA_CAST<ColorMod *>(local_98);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(tmpColor);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x14f8));
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_size)))->Vector::operator_assign(vecResult);
|
|
if (local_121 != '\0') {
|
|
vecResult = &g_vectorOne;
|
|
goto LAB_00787a31;
|
|
}
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(layer->_size).x = (float)local_148 * (layer->_size).x;
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
(layer->_size).y = (float)local_128 * (layer->_size).y;
|
|
LAB_00787b47:
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(pbVar17);
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_130));
|
|
(layer->_pos).x = (float)local_130;
|
|
}
|
|
pbVar17 = pbVar17 + 1;
|
|
local_150.y = (float)(GHIDRA_INT((GHIDRA_CAST<std_string *>((GHIDRA_INT(local_150.y) + 8)))->_buf) + 8);
|
|
} while (GHIDRA_INT(pbVar17) < 0xf);
|
|
FUN_005cbe20();
|
|
local_8 = 7;
|
|
local_158.y = 0.0;
|
|
do {
|
|
local_130 = (EntityPtr)(GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(this) + 0x122c)) + GHIDRA_INT(local_158.y));
|
|
if (-1 < *GHIDRA_CAST<int *>(local_130)) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_130) + 0xc)) == '\0') {
|
|
sprite = GHIDRA_CAST<Sprite *>(FUN_005cbd10());
|
|
if (GHIDRA_CAST<byte *>(0x3) < GHIDRA_UINT(local_158.y)) {
|
|
tmpColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_164.y))))->Sprite)::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_228 + -7)))))->Color::operator_assign(tmpColor);
|
|
goto LAB_00787c20;
|
|
}
|
|
tmpColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite)::Color();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(tmpColor);
|
|
}
|
|
else {
|
|
sprite = GHIDRA_CAST<Sprite *>(FUN_005cbd10());
|
|
tmpColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_120))))->Sprite)::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_228 + -7)))))->Color::operator_assign(tmpColor);
|
|
LAB_00787c20:
|
|
tmpColor = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(tmpColor);
|
|
this = player;
|
|
}
|
|
sprite = GHIDRA_CAST<Sprite *>(FUN_005cbd10());
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite)::Scale();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(vecResult);
|
|
EVar9 = local_130;
|
|
sprite = GHIDRA_CAST<Sprite *>(FUN_005cbd10());
|
|
local_150.y = (float)(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(EVar9) + 4)));
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(GHIDRA_CAST<byte *>(local_158.y));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(local_150.y) + 0x34)))))->Vector::operator_assign(&layer->_size);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetLayer(GHIDRA_CAST<byte *>(local_158.y));
|
|
fVar32 = local_150.y;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(local_150.y) + 0x40)))))->Vector::operator_assign(&layer->_pos);
|
|
EVar9 = local_130;
|
|
if (GHIDRA_CAST<byte *>(local_158.y) == GHIDRA_CAST<byte *>(0x0)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar32) + 0x8c)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar32) + 0x8c)) | 1;
|
|
}
|
|
std::set<int>::insert();
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar9) + 0xc)) != '\0') &&
|
|
(iVar5 = FUN_005cbd10(), *GHIDRA_CAST<int *>((iVar5 + 0x114)) != 0)) &&
|
|
((iVar5 = FUN_005cbd10(), **GHIDRA_CAST<int **>((iVar5 + 0x114)) == 0 &&
|
|
(iVar5 = FUN_005cbd10(), *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 0x114)) + 4)) == 0x5a)))) {
|
|
local_144.y = 0.0;
|
|
iVar5 = FUN_0042d040();
|
|
if (iVar5 != 0) {
|
|
FUN_0042d040();
|
|
local_144.y = (float)FUN_0067efb0();
|
|
}
|
|
bVar2 = IsHoldingItem(this);
|
|
if (bVar2 != 0) {
|
|
local_144.y = 0.0;
|
|
}
|
|
sprite = GHIDRA_CAST<Sprite *>(FUN_005cbd10());
|
|
local_13c.y = (float)GHIDRA_INT(local_144.y) * 96.0;
|
|
layer = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(EVar9) + 4)));
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_13c.y));
|
|
(layer->_cropOffset).y = local_13c.y;
|
|
}
|
|
}
|
|
local_158.y = (float)(GHIDRA_INT(local_158.y) + 1);
|
|
} while (GHIDRA_UINT(local_158.y) < &DAT_0000000f);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
FUN_0042c770();
|
|
std::iterator_copy(&local_17c,&local_150.y);
|
|
cVar3 = FUN_0042c710();
|
|
if (cVar3 != '\0') {
|
|
local_164.y = (float)(GHIDRA_INT(this) + 0x1220);
|
|
do {
|
|
FUN_005cba30();
|
|
tmpEntity = GHIDRA_CAST<Entity *>(FUN_005cbd10());
|
|
local_13c.y = (float)tmpEntity;
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::AddFlagsLow();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(tmpEntity))))->ANM2::Update();
|
|
FUN_0041e470();
|
|
cVar3 = FUN_004073a0();
|
|
if (cVar3 == '\0') {
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(FUN_0041e470());
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>((local_68 + 0x10)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) | 1);
|
|
local_158.y = (float)local_15c;
|
|
iVar5 = FUN_006da7d0();
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(1,(undefined3)local_128));
|
|
if (iVar5 != 0) goto LAB_00787ec4;
|
|
}
|
|
else {
|
|
LAB_00787ec4:
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
}
|
|
local_8 = 7;
|
|
if ((GHIDRA_UINT(local_15c) & 1) != 0) {
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) & 0xfffffffe);
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0') {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(FUN_0041e470());
|
|
iVar5 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType();
|
|
fVar32 = local_13c.y;
|
|
if (iVar5 != 0) {
|
|
pbVar17 = GHIDRA_CAST<byte *>(0x0);
|
|
iVar5 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_13c.y))))->Sprite::GetLayerCount();
|
|
if (iVar5 != 0) {
|
|
do {
|
|
animState = GHIDRA_CAST<AnimationState *>(FUN_0041e470());
|
|
tmpEntity = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetLayerFrame(GHIDRA_INT(pbVar17));
|
|
local_13c.y = (float)tmpEntity;
|
|
if (tmpEntity != GHIDRA_CAST<Entity *>(0x0)) {
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(fVar32))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_cropOffset)))->Vector::operator_assign(GHIDRA_CAST<Vector *>(tmpEntity));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(fVar32))))->Sprite::GetLayer(pbVar17);
|
|
FUN_00a10570();
|
|
}
|
|
pbVar17 = pbVar17 + 1;
|
|
layerCount = GHIDRA_CAST<byte *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(fVar32))))->Sprite)::GetLayerCount();
|
|
} while (pbVar17 < layerCount);
|
|
}
|
|
}
|
|
}
|
|
set_iterator_post_increment(&local_144.y,&local_130,0);
|
|
std::iterator_copy(&local_17c,&local_150.y);
|
|
cVar3 = FUN_0042c710();
|
|
} while (cVar3 != '\0');
|
|
this = player;
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
FUN_00424420();
|
|
}
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x173)) == 0) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)) {
|
|
pvVar16 = TemporaryEffects::GetCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)),0x11a);
|
|
if (pvVar16 != (void *)0x0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
itemCfg = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x11a);
|
|
local_164.y = (float)itemCfg->maxCooldown;
|
|
local_13c.y = 0.0;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_13c.y);
|
|
}
|
|
else {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(0x3f000000);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) =
|
|
(Entity_Effect *)
|
|
(SUB124(ZEXT812(0x3f800000),0) -
|
|
(((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar16) + 8)) - (float)tmpEntity) - 1.0) /
|
|
((float)GHIDRA_INT(local_164.y) - 2.0));
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = SUB128(ZEXT812(0x3f800000),4);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
local_150.y = (float)GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x334)))))->Vector::__sub(GHIDRA_CAST<Vector *>((local_24 + 8)),
|
|
GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)));
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_1a0._h),&local_150.y);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&local_16c,&local_150.y);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::operator_add_assign(vecResult);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00421780());
|
|
iVar5 = (GHIDRA_CAST<EntityList *>((entityList)))->EntityList::Size();
|
|
if ((iVar5 == 0x21) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar16) + 8)) == 1)) {
|
|
uVar31 = Random();
|
|
spawnedEffect =
|
|
(Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3d,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0,uVar31);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x370))));
|
|
(GHIDRA_CAST<Entity_Effect *>((spawnedEffect)))->Entity_Effect::SetRadii(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x370)),90.0);
|
|
(GHIDRA_CAST<Entity_Effect *>((spawnedEffect)))->Entity_Effect::SetTimeout(10);
|
|
}
|
|
}
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508));
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x146);
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(bVar2,(undefined3)local_128));
|
|
bVar2 = HasCollectible(this,0x3b,0);
|
|
if ((bVar2 != 0) &&
|
|
((bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x11a), bVar2 != 0 ||
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0')))) {
|
|
iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(4.0,0.0);
|
|
if (iVar5 != 0) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*vfunc)();
|
|
}
|
|
iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar5 != 0) {
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::__add(&local_16c,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x34c)));
|
|
local_13c.y = (float)(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("extra"));
|
|
if (GHIDRA_CAST<LayerState *>(local_13c.y) != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
iVar5 = _ptr_deref_or_minus1();
|
|
pvVar16 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetLayerFrame(iVar5);
|
|
if (pvVar16 != (void *)0x0) {
|
|
vecResult = GHIDRA_CAST<Vector *>(FUN_0067f2e0());
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(&local_1a0._h))))->Vector::Vector(0.0,-10.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&scratchVec,vecResult2);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Mul(&local_17c,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x14f0)));
|
|
(GHIDRA_CAST<Vector *>((&local_16c)))->Vector::operator_add_assign(vecResult);
|
|
}
|
|
}
|
|
uVar31 = Random();
|
|
local_13c.y = 0.1;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&player->_velocity)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_24 + 8)),&local_13c.y);
|
|
fVar32 = random_float();
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(&local_1a0._h))))->Vector::Vector(0.0,-2.0 - fVar32 * 6.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&scratchVec,vecResult2);
|
|
this = player;
|
|
spawnedEffect =
|
|
(Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&local_16c,vecResult,GHIDRA_CAST<Entity *>(player),0,uVar31);
|
|
local_164.y = (float)spawnedEffect;
|
|
(GHIDRA_CAST<BlendMode *>((&puStack_54)))->BlendMode::SetMode(2,0);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity)::GetSprite();
|
|
src = &puStack_54;
|
|
layer = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
copy_20_bytes(layer->_blendMode,src);
|
|
if (this->_headColor == 6) {
|
|
fVar23 = 0.21;
|
|
colorBuf = GHIDRA_CAST<Color *>((local_f0 + 0x2c));
|
|
fVar32 = 0.2;
|
|
}
|
|
else {
|
|
fVar23 = 0.2;
|
|
colorBuf = &local_11c;
|
|
fVar32 = 0.5;
|
|
}
|
|
::(GHIDRA_CAST<Color *>((colorBuf)))->Color::Color(5.0,fVar32,fVar23,1.0);
|
|
local_150.y = (float)extraout_EAX;
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity)::GetSprite();
|
|
layer = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(local_150.y));
|
|
fVar32 = random_float();
|
|
(GHIDRA_CAST<Entity_Effect *>((spawnedEffect)))->Entity_Effect::set_rotation(fVar32 * 10.0 + 2.0);
|
|
iVar5 = Isaac::Random(10);
|
|
(GHIDRA_CAST<Entity_Effect *>((spawnedEffect)))->Entity_Effect::SetTimeout(iVar5 + 10);
|
|
fVar32 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>((fVar32 * 0.3 + 0.4));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var_00;
|
|
local_150.y = (float)GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_playerSpriteScale)))->Vector::__mul(&local_17c,&local_150.y);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Mul(&local_174,&g_vectorOne);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_164.y))))->Entity::SetSpriteScale(vecResult);
|
|
FUN_00440e90();
|
|
}
|
|
iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar5 != 0) {
|
|
Config::GetCollectibles();
|
|
iVar5 = _get_index_plus_one_if_kind_4_5();
|
|
local_150.y = (float)iVar5 * 0.2 + 2.0;
|
|
local_13c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x370)) + 40.0;
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_13c.y));
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius
|
|
(entityList,GHIDRA_CAST<EntityList_EL *>(local_24),GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),local_13c.y,
|
|
10);
|
|
local_8 = 9;
|
|
EVar9 = (EntityPtr)0x0;
|
|
local_130 = (EntityPtr)0x0;
|
|
iVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_24))))->EntityList::Size();
|
|
if (iVar5 != 0) {
|
|
do {
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar11))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar2 == 0) ||
|
|
(pEVar7 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index(),
|
|
*pEVar7 == (EntityPtr)this)) {
|
|
LAB_0078863e:
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar11))))->Entity::IsProjectile();
|
|
if ((bVar2 != 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) == '\0')) {
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar11))))->Entity::IsDead();
|
|
if (cVar3 == '\0') {
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
uVar29 = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(*puVar11))))->Entity_Projectile::ProjectileFlags();
|
|
if ((uVar29 & 0x80000000) == 0) {
|
|
std::vector<int>::operator_index();
|
|
FUN_00652f80();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar11))))->Entity::HasEntityFlags(0x20000000);
|
|
if (bVar2 != 0) goto LAB_0078863e;
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(*puVar11) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_150.y));
|
|
(*vfunc)();
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
this = player;
|
|
tmpEntity = GHIDRA_CAST<Entity *>(*puVar11);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::AddBurn(GHIDRA_CAST<EntityRef *>(local_68),0x96,0.0,0);
|
|
EVar9 = local_130;
|
|
}
|
|
EVar9 = (EntityPtr)(GHIDRA_INT(EVar9) + 1);
|
|
local_130 = EVar9;
|
|
pcVar20 = GHIDRA_CAST<char *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_24))))->EntityList)::Size();
|
|
} while (GHIDRA_UINT(EVar9) < pcVar20);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_24)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508));
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c1);
|
|
if ((bVar2 != 0) &&
|
|
((((cVar3 = FUN_00a209c0(), cVar3 != '\0' || (cVar3 = FUN_00a209c0(), cVar3 != '\0')) ||
|
|
(cVar3 = FUN_00a209c0(), cVar3 != '\0')) || (cVar3 = FUN_00a209c0(), cVar3 != '\0')))) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x2c1,-1);
|
|
}
|
|
}
|
|
update_ladder(this);
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13bc))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13bc)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13bc)) + -1;
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) + -1;
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x418))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x418)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x418)) + -1;
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1884))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1884)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1884)) + -1;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ecc)) != 0) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ecc)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2ecc)) + -1;
|
|
}
|
|
if ((*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ec8)) < 0) &&
|
|
(sVar4 = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ec8)) + 1, *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ec8)) = sVar4,
|
|
sVar4 == 0)) {
|
|
rng = GetCollectibleRNG(this,0x197);
|
|
uVar31 = (GHIDRA_CAST<RNG *>((rng)))->RNG::RandomInt(4);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x192c)) = uVar31;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddCollectibleEffect(0x197,1,1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
itemCfg = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x11);
|
|
AddCostume(this,itemCfg,bVar2);
|
|
update_purity_glow(this);
|
|
}
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ae8))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ae8)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ae8)) + -1;
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c0))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c0)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c0)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 1;
|
|
EvaluateItems(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c4))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c4)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c4)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 2;
|
|
EvaluateItems(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c8))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c8)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18c8)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0x10;
|
|
EvaluateItems(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18cc))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18cc)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18cc)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0xc;
|
|
EvaluateItems(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d0))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d0)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d0)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0x400;
|
|
EvaluateItems(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d4))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d4)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d4)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0x800;
|
|
EvaluateItems(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d8))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d8)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18d8)) = iVar5, iVar5 == 0)
|
|
) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0x800;
|
|
EvaluateItems(this);
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18dc))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18dc)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18dc)) + -1;
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18e0))) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18e0)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x18e0)) + -1;
|
|
}
|
|
local_122 = 0;
|
|
bVar2 = IsHoldingItem(this);
|
|
if (bVar2 == 0) {
|
|
if (local_12a == 0) {
|
|
bVar2 = IsExtraAnimationFinished(this);
|
|
local_129 = 1;
|
|
if (bVar2 != 0) goto LAB_00788a54;
|
|
}
|
|
LAB_00788a4d:
|
|
local_129 = 0;
|
|
}
|
|
else {
|
|
local_150.y = (float)(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x41c)))))->ANM2::GetLayerFrame(0);
|
|
if (GHIDRA_CAST<LayerState *>(local_150.y) != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
local_122 = *GHIDRA_CAST<byte *>((GHIDRA_INT(((GHIDRA_CAST<LayerState *>(local_150.y))->_spriteSheetPath)._buf) + 4));
|
|
pbVar17 = GHIDRA_CAST<byte *>(0x0);
|
|
local_13c.y = (float)(GHIDRA_INT(this) + 0xff8);
|
|
iVar5 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_13c.y))))->Sprite::GetLayerCount();
|
|
fVar32 = local_13c.y;
|
|
if (iVar5 != 0) {
|
|
do {
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_120))))->Sprite)::Scale();
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_150.y))))->Vector::Mul(GHIDRA_CAST<Vector *>((local_24 + 8)),vecResult);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(fVar32))))->Sprite::GetLayer(pbVar17);
|
|
(GHIDRA_CAST<Vector *>((&layer->_pos)))->Vector::operator_assign(vecResult);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(fVar32))))->Sprite::GetLayer(pbVar17);
|
|
pbVar17 = pbVar17 + 1;
|
|
layer->_visible = local_122;
|
|
layerCount = GHIDRA_CAST<byte *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(fVar32))))->Sprite)::GetLayerCount();
|
|
} while (pbVar17 < layerCount);
|
|
this = player;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x17d8)) == 0) || (local_122 != 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (iVar5 != 0) goto LAB_00788a4d;
|
|
}
|
|
local_129 = 1;
|
|
}
|
|
LAB_00788a54:
|
|
bVar2 = IsExtraAnimationFinished(this);
|
|
if (bVar2 == 0) {
|
|
bVar2 = IsHoldingItem(this);
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
if (bVar2 != 0) goto LAB_00788a71;
|
|
}
|
|
else {
|
|
LAB_00788a71:
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(1,(undefined3)local_128));
|
|
}
|
|
local_12a = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1570));
|
|
local_121 = '\x01';
|
|
bVar2 = IsCollectibleCostumeVisible(this,0x271,1);
|
|
if (bVar2 != 0) {
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(1,(undefined3)local_128));
|
|
local_12a = 0;
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
local_121 = '\x01';
|
|
if (cVar3 != '\0') goto LAB_00788ade;
|
|
}
|
|
else {
|
|
LAB_00788ade:
|
|
local_121 = '\0';
|
|
}
|
|
local_122 = 0;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1398)) = 0;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar2 == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0')) {
|
|
if (local_129 != 0) {
|
|
FlushQueueItem(this);
|
|
}
|
|
local_148 = GHIDRA_CAST<std_string *>(0xb1e044);
|
|
pcVar20 = "PickupWalkDown";
|
|
if (local_122 != 0) {
|
|
local_148 = GHIDRA_CAST<std_string *>(0xb6b084);
|
|
}
|
|
local_158.y = 1.0;
|
|
GetBodyMoveDirection(this,&local_174);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar2 == 0) {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_174.x);
|
|
Math::abs();
|
|
local_13c.y = (float)tmpEntity;
|
|
if (local_122 == 0) {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_174.y);
|
|
Math::abs();
|
|
if (local_13c.y <= (float)tmpEntity) {
|
|
pcVar20 = "WalkDown";
|
|
walkAnim = GHIDRA_CAST<char *>(&DAT_00b1e020);
|
|
goto LAB_00788e85;
|
|
}
|
|
pcVar20 = "WalkRight";
|
|
walkAnim = "WalkLeft";
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_174.x);
|
|
}
|
|
else {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_174.y);
|
|
Math::abs();
|
|
if (local_13c.y <= (float)tmpEntity) {
|
|
walkAnim = "PickupWalkUp";
|
|
LAB_00788e85:
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_174.y);
|
|
}
|
|
else {
|
|
pcVar20 = "PickupWalkRight";
|
|
walkAnim = "PickupWalkLeft";
|
|
tmpEntity = GHIDRA_CAST<Entity *>(local_174.x);
|
|
}
|
|
}
|
|
local_144.y = (float)pcVar20;
|
|
if ((float)tmpEntity <= 0.0) {
|
|
local_144.y = (float)walkAnim;
|
|
}
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)) &&
|
|
(local_121 != '\0')) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::Play(GHIDRA_CAST<byte *>(local_144.y),0);
|
|
}
|
|
local_148 = GHIDRA_CAST<std_string *>((GHIDRA_INT(this) + 0x1238));
|
|
local_120 = (EntityPtr)&DAT_0000000f;
|
|
do {
|
|
if (((-1 < (GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(local_148) + -0xc)))->_index) &&
|
|
(*GHIDRA_CAST<byte *>(local_148) != 0)) &&
|
|
((pAVar21 = GHIDRA_CAST<ANM2 *>(FUN_005cbd10()), *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) != 1 &&
|
|
(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)))) {
|
|
pvVar16 = *(void **)pAVar21[1]._filename._buf;
|
|
if (((pvVar16 != (void *)0x0) && (bVar2 = (GHIDRA_CAST<Item *>((pvVar16)))->Item::IsNull(), bVar2 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(pAVar21[1]._filename._buf) + 4)) == 0x4c)) {
|
|
local_158.y = local_158.y + local_158.y;
|
|
}
|
|
if ((local_122 == 0) ||
|
|
((bVar2 = (GHIDRA_CAST<Item *>((*(void **)pAVar21[1]._filename._buf)))->Item::IsNull(), bVar2 != 0 &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(pAVar21[1]._filename._buf) + 4)) == 0x5a)))) {
|
|
if ((pAVar21[1]._filename._buf[8] == '\0') &&
|
|
((GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::Play(GHIDRA_CAST<byte *>(local_144.y),0), pAVar21[1]._filename._buf[10] != '\0'))
|
|
{
|
|
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>(local_144.y));
|
|
local_8 = 0x11;
|
|
FUN_0060c790();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x12;
|
|
Sprite::PlayOverlay();
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::_Tidy_deallocate();
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pAVar21))))->Sprite::Stop();
|
|
}
|
|
}
|
|
local_148 = GHIDRA_CAST<std_string *>((GHIDRA_INT(local_148) + 0x10));
|
|
local_120 = (EntityPtr)(GHIDRA_INT(&(GHIDRA_CAST<Sprite *>((GHIDRA_INT(local_120) + -0x114)))->_bitflags) + 3);
|
|
} while (local_120 != (EntityPtr)0x0);
|
|
}
|
|
else {
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)) &&
|
|
(local_121 != '\0')) {
|
|
if ((local_12a == 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23)) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::SetFrame(local_148,0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::Play(GHIDRA_CAST<byte *>(local_148),0);
|
|
}
|
|
}
|
|
local_130 = (EntityPtr)(GHIDRA_INT(this) + 0x1238);
|
|
local_128 = GHIDRA_CAST<RNG *>(0xf);
|
|
do {
|
|
if (((-1 < (GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(local_130) + -0xc)))->_index) &&
|
|
(*GHIDRA_CAST<byte *>(local_130) != 0)) &&
|
|
((pAVar21 = GHIDRA_CAST<ANM2 *>(FUN_005cbd10()), *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) != 1 &&
|
|
(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)))) {
|
|
pvVar16 = *(void **)pAVar21[1]._filename._buf;
|
|
if (((pvVar16 != (void *)0x0) && (bVar2 = (GHIDRA_CAST<Item *>((pvVar16)))->Item::IsNull(), bVar2 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(pAVar21[1]._filename._buf) + 4)) == 0x4c)) {
|
|
local_158.y = local_158.y + local_158.y;
|
|
}
|
|
if (pAVar21[1]._filename._buf[8] == '\0') {
|
|
if ((local_122 == 0) ||
|
|
((bVar2 = (GHIDRA_CAST<Item *>((*(void **)pAVar21[1]._filename._buf)))->Item::IsNull(), bVar2 != 0 &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(pAVar21[1]._filename._buf) + 4)) == 0x5a)))) {
|
|
piVar15 = *GHIDRA_CAST<int **>(pAVar21[1]._filename._buf);
|
|
if ((*piVar15 == 3) && (piVar15[1] == 0x271)) {
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>("WalkIdle"),0);
|
|
}
|
|
else {
|
|
if (local_12a == 0) {
|
|
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>(local_148));
|
|
local_8 = 10;
|
|
FUN_0060c790();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xc;
|
|
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::_Tidy_deallocate();
|
|
iVar5 = FUN_0040bcb0();
|
|
if (iVar5 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::SetFrame(local_148,0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pAVar21))))->Sprite::Play(GHIDRA_CAST<std_string *>((local_68 + 0x10)),0);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::Play(GHIDRA_CAST<byte *>(local_148),0);
|
|
}
|
|
if (pAVar21[1]._filename._buf[10] != '\0') {
|
|
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>(local_148));
|
|
if (local_12a == 0) {
|
|
local_8 = 0xf;
|
|
anim = GHIDRA_CAST<std_string *>(FUN_0060c790());
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x10;
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::SetFrame(anim,0);
|
|
}
|
|
else {
|
|
local_8 = 0xd;
|
|
FUN_0060c790();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xe;
|
|
Sprite::PlayOverlay();
|
|
}
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::_Tidy_deallocate();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pAVar21))))->Sprite::Stop();
|
|
}
|
|
}
|
|
}
|
|
local_130 = (EntityPtr)(GHIDRA_INT(local_130) + 0x10);
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_INT(local_128) + -1));
|
|
} while (local_128 != GHIDRA_CAST<RNG *>(0x0));
|
|
local_128 = GHIDRA_CAST<RNG *>(0x0);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x0))) = ZEXT812(0x3f800000);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
local_144.y = (float)BVar27._l;
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::IsPlaying(&s_empty);
|
|
if (bVar2 == 0) {
|
|
fVar32 = local_144.y;
|
|
}
|
|
else {
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::Length();
|
|
if (2.3 <= (float)local_120) {
|
|
fVar32 = local_144.y;
|
|
}
|
|
else {
|
|
fVar32 = assert_lerp_range((float)local_120,1.0,2.3,0.5,1.0,1);
|
|
}
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_120));
|
|
if (6.0 < (float)local_120) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>(assert_lerp_range((float)local_120,6.0,10.0,1.0,2.0,1));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var_01;
|
|
fVar32 = (float)GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x165c))) {
|
|
fVar32 = 1.0;
|
|
local_13c.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::Dot(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)));
|
|
local_13c.y = assert_lerp_range(local_13c.y,-3.0,1.0,3.0,fVar32,1);
|
|
fVar32 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::Length();
|
|
local_13c.y = fVar32 * local_13c.y;
|
|
auVar25 = ZEXT812(0x3f000000);
|
|
auVar28 = ZEXT812(0x40800000);
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar25)) + 0x0))) <= local_13c.y) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar25)) + 0x4))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar25)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar25)) + 0x0))) = local_13c.y;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x0))) = auVar25;
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar25)) + 0x0))) <= (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar28)) + 0x0)))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar28)) + 0x4))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar28)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar28)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar25)) + 0x0)));
|
|
}
|
|
fVar32 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar28)) + 0x0)));
|
|
}
|
|
}
|
|
local_144.y = fVar32 * local_158.y;
|
|
set_PlaybackSpeed(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)),local_144.y);
|
|
pbVar17 = GHIDRA_CAST<byte *>((GHIDRA_INT(this) + 0x1238));
|
|
local_120 = (EntityPtr)&DAT_0000000f;
|
|
do {
|
|
if ((-1 < (GHIDRA_CAST<PlayerCostumeMap *>((pbVar17 + -0xc)))->_index) && (*pbVar17 != 0)) {
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(FUN_005cbd10());
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_144.y));
|
|
set_PlaybackSpeed(pAVar21,local_144.y);
|
|
}
|
|
pbVar17 = pbVar17 + 0x10;
|
|
local_120 = (EntityPtr)(GHIDRA_INT(&(GHIDRA_CAST<Sprite *>((GHIDRA_INT(local_120) + -0x114)))->_bitflags) + 3);
|
|
} while (local_120 != (EntityPtr)0x0);
|
|
}
|
|
cVar3 = FUN_0040c2d0();
|
|
if ((cVar3 == '\0') && (bVar2 = IsExtraAnimationFinished(this), bVar2 != 0)) {
|
|
pbVar17 = (GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(this) + 0x139c)))))->std::string::c_str();
|
|
PlayExtraAnimation(this,pbVar17);
|
|
FUN_0040c2f0();
|
|
}
|
|
layer = GHIDRA_CAST<LayerState *>((GHIDRA_INT(this) + 0x1508));
|
|
local_150.y = (float)layer;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if ((bVar2 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::HasCollectibleEffect(0x5d), bVar2 == 0))
|
|
{
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::HasCollectibleEffect(299);
|
|
if (bVar2 != 0) {
|
|
pvVar16 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::GetCollectibleEffect(299);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar16) + 8)) != 0) goto LAB_00789259;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00789259:
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = &player->_pos;
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((&player->_velocity)))->Vector::Normalized(GHIDRA_CAST<Vector *>((local_24 + 8)));
|
|
local_13c.y = 40.0;
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((vecResult2)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_1a0._h),&local_13c.y);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&local_16c,vecResult2);
|
|
local_120 = (EntityPtr)(GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(vecResult);
|
|
if (GHIDRA_INT(local_120) < 0) {
|
|
layer = GHIDRA_CAST<LayerState *>(local_150.y);
|
|
this = player;
|
|
}
|
|
else {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
this = player;
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(GHIDRA_CAST<Room *>((room)))->Room::DamageGridWithSource(GHIDRA_INT(local_120),1,GHIDRA_CAST<EntityRef *>(local_68));
|
|
layer = GHIDRA_CAST<LayerState *>(&this->_temporaryeffects);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x168)) & 0x80) != 0) {
|
|
auVar26 = ZEXT416(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x3ac))));
|
|
FUN_00431260();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar26)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar26)) + 0x0))) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c))));
|
|
*GHIDRA_CAST<Entity_Effect **>((GHIDRA_CAST<char *>(this) + 0x36c)) = GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetBossID();
|
|
if ((iVar5 == 0x37) &&
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x0))) = ZEXT812(0x43a00000), (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0,
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) <= (float)BVar27._l &&
|
|
(float)BVar27._l != *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)))) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) = 320.0;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::HasCollectibleEffect(0x251);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::RemoveCollectibleEffect(0x251,-1);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1e94)) = -1;
|
|
dash_impact(this);
|
|
bVar2 = 0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_24 + 8)))))->Vector::Vector(0.0,-10.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity(vecResult,bVar2);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::HasCollectibleEffect(0x82);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::HasCollectibleEffect(0xb5), bVar2 != 0
|
|
)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1888)) = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::RemoveCollectibleEffect(0x82,-1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(layer))))->TemporaryEffects::RemoveCollectibleEffect(0xb5,-1);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(8);
|
|
bVar2 = 0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_24 + 8)))))->Vector::Vector(0.0,-10.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity(vecResult,bVar2);
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar2 != 0) {
|
|
local_150.y = 2.0;
|
|
local_13c.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::Length();
|
|
local_120 = (EntityPtr)0x3f800000;
|
|
std::max<float>();
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
local_164.y = *pfVar10 * 0.5;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::operator_mul_assign(&local_164.y);
|
|
local_13c.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::LengthSquared();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x0))) = ZEXT812(0x3c23d70a);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._h)) + 0x4))) = 0;
|
|
if (local_13c.y < (float)BVar27._l) {
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::operator_assign(&g_vectorZero);
|
|
}
|
|
}
|
|
FUN_007b9aa0();
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x173)) != 0) goto LAB_007894ef;
|
|
}
|
|
else {
|
|
LAB_007894ef:
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(GetDeathAnimName(this));
|
|
local_144.y = (float)pAVar21;
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
local_12a = FUN_0082ee30();
|
|
if (local_12a != 0) goto LAB_00789743;
|
|
Config::GetPillEffects();
|
|
pbVar17 = GHIDRA_CAST<byte *>(_string_holder_c_str());
|
|
do {
|
|
bVar2 = *pbVar17;
|
|
bVar1 = (pAVar21->_filename)._buf[0];
|
|
bVar22 = bVar2 < bVar1;
|
|
if (bVar2 != bVar1) {
|
|
LAB_00789567:
|
|
uVar31 = -GHIDRA_UINT(bVar22) | 1;
|
|
goto LAB_0078956c;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar17[1];
|
|
bVar1 = (pAVar21->_filename)._buf[1];
|
|
bVar22 = bVar2 < bVar1;
|
|
if (bVar2 != bVar1) goto LAB_00789567;
|
|
pbVar17 = pbVar17 + 2;
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>(((pAVar21->_filename)._buf + 2));
|
|
} while (bVar2 != 0);
|
|
uVar31 = 0;
|
|
LAB_0078956c:
|
|
if (uVar31 != 0) {
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x171)) = 1;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>(local_144.y));
|
|
iVar5 = GetTrinketMultiplier(this,0x15);
|
|
if (iVar5 < 1) {
|
|
LAB_007895b1:
|
|
iVar5 = GetTrinketMultiplier(this,0x15);
|
|
if (1 < iVar5) {
|
|
uVar31 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
uVar31 = uVar31 & 0x80000003;
|
|
if (GHIDRA_INT(uVar31) < 0) {
|
|
uVar31 = (uVar31 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
if (uVar31 == 2) goto LAB_007895db;
|
|
}
|
|
}
|
|
else {
|
|
uVar31 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
uVar31 = uVar31 & 0x80000003;
|
|
if (GHIDRA_INT(uVar31) < 0) {
|
|
uVar31 = (uVar31 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
if (uVar31 != 3) goto LAB_007895b1;
|
|
LAB_007895db:
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddTrinketEffect(0x17,1,1);
|
|
}
|
|
ThrowHeldEntity(this,&g_vectorZero);
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ghost"));
|
|
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
layer->_visible = 1;
|
|
}
|
|
if ((((*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc)) == (EntityPtr)0x0) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0)) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) == 0)) &&
|
|
(bVar2 = WillPlayerRevive(this), bVar2 == 0)) {
|
|
pcVar20 = GHIDRA_CAST<char *>(0x0);
|
|
local_120 = (EntityPtr)0x0;
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar5 != 0) {
|
|
do {
|
|
EVar9 = (EntityPtr)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(pcVar20));
|
|
if ((((EVar9 != (EntityPtr)this) &&
|
|
(EVar18 = (EntityPtr)GetOtherTwin(this), EVar9 != EVar18)) &&
|
|
((iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar9))))->Entity::Parent(), iVar5 == 0 &&
|
|
(iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar9))))->Entity::Variant(), iVar5 == 0)))) &&
|
|
((cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar9))))->Entity::IsDead(), cVar3 == '\0' ||
|
|
(bVar2 = WillPlayerRevive(GHIDRA_CAST<Entity_Player *>(EVar9)), bVar2 != 0))))
|
|
goto LAB_007896f1;
|
|
pcVar20 = GHIDRA_CAST<char *>((GHIDRA_INT(local_120) + 1));
|
|
local_120 = (EntityPtr)pcVar20;
|
|
puVar19 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetNumPlayers();
|
|
} while (pcVar20 < puVar19);
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
Game::DeleteSaveState();
|
|
persistent_game_data_set_writable();
|
|
}
|
|
}
|
|
LAB_007896f1:
|
|
if ((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) && (iVar5 = GetBabySkin(this), iVar5 == 0x3b)) &&
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc)) != (EntityPtr)0x0)) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc))))))->Entity::is_player(), bVar2 != 0)) {
|
|
tempEffects = (TemporaryEffects *)
|
|
GetEffects(GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc))));
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddTrinketEffect(0xb4,1,1);
|
|
}
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
|
|
}
|
|
}
|
|
else {
|
|
LAB_00789743:
|
|
local_12a = 1;
|
|
}
|
|
fVar32 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c)) * 0.6;
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(fVar32));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c)) = fVar32;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x13) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x14)) {
|
|
cVar3 = FUN_006f0040();
|
|
local_121 = '\x01';
|
|
if (cVar3 == '\0') goto LAB_00789784;
|
|
}
|
|
else {
|
|
LAB_00789784:
|
|
local_121 = '\0';
|
|
}
|
|
FUN_00417900();
|
|
iVar5 = FUN_007538e0();
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(iVar5 == 0,(undefined3)local_128));
|
|
cVar3 = FUN_00423960();
|
|
if (cVar3 == '\0') {
|
|
LAB_007897da:
|
|
cVar3 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3)));
|
|
}
|
|
else {
|
|
pvVar16 = (void *)FUN_00417920();
|
|
pvVar16 = (GHIDRA_CAST<InputManager *>((pvVar16)))->InputManager::GetDeviceByPlayerEntity(this);
|
|
if (pvVar16 == (void *)0x0) goto LAB_007897da;
|
|
iVar5 = FUN_00753d50();
|
|
cVar3 = iVar5 == 0;
|
|
}
|
|
if ((local_121 == '\0') || (iVar5 = 10, cVar3 == '\0')) {
|
|
iVar5 = 9;
|
|
}
|
|
if (((((GHIDRA_CAST<ActiveItemDesc *>((GHIDRA_INT(this) + 0x1580)))->_item == 0x28d) &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::IsPlaying(&s_empty), bVar2 != 0)) &&
|
|
(bVar2 = input_is_action_triggered
|
|
(g_manager,iVar5,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1618)),GHIDRA_CAST<Entity *>(0x0),0),
|
|
bVar2 != 0)) &&
|
|
(((local_158.y = (float)(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ghost")),
|
|
(EntityPtr)local_158.y != (EntityPtr)0x0 && (*GHIDRA_CAST<int *>(local_158.y) != 0)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_158.y) + 0x74)) != '\0')))) {
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_16c))))->EntityPtr::clear();
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
iVar5 = _ptr_deref_or_minus1();
|
|
local_13c.y = (float)(GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetLayerFrame(iVar5);
|
|
if ((GHIDRA_CAST<Entity *>(local_13c.y) != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
((char)(GHIDRA_CAST<Entity *>(local_13c.y))->_variant != '\0')) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(Config)::GetPillEffects();
|
|
iVar5 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType();
|
|
iVar6 = _ptr_deref_or_minus1();
|
|
if (-1 < *GHIDRA_CAST<int *>((iVar5 + 0x38 + iVar6 * 4))) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(Config)::GetPillEffects();
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType();
|
|
render_build_sprite_quad
|
|
(local_228,&g_vectorZero,(void *)local_13c.y,GHIDRA_CAST<LayerState *>(local_158.y),
|
|
&g_vectorZero,&g_vectorZero,GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)));
|
|
vecResult = (GHIDRA_CAST<Vector *>((local_228)))->Vector::__add(GHIDRA_CAST<Vector *>((local_24 + 8)),local_210);
|
|
local_13c.y = 0.5;
|
|
(GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_1a0._h),&local_13c.y);
|
|
vecResult = GHIDRA_CAST<Vector *>(FUN_0067f2e0());
|
|
(GHIDRA_CAST<Vector *>((&local_16c)))->Vector::operator_assign(vecResult);
|
|
}
|
|
uVar31 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x90,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),2,uVar31);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetPositionOffset(&local_16c);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetSprite();
|
|
fVar32 = random_float();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetRotation(fVar32 * 360.0);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetSprite();
|
|
local_13c.y = 1.5;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_24 + 8)),&local_13c.y);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(vecResult);
|
|
tmpEntity->SetCollisionDamage();
|
|
tmpEntity->Update();
|
|
fVar32 = random_float();
|
|
this = player;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>((fVar32 * 0.2 + 0.9));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var_02;
|
|
play_sound_with_fart_seed(0x1dd,1.25,2,0,(float)GHIDRA_CAST<Entity_Effect *>(BVar27._l));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0xe);
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(local_158.y) + 0x74)) = 0;
|
|
}
|
|
}
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48));
|
|
local_190.y = (float)pAVar21;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23) {
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>(local_144.y));
|
|
if ((bVar2 != 0) && (iVar5 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::GetFrame(), iVar5 == 0x13)) {
|
|
FUN_0042a020();
|
|
FUN_0069d9d0();
|
|
FUN_0069d9d0();
|
|
FUN_0069d9d0();
|
|
uVar31 = 0;
|
|
do {
|
|
Isaac::DestoryWeapon(GHIDRA_CAST<Weapon **>((GHIDRA_INT((GHIDRA_INT(this) + 0x13e0)) + uVar31)));
|
|
uVar31 = uVar31 + 4;
|
|
} while (uVar31 < 0x10);
|
|
Isaac::DestoryWeapon((void **)(GHIDRA_INT(this) + 0x13dc));
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar5 == 0x2a) {
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_f0 + 0x2c)))))->Color::Color();
|
|
BVar27 = g_tearFlagGigaBomb;
|
|
Game::BombExplosionEffects
|
|
(g_game,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),60.0,g_tearFlagGigaBomb,Color,
|
|
GHIDRA_CAST<Entity *>(this),1.0,1,4,1);
|
|
}
|
|
else {
|
|
spawn_gibs(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),6,40.0,GHIDRA_CAST<uint *>(&local_158.y),GHIDRA_CAST<Entity *>(this),
|
|
GHIDRA_CAST<ColorMod *>((GHIDRA_INT(this) + 0x1b8)),&g_vectorZero,1.0);
|
|
play_sound_with_fart_seed(0x1b,1.0,2,0,1.0);
|
|
}
|
|
LAB_00789f05:
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48));
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>(local_144.y));
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pAVar21))))->Sprite::IsEventTriggered("DeathSound"), bVar2 != 0)) {
|
|
bVar2 = IsHologram(this);
|
|
if (bVar2 == 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>(get_voice_pitch(this));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var_03;
|
|
play_sound_with_fart_seed(0xd9,1.0,2,0,(float)GHIDRA_CAST<Entity_Effect *>(BVar27._l));
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x19) {
|
|
local_150.y = (float)(GHIDRA_INT(this) + 0x33c);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_24 + 8)))))->Vector::Vector(10.0,0.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_1a0._h),vecResult)
|
|
;
|
|
Game::ButterBeanFart(g_game,vecResult,120.0,GHIDRA_CAST<Entity *>(this),1,0);
|
|
uVar31 = Random();
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_24 + 8)))))->Vector::Vector(10.0,0.0);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_1a0._h),vecResult)
|
|
;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(0xf5,0,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar31);
|
|
local_120 = (EntityPtr)0x6;
|
|
do {
|
|
uVar31 = Random();
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_24 + 8)))))->Vector::Vector(-1.0,0.0);
|
|
fVar32 = random_float();
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Rotated(GHIDRA_CAST<Vector *>(&local_1a0._h),fVar32 * 40.0 - 20.0);
|
|
fVar32 = random_float();
|
|
local_13c.y = fVar32 * 20.0 + 6.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&local_16c,&local_13c.y);
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::Vector(4.0,0.0);
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_150.y))))->Vector::__sub(&local_17c,vecResult2);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,99,vecResult2,vecResult,GHIDRA_CAST<Entity *>(0x0),1,uVar31);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::SpriteScale();
|
|
fVar32 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>((fVar32 * 1.5 + 1.0));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var_04;
|
|
local_164.y = (float)GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&local_174,&local_164.y);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetSpriteScale(vecResult);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetSprite();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_f0 + 0x2c)))))->Color::Color(0.4,0.33,0.25,1.0);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color_02);
|
|
tmpEntity->Update();
|
|
local_120 = (EntityPtr)(GHIDRA_INT(local_120) + -1);
|
|
} while (local_120 != (EntityPtr)0x0);
|
|
local_130 = (EntityPtr)0x0;
|
|
local_120 = (EntityPtr)0x0;
|
|
this = player;
|
|
if (0 < player->_poopMana) {
|
|
do {
|
|
if (0x12 < GHIDRA_INT(local_130)) break;
|
|
uVar31 = Random();
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_24 + 8)))))->Vector::Vector(-1.0,0.0);
|
|
fVar32 = random_float();
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Rotated(GHIDRA_CAST<Vector *>(&local_1a0._h),fVar32 * 40.0 - 20.0);
|
|
fVar32 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar27._l)) + 0x0))) = GHIDRA_CAST<Entity_Effect *>((fVar32 * 6.0 + 3.0));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar27)) + 0x4))) = extraout_var_05;
|
|
local_13c.y = (float)GHIDRA_CAST<Entity_Effect *>(BVar27._l);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&local_16c,&local_13c.y);
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::Vector(4.0,0.0);
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_150.y))))->Vector::__sub(&local_17c,vecResult2);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x2a,vecResult2,vecResult,GHIDRA_CAST<Entity *>(0x0),0,uVar31);
|
|
FUN_005b19f0();
|
|
tmpEntity->Update();
|
|
this = player;
|
|
AddPoopMana(player,-1);
|
|
local_130 = (EntityPtr)(GHIDRA_INT(local_130) + 1);
|
|
} while (GHIDRA_INT(local_130) < this->_poopMana);
|
|
}
|
|
goto LAB_00789f05;
|
|
}
|
|
}
|
|
}
|
|
if ((local_12a == 0) &&
|
|
(((bVar2 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>(local_144.y)), bVar2 != 0 &&
|
|
((iVar5 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::GetFrame(), 7 < iVar5 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23))))
|
|
|| (bVar2 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::IsFinishedImpl(&s_empty), bVar2 != 0)))) {
|
|
local_158.y = (float)(GHIDRA_INT(this) + 0x1e68);
|
|
iVar5 = EntityPtr::Ref();
|
|
if ((iVar5 != 0) && (iVar5 = EntityPtr::Ref(), *GHIDRA_CAST<char *>((iVar5 + 0x173)) == '\0')) {
|
|
iVar5 = EntityPtr::Ref();
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
pbVar17 = GetDeathAnimName(otherPlayer);
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar5 + 0x48)))))->ANM2::IsPlaying(pbVar17);
|
|
if (bVar2 == 0) {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
bVar2 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::IsCoopPlay();
|
|
if (bVar2 == 0) {
|
|
uVar30 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x16a8));
|
|
uVar34 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x16ac));
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x16a8)) = uVar30;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x16ac)) = uVar34;
|
|
other_02 = &player->_lastDamageSource;
|
|
iVar5 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((iVar5 + 0x167c)))))->EntityRef::operator_(other_02);
|
|
piVar15 = GHIDRA_CAST<int *>(EntityPtr)::Ref();
|
|
vfunc = *(code **)(*piVar15 + 0x24);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
(*vfunc)();
|
|
iVar5 = EntityPtr::Ref();
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x171)) = 1;
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
deathAnimPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
pbVar17 = GetDeathAnimName(deathAnimPlayer);
|
|
PlayExtraAnimation(otherPlayer,pbVar17);
|
|
}
|
|
else {
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref();
|
|
cVar3 = IsCoopGhost(otherPlayer);
|
|
if (cVar3 == '\0') {
|
|
piVar15 = GHIDRA_CAST<int *>(EntityPtr)::Ref();
|
|
vfunc = *(code **)(*piVar15 + 0x24);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
(*vfunc)();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_190.y))))->ANM2::IsFinishedImpl(GHIDRA_CAST<byte *>(local_144.y));
|
|
this = player;
|
|
if (bVar2 != 0) {
|
|
player->_visible = 0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x168)) & 0x4000) == 0) {
|
|
bVar2 = HasCollectible(this,0x177,0);
|
|
if (bVar2 == 0) {
|
|
LAB_0078a11e:
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::string_from_cstr(&s_empty);
|
|
local_8 = 0x13;
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) | 2);
|
|
local_158.y = (float)local_15c;
|
|
bVar2 = IsCollectibleAnimFinished(this,0x177,GHIDRA_CAST<std_string *>((local_68 + 0x10)));
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(1,(undefined3)local_128));
|
|
if (bVar2 == 0) goto LAB_0078a11e;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((GHIDRA_UINT(local_15c) & 2) != 0) {
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) & 0xfffffffd);
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0') {
|
|
ClearCollectibleAnim(this,0x177);
|
|
}
|
|
bVar2 = HasCollectible(this,399,0);
|
|
if (bVar2 == 0) {
|
|
LAB_0078a1b2:
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::string_from_cstr(&s_empty);
|
|
local_8 = 0x14;
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) | 4);
|
|
local_158.y = (float)local_15c;
|
|
bVar2 = IsCollectibleAnimFinished(this,399,GHIDRA_CAST<std_string *>((local_68 + 0x10)));
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(1,(undefined3)local_128));
|
|
if (bVar2 == 0) goto LAB_0078a1b2;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((GHIDRA_UINT(local_15c) & 4) != 0) {
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) & 0xfffffffb);
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0') {
|
|
ClearCollectibleAnim(this,399);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasNullEffect(0x75);
|
|
if (bVar2 == 0) {
|
|
LAB_0078a242:
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::string_from_cstr(&s_empty);
|
|
local_8 = 0x15;
|
|
local_15c = (EntityPtr)(GHIDRA_UINT(local_15c) | 8);
|
|
local_158.y = (float)local_15c;
|
|
cVar3 = FUN_007ad720();
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(1,(undefined3)local_128));
|
|
if (cVar3 == '\0') goto LAB_0078a242;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((GHIDRA_UINT(local_15c) & 8) != 0) {
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0') {
|
|
FUN_007ad610();
|
|
itemConfig = Isaac::GetItemConfig();
|
|
itemCfg = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x75);
|
|
RemoveCostume(this,itemCfg);
|
|
}
|
|
}
|
|
update_footprints(this);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) || (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) != 0)) {
|
|
update_baby_skin_effects(this);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b2c))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b2c)) + -1, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b2c)) = iVar5, iVar5 == 0))
|
|
{
|
|
SoundEffects::PlayWithFartOverride
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b24)),*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1b28)),2,0,1.0);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b24)) = 0;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetDebugFlag(7);
|
|
if (bVar2 != 0) {
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x1588));
|
|
local_120 = (EntityPtr)0x0;
|
|
do {
|
|
if ((GHIDRA_CAST<ActiveItemDesc *>((piVar15 + -2)))->_item != 0) {
|
|
iVar5 = GetActiveMaxCharge(this,GHIDRA_INT(local_120));
|
|
*piVar15 = iVar5;
|
|
}
|
|
local_120 = (EntityPtr)(GHIDRA_INT(local_120) + 1);
|
|
piVar15 = piVar15 + 8;
|
|
} while (GHIDRA_UINT(local_120) < &DAT_00000004);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x19) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1f54)) = 9;
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(1);
|
|
if ((bVar2 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0)) {
|
|
musicManager = GHIDRA_CAST<MusicManager *>(MusicManager)::MusicManager();
|
|
fVar32 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x360)))))->Vector::Length();
|
|
local_13c.y = fVar32 * 0.1 + 0.5;
|
|
BVar27 = (BitSet128)ZEXT416(GHIDRA_UINT(local_13c.y));
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::PitchSlide();
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(2);
|
|
if ((bVar2 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 0)) {
|
|
musicManager = GHIDRA_CAST<MusicManager *>(MusicManager)::MusicManager();
|
|
BVar27 = (BitSet128)ZEXT816(0);
|
|
FUN_00a155f0();
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::PitchSlide();
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x25);
|
|
if (bVar2 != 0) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*vfunc)();
|
|
tmpColor = (ColorMod *)::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::SetColor(tmpColor);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0xe);
|
|
if (bVar2 != 0) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*vfunc)();
|
|
tmpColor = (ColorMod *)::(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::SetColor(tmpColor);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x35);
|
|
if (bVar2 != 0) {
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::Color();
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_98))))->Color::SetColorize(1.0,1.0,1.0,1.0);
|
|
this->SetColor();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_98));
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x18);
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
EVar9 = (EntityPtr)(GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)));
|
|
local_120 = EVar9;
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
gridEntity = (GHIDRA_CAST<Room *>((room)))->Room::GetGridEntity(GHIDRA_UINT(EVar9));
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
local_12a = 0;
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
LAB_0078a679:
|
|
local_121 = '\0';
|
|
}
|
|
else {
|
|
iVar5 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType();
|
|
local_12a = iVar5 == 0xe;
|
|
if ((bool)local_12a) {
|
|
iVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(gridEntity))))->EntityList::Size();
|
|
local_128 = GHIDRA_CAST<RNG *>(CONCAT13(iVar5 == 1000,(undefined3)local_128));
|
|
LAB_0078a64a:
|
|
iVar5 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType();
|
|
if ((iVar5 != 1) && (iVar5 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType(), iVar5 != 10))
|
|
goto LAB_0078a679;
|
|
local_121 = '\x01';
|
|
}
|
|
else {
|
|
local_121 = '\0';
|
|
local_128 = GHIDRA_CAST<RNG *>((GHIDRA_UINT(local_128) & 0xffffff));
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) goto LAB_0078a64a;
|
|
}
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::GetGridPosition(GHIDRA_CAST<Vector *>((local_24 + 8)),GHIDRA_INT(local_120));
|
|
FUN_00a0ff00();
|
|
if ((float)BVar27._l < 20.0 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x370)) * 0.5) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
|
|
if ((bVar2 == 0) &&
|
|
(((gridEntity == GHIDRA_CAST<GridEntity *>(0x0) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_128)) + 0x3))) != '\0')) ||
|
|
((local_121 != '\0' && (local_12a == 0)))))) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
rng = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar31 = (GHIDRA_CAST<RNG *>((rng)))->RNG::Next();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SpawnGridEntity(GHIDRA_INT(local_120),0xe,0,uVar31,0);
|
|
play_sound_with_fart_seed(0x25,0.3,2,0,1.0);
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x1a);
|
|
if ((bVar2 != 0) && (iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount(), 0x3c < iVar5)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if ((10 < iVar5) && (bVar2 = IsExtraAnimationFinished(this), bVar2 != 0)) {
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (cVar3 == '\0') {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if ((cVar3 == '\0') &&
|
|
(((local_13c.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1660)))))->Vector::Length(), local_13c.y < 0.2 &&
|
|
(local_13c.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1654)))))->Vector::Length(), local_13c.y < 0.1)) ||
|
|
((local_13c.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1660)))))->Vector::Length(), local_13c.y < 0.2 &&
|
|
(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 400)) != 0)))))) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
(*vfunc)();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x1b);
|
|
if ((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar2 == 0)) {
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
iVar5 = 0x545 - iVar5 % 0x546;
|
|
if (iVar5 == 0) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
(*vfunc)();
|
|
fVar32 = 1.0;
|
|
fVar23 = 8.0;
|
|
}
|
|
else {
|
|
if ((iVar5 == (iVar5 / 0x1e) * 0x1e) && (iVar5 < 0x97)) {
|
|
fVar32 = 1.0;
|
|
}
|
|
else {
|
|
if ((iVar5 != (iVar5 / 0xf) * 0xf) || (0x96 < iVar5)) goto LAB_0078a970;
|
|
fVar32 = 0.8;
|
|
}
|
|
fVar23 = 4.0;
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x23,fVar32,0,0,fVar23);
|
|
}
|
|
LAB_0078a970:
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x1c);
|
|
if ((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar2 == 0)) {
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
iVar5 = 53999 - iVar5;
|
|
if ((iVar5 < 1) && (bVar2 = IsExtraAnimationFinished(this), bVar2 != 0)) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
cVar3 = (*vfunc)();
|
|
if (cVar3 == '\0') goto LAB_0078aa79;
|
|
fVar32 = 1.0;
|
|
fVar23 = 8.0;
|
|
}
|
|
else {
|
|
if ((iVar5 == (iVar5 / 0x1e) * 0x1e) && (iVar5 < 0x385)) {
|
|
fVar32 = 1.0;
|
|
}
|
|
else {
|
|
if ((iVar5 != (iVar5 / 0xf) * 0xf) || (300 < iVar5)) goto LAB_0078aa79;
|
|
fVar32 = 0.8;
|
|
}
|
|
fVar23 = 4.0;
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x23,fVar32,0,0,fVar23);
|
|
}
|
|
LAB_0078aa79:
|
|
local_16c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x16c));
|
|
uVar31 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x168));
|
|
if ((uVar31 & 0x4000) != 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x8000);
|
|
local_16c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x16c));
|
|
uVar31 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x168));
|
|
}
|
|
if ((uVar31 & 0x4000) == 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x8000000);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000);
|
|
if ((bVar2 != 0) && (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x28c)) == (EntityPtr)this)) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da4));
|
|
if (0 < iVar5) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) < 1) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) < 1)) {
|
|
iVar6 = GetHealthType(this);
|
|
iVar6 = scale_for_hard_difficulty(2 - GHIDRA_UINT((iVar6 != 3)));
|
|
if (iVar5 <= iVar6) goto LAB_0078ac08;
|
|
}
|
|
bVar2 = HasInstantDeathCurse(this);
|
|
if (bVar2 == 0) {
|
|
iVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetHitPointsLost();
|
|
uVar31 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x138c)) - iVar5;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x138c)) = uVar31;
|
|
if (GHIDRA_INT(uVar31) < 1) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x138c)) = 600;
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(local_68))))->EntityRef::EntityRef();
|
|
FUN_00665a30();
|
|
(*vfunc)();
|
|
this = player;
|
|
}
|
|
else if (GHIDRA_INT(uVar31) < 0x1e) {
|
|
uVar31 = uVar31 & 0x80000003;
|
|
bVar22 = uVar31 == 0;
|
|
if (GHIDRA_INT(uVar31) < 0) {
|
|
bVar22 = (uVar31 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (bVar22) {
|
|
vfunc = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_f0 + 0x2c)))))->Color::Color(1.0,0.0,0.0,1.0,0.0,0.0);
|
|
(*vfunc)();
|
|
}
|
|
}
|
|
goto LAB_0078ac1d;
|
|
}
|
|
}
|
|
LAB_0078ac08:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x400000000);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x138c)) = 0;
|
|
}
|
|
LAB_0078ac1d:
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x16) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
iVar6 = FUN_007d4320();
|
|
if (((iVar6 < iVar5) || (1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)))) ||
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) == 1 && (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) + iVar5)))) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) == 0) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) = 300;
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) + -1;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) = iVar5;
|
|
if (iVar5 < 1) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
iVar6 = FUN_007d4320();
|
|
if (iVar6 < iVar5) {
|
|
AddHearts(this,-1,0,0);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) = 300;
|
|
}
|
|
else {
|
|
if ((1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c))) ||
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) == 1 && (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) + iVar5)))
|
|
) {
|
|
AddSoulHearts(this,-1,0);
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) = 300;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_0078ace4;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1ef4)) = 0;
|
|
}
|
|
LAB_0078ace4:
|
|
bVar2 = IsHeldItemVisible(this);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1b1c));
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x17d8)) = bVar2;
|
|
bVar2 = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar2 != 0) {
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_24 + 8)),GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)));
|
|
local_13c.y = (GHIDRA_CAST<Vector *>((vecResult2)))->Vector::Length();
|
|
if (1.0 < local_13c.y) {
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_24 + 8)),GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)));
|
|
local_13c.y = 0.18;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_1a0._h),&local_13c.y);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)))))->Vector::__add(&local_16c,vecResult);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetPosition(vecResult);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
if (bVar2 == 0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) < 2) {
|
|
iVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetLastLevelWithoutHalfHp();
|
|
Config::GetCollectibles();
|
|
iVar6 = EntityPtr::Ref();
|
|
noHalfHpFloors = iVar6 - iVar5;
|
|
if (9 < iVar6) {
|
|
if (iVar6 < 0xc) {
|
|
noHalfHpFloors = noHalfHpFloors + -1;
|
|
}
|
|
else {
|
|
noHalfHpFloors = 10 - iVar5;
|
|
}
|
|
}
|
|
if (2 < noHalfHpFloors) {
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::TryUnlock(0x149);
|
|
}
|
|
}
|
|
else {
|
|
Config::GetCollectibles();
|
|
iVar5 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SetLastLevelWithoutHalfHp(iVar5);
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar2 != 0) || (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDead(), cVar3 != '\0')) goto LAB_0078b0f0;
|
|
uVar31 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x168));
|
|
if ((uVar31 & 0x100) == 0) {
|
|
if ((uVar31 & 0x200) != 0) {
|
|
local_15c = (EntityPtr)0xb67610;
|
|
goto LAB_0078af55;
|
|
}
|
|
if ((uVar31 & 0x1000) != 0) {
|
|
local_15c = (EntityPtr)0xb67618;
|
|
goto LAB_0078af55;
|
|
}
|
|
if ((uVar31 & 0x40) != 0) {
|
|
local_15c = (EntityPtr)0xb67620;
|
|
goto LAB_0078af55;
|
|
}
|
|
if ((uVar31 & 0x800) != 0) {
|
|
local_15c = (EntityPtr)&DAT_00b67628;
|
|
goto LAB_0078af55;
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) & 4) != 0) {
|
|
local_15c = (EntityPtr)0xb67690;
|
|
goto LAB_0078af55;
|
|
}
|
|
if ((uVar31 & 0x80) != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
local_15c = (EntityPtr)&DAT_00b6769c;
|
|
goto LAB_0078af55;
|
|
}
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x31c))) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if ((cVar3 != '\0') && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x2ed2)) == 0)) {
|
|
local_15c = (EntityPtr)0xb6b02c;
|
|
goto LAB_0078af55;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x110c)))))->Sprite::Stop();
|
|
}
|
|
else {
|
|
local_15c = (EntityPtr)0xb67630;
|
|
LAB_0078af55:
|
|
pAVar21 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x110c));
|
|
cVar3 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pAVar21))))->Sprite::IsLoaded();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("gfx/StatusEffects.anm2"));
|
|
local_8 = 0x16;
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::Load(GHIDRA_CAST<std_string *>((local_68 + 0x10)),1);
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>((local_68 + 0x10)))->std::string::_Tidy_deallocate();
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::IsPlaying(&s_empty);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::Update();
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((pAVar21)))->ANM2::Play(GHIDRA_CAST<byte *>(local_15c),0);
|
|
}
|
|
Config::GetPillEffects();
|
|
local_13c.y = (float)FUN_0040bc90();
|
|
bVar2 = IsExtraAnimationFinished(this);
|
|
if (bVar2 == 0) {
|
|
local_120 = (EntityPtr)0xffffffff;
|
|
}
|
|
else {
|
|
FUN_0041e470();
|
|
local_120 = (EntityPtr)FUN_0040bc90();
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(this) + 0x48)))))->Sprite::GetOverlayFrame();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this) + 0x48)))))->ANM2::GetFrame();
|
|
FUN_00753830();
|
|
FUN_00839840();
|
|
cVar3 = Level::IsAltStage();
|
|
if (cVar3 != '\0') {
|
|
Config::GetCollectibles();
|
|
iVar5 = EntityPtr::Ref();
|
|
if ((iVar5 == 0xc) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x96,0), bVar2 != 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar5 = (GHIDRA_CAST<Room *>((room)))->Room::GetDeliriumDistance();
|
|
iVar5 = Isaac::Random(iVar5 * 0x69 + 0x4b);
|
|
if ((iVar5 == 0) && (cVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::HasHallucination(), cVar3 == '\0')) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShowHallucination();
|
|
}
|
|
}
|
|
}
|
|
cVar3 = Level::IsAltStage();
|
|
if ((cVar3 != '\0') && (cVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::HasHallucination(), cVar3 != '\0')) {
|
|
FUN_00839830();
|
|
}
|
|
LAB_0078b0f0:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDead();
|
|
if (cVar3 != '\0') {
|
|
std::deque<12byte>::_Tidy();
|
|
}
|
|
FUN_0060c560();
|
|
_range_to_span();
|
|
cVar3 = FUN_0060c450();
|
|
while (cVar3 != '\0') {
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0060c420());
|
|
*piVar15 = *piVar15 + -1;
|
|
piVar15 = GHIDRA_CAST<int *>(FUN_0060c420());
|
|
if (*piVar15 < 1) {
|
|
FUN_00479d50();
|
|
FUN_007dc6d0();
|
|
FUN_0078b330();
|
|
}
|
|
else {
|
|
FUN_0060c410();
|
|
}
|
|
_range_to_span();
|
|
cVar3 = FUN_0060c450();
|
|
}
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this) + 0x1d94)) = 0;
|
|
}
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x20a9)) != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x188)) = 0;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x184)) = 3;
|
|
}
|
|
bVar2 = IsHologram(this);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x188)) = 0;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
entityList = GHIDRA_CAST<EntityList *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetField26614();
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>((entityList)))->EntityList)::Size();
|
|
(**(code **)(*piVar15 + 0x58))();
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x16b8)) = 0;
|
|
}
|
|
FUN_00864130();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0078b350
|
|
byte Entity_Player::IsHeadless()
|
|
{
|
|
byte isHasEffect;
|
|
TemporaryEffects *tempEffects;
|
|
|
|
isHasEffect = HasCollectible(this,0xce,0);
|
|
if (isHasEffect == 0) {
|
|
tempEffects = &this->_temporaryeffects;
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x145);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0xce);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x37);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x2d9);
|
|
if (isHasEffect == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0078ca00
|
|
void Entity_Player::Render(Vector *offset)
|
|
{
|
|
byte bVar1;
|
|
short sVar2;
|
|
float *extraout_EAX;
|
|
Entity_Player *localPlayer;
|
|
float *pfVar3;
|
|
void *pvVar4;
|
|
Vector *pVVar5;
|
|
KColor *color;
|
|
undefined4 extraout_EDX;
|
|
undefined4 extraout_EDX_00;
|
|
undefined4 uVar6;
|
|
Manager *manager;
|
|
int iVar7;
|
|
uint afterImageIdx;
|
|
float fVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
float fVar11;
|
|
float shadowHeight;
|
|
double flooredCoord;
|
|
undefined1 auStack_164 [24];
|
|
float fStack_14c;
|
|
KColor *imageRefCount;
|
|
undefined1 auStack_12a [2];
|
|
float quad0X;
|
|
float quad0Y;
|
|
float quad1X;
|
|
float quad1Y;
|
|
float quad2X;
|
|
float quad2Y;
|
|
float quad3X;
|
|
float quad3Y;
|
|
KColor drawColor;
|
|
Vector local_9c;
|
|
float local_94;
|
|
float local_90;
|
|
Entity_Player *local_8c;
|
|
Vector *renderOffset;
|
|
Vector renderPos;
|
|
float netplayAlpha;
|
|
float heldScaleX;
|
|
float heldOffsetY;
|
|
float heldScaleY;
|
|
uint isHeldBehind;
|
|
float local_68;
|
|
float local_64;
|
|
char isHolding;
|
|
float local_5c;
|
|
float local_58;
|
|
float local_54;
|
|
Vector local_50;
|
|
Vector local_48;
|
|
ColorMod tmpColor;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
float local_8;
|
|
Game *game;
|
|
int *heldEntity;
|
|
int shadowImageHeight;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00aff61d;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((&tmpColor)[1]._colorize);
|
|
renderOffset = offset;
|
|
local_8c = this;
|
|
if (this->_variant == 2) {
|
|
if (this->_target == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
}
|
|
else if (this->_target == (EntityPtr)0x0) {
|
|
local_64 = offset->x;
|
|
local_54 = offset->y;
|
|
if ((this->_flags & 0x200000000000000) == 0) {
|
|
local_64 = local_64 + (this->_posOffset).x * 0.65;
|
|
local_54 = local_54 + (this->_posOffset).y * 0.65;
|
|
}
|
|
ExceptionList = &local_10;
|
|
renderPos.x = local_64;
|
|
renderPos.y = local_54;
|
|
if (this->_canFly != 0) {
|
|
GetFlyingOffset(this,&local_9c);
|
|
renderPos.x = local_64 + *extraout_EAX;
|
|
renderPos.y = local_54 + extraout_EAX[1];
|
|
}
|
|
fVar9 = 1.0;
|
|
netplayAlpha = 1.0;
|
|
manager = g_manager;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
bVar1 = (GHIDRA_CAST<NetplayManager *>((&g_manager->_netplayManager)))->NetplayManager::IsIdxLocalPlayer(this->_controllerIndex);
|
|
manager = g_manager;
|
|
if (bVar1 == 0) {
|
|
FUN_00925df0();
|
|
netplayAlpha = fVar9;
|
|
}
|
|
}
|
|
if (this->_visible == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((((0 < this->_damageCooldown) && (this->_damageCooldown % 6 < 3)) &&
|
|
(bVar1 = IsExtraAnimationFinished(this), bVar1 != 0)) &&
|
|
((g_game->_challenge != 0x1e &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x1000000000), bVar1 == 0)))) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (((manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((manager + 1))) &&
|
|
(1 < GHIDRA_UINT((GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((manager + 1))) - GHIDRA_INT(manager->_netplayManager) >> 2)))) &&
|
|
((bVar1 = IsInvisible(this), bVar1 == 0 ||
|
|
(localPlayer = GHIDRA_CAST<Entity_Player *>(FUN_0090b0e0()), localPlayer == this)))) {
|
|
iVar7 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this->_shadowImage) + 0x10));
|
|
shadowImageHeight = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this->_shadowImage) + 0x14));
|
|
local_54 = (float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]);
|
|
local_90 = (float)((double)shadowImageHeight +
|
|
__uint_to_double_fixup[-(shadowImageHeight >> 0x1f)]);
|
|
FUN_00682260();
|
|
local_5c = this->_shadowSize * (this->_sprite)._scale.x;
|
|
if (0.001 <= local_5c) {
|
|
get_netplay_player_color(&g_game->_playerManager,&tmpColor,this);
|
|
bVar1 = IsLocalPlayer(this);
|
|
if (bVar1 == 0) {
|
|
tmpColor._tint[3] = netplayAlpha;
|
|
}
|
|
local_64 = g_displayPixelRatio * g_screenPointScale;
|
|
local_50.y = ((((this->_pos).x + (this->_shadowOffset).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * local_64 + 0.5;
|
|
flooredCoord = floor((double)local_50.y);
|
|
local_58 = (float)flooredCoord / local_64;
|
|
local_50.y = ((((this->_pos).y + (this->_shadowOffset).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * local_64 + 0.5;
|
|
flooredCoord = floor((double)local_50.y);
|
|
game = g_game;
|
|
local_50.y = (float)flooredCoord;
|
|
fVar9 = local_5c * local_54;
|
|
shadowHeight = local_5c * local_90;
|
|
fVar11 = local_50.y / local_64;
|
|
local_48.x = fVar9;
|
|
local_48.y = shadowHeight;
|
|
(GHIDRA_CAST<KColor *>((&drawColor)))->KColor::SetFromARGB(0xffffffff);
|
|
pVVar5 = &local_48;
|
|
local_50.x = (local_58 + renderOffset->x + (game->_screenShakeOffset).x) - fVar9 * 0.5;
|
|
local_50.y = (fVar11 + renderOffset->y + (game->_screenShakeOffset).y) - shadowHeight * 0.5;
|
|
imageRefCount = color;
|
|
render_quad_set_rect(&quad0X,&local_50,pVVar5,color);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_12a + -10)))->KAGE::SmartPointer::operator_assign(this->_shadowImage);
|
|
apply_sprite_shader_params(&tmpColor,1,pVVar5,imageRefCount);
|
|
drawColor._unk = 0;
|
|
drawColor._red = tmpColor._tint[0];
|
|
drawColor._green = tmpColor._tint[1];
|
|
drawColor._blue = tmpColor._tint[2];
|
|
drawColor._alpha = tmpColor._tint[3];
|
|
(**(code **)(**GHIDRA_CAST<int **>(this->_shadowImage) + 0x1c))();
|
|
this = local_8c;
|
|
}
|
|
}
|
|
pvVar4 = this->_heldEntity;
|
|
isHolding = pvVar4 != (void *)0x0;
|
|
heldOffsetY = 0.0;
|
|
local_64 = 0.0;
|
|
heldScaleX = g_vectorOne.x;
|
|
local_9c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12bc));
|
|
heldScaleY = g_vectorOne.y;
|
|
local_58 = 0.0;
|
|
isHeldBehind = isHeldBehind & 0xffffff00;
|
|
if (pvVar4 == (void *)0x0) goto LAB_0078d290;
|
|
isHeldBehind = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar4) + 0x354)) >> 0x1f;
|
|
if ((this->_itemState == 0x25c) || (1 < this->_suplexState)) {
|
|
if ((this->_bodySprite)._animState._animData == (void *)0x0) {
|
|
LAB_0078ced5:
|
|
if (1 < this->_suplexState) {
|
|
pfVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayerFrame(0);
|
|
uVar6 = extraout_EDX_00;
|
|
if (pfVar3 != GHIDRA_CAST<float *>(0x0)) goto LAB_0078cef6;
|
|
}
|
|
isHolding = '\0';
|
|
goto LAB_0078d290;
|
|
}
|
|
pfVar3 = (GHIDRA_CAST<AnimationState *>((&(this->_bodySprite)._animState)))->AnimationState::GetNullFrameById(0);
|
|
uVar6 = extraout_EDX;
|
|
if (pfVar3 == GHIDRA_CAST<float *>(0x0)) goto LAB_0078ced5;
|
|
LAB_0078cef6:
|
|
local_64 = *pfVar3;
|
|
heldOffsetY = pfVar3[1];
|
|
if (1 < this->_suplexState) {
|
|
heldScaleX = pfVar3[4];
|
|
heldScaleY = pfVar3[5];
|
|
isHeldBehind = CONCAT31((int3)(GHIDRA_UINT(uVar6) >> 8),this->_suplexState == 4);
|
|
local_58 = pfVar3[0x11];
|
|
local_50.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0x7c));
|
|
if (local_50.y != 0.0) {
|
|
local_90 = INFINITY;
|
|
local_54 = INFINITY;
|
|
local_5c = 0.0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_50.y) + 0x1c)) != 0) {
|
|
iVar7 = 0;
|
|
do {
|
|
local_48.y = (float)(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this->_heldEntity) + 0x48)))))->ANM2::GetLayer(*GHIDRA_CAST<byte **>((iVar7 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_50.y) + 0x18))
|
|
)));
|
|
pvVar4 = AnimationState::GetLayerFrame
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_INT(this->_heldEntity) + 0x78)),
|
|
*GHIDRA_CAST<int *>((iVar7 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_50.y) + 0x18)))));
|
|
if (pvVar4 != (void *)0x0) {
|
|
fStack_14c = 1.109483e-38;
|
|
render_build_sprite_quad
|
|
(&quad0X,&g_vectorZero,pvVar4,GHIDRA_CAST<LayerState *>(local_48.y),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>((GHIDRA_INT(this->_heldEntity) + 0x48)));
|
|
fVar9 = quad0X;
|
|
if (local_90 <= quad0X) {
|
|
fVar9 = local_90;
|
|
}
|
|
fVar11 = quad0Y;
|
|
if (local_54 <= quad0Y) {
|
|
fVar11 = local_54;
|
|
}
|
|
if (quad2X < fVar9) {
|
|
fVar9 = quad2X;
|
|
}
|
|
else {
|
|
}
|
|
if (quad2Y < fVar11) {
|
|
fVar11 = quad2Y;
|
|
}
|
|
else {
|
|
}
|
|
if (quad1X < fVar9) {
|
|
fVar9 = quad1X;
|
|
}
|
|
else {
|
|
}
|
|
if (quad1Y < fVar11) {
|
|
fVar11 = quad1Y;
|
|
}
|
|
else {
|
|
}
|
|
local_90 = quad3X;
|
|
if (fVar9 <= quad3X) {
|
|
local_90 = fVar9;
|
|
}
|
|
local_54 = quad3Y;
|
|
if (fVar11 <= quad3Y) {
|
|
local_54 = fVar11;
|
|
}
|
|
}
|
|
iVar7 = iVar7 + 0x10;
|
|
local_5c = (float)(GHIDRA_INT(local_5c) + 1);
|
|
} while (GHIDRA_UINT(local_5c) < GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_50.y) + 0x1c))));
|
|
}
|
|
sVar2 = fdclass();
|
|
if (sVar2 < 1) {
|
|
fVar9 = heldScaleY * 0.2 * local_54;
|
|
if (local_58 == 0.0) {
|
|
heldOffsetY = heldOffsetY - fVar9;
|
|
}
|
|
else {
|
|
heldOffsetY = heldOffsetY + fVar9;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pvVar4 = this->_heldEntity;
|
|
if (((pvVar4 != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar4) + 0x171)) == '\0')) &&
|
|
((char)isHeldBehind != '\0')) {
|
|
local_48.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe4));
|
|
local_5c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe8));
|
|
local_50.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xfc));
|
|
local_54 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xec));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe4)) = heldScaleX * local_48.y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe8)) = heldScaleY * local_5c;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xec)) = local_54 + local_58;
|
|
bVar1 = IsLocalPlayer(this);
|
|
if (bVar1 == 0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xfc)) = local_50.y * netplayAlpha;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0x171)) = 1;
|
|
heldEntity = this->_heldEntity;
|
|
local_94 = ((this->_pos).x - (float)heldEntity[0xcf]) * 0.65 + renderPos.x + local_64;
|
|
local_90 = ((this->_pos).y - (float)heldEntity[0xd0]) * 0.65 + renderPos.y + heldOffsetY;
|
|
(**(code **)(*heldEntity + 0x14))();
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0x171)) = 0;
|
|
pvVar4 = this->_heldEntity;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe4)) = local_48.y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe8)) = local_5c;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xec)) = local_54;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xfc)) = local_50.y;
|
|
}
|
|
LAB_0078d290:
|
|
tmpColor._tint[0] = (this->_sprite)._color._tint[0];
|
|
tmpColor._tint[1] = (this->_sprite)._color._tint[1];
|
|
tmpColor._tint[2] = (this->_sprite)._color._tint[2];
|
|
tmpColor._tint[3] = (this->_sprite)._color._tint[3];
|
|
tmpColor._offset[2] = (this->_sprite)._color._offset[2];
|
|
afterImageIdx = 0;
|
|
tmpColor._colorize[0] = (this->_sprite)._color._colorize[0];
|
|
tmpColor._colorize[1] = (this->_sprite)._color._colorize[1];
|
|
tmpColor._colorize[2] = (this->_sprite)._color._colorize[2];
|
|
tmpColor._colorize[3] = (this->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset);
|
|
if ((this->_afterImageFrames)._size != 0) {
|
|
do {
|
|
local_50.y = (float)(this->_afterImageFrames)._offset;
|
|
fVar9 = (float)**GHIDRA_CAST<int **>((GHIDRA_INT((this->_afterImageFrames)._map) +
|
|
(afterImageIdx + GHIDRA_INT(local_50.y) &
|
|
(this->_afterImageFrames)._mapSize - 1) * 4)) / 10.0;
|
|
if (fVar9 <= 0.0) {
|
|
fVar9 = 0.0;
|
|
}
|
|
if (1.0 <= fVar9) {
|
|
fVar9 = 1.0;
|
|
}
|
|
tmpColor._tint[3] = fVar9 * (this->_sprite)._color._tint[3] * netplayAlpha;
|
|
render_color_stack_push(&tmpColor);
|
|
local_50.y = (float)(this->_afterImageFrames)._offset;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT((this->_afterImageFrames)._map) +
|
|
(GHIDRA_INT(local_50.y) + afterImageIdx & (this->_afterImageFrames)._mapSize - 1) *
|
|
4));
|
|
local_48.x = (*GHIDRA_CAST<float *>((iVar7 + 4)) - (this->_pos).x) * 0.65 + renderPos.x;
|
|
local_48.y = (*GHIDRA_CAST<float *>((iVar7 + 8)) - (this->_pos).y) * 0.65 + renderPos.y;
|
|
Render(this,&local_48,0);
|
|
g_colorStackSize = g_colorStackSize - 1;
|
|
if (g_colorStackSize == 0) {
|
|
DAT_00c78dbc = 0;
|
|
}
|
|
afterImageIdx = afterImageIdx + 1;
|
|
} while (afterImageIdx < (this->_afterImageFrames)._size);
|
|
}
|
|
Render(this,&renderPos,1);
|
|
if (((isHolding != '\0') && (pvVar4 = this->_heldEntity, pvVar4 != (void *)0x0)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar4) + 0x171)) == '\0' && ((char)isHeldBehind == '\0')))) {
|
|
local_50.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xfc));
|
|
local_48.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe4));
|
|
local_5c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe8));
|
|
local_54 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xec));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe4)) = heldScaleX * local_48.y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe8)) = heldScaleY * local_5c;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xec)) = local_54 + local_58;
|
|
bVar1 = IsLocalPlayer(this);
|
|
if (bVar1 == 0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xfc)) = local_50.y * netplayAlpha;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0x171)) = 1;
|
|
heldEntity = this->_heldEntity;
|
|
local_68 = ((this->_pos).x - (float)heldEntity[0xcf]) * 0.65 + renderPos.x + local_64;
|
|
local_64 = ((this->_pos).y - (float)heldEntity[0xd0]) * 0.65 + renderPos.y + heldOffsetY;
|
|
(**(code **)(*heldEntity + 0x14))();
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0x171)) = 0;
|
|
pvVar4 = this->_heldEntity;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe4)) = local_48.y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0xe8)) = local_5c;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xec)) = local_54;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_heldEntity) + 0xfc)) = local_50.y;
|
|
}
|
|
FUN_00864210();
|
|
if ((this->_playerHUD != (void *)0x0) &&
|
|
((local_9c.y == 1.4013e-45 || (local_9c.y == 4.2039e-45)))) {
|
|
local_48.x = (this->_renderPosition).x + 0.0;
|
|
local_48.y = (this->_renderPosition).y - (this->_playerSpriteScale).y * 30.0;
|
|
FUN_0084a870();
|
|
}
|
|
if ((1 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2))) &&
|
|
(((local_9c.y == 1.4013e-45 || (local_9c.y == 4.2039e-45)) &&
|
|
(*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0)))) {
|
|
iVar7 = PlayerManager::GetPlayerSlotFromController
|
|
(&g_game->_playerManager,this->_controllerIndex);
|
|
if (-1 < iVar7) {
|
|
local_50.y = g_displayPixelRatio * g_screenPointScale;
|
|
fVar9 = (g_manager->_optionsConfig)._hudOffset;
|
|
local_54 = fVar9 * 12.0 + 16.0;
|
|
local_5c = fVar9 * 28.0 + 10.0;
|
|
local_48.y = ((g_screenWidth - 338.0) * 0.5 + ((this->_pos).x - 60.0) * 0.65) * local_50.y +
|
|
0.5;
|
|
flooredCoord = floor((double)local_48.y);
|
|
local_64 = (float)flooredCoord / local_50.y;
|
|
local_48.y = (((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_50.y
|
|
+ 0.5;
|
|
flooredCoord = floor((double)local_48.y);
|
|
game = g_game;
|
|
local_48.y = (float)flooredCoord;
|
|
local_64 = local_64 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1204));
|
|
local_58 = local_48.y / local_50.y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1208));
|
|
fVar9 = local_64;
|
|
if (local_64 <= g_vectorZero.x) {
|
|
fVar9 = g_vectorZero.x;
|
|
}
|
|
if (g_screenWidth + 0.0 <= fVar9) {
|
|
fVar9 = g_screenWidth + 0.0;
|
|
}
|
|
fVar11 = local_58;
|
|
if (local_58 <= g_vectorZero.y) {
|
|
fVar11 = g_vectorZero.y;
|
|
}
|
|
if (g_screenHeight + 10.0 <= fVar11) {
|
|
fVar11 = g_screenHeight + 10.0;
|
|
}
|
|
fVar9 = sqrtf((local_58 - fVar11) * (local_58 - fVar11) +
|
|
(local_64 - fVar9) * (local_64 - fVar9));
|
|
fVar11 = (fVar9 - 30.0) / 250.0;
|
|
if (fVar11 <= 0.0) {
|
|
fVar11 = 0.0;
|
|
}
|
|
if (1.0 <= fVar11) {
|
|
fVar11 = 1.0;
|
|
}
|
|
fVar8 = local_5c + g_vectorZero.x + 0.0;
|
|
fVar10 = (fVar9 - 10.0) / 140.0;
|
|
fVar9 = local_64;
|
|
if (local_64 <= fVar8) {
|
|
fVar9 = fVar8;
|
|
}
|
|
if (fVar10 <= 0.0) {
|
|
fVar10 = 0.0;
|
|
}
|
|
if (1.0 <= fVar10) {
|
|
fVar10 = 1.0;
|
|
}
|
|
fVar8 = ((g_screenWidth - local_5c) - 0.0) + 0.0;
|
|
if (fVar8 <= fVar9) {
|
|
fVar9 = fVar8;
|
|
}
|
|
fVar8 = local_54 + g_vectorZero.y + 10.0;
|
|
if (local_58 <= fVar8) {
|
|
local_58 = fVar8;
|
|
}
|
|
fVar8 = ((g_screenHeight - local_54) - 10.0) + 35.0;
|
|
if (fVar8 <= local_58) {
|
|
local_58 = fVar8;
|
|
}
|
|
if (0.0 < fVar10 + 0.0) {
|
|
iVar7 = this->_playerType;
|
|
fVar8 = ((2.0 - fVar11) - 2.0) * -1.0;
|
|
local_50.x = fVar9 - (2.0 - fVar11) * 0.5;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
if (1.0 <= fVar8) {
|
|
fVar8 = 1.0;
|
|
}
|
|
local_50.y = (-18.0 - (fVar8 + fVar8)) + local_58;
|
|
get_netplay_player_color(&game->_playerManager,GHIDRA_CAST<ColorMod *>(auStack_164),local_8c);
|
|
HUD::render_player_type_icon(iVar7,&local_50);
|
|
this = local_8c;
|
|
}
|
|
}
|
|
}
|
|
if ((this->_dead == 0) && ((local_9c.y == 1.4013e-45 || (local_9c.y == 4.2039e-45)))) {
|
|
render_charge_bars(this,&this->_renderPosition);
|
|
if (((this->_statusEffectSprite)._loaded != 0) &&
|
|
(((this->_statusEffectSprite)._animState._animData != (void *)0x0 &&
|
|
((this->_statusEffectSprite)._animState._isPlaying != 0)))) {
|
|
local_48.y = (this->_statusEffectSprite)._color._tint[3];
|
|
pfVar3 = &(this->_playerSpriteScale).y;
|
|
fVar9 = *pfVar3;
|
|
(this->_statusEffectSprite)._color._tint[3] = local_48.y * netplayAlpha;
|
|
pVVar5 = &this->_playerSpriteScale;
|
|
if (fVar9 < (this->_playerSpriteScale).x) {
|
|
pVVar5 = GHIDRA_CAST<Vector *>(pfVar3);
|
|
}
|
|
fVar11 = pVVar5->x * g_vectorOne.x;
|
|
(this->_statusEffectSprite)._scale.y = pVVar5->x * g_vectorOne.y;
|
|
(this->_statusEffectSprite)._scale.x = fVar11;
|
|
local_50.x = fVar9 * 0.0 + (this->_renderPosition).x;
|
|
local_50.y = fVar9 * -35.0 + (this->_renderPosition).y;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_statusEffectSprite)))->ANM2::Render(&local_50,&g_vectorZero,&g_vectorZero);
|
|
(this->_statusEffectSprite)._color._tint[3] = local_48.y;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c5c)))) != 0) && (0 < g_game->_hallucinationTimer)) {
|
|
(GHIDRA_CAST<HallucinationOverlay *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c58))))))->HallucinationOverlay::Render(renderOffset);
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>((g_game->_deathmatchManager)._type) + 0x5c))();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
bVar1 = (GHIDRA_CAST<NetplayManager *>((&g_manager->_netplayManager)))->NetplayManager::IsIdxLocalPlayer(this->_controllerIndex);
|
|
if (bVar1 == 0) goto LAB_0078dbfd;
|
|
}
|
|
local_50.y = g_displayPixelRatio * g_screenPointScale;
|
|
local_48.y = (((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_50.y + 0.5;
|
|
local_5c = ((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5;
|
|
flooredCoord = floor((double)local_48.y);
|
|
local_8c = GHIDRA_CAST<Entity_Player *>(((float)flooredCoord / local_50.y));
|
|
local_48.y = local_5c * local_50.y + 0.5;
|
|
flooredCoord = floor((double)local_48.y);
|
|
local_48.y = (float)flooredCoord;
|
|
tmpColor._colorize[0] = 1.4013e-45;
|
|
tmpColor._colorize[1] = 9.18341e-41;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 1.0;
|
|
tmpColor._offset[0] = -NAN;
|
|
tmpColor._offset[1] = 0.0;
|
|
tmpColor._offset[2] = 0.0;
|
|
local_8 = 0.0;
|
|
drawColor._unk = 0;
|
|
drawColor._red = 1.0;
|
|
drawColor._green = 0.6;
|
|
drawColor._blue = 0.6;
|
|
drawColor._alpha = 1.0;
|
|
(GHIDRA_CAST<Font *>((&g_manager->_font6_PFTempestaSevenCondensed)))->Font::DrawString(&DAT_00b6b080,&drawColor,
|
|
tmpColor._colorize,(float)local_8c + offset->x + 0.0,
|
|
(local_48.y / local_50.y + offset->y) - 40.0);
|
|
LAB_0078dbfd:
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0078dc20
|
|
byte Entity_Player::RenderShadowLayer(Vector *offset)
|
|
{
|
|
byte bVar1;
|
|
|
|
bVar1 = HasCollectible(this,0x1b1,0);
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::RenderShadowLayer(offset);
|
|
return bVar1;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0078dc60
|
|
void Entity_Player::RenderGlow(Vector *position)
|
|
{
|
|
byte bVar1;
|
|
LayerState *layer;
|
|
ANM2 *glowSprite;
|
|
int extraout_EDX;
|
|
int extraout_EDX_00;
|
|
float alphaCopy;
|
|
byte *layerName;
|
|
float savedAlpha;
|
|
int costumeIdx;
|
|
|
|
if (this->_visible != 0) {
|
|
bVar1 = IsFullSpriteRendering(this);
|
|
if (bVar1 == 0) {
|
|
costumeIdx = this->_playerCostumeMap[0]._index;
|
|
if (costumeIdx < 0) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
savedAlpha = (layer->_color)._tint[3];
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
alphaCopy = savedAlpha;
|
|
bVar1 = NetplayManager::IsIdxLocalPlayer
|
|
(&g_manager->_netplayManager,this->_controllerIndex);
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
FUN_00925df0();
|
|
*GHIDRA_CAST<float *>((extraout_EDX_00 + 0x54)) = alphaCopy * savedAlpha;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::RenderLayer(0,position,&g_vectorZero,&g_vectorZero);
|
|
layerName = GHIDRA_CAST<byte *>(0x0);
|
|
glowSprite = &this->_sprite;
|
|
}
|
|
else {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((costumeIdx * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin)
|
|
)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(this->_playerCostumeMap[0]._layerID));
|
|
savedAlpha = (layer->_color)._tint[3];
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
alphaCopy = savedAlpha;
|
|
bVar1 = NetplayManager::IsIdxLocalPlayer
|
|
(&g_manager->_netplayManager,this->_controllerIndex);
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this->_playerCostumeMap[0]._index * 0x130 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin))))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(this->_playerCostumeMap[0]._layerID));
|
|
FUN_00925df0();
|
|
*GHIDRA_CAST<float *>((extraout_EDX + 0x54)) = alphaCopy * savedAlpha;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Sprite *>(((Sprite *)
|
|
(this->_playerCostumeMap[0]._index * 0x130 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin)))))->Sprite::RenderLayer(this->_playerCostumeMap[0]._layerID,position,&g_vectorZero,&g_vectorZero);
|
|
layerName = GHIDRA_CAST<byte *>(this->_playerCostumeMap[0]._layerID);
|
|
glowSprite = GHIDRA_CAST<ANM2 *>((this->_playerCostumeMap[0]._index * 0x130 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin)));
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((glowSprite)))->ANM2::GetLayer(layerName);
|
|
(layer->_color)._tint[3] = savedAlpha;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0078dde0
|
|
void Entity_Player::RenderBody(Vector *position)
|
|
{
|
|
byte isCheck;
|
|
int iVar1;
|
|
void *pvVar2;
|
|
uint layerId;
|
|
float prevGushOffsetY;
|
|
float gushOffsetY;
|
|
Vector local_10;
|
|
int *costumeItem;
|
|
int costumeItemType;
|
|
bool isBodyRendered;
|
|
|
|
if ((this->_visible != 0) && (isCheck = IsFullSpriteRendering(this), isCheck == 0)) {
|
|
prevGushOffsetY = 0.0;
|
|
gushOffsetY = 0.0;
|
|
layerId = 1;
|
|
isBodyRendered = false;
|
|
do {
|
|
iVar1 = this->_playerCostumeMap[layerId]._index;
|
|
if (iVar1 < 0) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::RenderLayer(layerId,position,&g_vectorZero,&g_vectorZero);
|
|
isBodyRendered = true;
|
|
prevGushOffsetY = gushOffsetY;
|
|
}
|
|
else {
|
|
if ((this->_canFly == 0) ||
|
|
(*GHIDRA_CAST<char *>((iVar1 * 0x130 + 0x11d + GHIDRA_INT((this->_costumeSpriteDescs)._begin))) != '\0')) {
|
|
if (layerId == 1) {
|
|
local_10.x = (float)(iVar1 * 0x130);
|
|
costumeItem = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_10.x) + 0x114 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin)));
|
|
if (costumeItem != GHIDRA_CAST<int *>(0x0)) {
|
|
costumeItemType = *costumeItem;
|
|
if (costumeItemType == 0) {
|
|
if (costumeItem[1] - 0x4bU < 4) {
|
|
gushOffsetY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_10.x) + 0xa0 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin))) * -15.0;
|
|
goto LAB_0078dedb;
|
|
}
|
|
}
|
|
else if ((((costumeItemType == 1) || (costumeItemType == 3)) || (costumeItemType == 4)
|
|
) && (costumeItem[1] == 0x271)) {
|
|
gushOffsetY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_10.x) + 0xa0 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin))) * -65.0;
|
|
LAB_0078dedb:
|
|
if (prevGushOffsetY <= gushOffsetY) {
|
|
gushOffsetY = prevGushOffsetY;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((iVar1 * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin))))))->Sprite::RenderLayer(this->_playerCostumeMap[layerId]._layerID,position,&g_vectorZero,
|
|
&g_vectorZero);
|
|
iVar1 = this->_playerCostumeMap[layerId]._index * 0x130;
|
|
pvVar2 = (this->_costumeSpriteDescs)._begin;
|
|
prevGushOffsetY = gushOffsetY;
|
|
if (((*GHIDRA_CAST<int *>((iVar1 + 0x34 + GHIDRA_INT(pvVar2))) != 0) &&
|
|
(pvVar2 = AnimationState::GetLayerFrame
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_INT(pvVar2) + iVar1 + 0x30)),
|
|
this->_playerCostumeMap[layerId]._layerID), pvVar2 != (void *)0x0
|
|
)) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar2) + 0x2c)) != '\0')) {
|
|
isBodyRendered = true;
|
|
goto LAB_0078df80;
|
|
}
|
|
}
|
|
}
|
|
LAB_0078df80:
|
|
layerId = layerId + 1;
|
|
} while (layerId < 4);
|
|
if ((isBodyRendered) && (isCheck = IsHeadless(this), isCheck != 0)) {
|
|
local_10.x = position->x + 0.0;
|
|
local_10.y = gushOffsetY * 0.65 + position->y;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_bloodGushSprite))))->Sprite::RenderLayer(0,&local_10,&g_vectorZero,&g_vectorZero)
|
|
;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0078dff0
|
|
void Entity_Player::RenderHead(Vector *position)
|
|
{
|
|
byte bVar1;
|
|
uint layerId;
|
|
Sprite *costumeSprite;
|
|
AnimationState *secondAnimState;
|
|
uint layer;
|
|
int *costumeLayerIdPtr;
|
|
|
|
if (this->_visible != 0) {
|
|
bVar1 = IsFullSpriteRendering(this);
|
|
if (bVar1 == 0) {
|
|
layer = 4;
|
|
costumeLayerIdPtr = &this->_playerCostumeMap[4]._layerID;
|
|
do {
|
|
if ((GHIDRA_CAST<PlayerCostumeMap *>((costumeLayerIdPtr + -1)))->_index < 0) {
|
|
costumeSprite = GHIDRA_CAST<Sprite *>(&this->_sprite);
|
|
layerId = layer;
|
|
}
|
|
else {
|
|
costumeSprite =
|
|
(Sprite *)
|
|
((GHIDRA_CAST<PlayerCostumeMap *>((costumeLayerIdPtr + -1)))->_index * 0x130 +
|
|
GHIDRA_INT((this->_costumeSpriteDescs)._begin));
|
|
layerId = *costumeLayerIdPtr;
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((costumeSprite)))->Sprite::RenderLayer(layerId,position,&g_vectorZero,&g_vectorZero);
|
|
layer = layer + 1;
|
|
costumeLayerIdPtr = costumeLayerIdPtr + 4;
|
|
} while (layer < 0xb);
|
|
bVar1 = HasCollectible(this,0x1ba,0);
|
|
if ((bVar1 != 0) && ((this->_darkPrincesCrownSprite)._loaded != 0)) {
|
|
if ((this->_darkPrincesCrownSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(this->_darkPrincesCrownSprite)._animState,position,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = &(this->_darkPrincesCrownSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(this->_darkPrincesCrownSprite)._overlayAnimState,position,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = &(this->_darkPrincesCrownSprite)._animState;
|
|
}
|
|
AnimationState::Render(secondAnimState,position,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
bVar1 = HasCollectible(this,0x19f,0);
|
|
if ((bVar1 != 0) && ((this->_crownOfLightSprite)._loaded != 0)) {
|
|
if ((this->_crownOfLightSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(this->_crownOfLightSprite)._animState,position,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = &(this->_crownOfLightSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(this->_crownOfLightSprite)._overlayAnimState,position,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = &(this->_crownOfLightSprite)._animState;
|
|
}
|
|
AnimationState::Render(secondAnimState,position,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0078e190
|
|
void Entity_Player::RenderTop(Vector *param_2)
|
|
{
|
|
byte isFullSprite;
|
|
int costumeIndex;
|
|
|
|
if (this->_visible != 0) {
|
|
isFullSprite = IsFullSpriteRendering(this);
|
|
if (isFullSprite == 0) {
|
|
costumeIndex = this->_playerCostumeMap[0xb]._index;
|
|
if (-1 < costumeIndex) {
|
|
(GHIDRA_CAST<Sprite *>(((Sprite *)
|
|
(costumeIndex * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin)))))->Sprite::RenderLayer(this->_playerCostumeMap[0xb]._layerID,param_2,&g_vectorZero,
|
|
&g_vectorZero);
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::RenderLayer(0xb,param_2,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0078fec0
|
|
void Entity_Player::RemoveCollectibleByHistoryIndex(int index, byte RemovedBool)
|
|
{
|
|
int collectibleId;
|
|
byte isInSet;
|
|
void *historyItems;
|
|
|
|
if (((-1 < index) &&
|
|
(historyItems = (this->_history)._historyItems._begin,
|
|
index < (GHIDRA_INT((this->_history)._historyItems._end) - GHIDRA_INT(historyItems)) / 0x1c)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(historyItems) + index * 0x1c + 4)) == '\0')) {
|
|
collectibleId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyItems) + index * 0x1c + 8));
|
|
if (collectibleId < 0) {
|
|
isInSet = collectible_set_has(&this->_proceduralItems,collectibleId);
|
|
if (isInSet != 0) goto LAB_0078ff31;
|
|
}
|
|
else if (0 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_collectibleCounts)._begin) + collectibleId * 4))) {
|
|
LAB_0078ff31:
|
|
isInSet = (this->_history)._isLocked;
|
|
(this->_history)._isLocked = 1;
|
|
RemoveCollectible(this,*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(historyItems) + index * 0x1c + 8)),1,0,1);
|
|
(this->_history)._isLocked = isInSet;
|
|
(GHIDRA_CAST<History *>((&this->_history)))->History::RemoveHistoryItemByIndex(index);
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0078ff90
|
|
void Entity_Player::TriggerCollectibleRemoved(int collectibleID)
|
|
{
|
|
std_vector *itemRng;
|
|
char isUserTracked;
|
|
byte bVar1;
|
|
int iVar2;
|
|
uint uVar3;
|
|
Vector *spawnPos;
|
|
ItemConfig_Item *itemConfig;
|
|
RNG *itemRng;
|
|
uint uVar4;
|
|
uint uVar5;
|
|
short newCatLives;
|
|
QueueItemData *srcSlot;
|
|
int *pocketSlot;
|
|
ulonglong netUserId;
|
|
int *local_1c;
|
|
int excessPockets;
|
|
uint slotIndex;
|
|
Vector freePosOut;
|
|
Game *game;
|
|
void *nullItems;
|
|
|
|
game = g_game;
|
|
itemRng = &g_game->_onlinePlayerStats;
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (this != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
netUserId = player_get_net_user_id(this);
|
|
local_1c = GHIDRA_CAST<int *>((netUserId >> 0x20));
|
|
if ((netUserId != 0xffffffffffffffff) &&
|
|
((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1c030))) == '\0')))) {
|
|
isUserTracked = FUN_00425a70(netUserId);
|
|
if (isUserTracked == '\0') {
|
|
online_stats_add_user(itemRng,GHIDRA_UINT(netUserId),GHIDRA_UINT(local_1c));
|
|
}
|
|
iVar2 = FUN_00426560(GHIDRA_UINT(netUserId),local_1c);
|
|
if (iVar2 != 0) {
|
|
*GHIDRA_CAST<float *>((iVar2 + 0x14)) = *GHIDRA_CAST<float *>((iVar2 + 0x14)) - 1.0;
|
|
}
|
|
}
|
|
}
|
|
if (collectibleID < 0x12f) {
|
|
if ((collectibleID == 0x12e) || (collectibleID == 0xc)) {
|
|
IncrementPlayerFormCounter(this,0xd,-1);
|
|
}
|
|
else if (collectibleID == 0x51) {
|
|
iVar2 = GetCollectibleNum(this,0x51,0);
|
|
newCatLives = this->_deadCatLives;
|
|
if (iVar2 * 9 < GHIDRA_INT(this->_deadCatLives)) {
|
|
newCatLives = (short)(iVar2 * 9);
|
|
}
|
|
this->_deadCatLives = newCatLives;
|
|
}
|
|
}
|
|
else if (collectibleID == 0x2b6) {
|
|
AddBrokenHearts(this,-3);
|
|
}
|
|
iVar2 = GetCollectibleNum(this,collectibleID,0);
|
|
if (0 < iVar2) {
|
|
return;
|
|
}
|
|
if (collectibleID < 0xfc) {
|
|
if (collectibleID == 0xfb) {
|
|
switchD_0079018f_caseD_fc:
|
|
uVar3 = GetMaxPocketItems(this);
|
|
uVar4 = GHIDRA_UINT((this->_pocketSlots[0] != 0));
|
|
uVar5 = uVar4 + 1;
|
|
if (this->_pocketSlots[2] == 0) {
|
|
uVar5 = uVar4;
|
|
}
|
|
uVar4 = uVar5 + 1;
|
|
if (this->_pocketSlots[4] == 0) {
|
|
uVar4 = uVar5;
|
|
}
|
|
uVar5 = uVar4 + 1;
|
|
if (this->_pocketSlots[6] == 0) {
|
|
uVar5 = uVar4;
|
|
}
|
|
iVar2 = uVar5 - uVar3;
|
|
excessPockets = iVar2;
|
|
if (iVar2 < 1) goto switchD_0079018f_caseD_fd;
|
|
slotIndex = 3;
|
|
local_1c = this->_pocketSlots + 6;
|
|
do {
|
|
pocketSlot = local_1c;
|
|
if (iVar2 < 1) break;
|
|
if ((*local_1c != 0) && (local_1c[1] != 2)) {
|
|
uVar3 = Random();
|
|
uVar5 = *pocketSlot;
|
|
spawnPos = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,&freePosOut,&this->_pos,40.0,0,0,0);
|
|
pocketSlot = local_1c;
|
|
uVar4 = 0x46;
|
|
if (local_1c[1] == 1) {
|
|
uVar4 = 300;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,uVar4,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),uVar5,uVar3,0);
|
|
if (slotIndex < 3) {
|
|
srcSlot = GHIDRA_CAST<QueueItemData *>((pocketSlot + 2));
|
|
for (uVar5 = (3 - slotIndex) * 2 & 0x3ffffffe; uVar5 != 0; uVar5 = uVar5 - 1) {
|
|
*pocketSlot = GHIDRA_INT(srcSlot->_item);
|
|
srcSlot = GHIDRA_CAST<QueueItemData *>(&srcSlot->_charge);
|
|
pocketSlot = pocketSlot + 1;
|
|
}
|
|
pocketSlot = local_1c;
|
|
}
|
|
iVar2 = excessPockets + -1;
|
|
this->_pocketSlots[6] = 0;
|
|
this->_pocketSlots[7] = 1;
|
|
excessPockets = iVar2;
|
|
}
|
|
slotIndex = slotIndex - 1;
|
|
local_1c = pocketSlot + -2;
|
|
} while (-1 < GHIDRA_INT(slotIndex));
|
|
}
|
|
else {
|
|
if (collectibleID == 0x23) {
|
|
switchD_0079018f_caseD_106:
|
|
IncrementPlayerFormCounter(this,0xf,-1);
|
|
goto switchD_0079018f_caseD_fd;
|
|
}
|
|
if (collectibleID != 0x8b) goto switchD_0079018f_caseD_fd;
|
|
switchD_0079025a_caseD_1ca:
|
|
if (this->_trinketsID[1] == 0) goto switchD_0079018f_caseD_fd;
|
|
uVar3 = Random();
|
|
uVar5 = this->_trinketsID[1];
|
|
spawnPos = Room::FindFreePickupSpawnPosition(g_game->_room,&freePosOut,&this->_pos,40.0,0,0,0)
|
|
;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,0x15e,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),uVar5,uVar3,0);
|
|
this->_trinketsID[1] = 0;
|
|
}
|
|
}
|
|
else {
|
|
if (collectibleID < 0x1b8) {
|
|
if (collectibleID == 0x1b7) {
|
|
bVar1 = HasTrinket(this,0x79,0);
|
|
if (bVar1 != 0) {
|
|
remove_wooden_cross_mantles(this);
|
|
}
|
|
goto switchD_0079018f_caseD_fd;
|
|
}
|
|
switch(collectibleID) {
|
|
case 0xfc:
|
|
case 0x1a0:
|
|
goto switchD_0079018f_caseD_fc;
|
|
case 0x106:
|
|
goto switchD_0079018f_caseD_106;
|
|
case 0x122:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>(&local_1c),collectibleID,1,-1,0);
|
|
break;
|
|
case 0x197:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x197,1);
|
|
itemRng = GetCollectibleRNG(this,0x197);
|
|
uVar5 = (GHIDRA_CAST<RNG *>((itemRng)))->RNG::RandomInt(4);
|
|
this->_purityState = uVar5;
|
|
nullItems = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) & 0xfffffffcU)) <
|
|
0x45) {
|
|
RemoveCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
}
|
|
else {
|
|
RemoveCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(nullItems) + 0x44)));
|
|
}
|
|
}
|
|
goto switchD_0079018f_caseD_fd;
|
|
}
|
|
switch(collectibleID) {
|
|
case 0x1c6:
|
|
goto switchD_0079018f_caseD_fc;
|
|
case 0x1ca:
|
|
goto switchD_0079025a_caseD_1ca;
|
|
case 0x1f5:
|
|
update_greeds_gullet(this);
|
|
break;
|
|
case 0x232:
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef4)))) == 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0)) {
|
|
FUN_007d3e00();
|
|
}
|
|
break;
|
|
case 0x244:
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::UpdateRedKey();
|
|
}
|
|
}
|
|
switchD_0079018f_caseD_fd:
|
|
itemConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectibleID);
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(collectibleID);
|
|
if (((bVar1 != 0) && (itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) &&
|
|
(itemConfig->clearEffectsOnRemove != 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(collectibleID,1);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007907a0
|
|
void Entity_Player::ClearTemporaryEffects()
|
|
{
|
|
void *pvVar1;
|
|
byte isMirrorDimension;
|
|
int iVar2;
|
|
int *piVar3;
|
|
int *itemConfig;
|
|
int *collectibleNode;
|
|
int trinketEffect [3];
|
|
undefined4 local_c;
|
|
uint collectibleId;
|
|
|
|
if (GHIDRA_INT((this->_temporaryeffects)._effects._end) - GHIDRA_INT((this->_temporaryeffects)._effects._begin)
|
|
>> 4 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::ClearEffects(0);
|
|
}
|
|
iVar2 = this->_strengthMaxHearts;
|
|
if (0 < iVar2) {
|
|
do {
|
|
if (2 < this->_soulHearts + this->_boneHearts * 2 + this->_maxHearts) {
|
|
AddMaxHearts(this,-2,0);
|
|
}
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
}
|
|
this->_strengthMaxHearts = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x170c)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1710)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1714)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1718)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x171c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1720)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1724)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1728)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x172c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1730)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1734)))) = 0;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar3 = (this->_temporaryeffects)._effects._begin;
|
|
piVar3 != (this->_temporaryeffects)._effects._end; piVar3 = piVar3 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar3) == 0) && ((GHIDRA_CAST<int *>(*piVar3))[1] == 0x70)) {
|
|
if (piVar3[1] == 2) {
|
|
iVar2 = g_game->_currentDimensionIdx;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_roomTransition) != 0) {
|
|
iVar2 = (g_game->_roomTransition)._targetDimension;
|
|
}
|
|
isMirrorDimension = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasMirrorDimension();
|
|
if ((isMirrorDimension == 0) || (iVar2 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x70,-1);
|
|
pvVar1 = this->_backupPlayer;
|
|
if ((pvVar1 != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x1519)) == '\0')) {
|
|
piVar3 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar1) + 0x150c));
|
|
goto joined_r0x00790924;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
LAB_00790947:
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar3 = (this->_temporaryeffects)._effects._begin;
|
|
piVar3 != (this->_temporaryeffects)._effects._end; piVar3 = piVar3 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar3) == 2) && ((GHIDRA_CAST<int *>(*piVar3))[1] == 0xa2)) {
|
|
if ((piVar3[1] == 1) &&
|
|
((pvVar1 = (g_manager->_itemConfig)._trinkets._begin,
|
|
0x288 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU
|
|
)) && (iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x288)), iVar2 != 0)))) {
|
|
trinketEffect[2] = *GHIDRA_CAST<undefined4 *>((iVar2 + 0x78));
|
|
trinketEffect[1] = 0;
|
|
local_c = 0;
|
|
trinketEffect[0] = iVar2;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(trinketEffect,1);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ((this->_roomTemporaryCollectibles)._size != 0) {
|
|
piVar3 = (this->_roomTemporaryCollectibles)._head;
|
|
collectibleNode = GHIDRA_CAST<int *>(*piVar3);
|
|
if (collectibleNode != piVar3) {
|
|
do {
|
|
piVar3 = collectibleNode;
|
|
collectibleId = collectibleNode[4];
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(collectibleId)) goto LAB_00790a4a;
|
|
LAB_00790a64:
|
|
itemConfig = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(collectibleId) < 0) {
|
|
if ((GHIDRA_INT(collectibleId) < 0) &&
|
|
(pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~collectibleId) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar1) >> 2)) {
|
|
itemConfig = GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar1) + ~collectibleId * 4)));
|
|
}
|
|
else {
|
|
itemConfig = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_00790a4a:
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) >> 2 <=
|
|
GHIDRA_INT(collectibleId)) goto LAB_00790a64;
|
|
itemConfig = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar1) + collectibleId * 4));
|
|
}
|
|
if ((*itemConfig != 3) && (iVar2 = 0, 0 < collectibleNode[5])) {
|
|
do {
|
|
RemoveCollectible(this,itemConfig[1],1,0,1);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < piVar3[5]);
|
|
}
|
|
piVar3[5] = 0;
|
|
std::
|
|
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
*)&collectibleNode);
|
|
piVar3 = (this->_roomTemporaryCollectibles)._head;
|
|
} while (collectibleNode != piVar3);
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&this->_roomTemporaryCollectibles,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)
|
|
&this->_roomTemporaryCollectibles,(_Tree_node<unsigned_int,void*> *)piVar3[1]);
|
|
piVar3[1] = GHIDRA_INT(piVar3);
|
|
*piVar3 = GHIDRA_INT(piVar3);
|
|
piVar3[2] = GHIDRA_INT(piVar3);
|
|
(this->_roomTemporaryCollectibles)._size = 0;
|
|
}
|
|
SetPocketActiveItem(this,0,3,0);
|
|
return;
|
|
joined_r0x00790924:
|
|
if (piVar3 == *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar1) + 0x1510))) goto LAB_00790947;
|
|
if ((*GHIDRA_CAST<int *>(*piVar3) == 0) && ((GHIDRA_CAST<int *>(*piVar3))[1] == 0x70)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(pvVar1) + 0x1508)))))->TemporaryEffects::RemoveNullEffect(0x70,-1);
|
|
goto LAB_00790947;
|
|
}
|
|
piVar3 = piVar3 + 4;
|
|
goto joined_r0x00790924;
|
|
}
|
|
|
|
// 007910f0
|
|
int Entity_Player::GetTotalActiveCharge(int slot)
|
|
{
|
|
ItemConfig_Item *item;
|
|
int chargeMode;
|
|
int iVar1;
|
|
int bethanyCharge;
|
|
|
|
iVar1 = this->_activeDesc[slot]._batteryCharge + this->_activeDesc[slot]._charge;
|
|
if (this->_playerType == 0x12) {
|
|
bethanyCharge = this->_effectiveSoulCharge;
|
|
}
|
|
else {
|
|
bethanyCharge = 0;
|
|
if (this->_playerType == 0x24) {
|
|
bethanyCharge = this->_effectiveBloodCharge;
|
|
}
|
|
}
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(this->_activeDesc[slot]._item);
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
if ((item->type == 3) && ((item->id == 0x28f || (item->id == 0x146)))) {
|
|
chargeMode = 2;
|
|
}
|
|
else if ((item->chargeType == 1) || ((item->chargeType == 2 && (0xc < item->maxCharges)))) {
|
|
chargeMode = 1;
|
|
}
|
|
else {
|
|
chargeMode = 0;
|
|
}
|
|
if (chargeMode == 1) {
|
|
if ((0 < bethanyCharge) && (iVar1 < item->maxCharges)) {
|
|
iVar1 = item->maxCharges;
|
|
}
|
|
return iVar1;
|
|
}
|
|
if (chargeMode == 2) {
|
|
return iVar1;
|
|
}
|
|
}
|
|
return bethanyCharge + iVar1;
|
|
}
|
|
|
|
// 007911c0
|
|
int Entity_Player::GetActiveItemSlot(int id)
|
|
{
|
|
uint slot;
|
|
ActiveItemDesc *activeDesc;
|
|
|
|
slot = 0;
|
|
activeDesc = this->_activeDesc;
|
|
do {
|
|
if (activeDesc->_item == id) {
|
|
return slot;
|
|
}
|
|
slot = slot + 1;
|
|
activeDesc = activeDesc + 1;
|
|
} while (slot < 4);
|
|
return -1;
|
|
}
|
|
|
|
// 007911f0
|
|
int Entity_Player::GetCollectibleMaxCharge(int collectibleId, int varData, int unused)
|
|
{
|
|
byte isConditionMet;
|
|
ItemConfig_Item *pIVar1;
|
|
|
|
if (((((collectibleId == 0x11e) || (collectibleId == 0x107)) || (collectibleId == 0x15c)) ||
|
|
(collectibleId == 0x1fe)) && (0 < varData)) {
|
|
return varData;
|
|
}
|
|
if (collectibleId == 0x1e9) {
|
|
if ((varData & 0xffffU) != 0) {
|
|
return varData & 0xffffU;
|
|
}
|
|
}
|
|
else if (collectibleId == 0x2c9) {
|
|
if (this->_playerType == 0x1a) {
|
|
return 0x1e;
|
|
}
|
|
}
|
|
else if (collectibleId == 0x2d2) {
|
|
if (((this->_playerType == 0x25) || (this->_playerType == 0x27)) &&
|
|
(isConditionMet = HasCollectible(this,0x26b,0), isConditionMet != 0)) {
|
|
return 300;
|
|
}
|
|
}
|
|
else if (collectibleId == 0x2c7) {
|
|
if ((this->_playerType == 0x1d) || (this->_playerType == 0x26)) {
|
|
return 4;
|
|
}
|
|
}
|
|
else if (collectibleId == 0x1a6) {
|
|
if (varData < 3) {
|
|
return 0;
|
|
}
|
|
}
|
|
else if (((collectibleId == 0x23) &&
|
|
(isConditionMet = HasPlayerForm(this,0xf), isConditionMet != 0)) && (varData == 1)) {
|
|
return 10;
|
|
}
|
|
pIVar1 = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectibleId);
|
|
if (pIVar1 == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
return 0;
|
|
}
|
|
return pIVar1->maxCharges;
|
|
}
|
|
|
|
// 00791320
|
|
int Entity_Player::GetActiveMaxCharge(int slot)
|
|
{
|
|
int maxCharge;
|
|
|
|
if ((slot == 3) ||
|
|
(((slot == 2 && (this->_activeDesc[2]._item == 0x244)) && (g_game->_challenge == 0x2c)))) {
|
|
return 0;
|
|
}
|
|
maxCharge = GetCollectibleMaxCharge
|
|
(this,this->_activeDesc[slot]._item,this->_activeDesc[slot]._varData,
|
|
GHIDRA_INT(this));
|
|
return maxCharge;
|
|
}
|
|
|
|
// 00791420
|
|
void Entity_Player::SetActiveCharge(int charge, int slot)
|
|
{
|
|
byte isBulbTrinketHeld;
|
|
int previousTotalCharge;
|
|
int iVar1;
|
|
uint eachSlot;
|
|
int iVar2;
|
|
Game *game;
|
|
|
|
if (slot < 0) {
|
|
eachSlot = 0;
|
|
do {
|
|
SetActiveCharge(this,charge,eachSlot);
|
|
eachSlot = eachSlot + 1;
|
|
} while (eachSlot < 4);
|
|
return;
|
|
}
|
|
if (3 < slot) {
|
|
return;
|
|
}
|
|
previousTotalCharge = GetTotalActiveCharge(this,slot);
|
|
if (this->_activeDesc[slot]._item != 0) {
|
|
iVar1 = GetActiveMaxCharge(this,slot);
|
|
iVar2 = charge;
|
|
if (iVar1 < charge) {
|
|
iVar2 = iVar1;
|
|
}
|
|
this->_activeDesc[slot]._charge = iVar2;
|
|
iVar2 = charge - iVar1;
|
|
if (iVar2 < 0) {
|
|
iVar2 = 0;
|
|
}
|
|
if (iVar2 < iVar1) {
|
|
iVar1 = iVar2;
|
|
}
|
|
this->_activeDesc[slot]._batteryCharge = iVar1;
|
|
}
|
|
iVar1 = GetTotalActiveCharge(this,slot);
|
|
if ((previousTotalCharge != iVar1) &&
|
|
((isBulbTrinketHeld = HasTrinket(this,0x65,0), isBulbTrinketHeld != 0 ||
|
|
(isBulbTrinketHeld = HasTrinket(this,100,0), isBulbTrinketHeld != 0)))) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x41f;
|
|
EvaluateItems(this);
|
|
}
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00791510
|
|
void Entity_Player::SetActiveVarData(int vardata, int slot)
|
|
{
|
|
this->_activeDesc[slot]._varData = vardata;
|
|
return;
|
|
}
|
|
|
|
// 00791a40
|
|
void Entity_Player::ControlActiveItem(int slot)
|
|
{
|
|
Manager *pMVar1;
|
|
byte bVar2;
|
|
char cVar3;
|
|
uint uVar4;
|
|
void *pvVar5;
|
|
float *drainAmount;
|
|
EntityPtr breathEffect;
|
|
Entity_Familiar *wisp;
|
|
ItemConfig_Item *pIVar6;
|
|
ItemConfig_Item *itemConfig;
|
|
uint seed;
|
|
Entity *tmpEntity;
|
|
int iVar7;
|
|
undefined2 *extraout_EAX;
|
|
undefined2 *extraout_EAX_00;
|
|
int *piVar8;
|
|
NetplayManager *extraout_ECX;
|
|
NetplayManager *pNVar9;
|
|
int extraout_ECX_00;
|
|
int extraout_ECX_01;
|
|
int unused;
|
|
int unused_00;
|
|
int iVar10;
|
|
int unused_01;
|
|
int *piVar11;
|
|
Entity_Player *this_00;
|
|
uint nearbyCount;
|
|
int extraout_EDX;
|
|
int iVar12;
|
|
float in_XMM0_Da;
|
|
float distSq;
|
|
float fVar13;
|
|
undefined4 uVar14;
|
|
Vector *position;
|
|
TypeDescriptor *pTVar15;
|
|
TypeDescriptor *pTVar16;
|
|
byte isDontUpdate;
|
|
undefined4 uVar17;
|
|
EntityRef local_c8;
|
|
int totalChargeBefore;
|
|
int *candidateItems;
|
|
int *candidateItemsEnd;
|
|
int *candidateItemsCapacity;
|
|
Vector local_90;
|
|
EntityList_EL local_88;
|
|
Vector local_78;
|
|
undefined4 local_70;
|
|
Vector local_6c;
|
|
int slotOffset;
|
|
int local_60;
|
|
int savedSlot;
|
|
undefined2 local_56;
|
|
Manager *local_54;
|
|
Manager *local_50;
|
|
int local_4c;
|
|
ItemConfig_Item *local_48;
|
|
byte local_44;
|
|
char local_43;
|
|
char isItemPressed;
|
|
char isItemTriggered;
|
|
undefined4 local_40;
|
|
Capsule CStack_3c;
|
|
undefined4 uStack_38;
|
|
undefined4 uStack_34;
|
|
undefined4 local_30;
|
|
undefined4 uStack_2c;
|
|
undefined4 uStack_28;
|
|
undefined4 uStack_24;
|
|
undefined4 local_20;
|
|
undefined4 local_1c;
|
|
undefined4 local_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
EntityPtr *breathEffectSlot;
|
|
Game *game;
|
|
int *itemEntry;
|
|
code *takeDamageFn;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff6b3;
|
|
local_10 = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
savedSlot = slot;
|
|
if (this->_variant == 1) {
|
|
return;
|
|
}
|
|
if (this->_isCoopGhost != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
local_14 = uVar4;
|
|
bVar2 = IsHologram(this);
|
|
if (bVar2 != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar10 = this->_playerType;
|
|
if (iVar10 == 0x28) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar12 = 9;
|
|
if ((iVar10 == 0x13) || (iVar10 == 0x14)) {
|
|
local_44 = 1;
|
|
cVar3 = FUN_006f0040(uVar4);
|
|
isItemTriggered = '\x01';
|
|
if (cVar3 == '\0') goto LAB_00791acf;
|
|
}
|
|
else {
|
|
local_44 = 0;
|
|
LAB_00791acf:
|
|
isItemTriggered = '\0';
|
|
}
|
|
pNVar9 = &g_manager->_netplayManager;
|
|
local_43 = (g_manager->_optionsConfig)._jacobEsauControls == 0;
|
|
if (*pNVar9 != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
pvVar5 = (GHIDRA_CAST<InputManager *>((pNVar9)))->InputManager::GetDeviceByPlayerEntity(this);
|
|
pNVar9 = extraout_ECX;
|
|
if (pvVar5 != (void *)0x0) {
|
|
local_43 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x3d0)) == 0;
|
|
}
|
|
}
|
|
if (((isItemTriggered != '\0') && (local_43 != '\0')) || (slot != 0)) {
|
|
iVar12 = 10;
|
|
}
|
|
bVar2 = input_is_action_pressed(iVar12,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),GHIDRA_INT(pNVar9));
|
|
if (bVar2 == 0) {
|
|
LAB_00791b40:
|
|
isItemPressed = '\0';
|
|
}
|
|
else {
|
|
cVar3 = FUN_00708350();
|
|
isItemPressed = '\x01';
|
|
if (cVar3 != '\0') goto LAB_00791b40;
|
|
}
|
|
bVar2 = input_is_action_triggered(g_manager,iVar12,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
iVar10 = extraout_ECX_00;
|
|
if (bVar2 == 0) {
|
|
LAB_00791b6a:
|
|
isItemTriggered = '\0';
|
|
}
|
|
else {
|
|
cVar3 = FUN_00708350();
|
|
isItemTriggered = '\x01';
|
|
iVar10 = extraout_ECX_01;
|
|
if (cVar3 != '\0') goto LAB_00791b6a;
|
|
}
|
|
if (local_44 != 0) {
|
|
if (local_43 == '\0') {
|
|
cVar3 = FUN_00753bf0();
|
|
if (((cVar3 != '\0') &&
|
|
(bVar2 = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused),
|
|
bVar2 != 0)) ||
|
|
((cVar3 = FUN_006f0040(), cVar3 != '\0' &&
|
|
(bVar2 = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_00),
|
|
bVar2 == 0)))) goto LAB_00791bd4;
|
|
}
|
|
else {
|
|
bVar2 = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),iVar10);
|
|
if ((bVar2 != 0) && (this->_twinPlayer != (EntityPtr)0x0)) {
|
|
LAB_00791bd4:
|
|
isItemTriggered = '\0';
|
|
isItemPressed = '\0';
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x800);
|
|
if (((bVar2 != 0) || (this->_hasCurseMistEffect != 0)) || (this->_isCoopGhost != 0)) {
|
|
isItemTriggered = '\0';
|
|
isItemPressed = '\0';
|
|
}
|
|
if ((this->_itemStateCooldown != 0) && (this->_itemState != 0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_56)) + 0x1))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26cc)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26cc))) = 0;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_56)) + 0x1))) != '\0') {
|
|
isItemTriggered = '\x01';
|
|
isItemPressed = '\x01';
|
|
}
|
|
totalChargeBefore = GetTotalActiveCharge(this,slot);
|
|
if ((this->_itemState == 0x2c5) || (this->_suplexState != 0)) {
|
|
if (this->_suplexState != 2) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (isItemTriggered == '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (this->_suplexAimCountdown < 2) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_suplexAimCountdown = 1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_70 = local_70 & 0xffffff;
|
|
if (((((((slot == 0) && (isItemPressed == '\0')) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar2 == 0)) &&
|
|
((bVar2 = HasTrinket(this,0x95,0), bVar2 != 0 &&
|
|
(iVar10 = this->_activeDesc[0]._item, iVar10 != 0)))) &&
|
|
((cVar3 = (GHIDRA_CAST<KAGE_Filesys_FileManager *>((GHIDRA_CAST<KAGE_Filesys_FileManager *>(this))))->KAGE_Filesys_FileManager::OpenRead(iVar10,0),
|
|
cVar3 != '\0' && ((this->_entityCollisionClass != 0 && (this->_itemState == 0)))))) &&
|
|
(this->_damageCooldown < 2)) &&
|
|
(bVar2 = HasInvincibility(this,0,GHIDRA_CAST<EntityRef *>(0x0)), bVar2 == 0)) {
|
|
in_XMM0_Da = this->_friction * (this->_velocity).x;
|
|
local_90.y = this->_speedMultiplier * this->_friction * (this->_velocity).y + (this->_pos).y;
|
|
local_90.x = this->_speedMultiplier * in_XMM0_Da + (this->_pos).x;
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_88,&local_90,this->_size + 150.0,
|
|
GHIDRA_UINT((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager))) * 4 + 10);
|
|
uVar4 = 0;
|
|
nearbyCount = local_88._size;
|
|
if (GHIDRA_CAST<undefined1 *>(local_88._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
do {
|
|
tmpEntity = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(local_88._data) + uVar4 * 4));
|
|
if ((tmpEntity->_dead == 0) && (tmpEntity->_entityCollisionClass != 0)) {
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (tmpEntity->_type != 1)) {
|
|
iVar10 = tmpEntity->_type;
|
|
if ((((0x3dd < iVar10 - 10U) && (iVar10 != 9)) && (iVar10 != 2)) ||
|
|
((iVar10 == 0x21 && (tmpEntity->_variant == 4)))) goto LAB_00791f0d;
|
|
}
|
|
else {
|
|
iVar10 = 1;
|
|
}
|
|
if ((tmpEntity->_flags & 0x20000000) == 0) {
|
|
if (iVar10 == 9) {
|
|
if ((tmpEntity[1]._type & 0x80000000U) == 0) goto LAB_00791e44;
|
|
}
|
|
else {
|
|
in_XMM0_Da = 0.0;
|
|
if (0.0 < tmpEntity->_collisionDamage) {
|
|
LAB_00791e44:
|
|
local_90.x = this->_speedMultiplier * this->_friction * (this->_velocity).x;
|
|
local_90.y = this->_speedMultiplier * this->_friction * (this->_velocity).y;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetCollisionCapsule(&local_c8,&local_90);
|
|
local_78.y = tmpEntity->_speedMultiplier *
|
|
(tmpEntity->_velocity).y * tmpEntity->_friction;
|
|
in_XMM0_Da = tmpEntity->_speedMultiplier *
|
|
(tmpEntity->_velocity).x * tmpEntity->_friction;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x0))) = SUB41(in_XMM0_Da,0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x1))) = (byte)(GHIDRA_UINT(in_XMM0_Da) >> 8);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x2))) = (undefined2)(GHIDRA_UINT(in_XMM0_Da) >> 0x10);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::GetCollisionCapsule(&CStack_3c,&local_78);
|
|
local_6c.y = 0.0;
|
|
local_6c.x = 0.0;
|
|
bVar2 = Capsule::Collide(GHIDRA_CAST<Capsule *>(&local_c8),&CStack_3c,&local_6c);
|
|
if (bVar2 != 0) {
|
|
local_70 = CONCAT13(1,(undefined3)local_70);
|
|
isItemTriggered = '\x01';
|
|
isItemPressed = '\x01';
|
|
break;
|
|
}
|
|
nearbyCount = local_88._size;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_00791f0d:
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < nearbyCount);
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((&local_88)))->EntityList_Query::~EntityList_Query();
|
|
slot = savedSlot;
|
|
}
|
|
local_50 = GHIDRA_CAST<Manager *>((GHIDRA_UINT(local_50) & 0xffffff00));
|
|
slotOffset = GHIDRA_INT((slot + 0xac)) * 0x20;
|
|
local_43 = '\0';
|
|
local_90.y = *GHIDRA_CAST<float *>((GHIDRA_INT(&(this->_sprite)._filename) + slotOffset + -0x48));
|
|
if (local_90.y == 4.56823e-43) {
|
|
local_4c = slot * 0x20;
|
|
bVar2 = AreControlsEnabled(this);
|
|
if (bVar2 == 0) {
|
|
iVar10 = this->_activeDesc[slot]._timeRechargeCooldown;
|
|
LAB_007922ae:
|
|
if (((9 < iVar10) && (*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0)) &&
|
|
((bVar2 = AreControlsEnabled(this), bVar2 == 0 || (isItemPressed == '\0')))) {
|
|
local_43 = '\x01';
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x146);
|
|
pMVar1 = g_manager;
|
|
if (bVar2 == 0) {
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(0x10b);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_48));
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar1->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_48),1.0,2,0,1.0,0.0);
|
|
DischargeActiveItem(this,slot,0);
|
|
iVar10 = local_4c;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x146,-1);
|
|
iVar10 = slot * 0x20;
|
|
if (this->_activeDesc[slot]._charge == 0) {
|
|
DischargeActiveItem(this,slot,0);
|
|
this->_activeDesc[slot]._timeRechargeCooldown = 9;
|
|
isItemTriggered = '\0';
|
|
goto LAB_007926d7;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_activeDesc[0]._timeRechargeCooldown) + iVar10)) = 9;
|
|
}
|
|
}
|
|
else {
|
|
iVar10 = this->_activeDesc[slot]._timeRechargeCooldown;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_roomTransition) != 0) goto LAB_007922ae;
|
|
if ((9 < iVar10) && (isItemPressed != '\0')) {
|
|
LAB_00791ff1:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
iVar10 = GetActiveMaxCharge(this,slot);
|
|
local_54 = GHIDRA_CAST<Manager *>((GHIDRA_INT((iVar10 + (iVar10 >> 0x1f & 3U))) >> 2));
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x146);
|
|
if (bVar2 == 0) {
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(this->_activeDesc[slot]._batteryCharge);
|
|
local_6c.y = (float)&DAT_00000004;
|
|
if (GHIDRA_INT(local_48) < 1) {
|
|
piVar8 = &this->_activeDesc[slot]._charge;
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(*piVar8);
|
|
drainAmount = &local_6c.y;
|
|
if (GHIDRA_INT(local_48) < 5) {
|
|
drainAmount = GHIDRA_CAST<float *>(piVar8);
|
|
}
|
|
AddActiveCharge(this,-GHIDRA_INT(*drainAmount),slot,0,0,0);
|
|
iVar10 = this->_activeDesc[slot]._charge;
|
|
}
|
|
else {
|
|
drainAmount = &local_6c.y;
|
|
if (GHIDRA_INT(local_48) < 5) {
|
|
drainAmount = GHIDRA_CAST<float *>(&this->_activeDesc[slot]._batteryCharge);
|
|
}
|
|
AddActiveCharge(this,-GHIDRA_INT(*drainAmount),slot,0,0,0);
|
|
iVar10 = this->_activeDesc[slot]._batteryCharge;
|
|
}
|
|
if (iVar10 < 1) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x146);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x146,0,2);
|
|
pMVar1 = g_manager;
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(0x1fa);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_48));
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar1->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_48),1.0,2,0,1.0,0.0);
|
|
breathEffectSlot = &this->_breathOfLifeEffect;
|
|
if (this->_breathOfLifeEffect != (EntityPtr)0x0) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_breathOfLifeEffect) + 0x28))();
|
|
if (*breathEffectSlot != (EntityPtr)0x0) {
|
|
local_6c.y = (float)breathEffectSlot;
|
|
std::multiset<unsigned_int>::erase(&local_6c.y);
|
|
}
|
|
*breathEffectSlot = (EntityPtr)0x0;
|
|
}
|
|
uVar4 = Random();
|
|
breathEffect = (EntityPtr)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,&this->_pos,&this->_velocity,
|
|
GHIDRA_CAST<Entity *>(this),9,uVar4);
|
|
*breathEffectSlot = breathEffect;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(breathEffect) + 0x34c)))->x = 0.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(breathEffect) + 0x350)) = -15.0;
|
|
local_54 = GHIDRA_CAST<Manager *>((GHIDRA_INT(*breathEffectSlot) + 0x3bc));
|
|
if (*GHIDRA_CAST<int *>(local_54) != 0) {
|
|
local_6c.y = (float)local_54;
|
|
std::multiset<unsigned_int>::erase(&local_6c.y);
|
|
}
|
|
*GHIDRA_CAST<Entity_Player **>(local_54) = this;
|
|
std::multiset<unsigned_int>::insert(local_54);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(*breathEffectSlot) + 0x48)))))->ANM2::Play(GHIDRA_CAST<byte *>("Appear"),0);
|
|
bVar2 = HasCollectible(this,0x3b,0);
|
|
if (bVar2 != 0) {
|
|
local_40 = 0x3f800000;
|
|
CStack_3c = (Capsule)0x3f800000;
|
|
uStack_38 = 0x3f800000;
|
|
uStack_34 = 0x3f800000;
|
|
in_XMM0_Da = 1.0;
|
|
local_30 = 0x3f800000;
|
|
uStack_2c = 0x3d4ccccd;
|
|
uStack_28 = 0x3d75c28f;
|
|
uStack_24 = 0x3f800000;
|
|
local_20 = 0;
|
|
local_1c = 0xbe4ccccd;
|
|
local_18 = 0xbe4ccccd;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*breathEffectSlot) + 0x3c))(&local_40,0xffffffff,0xff,0,1);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(*breathEffectSlot) + 0xc))();
|
|
isItemTriggered = '\0';
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_activeDesc[0]._timeRechargeCooldown) + local_4c)) = 0xb;
|
|
goto LAB_007926d7;
|
|
}
|
|
}
|
|
else {
|
|
local_6c.y = (float)(iVar10 / GHIDRA_INT(local_54));
|
|
if (GHIDRA_INT(local_6c.y) < GHIDRA_INT(local_48) / GHIDRA_INT(local_54)) {
|
|
in_XMM0_Da = (float)GHIDRA_INT(local_6c.y) * 0.2;
|
|
fVar13 = 1.6 - in_XMM0_Da;
|
|
if (fVar13 <= 1.0) {
|
|
fVar13 = 1.0;
|
|
}
|
|
if (1.6 <= fVar13) {
|
|
fVar13 = 1.6;
|
|
}
|
|
play_sound_with_fart_seed(0x1fb,1.0,1,0,fVar13);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_00792293:
|
|
this->_activeDesc[slot]._timeRechargeCooldown = 0xb;
|
|
isItemTriggered = '\0';
|
|
goto LAB_007926d7;
|
|
}
|
|
if (isItemTriggered == '\0') goto LAB_007922ae;
|
|
if (9 < iVar10) goto LAB_00791ff1;
|
|
iVar10 = GetActiveMaxCharge(this,slot);
|
|
if (iVar10 <= this->_activeDesc[slot]._charge) {
|
|
local_50 = GHIDRA_CAST<Manager *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x1))),1));
|
|
iVar10 = GetActiveMaxCharge(this,slot);
|
|
if (this->_activeDesc[slot]._batteryCharge < iVar10) {
|
|
this->_activeDesc[slot]._batteryCharge = 0;
|
|
this->_activeDesc[slot]._timeRechargeCooldown = 0xb;
|
|
isItemTriggered = '\0';
|
|
goto LAB_007926d7;
|
|
}
|
|
goto LAB_00792293;
|
|
}
|
|
}
|
|
isItemTriggered = '\0';
|
|
}
|
|
else if (local_90.y == 9.94922e-43) {
|
|
if ((GHIDRA_CAST<int *>(slot) == GHIDRA_CAST<int *>(0x2)) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000), bVar2 == 0)) {
|
|
if ((this->_itemState == 0x2c6) &&
|
|
(((bVar2 = AreControlsEnabled(this), bVar2 != 0 && (isItemPressed != '\0')) &&
|
|
(this->_bagOfCraftingOutput != 0)))) {
|
|
this->_bagOfCraftingHoldFrames = this->_bagOfCraftingHoldFrames + 1;
|
|
if (0x1d < this->_bagOfCraftingHoldFrames) {
|
|
ResetItemState(this);
|
|
iVar10 = this->_bagOfCraftingOutput;
|
|
local_48 = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar10);
|
|
if (local_48 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
AnimateCollectible(this,iVar10,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
if (local_48->type == 3) {
|
|
FlushQueueItem(this);
|
|
pMVar1 = GHIDRA_CAST<Manager *>(this->_activeDesc[0]._item);
|
|
local_6c.y = (float)pMVar1;
|
|
bVar2 = ItemConfig::IsValidCollectible(GHIDRA_INT(pMVar1));
|
|
if (((bVar2 != 0) && (pMVar1 != GHIDRA_CAST<Manager *>(0x248))) &&
|
|
((bVar2 = HasCollectible(this,0x216,0), bVar2 == 0 ||
|
|
((bVar2 = ItemConfig::IsValidCollectible(this->_activeDesc[1]._item), bVar2 != 0
|
|
&& (this->_activeDesc[1]._item != 0x248)))))) {
|
|
RemoveCollectible(this,GHIDRA_UINT(pMVar1),0,0,0);
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT(local_6c.y) * 0x10 +
|
|
GHIDRA_INT((this->_collectibleRNGs)._begin))))))->RNG::Next();
|
|
tainted_cain_pedestal_burst(this,&this->_pos,unused_01,uVar4,GHIDRA_UINT(bVar2) << 4);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::ShowItemText(this,local_48);
|
|
iVar10 = ItemPool::GetFirstItemPoolForCollectible
|
|
(&g_game->_itemPool,this->_bagOfCraftingOutput);
|
|
SetQueuedItem(this,local_48,local_48->_initCharge,0,0,iVar10);
|
|
bVar2 = HasCollectible(this,0x248,0);
|
|
if (bVar2 != 0) {
|
|
position = &this->_pos;
|
|
isDontUpdate = 0;
|
|
bVar2 = 0;
|
|
iVar10 = Entity_Familiar::GetRandomWisp
|
|
(GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0x2c60)));
|
|
AddWisp(this,iVar10,position,bVar2,isDontUpdate);
|
|
}
|
|
}
|
|
game = g_game;
|
|
in_XMM0_Da = 0.0;
|
|
this->_bagOfCraftingHoldFrames = 0;
|
|
this->_bagOfCraftingOutput = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f50)))) = 0xffffffff;
|
|
this->_bagOfCraftingContent[0] = 0;
|
|
this->_bagOfCraftingContent[1] = 0;
|
|
this->_bagOfCraftingContent[2] = 0;
|
|
this->_bagOfCraftingContent[3] = 0;
|
|
this->_bagOfCraftingContent[4] = 0;
|
|
this->_bagOfCraftingContent[5] = 0;
|
|
this->_bagOfCraftingContent[6] = 0;
|
|
this->_bagOfCraftingContent[7] = 0;
|
|
(GHIDRA_CAST<HUD *>((&game->_hud)))->HUD::InvalidateCraftingItem(this);
|
|
pMVar1 = g_manager;
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(0x84);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_48));
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar1->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_48),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
else {
|
|
this->_bagOfCraftingHoldFrames = 0;
|
|
}
|
|
}
|
|
}
|
|
else if (local_90.y == 9.1785e-43) {
|
|
local_44 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x32);
|
|
game = g_game;
|
|
if (local_44 == 0) {
|
|
bVar2 = AreControlsEnabled(this);
|
|
if ((bVar2 != 0) && (local_50 = GHIDRA_CAST<Manager *>((GHIDRA_UINT(local_50) & 0xff)), isItemPressed != '\0')) {
|
|
local_50 = GHIDRA_CAST<Manager *>(0x1);
|
|
}
|
|
}
|
|
else {
|
|
this->_activeDesc[slot]._timeRechargeCooldown = 0xf;
|
|
if (((*GHIDRA_CAST<int *>(&game->_roomTransition) == 0) &&
|
|
((bVar2 = AreControlsEnabled(this), bVar2 == 0 || (isItemPressed == '\0')))) ||
|
|
(this->_activeDesc[slot]._charge < 1)) {
|
|
local_43 = '\x01';
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x248,0);
|
|
if ((((bVar2 != 0) && (local_44 != 0)) && (local_43 == '\0')) &&
|
|
((bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(6,0), bVar2 != 0 &&
|
|
(wisp = AddWisp(this,0x28f,&this->_pos,0,1), wisp != GHIDRA_CAST<Entity_Familiar *>(0x0))))) {
|
|
uVar14 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&wisp->_flags) + 4));
|
|
iVar10 = *GHIDRA_CAST<int *>(wisp);
|
|
*GHIDRA_CAST<uint *>(&wisp->_flags) = GHIDRA_UINT(wisp->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&wisp->_flags) + 4)) = uVar14;
|
|
wisp->_isNotCountedAsFollower = 1;
|
|
(**(code **)(iVar10 + 0xc))();
|
|
}
|
|
}
|
|
LAB_007926d7:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if ((bVar2 == 0) && (GHIDRA_CAST<int *>(slot) == GHIDRA_CAST<int *>(0x0))) {
|
|
local_4c = 0;
|
|
uVar4 = 0;
|
|
do {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._timeRechargeCooldown) + uVar4));
|
|
if (0 < iVar10) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._timeRechargeCooldown) + uVar4)) = iVar10 + -1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._item) + uVar4)) != 0) {
|
|
pIVar6 = GHIDRA_CAST<ItemConfig_Item *>(GetActiveMaxCharge(this,local_4c));
|
|
local_48 = pIVar6;
|
|
local_78.y = (float)GetActiveMaxCharge(this,local_4c);
|
|
local_54 = GHIDRA_CAST<Manager *>(GetActiveMaxCharge(this,local_4c));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._timeRechargeCooldown) + uVar4)) < 1) {
|
|
local_6c.y = (float)g_manager;
|
|
itemConfig = ItemConfig::GetCollectible
|
|
(&g_manager->_itemConfig,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._item) + uVar4)));
|
|
if ((itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (itemConfig->chargeType == 1)) {
|
|
iVar10 = 1;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._item) + uVar4)) == 0x246) {
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar8 = (this->_temporaryeffects)._effects._begin;
|
|
piVar8 != (this->_temporaryeffects)._effects._end; piVar8 = piVar8 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar8) == 0) && ((GHIDRA_CAST<int *>(*piVar8))[1] == 0x47)) {
|
|
iVar12 = piVar8[1];
|
|
goto LAB_00792a66;
|
|
}
|
|
}
|
|
iVar12 = 0;
|
|
LAB_00792a66:
|
|
pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x246);
|
|
if (pvVar5 == (void *)0x0) goto LAB_007927a6;
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 4));
|
|
}
|
|
else {
|
|
iVar12 = 0;
|
|
LAB_007927a6:
|
|
iVar10 = 0;
|
|
}
|
|
iVar12 = (10 - iVar10) - iVar12;
|
|
iVar10 = 0;
|
|
if (0 < iVar12) {
|
|
iVar10 = iVar12;
|
|
}
|
|
iVar10 = (iVar10 + 1) * iVar10;
|
|
}
|
|
iVar12 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._charge) + uVar4));
|
|
if (iVar12 < GHIDRA_INT(local_48)) {
|
|
iVar12 = GHIDRA_INT(local_48) - iVar12;
|
|
iVar7 = iVar10;
|
|
if (iVar12 < iVar10) {
|
|
iVar7 = iVar12;
|
|
}
|
|
iVar12 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._charge) + uVar4)) + iVar7;
|
|
iVar10 = iVar10 - iVar7;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._charge) + uVar4)) = iVar12;
|
|
if (GHIDRA_INT(local_48) <= iVar12) {
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::FlashChargeBar(this,local_4c);
|
|
local_60 = 0xab;
|
|
seed_fart_sound_override(&local_60);
|
|
(GHIDRA_CAST<SoundEffects *>((GHIDRA_CAST<SoundEffects *>((GHIDRA_INT(local_6c.y) + 0x2a324)))))->SoundEffects::Play(local_60,1.0,2,0,1.0,
|
|
0.0);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x3f,0);
|
|
if (((bVar2 != 0) &&
|
|
(iVar12 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._batteryCharge) + uVar4)),
|
|
iVar12 < GHIDRA_INT(local_48))) && (0 < iVar10)) {
|
|
if (GHIDRA_INT(local_48) - iVar12 < iVar10) {
|
|
iVar10 = GHIDRA_INT(local_48) - iVar12;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._batteryCharge) + uVar4)) = iVar10 + iVar12;
|
|
pIVar6 = local_48;
|
|
if (iVar10 + iVar12 < GHIDRA_INT(local_48)) goto LAB_0079293f;
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::FlashChargeBar(this,local_4c);
|
|
pMVar1 = g_manager;
|
|
local_60 = 0xaa;
|
|
seed_fart_sound_override(&local_60);
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar1->_sfxManager)))->SoundEffects::Play(local_60,1.0,2,0,1.0,0.0);
|
|
seed = Random();
|
|
uVar17 = 0;
|
|
pTVar16 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar14 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,
|
|
seed);
|
|
iVar10 = __RTDynamicCast(tmpEntity,uVar14,pTVar15,pTVar16,uVar17);
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0x358)) = 0x3f800000;
|
|
}
|
|
pIVar6 = local_48;
|
|
}
|
|
LAB_0079293f:
|
|
bVar2 = HasCollectible(this,0x74,0);
|
|
if (((bVar2 != 0) && (GHIDRA_CAST<ItemConfig_Item *>(local_78.y) == GHIDRA_CAST<ItemConfig_Item *>(0x1))) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._charge) + uVar4)) == 0 &&
|
|
(local_54 == GHIDRA_CAST<Manager *>(0x0))))) {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._subCharge) + uVar4));
|
|
if (iVar10 == 0) {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12c0)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12c4));
|
|
iVar12 = 0;
|
|
if (0 < iVar7) {
|
|
iVar12 = iVar7;
|
|
}
|
|
if (iVar12 < 1) goto LAB_007929af;
|
|
}
|
|
iVar10 = iVar10 + 1;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._subCharge) + uVar4)) = iVar10;
|
|
if (iVar10 < 0x1c2) goto LAB_007929ba;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_activeDesc[0]._charge) + uVar4)) = 1;
|
|
}
|
|
LAB_007929af:
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_activeDesc[0]._subCharge) + uVar4)) = 0;
|
|
}
|
|
LAB_007929ba:
|
|
bVar2 = HasCollectible(this,0x287,0);
|
|
if (((bVar2 == 0) || (local_54 != GHIDRA_CAST<Manager *>(0x0))) ||
|
|
((GHIDRA_INT(pIVar6) <= *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._charge) + uVar4)) &&
|
|
((bVar2 = HasCollectible(this,0x3f,0), bVar2 == 0 ||
|
|
(GHIDRA_INT(pIVar6) <= *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_activeDesc[0]._batteryCharge) + uVar4)))))))) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_activeDesc[0]._partialCharge) + uVar4)) = 0;
|
|
}
|
|
else {
|
|
in_XMM0_Da = *GHIDRA_CAST<float *>((GHIDRA_INT(&this->_activeDesc[0]._partialCharge) + uVar4));
|
|
if (1.0 <= in_XMM0_Da) {
|
|
in_XMM0_Da = in_XMM0_Da - 1.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_INT(&this->_activeDesc[0]._partialCharge) + uVar4)) = in_XMM0_Da;
|
|
AddActiveCharge(this,1,local_4c,0,0,0);
|
|
}
|
|
}
|
|
}
|
|
local_4c = local_4c + 1;
|
|
uVar4 = uVar4 + 0x20;
|
|
} while (uVar4 < 0x80);
|
|
slot = savedSlot;
|
|
}
|
|
bVar2 = AreControlsEnabled(this);
|
|
if ((bVar2 == 0) || ((isItemTriggered == '\0' && ((char)local_50 == '\0')))) goto LAB_00793653;
|
|
local_6c.y = (float)this->_itemState;
|
|
this->_lastActionTriggers = this->_lastActionTriggers | 0x10;
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset));
|
|
isItemTriggered = '\x01';
|
|
if (iVar10 != 0x93) {
|
|
if (iVar10 == 0x2d2) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_88,1000,0xc1,0,0,0);
|
|
iVar10 = 0;
|
|
fVar13 = 1e+09;
|
|
uVar4 = 0;
|
|
if (GHIDRA_CAST<undefined1 *>(local_88._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
do {
|
|
iVar12 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_88._data) + uVar4 * 4));
|
|
if (*GHIDRA_CAST<Entity_Player **>((iVar12 + 0x3c8)) == this) {
|
|
distSq = (this->_pos).y - *GHIDRA_CAST<float *>((iVar12 + 0x340));
|
|
in_XMM0_Da = (this->_pos).x - *GHIDRA_CAST<float *>((iVar12 + 0x33c));
|
|
in_XMM0_Da = in_XMM0_Da * in_XMM0_Da;
|
|
distSq = distSq * distSq + in_XMM0_Da;
|
|
if (distSq < fVar13) {
|
|
iVar10 = iVar12;
|
|
fVar13 = distSq;
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT(local_88._size));
|
|
slot = savedSlot;
|
|
if (iVar10 != 0) {
|
|
*GHIDRA_CAST<undefined1 *>((iVar10 + 0x173)) = 1;
|
|
isItemTriggered = '\0';
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (iVar10 != 0x2d9) goto LAB_00792c68;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_88,3,0xf3,0,0,0);
|
|
uVar4 = 0;
|
|
if (GHIDRA_CAST<undefined1 *>(local_88._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
do {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_88._data) + uVar4 * 4));
|
|
if ((iVar10 == 0) || (*GHIDRA_CAST<int *>((iVar10 + 0x28)) != 3)) {
|
|
iVar10 = 0;
|
|
}
|
|
if (*GHIDRA_CAST<Entity_Player **>((iVar10 + 0x410)) == this) {
|
|
if (*GHIDRA_CAST<int *>((iVar10 + 0xd88)) == 0) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0xd88)) = 1;
|
|
}
|
|
isItemTriggered = '\0';
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT(local_88._size));
|
|
}
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((&local_88)))->EntityList_Query::~EntityList_Query();
|
|
if (isItemTriggered != '\0') goto LAB_00792c68;
|
|
goto LAB_007935ed;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x93);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x93,-1);
|
|
AnimateCollectible(this,0x93,GHIDRA_CAST<byte *>("HideItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
goto LAB_007935ed;
|
|
}
|
|
LAB_00792c68:
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset));
|
|
if (iVar10 == 0) goto LAB_007935ed;
|
|
local_78.y = (float)(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar10);
|
|
local_60 = GetActiveMaxCharge(this,slot);
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset));
|
|
if (iVar10 == 0x28f) {
|
|
if ((char)local_50 == '\0') goto LAB_00792df3;
|
|
if (this->_activeDesc[slot]._charge < 0x10) goto LAB_00792da8;
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0xc9) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_88)) + 0x0))) = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_88)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 200));
|
|
}
|
|
local_88._data = GHIDRA_CAST<int *>(0x0);
|
|
local_88._size = 0;
|
|
local_88._capacity = -1;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&local_88,0,1);
|
|
uVar4 = 0;
|
|
pvVar5 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x1264)) != 0) {
|
|
do {
|
|
iVar10 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x125c)) + uVar4 * 4));
|
|
if ((*GHIDRA_CAST<int *>((iVar10 + 0x28)) == 3) && (*GHIDRA_CAST<Entity_Player **>((iVar10 + 0x410)) == this)) {
|
|
*GHIDRA_CAST<uint *>((iVar10 + 0x16c)) = *GHIDRA_CAST<uint *>((iVar10 + 0x16c)) | 0x200;
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0x168)) = *GHIDRA_CAST<undefined4 *>((iVar10 + 0x168));
|
|
if (-1 < *GHIDRA_CAST<int *>((iVar10 + 0xd70))) {
|
|
*GHIDRA_CAST<float *>((iVar10 + 0x370)) = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((iVar10 + 0x330)) + 0x38)) + 5.0;
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar5) + 0x1264)));
|
|
}
|
|
EvaluateItems(this);
|
|
goto LAB_007935ed;
|
|
}
|
|
if ((char)local_50 != '\0') {
|
|
LAB_00792da8:
|
|
if (this->_activeDesc[slot]._charge != local_60) goto LAB_00792df3;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 != 0) goto LAB_007935ed;
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_70) + 2)),iVar10,5,slot,0);
|
|
AddActiveCharge(this,-1,0,0,0,0);
|
|
goto LAB_00793273;
|
|
}
|
|
LAB_00792df3:
|
|
cVar3 = (GHIDRA_CAST<KAGE_Filesys_FileManager *>((GHIDRA_CAST<KAGE_Filesys_FileManager *>(this))))->KAGE_Filesys_FileManager::OpenRead(iVar10,slot);
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(this->_sprite)._filename) + GHIDRA_INT((slot + 0xac)) * 0x20 + -0x48));
|
|
if (cVar3 == '\0') {
|
|
local_70 = CONCAT13(1,(undefined3)local_70);
|
|
if (iVar10 == 0x1ab) {
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_88,0x124,-1,1,0,0)
|
|
;
|
|
local_8 = 2;
|
|
if (GHIDRA_CAST<undefined1 *>(local_88._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
local_54 = GHIDRA_CAST<Manager *>(0x0);
|
|
if (GHIDRA_CAST<undefined1 *>(local_88._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
piVar8 = local_88._data;
|
|
do {
|
|
iVar10 = piVar8[GHIDRA_INT(local_54)];
|
|
in_XMM0_Da = *GHIDRA_CAST<float *>((iVar10 + 0x380));
|
|
if (1.0 < in_XMM0_Da) {
|
|
if (1 < g_game->_frameCount - *GHIDRA_CAST<int *>((iVar10 + 0x328))) {
|
|
piVar8 = GHIDRA_CAST<int *>(__RTDynamicCast(iVar10,0,&IsaacRepentancePlus::Entity::
|
|
RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::
|
|
RTTI_Type_Descriptor,0));
|
|
takeDamageFn = *(code **)(*piVar8 + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&local_c8)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(*takeDamageFn)(0x42c80000,4,0,&local_c8,0x1e);
|
|
local_70 = local_70 & 0xffffff;
|
|
}
|
|
piVar8 = local_88._data;
|
|
}
|
|
local_54 = GHIDRA_CAST<Manager *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_54)) + 0x1))));
|
|
} while (local_54 < GHIDRA_UINT(local_88._size));
|
|
slot = savedSlot;
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&local_88)))->EntityList_Query::~EntityList_Query();
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_70)) + 0x3))) == '\0') goto LAB_007935ed;
|
|
}
|
|
bVar2 = HasCollectible(this,0xcd,0);
|
|
if ((((bVar2 != 0) && (this->_itemState == 0)) &&
|
|
(pIVar6 = ItemConfig::GetCollectible
|
|
(&g_manager->_itemConfig,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset))),
|
|
pIVar6 != GHIDRA_CAST<ItemConfig_Item *>(0x0))) && (iVar10 = FUN_007308d0(), iVar10 != 2)) {
|
|
local_54 = GHIDRA_CAST<Manager *>(FUN_007308d0());
|
|
if (local_54 == GHIDRA_CAST<Manager *>(0x1)) {
|
|
local_50 = local_54;
|
|
iVar10 = GetHealthType(this);
|
|
local_4c = 2 - GHIDRA_UINT((iVar10 != 3));
|
|
}
|
|
else {
|
|
local_50 = GHIDRA_CAST<Manager *>(GetActiveMaxCharge(this,slot));
|
|
iVar10 = GetTotalActiveCharge(this,slot);
|
|
local_50 = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_50) - iVar10));
|
|
iVar10 = GetHealthType(this);
|
|
local_4c = 2 - GHIDRA_UINT((iVar10 != 3));
|
|
if (extraout_EDX < 1) goto LAB_007935ed;
|
|
}
|
|
iVar10 = local_4c;
|
|
if (local_4c < this->_soulHearts + this->_redHearts + this->_boneHearts) {
|
|
IsLocalPlayer(this);
|
|
SoundEffects::PlayWithFartOverride(0x38a,in_XMM0_Da,2,0,1.0);
|
|
iVar12 = 0;
|
|
if (local_50 != GHIDRA_CAST<Manager *>(0x0)) {
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
do {
|
|
local_60 = this->_soulHearts;
|
|
local_70 = this->_redHearts;
|
|
if (GHIDRA_INT((local_60 + local_70 + this->_boneHearts)) <= iVar10) break;
|
|
this->_damageCooldown = 0;
|
|
local_78.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x20));
|
|
(GHIDRA_CAST<EntityRef *>((&local_c8)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
uVar14 = 0x3f800000;
|
|
}
|
|
else {
|
|
uVar14 = 0x41000000;
|
|
}
|
|
cVar3 = (*(code *)local_78.y)(uVar14,0x2042821,0,&local_c8,0x1e);
|
|
if (cVar3 == '\0') break;
|
|
if (local_54 == GHIDRA_CAST<Manager *>(0x1)) {
|
|
FullCharge(this,savedSlot,0,0);
|
|
break;
|
|
}
|
|
if ((this->_playerType == 0x16) &&
|
|
((this->_soulHearts < local_60 ||
|
|
((this->_redHearts < GHIDRA_INT(local_70) &&
|
|
(bVar2 = HasCollectible(this,0x26b,0),
|
|
GHIDRA_INT((GHIDRA_UINT((bVar2 != 0)) * 2 + 4)) <= this->_redHearts)))))) {
|
|
if (local_48 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
goto LAB_00793587;
|
|
}
|
|
local_48 = GHIDRA_CAST<ItemConfig_Item *>(0x1);
|
|
iVar12 = iVar12 + -1;
|
|
}
|
|
else {
|
|
LAB_00793587:
|
|
AddActiveCharge(this,1,savedSlot,0,0,0);
|
|
iVar7 = GetHealthType(this);
|
|
if (iVar7 == 3) {
|
|
iVar12 = iVar12 + 1;
|
|
iVar10 = GetActiveMaxCharge(this_00,savedSlot);
|
|
iVar7 = GetTotalActiveCharge(this,savedSlot);
|
|
if (iVar7 < iVar10) {
|
|
AddActiveCharge(this,1,savedSlot,0,0,0);
|
|
}
|
|
iVar10 = local_4c;
|
|
}
|
|
}
|
|
iVar12 = iVar12 + 1;
|
|
} while (iVar12 < GHIDRA_INT(local_50));
|
|
}
|
|
}
|
|
}
|
|
goto LAB_007935ed;
|
|
}
|
|
pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(iVar10);
|
|
if (((local_60 == 0) && (pvVar5 != (void *)0x0)) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_78.y) + 0x78)) != 0))
|
|
goto LAB_007935ed;
|
|
if (0x123 < iVar10) {
|
|
switch(iVar10) {
|
|
case 0x124:
|
|
iVar12 = 3;
|
|
iVar10 = 0xf;
|
|
break;
|
|
default:
|
|
goto switchD_00792e5b_caseD_24;
|
|
case 0x182:
|
|
iVar12 = 3;
|
|
iVar10 = 0x25;
|
|
break;
|
|
case 0x196:
|
|
iVar12 = 3;
|
|
iVar10 = 0x24;
|
|
break;
|
|
case 0x1a6:
|
|
if (2 < this->_activeDesc[slot]._varData) goto switchD_00792e5b_caseD_42;
|
|
goto switchD_00792e5b_caseD_24;
|
|
}
|
|
goto LAB_00792f6c;
|
|
}
|
|
if (iVar10 == 0x123) {
|
|
iVar12 = 0;
|
|
iVar10 = 0x13;
|
|
goto LAB_00792f6c;
|
|
}
|
|
switch(iVar10) {
|
|
case 0x21:
|
|
iVar12 = 3;
|
|
iVar10 = 10;
|
|
break;
|
|
case 0x22:
|
|
case 0x3b:
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x22);
|
|
if (bVar2 == 0) {
|
|
iVar12 = 3;
|
|
iVar10 = 0x22;
|
|
break;
|
|
}
|
|
goto switchD_00792e5b_caseD_24;
|
|
case 0x23:
|
|
bVar2 = HasPlayerForm(this,0xf);
|
|
if ((bVar2 == 0) || (this->_activeDesc[slot]._varData == 0)) {
|
|
iVar12 = 3;
|
|
iVar10 = 1;
|
|
break;
|
|
}
|
|
default:
|
|
goto switchD_00792e5b_caseD_24;
|
|
case 0x27:
|
|
iVar12 = 3;
|
|
iVar10 = 7;
|
|
break;
|
|
case 0x29:
|
|
iVar12 = 3;
|
|
iVar10 = 8;
|
|
break;
|
|
case 0x41:
|
|
iVar12 = 3;
|
|
iVar10 = 9;
|
|
break;
|
|
case 0x42:
|
|
switchD_00792e5b_caseD_42:
|
|
iVar12 = 3;
|
|
iVar10 = 0xe;
|
|
break;
|
|
case 0x4e:
|
|
iVar12 = 3;
|
|
iVar10 = 0xb;
|
|
break;
|
|
case 0x7b:
|
|
iVar12 = 3;
|
|
iVar10 = 2;
|
|
break;
|
|
case 0x7c:
|
|
if (this->_itemState == 0) {
|
|
iVar12 = 3;
|
|
iVar10 = 4;
|
|
break;
|
|
}
|
|
goto switchD_00792e5b_caseD_24;
|
|
case 0xab:
|
|
iVar12 = 3;
|
|
iVar10 = 0x20;
|
|
break;
|
|
case 0x11b:
|
|
iVar12 = 3;
|
|
iVar10 = 0x1c;
|
|
break;
|
|
case 0x11c:
|
|
iVar12 = 3;
|
|
iVar10 = 0x11;
|
|
}
|
|
LAB_00792f6c:
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(iVar10,iVar12,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
switchD_00792e5b_caseD_24:
|
|
if ((GHIDRA_CAST<int *>(slot) != GHIDRA_CAST<int *>(0x0)) || (local_44 = 1, this->_activeDesc[1]._item == 0)) {
|
|
local_44 = 0;
|
|
}
|
|
local_50 = GHIDRA_CAST<Manager *>(this->_activeDesc[slot]._varData);
|
|
if ((g_game->_challenge == 0x20) && (GHIDRA_CAST<int *>(slot) == GHIDRA_CAST<int *>(0x0))) {
|
|
std::vector<int>::copy_constructor(&g_manager->_itemConfig);
|
|
piVar8 = local_88._data;
|
|
local_8 = 1;
|
|
candidateItems = GHIDRA_CAST<int *>(slot);
|
|
candidateItemsEnd = GHIDRA_CAST<int *>(slot);
|
|
candidateItemsCapacity = GHIDRA_CAST<int *>(slot);
|
|
FUN_0042c820(local_88._capacity - GHIDRA_INT(local_88._data) >> 2);
|
|
piVar11 = candidateItemsEnd;
|
|
if (piVar8 != GHIDRA_CAST<int *>(local_88._capacity)) {
|
|
do {
|
|
itemEntry = GHIDRA_CAST<int *>(*piVar8);
|
|
if (itemEntry != GHIDRA_CAST<int *>(0x0)) {
|
|
if (*itemEntry == 3) {
|
|
pIVar6 = GHIDRA_CAST<ItemConfig_Item *>(itemEntry[1]);
|
|
if (pIVar6 != GHIDRA_CAST<ItemConfig_Item *>(0x1db)) {
|
|
if (pIVar6 != GHIDRA_CAST<ItemConfig_Item *>(0x274)) {
|
|
local_78.y = (float)pIVar6;
|
|
if (piVar11 == candidateItemsCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(piVar11,&local_78.y);
|
|
piVar11 = candidateItemsEnd;
|
|
}
|
|
else {
|
|
*piVar11 = GHIDRA_INT(pIVar6);
|
|
candidateItemsEnd = piVar11 + 1;
|
|
piVar11 = candidateItemsEnd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
piVar8 = piVar8 + 1;
|
|
} while (piVar8 != GHIDRA_CAST<int *>(local_88._capacity));
|
|
}
|
|
piVar8 = candidateItems;
|
|
iVar10 = Isaac::Random(GHIDRA_INT(piVar11) - GHIDRA_INT(candidateItems) >> 2);
|
|
local_54 = GHIDRA_CAST<Manager *>(piVar8[iVar10]);
|
|
if ((GHIDRA_CAST<Manager *>(this->_itemState) != GHIDRA_CAST<Manager *>(0x0)) && (local_54 != GHIDRA_CAST<Manager *>(this->_itemState))
|
|
) {
|
|
ResetItemState(this);
|
|
}
|
|
this->_wildCardItem = GHIDRA_INT(local_54);
|
|
this->_wildCardItemType = 2;
|
|
this->_wildCardVarData = 0;
|
|
UseActiveItem(this,&local_56,GHIDRA_INT(local_54),((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_56)) + 0x1))) != '\0') + 2,-1,0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x0))) = (char)*extraout_EAX;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x1))) = (byte)((ushort)*extraout_EAX >> 8);
|
|
pIVar6 = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(local_54));
|
|
AddCostume(this,pIVar6,1);
|
|
if ((this->_itemState != 0) && ((bool)local_44 == (this->_activeDesc[1]._item != 0))) {
|
|
DischargeActiveItem(this,0,0);
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
if (piVar8 != GHIDRA_CAST<int *>(0x0)) {
|
|
uVar4 = (GHIDRA_INT(candidateItemsCapacity) - GHIDRA_INT(piVar8) >> 2) * 4;
|
|
piVar11 = piVar8;
|
|
if (0xfff < uVar4) {
|
|
piVar11 = GHIDRA_CAST<int *>(piVar8[-1]);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(piVar8) + (-4 - GHIDRA_INT(piVar11))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(piVar11,uVar4);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Tidy(&local_88._data);
|
|
iVar10 = slotOffset;
|
|
}
|
|
else {
|
|
if ((this->_itemState != 0) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset)) != this->_itemState)) {
|
|
ResetItemState(this);
|
|
}
|
|
iVar10 = slotOffset;
|
|
this->_wildCardItemType = 2;
|
|
this->_wildCardItem = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset));
|
|
this->_wildCardVarData = this->_activeDesc[slot]._varData;
|
|
UseActiveItem(this,&local_56,*GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset)),
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_56)) + 0x1))) != '\0') + 4,slot,0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x0))) = (char)*extraout_EAX_00;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x1))) = (byte)((ushort)*extraout_EAX_00 >> 8);
|
|
}
|
|
bVar2 = HasCollectible(this,0x164,0);
|
|
if ((((((bVar2 != 0) && (this->_itemState == 0)) && (GHIDRA_CAST<Manager *>(local_6c.y) == GHIDRA_CAST<Manager *>(0x0))) &&
|
|
(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x1))) == 0 &&
|
|
(iVar12 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + iVar10)), iVar12 != 0)))) &&
|
|
(0 < local_60)) && ((iVar12 != 0x20b && (iVar12 != 0x20f)))) {
|
|
UseActiveItem(this,&local_56,iVar12,0x621,-1,GHIDRA_INT(local_50));
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_70)) + 0x3))) == '\0') {
|
|
LAB_0079324d:
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x0))) != '\0') {
|
|
DischargeActiveItem(this,slot,(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x1))));
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x0))) != '\0') {
|
|
iVar12 = GetTrinketMultiplier(this,0x95);
|
|
if (iVar12 == 2) {
|
|
uVar4 = 10;
|
|
}
|
|
else {
|
|
if (iVar12 < 3) goto LAB_0079324d;
|
|
uVar4 = 5;
|
|
}
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0x950)))))->RNG::RandomInt(uVar4);
|
|
if (uVar4 != 0) goto LAB_0079324d;
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_78.x)) + 0x1))) != 0) {
|
|
RemoveCollectible(this,*GHIDRA_CAST<uint *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + iVar10)),0,slot,1);
|
|
}
|
|
LAB_00793273:
|
|
bVar2 = HasTrinket(this,4,0);
|
|
if ((bVar2 != 0) && (GHIDRA_CAST<int *>(slot) == GHIDRA_CAST<int *>(0x0))) {
|
|
this->_isBrokenRemotePending = 1;
|
|
}
|
|
LAB_007935ed:
|
|
fVar13 = local_6c.y;
|
|
pMVar1 = GHIDRA_CAST<Manager *>(this->_itemState);
|
|
if (((GHIDRA_CAST<Manager *>(local_6c.y) == pMVar1) && (this->_itemStateCooldown < 1)) &&
|
|
(pMVar1 != GHIDRA_CAST<Manager *>(0x0))) {
|
|
if (pMVar1 == GHIDRA_CAST<Manager *>(0x31)) {
|
|
iVar10 = 0x31;
|
|
}
|
|
else {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + slotOffset));
|
|
}
|
|
TryRemoveCollectibleCostume(this,iVar10,0);
|
|
ResetItemState(this);
|
|
if (((GHIDRA_CAST<Manager *>(fVar13) != GHIDRA_CAST<Manager *>(0x0)) && (GHIDRA_CAST<Manager *>(fVar13) != GHIDRA_CAST<Manager *>(0x82))) &&
|
|
((GHIDRA_CAST<Manager *>(fVar13) != GHIDRA_CAST<Manager *>(0xb5) && (GHIDRA_CAST<Manager *>(fVar13) != GHIDRA_CAST<Manager *>(0x152))))) {
|
|
AnimateCollectible(this,GHIDRA_INT(fVar13),GHIDRA_CAST<byte *>("HideItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
}
|
|
}
|
|
LAB_00793653:
|
|
fVar13 = local_90.y;
|
|
if (local_43 != '\0') {
|
|
if (local_90.y == 9.1785e-43) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x32,1);
|
|
iVar10 = savedSlot;
|
|
if ((this->_activeDesc[savedSlot]._charge == 0) &&
|
|
(bVar2 = HasTrinket(this,0x8a,0), bVar2 != 0)) {
|
|
DischargeActiveItem(this,iVar10,0);
|
|
}
|
|
}
|
|
else if ((local_90.y != 4.56823e-43) &&
|
|
(pIVar6 = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(local_90.y)),
|
|
pIVar6 != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(GHIDRA_INT(fVar13),-1);
|
|
piVar8 = &this->_cacheFlags;
|
|
*piVar8 = *piVar8 | pIVar6->cacheFlags;
|
|
if (*piVar8 != 0) {
|
|
EvaluateItems(this);
|
|
}
|
|
}
|
|
}
|
|
if (((savedSlot == 0) && (iVar10 = GetTotalActiveCharge(this,0), totalChargeBefore != iVar10)) &&
|
|
((bVar2 = HasTrinket(this,0x65,0), bVar2 != 0 || (bVar2 = HasTrinket(this,100,0), bVar2 != 0)))
|
|
) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x41f;
|
|
EvaluateItems(this);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00793940
|
|
byte Entity_Player::HasTimedItem()
|
|
{
|
|
ItemConfig_Item *activeItemConfig;
|
|
|
|
activeItemConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(this->_activeDesc[0]._item);
|
|
if ((activeItemConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) || (activeItemConfig->chargeType != 1)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00794e50
|
|
void Entity_Player::update_effects()
|
|
{
|
|
code *pcVar1;
|
|
ColorMod color;
|
|
ColorMod color_00;
|
|
Vector direction;
|
|
Vector direction_00;
|
|
BitSet128 tearFlags;
|
|
BitSet128 flags;
|
|
BitSet128 flags_00;
|
|
RNG rng;
|
|
Vector sizeMulti;
|
|
Vector pos;
|
|
Vector position;
|
|
Vector position_00;
|
|
byte bVar2;
|
|
char cVar3;
|
|
undefined3 extraout_var;
|
|
int iVar4;
|
|
EntityList_EL *queryList;
|
|
Vector *tmpVec;
|
|
uint uVar5;
|
|
Entity *queryList;
|
|
PersistentGameData *persistentData;
|
|
void *pvVar7;
|
|
Room *room;
|
|
BitSet128 *tmpFlags;
|
|
Room *currentRoom;
|
|
Entity_Tear *pEVar8;
|
|
undefined4 *puVar9;
|
|
undefined1 *puVar10;
|
|
ItemConfig *itemConfig;
|
|
ColorMod *color_01;
|
|
Entity_Effect *effect;
|
|
Entity_Bomb *bomb;
|
|
TemporaryEffects *tempEffects;
|
|
RNG *rngPtr;
|
|
float fVar11;
|
|
MusicManager *musicManager;
|
|
Music *music;
|
|
Level *level;
|
|
ColorMod *tmpColor;
|
|
ItemConfig_Item *configItem;
|
|
PlayerManager *playerManager;
|
|
GridEntity *pGVar12;
|
|
EntityList *entityList;
|
|
TearParams *pTVar13;
|
|
int *piVar14;
|
|
SoundEffects *sfx;
|
|
EntityRef *sourceRef;
|
|
RNG *music;
|
|
Vector *pVVar15;
|
|
float *pfVar16;
|
|
RNG *playerManager;
|
|
Sprite *sprite;
|
|
ColorMod *color_02;
|
|
LayerState *layer;
|
|
ANM2 *anm;
|
|
ColorMod *color_03;
|
|
ItemPool *itemPool;
|
|
HUD *hud;
|
|
Entity_Familiar *pEVar17;
|
|
Entity_Laser *laser;
|
|
std_string *animName;
|
|
Entity_Pickup *pickup;
|
|
Entity_NPC *pEVar18;
|
|
Vector *offset;
|
|
Vector *offset_00;
|
|
undefined1 *puVar19;
|
|
Color *entityColor;
|
|
ColorMod *from;
|
|
byte *layerCount;
|
|
EntityConfig *entityConfig;
|
|
EntityConfig_Entity *entityConfigEntry;
|
|
int iVar20;
|
|
int blue;
|
|
Entity_Player *pEVar21;
|
|
uint uVar22;
|
|
Entity_Player *pEVar23;
|
|
Entity_Player *pEVar24;
|
|
ActiveItemDesc *pAVar25;
|
|
byte *layerIndex;
|
|
bool bVar26;
|
|
float10 fVar27;
|
|
void *pvVar28;
|
|
undefined1 auVar30 [12];
|
|
undefined1 auVar31 [12];
|
|
double dVar29;
|
|
BitSet128 flags_01;
|
|
undefined1 extraout_var_00 [12];
|
|
undefined1 auVar32 [16];
|
|
undefined1 auVar33 [16];
|
|
undefined1 auVar34 [16];
|
|
BitSet128 BVar35;
|
|
undefined1 extraout_var_01 [12];
|
|
undefined1 extraout_var_02 [12];
|
|
undefined1 extraout_var_03 [12];
|
|
undefined1 extraout_var_04 [12];
|
|
undefined1 extraout_var_05 [12];
|
|
BitSet128 BVar36;
|
|
undefined1 auVar37 [16];
|
|
ulonglong projectileFlags;
|
|
Color aCStackY_2e04 [128];
|
|
undefined4 in_stack_ffffe824;
|
|
undefined4 in_stack_ffffe828;
|
|
uint in_stack_ffffe82c;
|
|
Vector *in_stack_ffffe830;
|
|
Vector *in_stack_ffffe834;
|
|
Entity_Player *in_stack_ffffe838;
|
|
EntityList_EL *in_stack_ffffe83c;
|
|
Entity_Player *in_stack_ffffe840;
|
|
undefined4 uVar38;
|
|
undefined4 uVar39;
|
|
TypeDescriptor *outResult;
|
|
char *pcVar40;
|
|
Entity_Player *pEVar41;
|
|
undefined4 uVar42;
|
|
Entity *pEVar43;
|
|
EntityRef planCSource;
|
|
EntityRef challengeDamageSource;
|
|
EntityRef challengeKillSource;
|
|
EntityRef auraFearSource;
|
|
EntityRef auraBossFearSource;
|
|
EntityRef auraCharmSource;
|
|
EntityRef auraBossCharmSource;
|
|
EntityRef freezeSource;
|
|
EntityRef fearSource;
|
|
EntityRef charmSource;
|
|
EntityRef spotlightSlowSource;
|
|
EntityRef spotlightSlowSourcePvp;
|
|
EntityRef confusionSource;
|
|
EntityRef mirrorDamageSource;
|
|
EntityRef breathOfLifeSource;
|
|
EntityRef dashDamageSource;
|
|
EntityRef fireplaceDamageSource;
|
|
Capsule dashCapsule [10];
|
|
Capsule hitCapsule [10];
|
|
EntityRef damageAuraSource;
|
|
BitSet128 homingBombFlags;
|
|
BitSet128 spawnedBombFlags;
|
|
BitSet128 cookbookBombFlags;
|
|
BitSet128 notWaitFlags3;
|
|
BitSet128 capturedTearFlags2;
|
|
BitSet128 rageLaserFlags2;
|
|
BitSet128 notWaitFlags4;
|
|
BitSet128 megaBlastFlags2;
|
|
BitSet128 megaBlastFlags;
|
|
BitSet128 notWaitFlags2;
|
|
BitSet128 rageLaserFlags;
|
|
BitSet128 notWaitFlags;
|
|
BitSet128 fartBombFlags;
|
|
BitSet128 quadsplitFlagMatch;
|
|
BitSet128 explosiveFlagMatch;
|
|
BitSet128 explosiveCheckFlags;
|
|
BitSet128 orbitFlagsBase;
|
|
BitSet128 capturedFlagsBase;
|
|
BitSet128 quadsplitCheckFlags;
|
|
BitSet128 slowedTearFlags;
|
|
BitSet128 currentTearFlags2 [2];
|
|
BitSet128 slowFlagMatch;
|
|
BitSet128 currentTearFlags;
|
|
BitSet128 bombFlagsCopy [2];
|
|
undefined1 snareBlendMode [20];
|
|
undefined1 trailBlendMode [20];
|
|
EntityRef challengeDeathSource;
|
|
Vector marsDashVelocity;
|
|
Vector smoke2PosOffset;
|
|
Vector smoke2HeightOffset;
|
|
Vector smoke2Scale;
|
|
Vector smoke2SpawnPos;
|
|
Vector smoke2Velocity;
|
|
Vector smoke2InheritedVel;
|
|
Vector smoke2OffsetVel;
|
|
Vector smoke2DirRandomized;
|
|
Vector smoke2DirScaled;
|
|
Vector smoke2RandomDir;
|
|
Vector smoke2Spread;
|
|
Vector smoke2Origin;
|
|
Vector smokePosOffset;
|
|
Vector smokeHeightOffset;
|
|
Vector smokeScale;
|
|
Vector smokeSpawnPos;
|
|
Vector smokeVelocity;
|
|
Vector smokeInheritedVel;
|
|
Vector smokeOffsetVel;
|
|
Vector smokeDirRandomized;
|
|
Vector smokeDirScaled;
|
|
Vector smokeRandomDir;
|
|
Vector smokeSpread;
|
|
Vector smokeOrigin;
|
|
Vector snareScale2;
|
|
Vector snareScale;
|
|
Vector snareTargetPos2;
|
|
Vector snareTargetPos;
|
|
Vector darkArtsAuraOffset;
|
|
Vector salvationOffset;
|
|
Vector orbitTearPos;
|
|
Vector capturedProjPos2;
|
|
Vector capturedProjVel;
|
|
Vector capturedProjPos;
|
|
Vector damageAuraTargetPos;
|
|
Vector auraEnemyPos;
|
|
Vector negPushDir;
|
|
Vector pushDirNorm;
|
|
Vector pushedEnemyVel;
|
|
Vector toPushedEnemy;
|
|
Vector pushedEnemyPos;
|
|
Vector bendOffset;
|
|
Vector projVelBeforeBend;
|
|
Vector rotatedLeft;
|
|
Vector rotatedRight;
|
|
Vector negProjPerp;
|
|
Vector projPerp;
|
|
Vector projDir;
|
|
Vector projVel;
|
|
Vector toProjectileNorm;
|
|
Vector deflectedProjVel2;
|
|
Vector deflectedProjVel;
|
|
Vector deflectedProjPos;
|
|
Vector crownOffset;
|
|
Vector trailCheckPos;
|
|
Vector trailSumPos;
|
|
Vector farthestTrailPos;
|
|
Vector trailPos;
|
|
Vector trailPointPos;
|
|
Vector lastTrailPos;
|
|
Vector haloOffset;
|
|
Vector slowedTearVel;
|
|
Vector spotlitTearVel;
|
|
Vector spotlitTearPos;
|
|
Vector slowedProjectileVel;
|
|
Vector spotlitProjectileVel;
|
|
Vector spotlitProjectilePos;
|
|
Vector spotlitEnemyPos;
|
|
Vector bobCreepScale;
|
|
Vector knifeOffset;
|
|
Vector aquariusCreepScale;
|
|
Vector tarCreepScale;
|
|
Vector heartOffset;
|
|
Vector anemicCreepScale;
|
|
Vector freeSpawnPos;
|
|
Vector targetEnemyPos;
|
|
Vector enemyPos;
|
|
Vector randomRoomPos;
|
|
Vector stompEffectPos;
|
|
Vector stompRandomDir;
|
|
Vector capturedTearVel;
|
|
Vector wispSpawnPos2;
|
|
Vector capturedShotVel;
|
|
Vector wispSpawnPos;
|
|
Vector otherPlayerPos;
|
|
Vector cloudScale;
|
|
Vector stompyDustPos;
|
|
Vector stompyDustOffset;
|
|
Vector stompyRandomDir;
|
|
Vector stompyPos;
|
|
Vector stompyDustVel;
|
|
Vector montezumaDir;
|
|
Vector rageRecoilVel;
|
|
Vector rageRecoilDir;
|
|
Vector rageLaserOffset2;
|
|
Vector megaBlastRecoilVel;
|
|
Vector megaBlastRecoilDir;
|
|
Vector megaBlastLaserOffset;
|
|
Vector megaBlastOffset;
|
|
Vector cordDelta;
|
|
Vector cordLaserOffset;
|
|
Vector prevCordPos;
|
|
Vector pushVelocity;
|
|
Vector heartPushVel;
|
|
Vector heartPushPos;
|
|
Vector heartPushPosY;
|
|
Vector heartPushPosX;
|
|
Vector heartProjPos;
|
|
Vector heartProjPosY;
|
|
Vector heartProjPosX;
|
|
Vector coinPullVel;
|
|
Vector coinPos;
|
|
Vector rageLaserOffset;
|
|
Vector poofScale [2];
|
|
Vector bounceVelocity;
|
|
Vector reflectedVelocity;
|
|
Vector reflectNormal;
|
|
Vector gridHitDir;
|
|
Vector trailPosOffset;
|
|
Vector trailHeightOffset;
|
|
Vector trailVel;
|
|
Vector twinPullVel;
|
|
Vector toTwin;
|
|
Vector knockbackVelScaled;
|
|
Vector knockbackVel;
|
|
Vector bossKnockbackScaled;
|
|
Vector bossKnockbackVel;
|
|
Vector toHitEntity;
|
|
Vector hitEntityPos;
|
|
Vector hitCapsulePos;
|
|
Vector selfPos;
|
|
Vector hitPos3;
|
|
Vector hitPos2;
|
|
Vector hitPos;
|
|
Vector dashCapsuleSize;
|
|
Vector beamSizeMulti;
|
|
Vector beamPos;
|
|
Vector beamOffset;
|
|
Vector ponySideDir;
|
|
undefined1 darkArtsCapsule [32];
|
|
float darkArtsCapsuleSize;
|
|
undefined1 dashTempEffect [8];
|
|
int dashTempEffectCooldown;
|
|
undefined1 vesselShieldEffect [8];
|
|
undefined4 vesselShieldCooldown;
|
|
undefined1 taurusEffect [8];
|
|
undefined4 taurusEffectCooldown;
|
|
undefined1 polaroidEffect [8];
|
|
int polaroidEffectCooldown;
|
|
EntityList_EL momFootQuery;
|
|
BitSet128 capturedTearFlags;
|
|
BitSet128 orbitTearFlags;
|
|
Vector riftSpawnPos;
|
|
Vector twinPos;
|
|
EntityPtr capsuleHitInfo [2];
|
|
Vector clampedBeamPos;
|
|
Vector darkEsauRespawnPos;
|
|
Vector darkEsauSpawnPos;
|
|
Vector farthestPos;
|
|
Vector trollBombPos;
|
|
Vector stompPos;
|
|
undefined1 deflectQuery [16];
|
|
undefined1 freezeQuery [16];
|
|
undefined1 damageAuraQuery [16];
|
|
undefined1 riftQuery [16];
|
|
undefined1 familiarQuery [16];
|
|
undefined1 coinQuery [16];
|
|
undefined1 local_cd4 [16];
|
|
undefined1 dashHits [16];
|
|
undefined1 darkArtsHits [16];
|
|
undefined1 chainLightningQuery [16];
|
|
undefined1 auraQuery [16];
|
|
undefined1 local_c84 [24];
|
|
Vector knockbackDir;
|
|
Vector smoke2Offset;
|
|
Vector smokeOffset;
|
|
Vector snarePos;
|
|
Vector damageAuraCenter;
|
|
Vector newVelocity;
|
|
undefined1 local_c3c [20];
|
|
float jupiterCooldownMin;
|
|
float jupiterCooldownNext;
|
|
void *voltCooldownLeft;
|
|
float voltCooldownMin;
|
|
void *partialChargeMin;
|
|
float poofScaleFactor;
|
|
void *ibsChargeMax;
|
|
float pushStrength;
|
|
Entity_Player *cordPlayer;
|
|
Entity *cordFamiliar;
|
|
void *minLaserTimeout;
|
|
float laserTimeout;
|
|
void *megaBlastRecoil;
|
|
float rageRecoil;
|
|
void *stompyDustVelFactor;
|
|
float stompyDustSpread;
|
|
void *cloudScaleFactor;
|
|
float smokeSpeedWanted;
|
|
float pushBoost;
|
|
float minTearHeight2;
|
|
float capturedTearHeight;
|
|
undefined4 minTearHeight;
|
|
float orbitTearHeight;
|
|
undefined4 maxCollisionPoints;
|
|
float snareScaleFactor;
|
|
void *snareScaleFactor2;
|
|
void *smokeCountCap;
|
|
void *smokeRandomScale;
|
|
float smokeOffsetLength;
|
|
float smokeVelFactor;
|
|
float ibsChargeNext;
|
|
float smokeInheritFactor;
|
|
void *smokeScaleWanted;
|
|
float smokeSpeedMax;
|
|
float smoke2RandomScale;
|
|
float smoke2OffsetLength;
|
|
float smoke2VelFactor;
|
|
undefined1 local_b94 [20];
|
|
float doubledSizeScale;
|
|
float maxSizeScale;
|
|
float smokeScaleMax;
|
|
float smoke2InheritFactor;
|
|
void *smoke2ScaleWanted;
|
|
float smoke2ScaleMax;
|
|
float smoke2SpeedWanted;
|
|
float smoke2SpeedMax;
|
|
void *marsDashSpeed;
|
|
float beamSideOffset;
|
|
float aquariusScaleFactor;
|
|
float bossKnockbackFactor;
|
|
void *hitFriction;
|
|
float trailVelFactor;
|
|
float reflectDot;
|
|
float suplexCountdownCap;
|
|
void *bounceStrength;
|
|
float local_b3c;
|
|
float minMarsCooldown;
|
|
Vector dashDir;
|
|
float local_b2c [2];
|
|
float bendFactor;
|
|
float local_b20 [2];
|
|
int stewDurationLeft;
|
|
float invTrailCount;
|
|
float tearSlowFactor;
|
|
float projectileSlowFactor;
|
|
float bobScaleFactor;
|
|
float tarScaleFactor;
|
|
void *anemicScaleFactor;
|
|
undefined1 local_afa [2];
|
|
undefined1 targetIndices [12];
|
|
Vector pushDir;
|
|
Vector rageDir;
|
|
undefined1 local_adc [24];
|
|
Vector megaBlastDir;
|
|
float local_abc;
|
|
void *knockbackStrength;
|
|
Vector spawnPos;
|
|
void *collisionPointCount;
|
|
Vector snareOffset;
|
|
Vector cordEnd;
|
|
undefined1 local_a98 [24];
|
|
Vector averagePos;
|
|
Vector rageLaserDir;
|
|
float pushRadius;
|
|
float shadowScale;
|
|
float chargeLeft;
|
|
float projectileSpeed;
|
|
Vector toProjectile;
|
|
WeightedOutcomePicker poolPicker [3];
|
|
undefined1 cordEntities [12];
|
|
float dashSpeed;
|
|
Entity *local_a3c;
|
|
void *local_a38;
|
|
Entity_Tear *local_a34;
|
|
Entity_Player *local_a30;
|
|
byte local_a29;
|
|
Entity_Tear *local_a28;
|
|
Entity_Player *savedPlayer;
|
|
float local_a20;
|
|
Entity_Familiar *local_a1c;
|
|
Entity_Tear *local_a14;
|
|
byte local_a0d;
|
|
Entity_Tear *local_a0c;
|
|
Entity_Player *local_a08;
|
|
Entity_NPC *local_a04;
|
|
Entity_Player *local_a00;
|
|
Entity_Player *local_9fc;
|
|
undefined1 haloTearParams [104];
|
|
undefined1 newHaloTearParams [104];
|
|
TearParams TStack_928;
|
|
TearParams aTStack_8c0 [2];
|
|
Color poofColor [2];
|
|
Color splatColor [3];
|
|
ColorMod fadedSpriteColor;
|
|
ColorMod footprintColor [2];
|
|
Color fartColor [8];
|
|
Color snareBlackColor;
|
|
Color fartColor2 [6];
|
|
TearParams TStack_408;
|
|
TearParams aquariusTearParams;
|
|
TearParams local_338;
|
|
Color smokeColor [2];
|
|
Color trailColor;
|
|
Color chargeFadeColor [2];
|
|
Color mirrorFadeColor;
|
|
char rageHeadAnim [24];
|
|
Color tearColorCopy;
|
|
Color flashColor;
|
|
RNG projectileRng;
|
|
RNG tearRng;
|
|
char headDownShoot2 [24];
|
|
char headRightShoot2 [24];
|
|
char headUpShoot2 [24];
|
|
char headLeftShoot2 [24];
|
|
char headDownShoot [24];
|
|
char headRightShoot [24];
|
|
char headUpShoot [24];
|
|
char headLeftShoot [24];
|
|
undefined1 local_78 [68];
|
|
RNG deflectRng;
|
|
void *local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
byte isDontUpdateWisp;
|
|
Manager *manager;
|
|
EntityPtr salvationEffect;
|
|
BitSet128 *tmpFlags2;
|
|
|
|
puStack_20 = local_78 + 0x74;
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00aff8a0;
|
|
local_1c = ExceptionList;
|
|
local_24 = (void *)(__security_cookie ^ GHIDRA_UINT((local_78 + 0x68)));
|
|
if (*GHIDRA_CAST<int *>(&g_game->_stageTransition) != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
savedPlayer = this;
|
|
puVar10 = local_78 + 0x74;
|
|
if (this->_isPlayingExtraAnimation != 0) {
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>("Trapdoor"));
|
|
puVar10 = puStack_20;
|
|
if (bVar2 != 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
puStack_20 = puVar10;
|
|
UpdateBookOfVirtues(this,0);
|
|
piVar14 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10));
|
|
if (((piVar14 != GHIDRA_CAST<int *>(0x0)) && (piVar14[2] == 0x10)) && (*piVar14 == 0x23)) {
|
|
piVar14 = &this->_activeDesc[0]._varData;
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
do {
|
|
if (((GHIDRA_CAST<ActiveItemDesc *>((piVar14 + -7)))->_item == 0x1a6) && (*piVar14 < 3)) {
|
|
*piVar14 = 3;
|
|
FullCharge(this,GHIDRA_INT(local_a34),0,0);
|
|
}
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(local_a34) + 1));
|
|
piVar14 = piVar14 + 8;
|
|
} while (local_a34 < &DAT_00000004);
|
|
}
|
|
bVar2 = HasTrinket(this,0x78,0);
|
|
pvVar28 = (void *)0x3f800000;
|
|
shadowScale = 1.0;
|
|
if (((bVar2 != 0) && (pcVar40 = g_game->_room, *pcVar40 != '\0')) &&
|
|
((g_game->_frameCount - *GHIDRA_CAST<int *>((pcVar40 + 0x11f0)) == 1 &&
|
|
((*GHIDRA_CAST<int *>((pcVar40 + 8)) == 5 && (pcVar40[1] != '\0')))))) {
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_UINT(local_a34) & 0xffffff00));
|
|
bVar2 = HasGoldenTrinket(this,0x78);
|
|
if ((bVar2 != 0) || (bVar2 = HasCollectible(this,0x1b7,0), bVar2 != 0)) {
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a34)) + 0x1))),1));
|
|
}
|
|
uVar22 = 0;
|
|
do {
|
|
bVar2 = FullCharge(this,uVar22,0,(byte)local_a34);
|
|
manager = g_manager;
|
|
if (CONCAT31(extraout_var,bVar2) != 0) break;
|
|
uVar22 = uVar22 + 1;
|
|
} while (uVar22 < 4);
|
|
local_abc = 2.38221e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_abc));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_abc),1.0,2,0,1.0,0.0);
|
|
uVar22 = Random();
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &this->_pos;
|
|
in_stack_ffffe82c = 0x31;
|
|
in_stack_ffffe828 = 1000;
|
|
in_stack_ffffe824 = 0x79506a;
|
|
in_stack_ffffe840 =
|
|
(Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x31,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar22);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795070);
|
|
iVar4 = __RTDynamicCast();
|
|
*GHIDRA_CAST<undefined4 *>((iVar4 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar4 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar4 + 0x358)) = 0x3f800000;
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(tempEffects);
|
|
local_a0d = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x3d);
|
|
bVar2 = HasCollectible(this,0x226,0);
|
|
if ((((((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x226), bVar2 == 0)) ||
|
|
(local_a0d != 0)) &&
|
|
((*GHIDRA_CAST<char *>(g_game->_room) != '\0' &&
|
|
(0x1e < g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f0)))))) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(10,0), bVar2 != 0)) &&
|
|
((uVar22 = Random(), uVar22 % 5 == 0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1bb0)) != 6)))) {
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x3e8);
|
|
in_stack_ffffe83c = &momFootQuery;
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x795164);
|
|
queryList = EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),in_stack_ffffe83c,1000,0x1d,
|
|
-1,0,0);
|
|
uVar22 = queryList->_size;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(momFootQuery)) + 0x0))) == '\0') {
|
|
local_14 = 0.0;
|
|
tracked_alloc(1,momFootQuery._data,0);
|
|
local_14 = -NAN;
|
|
}
|
|
if (uVar22 < 2) {
|
|
uVar22 = Random();
|
|
local_a3c = GHIDRA_CAST<Entity *>((this->_pos).x);
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((this->_pos).y);
|
|
tmpVec = MusicManager::RandomVector(&stompRandomDir);
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>((tmpVec->x * 40.0));
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>((tmpVec->y * 40.0));
|
|
uVar5 = Random();
|
|
pvVar28 = (void *)((float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)])
|
|
* 2.3283064e-10);
|
|
(GHIDRA_CAST<Vector *>((&stompPos)))->Vector::Vector((float)local_a3c + (float)local_a28 * (float)pvVar28,
|
|
(float)local_a04 * (float)pvVar28 + (float)local_a08);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&stompPos);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(&DAT_0000001d);
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x3e8);
|
|
in_stack_ffffe834 = GHIDRA_CAST<Vector *>(0x795279);
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x1d,GHIDRA_CAST<Vector *>(in_stack_ffffe840),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
0,uVar22);
|
|
tmpVec = (GHIDRA_CAST<Entity *>((queryList)))->Entity::Position(&stompEffectPos);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetTargetPosition(*tmpVec);
|
|
queryList->SetCollisionDamage();
|
|
queryList->Update();
|
|
}
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar4 == 0x16) {
|
|
iVar4 = (GHIDRA_CAST<Game *>(()))->Game::GetFrameCount();
|
|
if ((0x7080 < iVar4) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(300,0), bVar2 != 0)) {
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&challengeDamageSource)))->EntityRef::EntityRef();
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x3f800000);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795311);
|
|
(*pcVar1)();
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (((iVar4 == 0x18) && (this->_dead == 0)) && (this->_numCoins < 1)) {
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x24);
|
|
(GHIDRA_CAST<EntityRef *>((&challengeKillSource)))->EntityRef::EntityRef();
|
|
(*pcVar1)();
|
|
(GHIDRA_CAST<EntityRef *>((&challengeDeathSource)))->EntityRef::EntityRef();
|
|
challengeDeathSource._type = 0x125;
|
|
challengeDeathSource._variant = 0;
|
|
set_last_damage(this,0,&challengeDeathSource);
|
|
}
|
|
}
|
|
if (this->_playerType == 0xb) {
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
bVar2 = (GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::Unlocked(0x14b);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0xd6), bVar2 == 0))
|
|
{
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0xd6,1,1);
|
|
}
|
|
}
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
pvVar7 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0x41);
|
|
if ((pvVar7 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 8)) % 5 == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::get_random_pickup_position(room,&trollBombPos,0,0);
|
|
uVar22 = Random();
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &trollBombPos;
|
|
in_stack_ffffe82c = 3;
|
|
in_stack_ffffe828 = 4;
|
|
in_stack_ffffe824 = 0x79543a;
|
|
in_stack_ffffe838 = this;
|
|
in_stack_ffffe840 =
|
|
(Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,3,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar22);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795440);
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
if (local_a28 != GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
tmpFlags = GetBombFlags(this,&cookbookBombFlags,0);
|
|
pvVar28 = *(void **)&tmpFlags->_l;
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x795473);
|
|
FUN_006a6910();
|
|
}
|
|
}
|
|
pvVar7 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0xa0);
|
|
if ((pvVar7 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 8)) % 5 == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
currentRoom = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
tmpVec = (GHIDRA_CAST<Room *>((currentRoom)))->Room::GetRandomPosition(&randomRoomPos,20.0);
|
|
Room::FindFreePickupSpawnPosition(room,&spawnPos,tmpVec,0.0,0,0,0);
|
|
iVar4 = Isaac::Random(2);
|
|
if (iVar4 == 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Room *>((room)))->Room)::GetEntities();
|
|
local_a0c = pEVar8;
|
|
FUN_00424510();
|
|
local_14 = 1.4013e-45;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(pEVar8))))->EntityList::Size();
|
|
FUN_0042c820();
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_a0c))))->EntityList::Size();
|
|
pEVar8 = local_a0c;
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Position(&enemyPos);
|
|
local_a20 = tmpVec->x;
|
|
pvVar28 = (void *)tmpVec->y;
|
|
local_a1c = pvVar28;
|
|
iVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(*tmpVec);
|
|
pEVar23 = local_9fc;
|
|
if (iVar4 == 0) {
|
|
std::vector<int>::operator_index();
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
}
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1))));
|
|
local_9fc = pEVar23;
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(pEVar8))))->EntityList)::Size();
|
|
} while (pEVar23 < puVar10);
|
|
this = savedPlayer;
|
|
}
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((targetIndices)))->std::vector::size();
|
|
if (iVar4 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((targetIndices)))->std::vector::size();
|
|
Isaac::Random(iVar4);
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Position(&targetEnemyPos);
|
|
tmpVec = Room::FindFreePickupSpawnPosition(room,&freeSpawnPos,tmpVec,0.0,0,0,0);
|
|
(GHIDRA_CAST<Vector *>((&spawnPos)))->Vector::operator_assign(tmpVec);
|
|
}
|
|
local_14 = -NAN;
|
|
FID_conflict__Tidy(targetIndices);
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
pos.y = spawnPos.y;
|
|
pos.x = spawnPos.x;
|
|
iVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos);
|
|
if (iVar4 == 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
currentRoom = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<Room *>((currentRoom)))->Room::GetGridIndex(&spawnPos);
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SetGridPath(iVar4,900);
|
|
}
|
|
uVar22 = Random();
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&spawnPos);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(&DAT_00000013);
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x3e8);
|
|
in_stack_ffffe834 = GHIDRA_CAST<Vector *>(0x7956f9);
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x13,GHIDRA_CAST<Vector *>(in_stack_ffffe840),&g_vectorZero,GHIDRA_CAST<Entity *>(this),0
|
|
,uVar22);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(queryList) + 0x40);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity *>((queryList)))->Entity::CollisionDamage();
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>((float)fVar27);
|
|
FUN_0060d040();
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(((float)pvVar28 + (float)local_a04));
|
|
(*pcVar1)();
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(savedPlayer));
|
|
pEVar8 = local_a34;
|
|
this = savedPlayer;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0xb4);
|
|
iVar4 = FUN_00930a00();
|
|
if ((iVar4 != 0) && (*GHIDRA_CAST<int *>((iVar4 + 8)) % 5 == 0)) {
|
|
(GHIDRA_CAST<Color *>((fartColor)))->Color::Color();
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&this->_pos);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(GHIDRA_CAST<Vector *>(in_stack_ffffe840),100.0,GHIDRA_CAST<Entity *>(this),1.0,0,color_01);
|
|
Game::ButterBeanFart(g_game,GHIDRA_CAST<Vector *>(in_stack_ffffe840),120.0,GHIDRA_CAST<Entity *>(this),0,1);
|
|
uVar22 = Random();
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x8d);
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x3e8);
|
|
in_stack_ffffe834 = GHIDRA_CAST<Vector *>(0x795805);
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x8d,GHIDRA_CAST<Vector *>(in_stack_ffffe840),&g_vectorZero,GHIDRA_CAST<Entity *>(this),0
|
|
,uVar22);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x5a);
|
|
effect->Update();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0);
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(FUN_00930a00());
|
|
if ((local_a28 != GHIDRA_CAST<Entity_Tear *>(0x0)) && (((GHIDRA_CAST<GridEntity *>(local_a28))->_desc)._variant % 10 == 0))
|
|
{
|
|
iVar4 = this->_playerType;
|
|
uVar22 = Random();
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &this->_pos;
|
|
in_stack_ffffe82c = 9;
|
|
if (iVar4 != 0x19) {
|
|
in_stack_ffffe82c = 0;
|
|
}
|
|
in_stack_ffffe828 = 4;
|
|
in_stack_ffffe824 = 0x7958a0;
|
|
in_stack_ffffe838 = this;
|
|
in_stack_ffffe840 =
|
|
(Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,in_stack_ffffe82c,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,
|
|
uVar22);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x7958a6);
|
|
bomb = GHIDRA_CAST<Entity_Bomb *>(__RTDynamicCast());
|
|
if (bomb != GHIDRA_CAST<Entity_Bomb *>(0x0)) {
|
|
GetBombFlags(this,&spawnedBombFlags,0);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x7958d1);
|
|
FUN_006a6910();
|
|
if (1 < (GHIDRA_CAST<GridEntityDesc *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a28)) + 0x4)))))->_type) {
|
|
tmpFlags2 = &g_tearFlagHoming;
|
|
tmpFlags = (GHIDRA_CAST<Entity_Bomb *>((bomb)))->Entity_Bomb::Flags(bombFlagsCopy);
|
|
BitSet128::operator_or(&homingBombFlags,tmpFlags,tmpFlags2);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x79590f);
|
|
FUN_006a6910();
|
|
FUN_006a6930();
|
|
}
|
|
}
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x1c);
|
|
iVar4 = FUN_00930a00();
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x41200000);
|
|
if ((iVar4 != 0) && ((*GHIDRA_CAST<byte *>((iVar4 + 8)) & 1) == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Room *>((room)))->Room)::GetGridIndex(&this->_pos);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Room *>((room)))->Room)::GetGridEntity(GHIDRA_UINT(local_a00));
|
|
if ((local_a28 == GHIDRA_CAST<Entity_Tear *>(0x0)) ||
|
|
((iVar4 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_a28))))->GridEntity::GetType(), iVar4 == 1 ||
|
|
(iVar4 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_a28))))->GridEntity::GetType(), iVar4 == 10)))) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
|
|
if (bVar2 == 0) {
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(GetPillRNG(this,0x1e));
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
bVar2 = HasCollectible(this,0x21f,0);
|
|
if (bVar2 == 0) {
|
|
tempEffects = GHIDRA_CAST<TemporaryEffects *>(GetEffects(this));
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x21f);
|
|
if (bVar2 != 0) goto LAB_00795a1c;
|
|
}
|
|
else {
|
|
LAB_00795a1c:
|
|
rngPtr = GetCollectibleRNG(this,0x21f);
|
|
uVar22 = (GHIDRA_CAST<RNG *>((rngPtr)))->RNG::RandomInt(100);
|
|
if (uVar22 < 0x21) {
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(&DAT_00000006);
|
|
}
|
|
local_9fc = pEVar23;
|
|
}
|
|
bVar2 = HasTrinket(this,0x5b,0);
|
|
if (bVar2 != 0) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x21);
|
|
iVar4 = GetTrinketMultiplier(this,0x5b);
|
|
if (iVar4 == 2) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x42);
|
|
}
|
|
else if (iVar4 == 3) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x64);
|
|
}
|
|
rngPtr = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
fVar11 = (float)(GHIDRA_CAST<RNG *>((rngPtr)))->RNG::RandomInt(100);
|
|
if (GHIDRA_UINT(fVar11) < local_9fc) {
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(&DAT_00000005);
|
|
}
|
|
local_9fc = pEVar23;
|
|
}
|
|
bVar2 = HasCollectible(this,0xca,0);
|
|
if (bVar2 != 0) {
|
|
uVar22 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_a0c))))->RNG::RandomInt(100);
|
|
if (GHIDRA_INT((uVar22 - GHIDRA_INT((this->_luck * 10.0)))) < 0x1a) {
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(0x3);
|
|
}
|
|
local_9fc = pEVar23;
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar22 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_a0c))))->RNG::Next();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SpawnGridEntity(GHIDRA_INT(local_a00),0xe,GHIDRA_UINT(local_9fc),uVar22,0);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795b43);
|
|
Game::ButterBeanFart(g_game,&this->_pos,120.0,GHIDRA_CAST<Entity *>(this),0,0);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x795b60);
|
|
play_sound_with_fart_seed(0x25,1.0,2,0,1.0);
|
|
ShootCandle(this,&g_vectorZero);
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
}
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(299);
|
|
if ((bVar2 != 0) &&
|
|
(pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(299),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) != 0)) {
|
|
local_9fc = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(299);
|
|
musicManager = GHIDRA_CAST<MusicManager *>(MusicManager)::MusicManager();
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::PitchSlide();
|
|
goto LAB_00795cf2;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x5d);
|
|
if (bVar2 != 0) {
|
|
local_9fc = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0x5d);
|
|
musicManager = GHIDRA_CAST<MusicManager *>(MusicManager)::MusicManager();
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::PitchSlide();
|
|
goto LAB_00795cf2;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x12a);
|
|
if (bVar2 != 0) {
|
|
local_9fc = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0x12a);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x18,0);
|
|
if ((bVar2 != 0) && (iVar4 = Isaac::Random(2), iVar4 != 0)) {
|
|
musicManager = GHIDRA_CAST<MusicManager *>(MusicManager)::MusicManager();
|
|
random_float();
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::PitchSlide();
|
|
music = GHIDRA_CAST<Music *>(MusicManager)::MusicManager();
|
|
iVar4 = Isaac::Random(3);
|
|
if (iVar4 == 0) {
|
|
fVar11 = 0.0;
|
|
}
|
|
else {
|
|
fVar11 = 1.0;
|
|
}
|
|
(GHIDRA_CAST<Music *>((music)))->Music::VolumeSlide(fVar11,0.08);
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
}
|
|
goto LAB_00795cf2;
|
|
}
|
|
}
|
|
else {
|
|
local_9fc = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0x4d);
|
|
musicManager = GHIDRA_CAST<MusicManager *>(MusicManager)::MusicManager();
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::PitchSlide();
|
|
LAB_00795cf2:
|
|
if (local_9fc != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pvVar28 = (local_9fc->_damageEvents)._begin;
|
|
if (GHIDRA_INT(pvVar28) < 0x1f) {
|
|
local_9fc = *GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>(this) + 0x3c));
|
|
if ((GHIDRA_UINT(pvVar28) & 1) == 0) {
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
}
|
|
else {
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(FUN_00757980());
|
|
}
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795e7b);
|
|
(*(code *)local_9fc)();
|
|
}
|
|
else {
|
|
uVar22 = GHIDRA_UINT(pvVar28) & 0x80000003;
|
|
bVar26 = uVar22 == 0;
|
|
if (GHIDRA_INT(uVar22) < 0) {
|
|
bVar26 = (uVar22 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (bVar26) {
|
|
(GHIDRA_CAST<Color *>((&flashColor)))->Color::Color();
|
|
iVar4 = Isaac::Random(6);
|
|
if (iVar4 == 0) {
|
|
iVar20 = 0;
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x32);
|
|
iVar4 = 0xff;
|
|
blue = 0;
|
|
}
|
|
else {
|
|
iVar4 = Isaac::Random(5);
|
|
if (iVar4 == 0) {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x32);
|
|
iVar20 = 0xff;
|
|
blue = 0;
|
|
iVar4 = 0;
|
|
}
|
|
else {
|
|
iVar4 = Isaac::Random(4);
|
|
if (iVar4 == 0) {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x32);
|
|
iVar4 = 0;
|
|
LAB_00795ddd:
|
|
blue = 0xff;
|
|
iVar20 = 0;
|
|
}
|
|
else {
|
|
iVar4 = Isaac::Random(3);
|
|
if (iVar4 == 0) {
|
|
iVar4 = 0xff;
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x46);
|
|
iVar20 = 0xff;
|
|
blue = 0;
|
|
}
|
|
else {
|
|
iVar4 = Isaac::Random(2);
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x46);
|
|
if (iVar4 != 0) {
|
|
iVar4 = 0xff;
|
|
goto LAB_00795ddd;
|
|
}
|
|
iVar20 = 0xff;
|
|
blue = 0xff;
|
|
iVar4 = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(&flashColor))))->KColor::FromRGBA255(iVar4,iVar20,blue,0xff);
|
|
FUN_00683010();
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&flashColor);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795e1e);
|
|
this->SetColor();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0xd6);
|
|
if ((((pvVar28 != (void *)0x0) ||
|
|
((bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000), bVar2 != 0 &&
|
|
((this->_entityRef2)._entity == this)))) ||
|
|
((this->_playerType == 0x16 && (0 < this->_maggyHealthDrainCooldown)))) &&
|
|
(iVar4 = Isaac::Random(5), iVar4 == 0)) {
|
|
uVar22 = Random();
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &this->_pos;
|
|
in_stack_ffffe82c = 0x2e;
|
|
in_stack_ffffe828 = 1000;
|
|
in_stack_ffffe824 = 0x795f02;
|
|
in_stack_ffffe838 = this;
|
|
in_stack_ffffe840 =
|
|
(Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar22);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795f08);
|
|
queryList = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
fVar11 = random_float();
|
|
anemicScaleFactor = (void *)(fVar11 * 0.5 + 0.2);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&anemicCreepScale,GHIDRA_CAST<float *>(&anemicScaleFactor));
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
queryList->Update();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0x146);
|
|
if (pvVar28 == (void *)0x0) {
|
|
if (this->_breathOfLifeEffect != (EntityPtr)0x0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_breathOfLifeEffect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(0x0));
|
|
(GHIDRA_CAST<EntityPtr *>((&this->_breathOfLifeEffect)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else if (this->_activeDesc[0]._item == 0x146) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) == 1) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::RemoveCollectibleEffect(0x146,-1);
|
|
ResetDamageCooldown(this);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&breathOfLifeSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(0x0));
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x3f800000);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x795fc6);
|
|
(*pcVar1)();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::AddCollectibleEffect(0x146,1,1);
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::RemoveCollectibleEffect(0x146,-1);
|
|
}
|
|
Config::GetCollectibles();
|
|
iVar4 = FUN_004f8930();
|
|
if (iVar4 != 0) {
|
|
level = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
bVar2 = (GHIDRA_CAST<Level *>((level)))->Level::HasMirrorDimension();
|
|
if (bVar2 != 0) {
|
|
level = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
bVar2 = (GHIDRA_CAST<Level *>((level)))->Level::GetStateFlag(0x17);
|
|
if (bVar2 != 0) {
|
|
local_a28 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetNullEffect(0x74);
|
|
if (local_a28 == GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
LAB_007960af:
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::AddNullEffect(0x74,1,1);
|
|
if (local_a28 != GHIDRA_CAST<Entity_Tear *>(0x0)) goto LAB_007960c6;
|
|
iVar4 = 0;
|
|
}
|
|
else {
|
|
if (((GHIDRA_CAST<GridEntity *>(local_a28))->_desc)._variant == 1) {
|
|
if (5 < ((GHIDRA_CAST<GridEntity *>(local_a28))->_desc)._type) {
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&mirrorDamageSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(0x0));
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x3f800000);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x7960a9);
|
|
(*pcVar1)();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&this->_temporaryeffects);
|
|
}
|
|
goto LAB_007960af;
|
|
}
|
|
LAB_007960c6:
|
|
iVar4 = (GHIDRA_CAST<GridEntityDesc *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a28)) + 0x4)))))->_type;
|
|
}
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(Math)::clamp(0.0,1.0,1.0 - (float)iVar4 / 6.0);
|
|
if ((float)local_9fc < 0.99) {
|
|
FUN_00757980();
|
|
(GHIDRA_CAST<Color *>((&mirrorFadeColor)))->Color::Color();
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(Math)::lerp(0.6,1.0,(float)local_9fc,0);
|
|
Math::lerp(0.5,1.0,(float)local_9fc,0);
|
|
(GHIDRA_CAST<Color *>((aCStackY_2e04 + 0x81)))->Color::Color();
|
|
in_stack_ffffe824 = 0x796199;
|
|
tmpColor = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Color *>((&mirrorFadeColor)))->Color::operator_assign(tmpColor);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&mirrorFadeColor);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x7961c3);
|
|
this->SetColor();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(GetActiveItemSlot(this,0x146));
|
|
if (-1 < GHIDRA_INT(local_a28)) {
|
|
iVar4 = GetActiveMaxCharge(this,GHIDRA_INT(local_a28));
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(this->_activeDesc[GHIDRA_INT(local_a28)]._charge);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(((float)GHIDRA_INT(local_a28) / (float)iVar4));
|
|
if ((float)local_9fc < 0.99) {
|
|
FUN_00757980();
|
|
(GHIDRA_CAST<Color *>((chargeFadeColor)))->Color::Color();
|
|
if ((local_a28 == GHIDRA_CAST<Entity_Tear *>(0x0)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x146),
|
|
bVar2 != 0)) {
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
fVar11 = sinf_wrapper((float)iVar4 * 3.1415927 * 0.5);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((fVar11 * 0.5 + 0.5));
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(Math)::lerp(0.6,1.0,(float)local_9fc,0);
|
|
Math::lerp(0.5,1.0,(float)local_9fc,0);
|
|
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color((float)local_9fc * 0.25,(float)local_9fc * 0.35);
|
|
}
|
|
else {
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(Math)::lerp(0.6,1.0,(float)local_9fc,0);
|
|
Math::lerp(0.5,1.0,(float)local_9fc,0);
|
|
(GHIDRA_CAST<Color *>((aCStackY_2e04 + 0x81)))->Color::Color();
|
|
}
|
|
in_stack_ffffe824 = 0x7963b7;
|
|
tmpColor = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Color *>((chargeFadeColor)))->Color::operator_assign(tmpColor);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(chargeFadeColor);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x7963e1);
|
|
this->SetColor();
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0xbf,0);
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (iVar4 % 0xb4 == 0) {
|
|
AddDollarBillEffect(this);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0xda,0);
|
|
if ((bVar2 != 0) && (bVar2 = HasFullHearts(this), bVar2 == 0)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x708,0);
|
|
if (bVar2 == 0) goto LAB_00796537;
|
|
iVar4 = Isaac::Random(2);
|
|
bVar2 = iVar4 != 0;
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(900,0);
|
|
}
|
|
if (bVar2 != 0) {
|
|
AddHearts(this,1,0,0);
|
|
iVar4 = 0x9d;
|
|
if (this->_playerType == 0x16) {
|
|
iVar4 = 0x266;
|
|
}
|
|
play_sound_with_fart_seed(iVar4,1.0,2,0,1.0);
|
|
uVar22 = Random();
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &this->_pos;
|
|
in_stack_ffffe82c = 0x31;
|
|
in_stack_ffffe828 = 1000;
|
|
in_stack_ffffe824 = 0x7964ff;
|
|
in_stack_ffffe840 =
|
|
(Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x31,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar22);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x796505);
|
|
pvVar28 = (void *)__RTDynamicCast();
|
|
(GHIDRA_CAST<Vector *>((&heartOffset)))->Vector::Vector(0.0,-24.0);
|
|
FUN_004563c0();
|
|
set_field_358(pvVar28,1.0);
|
|
}
|
|
}
|
|
LAB_00796537:
|
|
bVar2 = HasCollectible(this,0xe7,0);
|
|
if (((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0), bVar2 != 0)) &&
|
|
(uVar22 = Isaac::Random(5), 1 < uVar22)) {
|
|
uVar22 = Random();
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &this->_pos;
|
|
in_stack_ffffe82c = 0x2d;
|
|
in_stack_ffffe828 = 1000;
|
|
in_stack_ffffe824 = 0x7965a8;
|
|
in_stack_ffffe838 = this;
|
|
in_stack_ffffe840 =
|
|
(Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2d,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar22);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x7965ae);
|
|
queryList = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
fVar11 = random_float();
|
|
tarScaleFactor = fVar11 * 0.5 + 0.2;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&tarCreepScale,&tarScaleFactor);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
queryList->Update();
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasTrinketEffect(0x45);
|
|
if (((bVar2 == 0) && (bVar2 = HasTrinket(this,0x45,0), bVar2 != 0)) &&
|
|
((bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(300,0), bVar2 != 0 &&
|
|
(iVar4 = Isaac::Random(5), iVar4 == 0)))) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetTrinket(0x45);
|
|
(GHIDRA_CAST<TemporaryEffect *>((polaroidEffect)))->TemporaryEffect::TemporaryEffect(configItem);
|
|
iVar4 = GetTrinketMultiplier(this,0x45);
|
|
iVar20 = Isaac::Random(5);
|
|
polaroidEffectCooldown = iVar4 * (iVar20 + 3) * 0x1e;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(polaroidEffect,1,1);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
pvVar28 = (void *)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((pvVar28)))->std::vector::size();
|
|
if (iVar4 != 0) {
|
|
uVar22 = 0;
|
|
do {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
local_9fc = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::GetPlayer(uVar22);
|
|
if ((local_9fc != this) &&
|
|
(pEVar23 = GHIDRA_CAST<Entity_Player *>(EntityPtr)::Ref(), local_9fc != pEVar23)) {
|
|
(GHIDRA_CAST<EntityRef *>((&confusionSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_9fc))))->Entity::AddConfusion(&confusionSource,0x5a,0);
|
|
}
|
|
uVar22 = uVar22 + 1;
|
|
pvVar28 = (void *)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
uVar5 = (GHIDRA_CAST<std::vector *>((pvVar28)))->std::vector::size();
|
|
} while (uVar22 < uVar5);
|
|
}
|
|
}
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(299);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01)) + 0x0))) = ZEXT812(0x40000000);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x4))) = 0;
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(flags_01._l);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(this,299,0);
|
|
if (((bVar2 != 0) || (iVar4 = GetZodiacEffect(this), iVar4 == 299)) &&
|
|
(flags_01 = (BitSet128)ZEXT416(GHIDRA_UINT(this->_taurusSpeedBonus)), this->_taurusSpeedBonus != 0.0
|
|
)) {
|
|
this->_taurusSpeedBonus = 0.0;
|
|
this->_cacheFlags = this->_cacheFlags | 0x10;
|
|
LAB_00796889:
|
|
EvaluateItems(this);
|
|
}
|
|
}
|
|
else {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetAliveEnemiesCount();
|
|
if ((iVar4 != 0) ||
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01)) + 0x0))) = ZEXT812(0x40000000), (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x4))) = 0,
|
|
(float)flags_01._l < this->_movespeed || (float)flags_01._l == this->_movespeed)) {
|
|
flags_01 = (BitSet128)ZEXT416(GHIDRA_UINT(this->_movespeed));
|
|
if ((this->_movespeed < 2.0) ||
|
|
(pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(299),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) != 0)) {
|
|
fVar11 = this->_taurusSpeedBonus + 0.0022222223;
|
|
flags_01 = (BitSet128)ZEXT416(GHIDRA_UINT(fVar11));
|
|
this->_taurusSpeedBonus = fVar11;
|
|
this->_cacheFlags = this->_cacheFlags | 0x1010;
|
|
goto LAB_00796889;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(299,1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(299);
|
|
(GHIDRA_CAST<TemporaryEffect *>((taurusEffect)))->TemporaryEffect::TemporaryEffect(configItem);
|
|
taurusEffectCooldown = 0xb4;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddEffect(taurusEffect,1,1);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(299,1);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x134,0);
|
|
if (bVar2 == 0) {
|
|
iVar4 = GetZodiacEffect(this);
|
|
if (iVar4 == 0x134) goto LAB_007968b4;
|
|
}
|
|
else {
|
|
LAB_007968b4:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = Isaac::Random(5);
|
|
if (iVar4 != 0) {
|
|
iVar4 = Isaac::Random(2);
|
|
GetTearHitParams(this,&aquariusTearParams,1,(this->_meleeDamage * 0.666) / this->_damage,
|
|
(-GHIDRA_UINT((iVar4 != 0)) & 2) - 1,GHIDRA_CAST<Entity *>(0x0));
|
|
uVar22 = Random();
|
|
in_stack_ffffe834 = GHIDRA_CAST<Vector *>(0x796943);
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x36,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar22);
|
|
fVar11 = random_float();
|
|
aquariusScaleFactor = fVar11 * 0.5 + 0.2;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&aquariusCreepScale,&aquariusScaleFactor);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
queryList->SetCollisionDamage();
|
|
FUN_00665b80();
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(&aquariusTearParams._tearColor);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
queryList->SetColor();
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x7969d3);
|
|
queryList->Update();
|
|
flags_01 = aquariusTearParams._flags;
|
|
}
|
|
}
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
bVar2 = HasCollectible(this,0x199,0);
|
|
if (bVar2 != 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x199);
|
|
if (this->_redHearts < 1) {
|
|
if (bVar2 != 0) goto LAB_00796a3f;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddCollectibleEffect(0x199,1,1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x12);
|
|
AddCostume(this,configItem,bVar2);
|
|
}
|
|
else if (bVar2 != 0) {
|
|
LAB_00796a3f:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x4b0,0);
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::IsClear();
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') goto LAB_00796ab9;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x3a);
|
|
(GHIDRA_CAST<TemporaryEffect *>((vesselShieldEffect)))->TemporaryEffect::TemporaryEffect(configItem);
|
|
vesselShieldCooldown = 300;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddEffect(vesselShieldEffect,1,1);
|
|
}
|
|
}
|
|
}
|
|
LAB_00796ab9:
|
|
bVar2 = HasPlayerForm(this,9);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(&DAT_0000000f);
|
|
if (((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x708,0), bVar2 != 0)) &&
|
|
(iVar4 = Isaac::Random(0xf), iVar4 == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::IsClear();
|
|
if (bVar2 == 0) {
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(local_afa);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x796b1a);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>(in_stack_ffffe840),0x24,1,-1,0);
|
|
}
|
|
}
|
|
bVar2 = HasPlayerForm(this,6);
|
|
if ((bVar2 != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434)))) == 0)) {
|
|
uVar22 = Random();
|
|
in_stack_ffffe828 = 8;
|
|
in_stack_ffffe824 = 0x796b6a;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(8,0,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),3,uVar22);
|
|
queryList = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&knifeOffset)))->Vector::Vector(0.0,-10.0);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetPositionOffset(tmpVec);
|
|
(GHIDRA_CAST<Color *>((&tearColorCopy)))->Color::operator_assign(&this->_tearColor);
|
|
FUN_007cf940();
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(flags_01._l);
|
|
fVar11 = (GHIDRA_CAST<Color *>((&tearColorCopy)))->Color::A();
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(&tearColorCopy))))->Font::SetLineHeightModifier(fVar11 * (float)local_a08);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&tearColorCopy);
|
|
queryList->SetColor();
|
|
in_stack_ffffe82c = 0x796c1d;
|
|
FUN_005cd5c0();
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(this->_damage);
|
|
flags_01 = (BitSet128)ZEXT416(in_stack_ffffe83c);
|
|
queryList->SetCollisionDamage();
|
|
in_stack_ffffe834 = GHIDRA_CAST<Vector *>(0x200000);
|
|
in_stack_ffffe830 = GHIDRA_CAST<Vector *>(0x796c42);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddEntityFlags(0x200000);
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1434)))))))->EntityPtr::SetReference(queryList);
|
|
in_stack_ffffe838 = GHIDRA_CAST<Entity_Player *>(0x796c58);
|
|
queryList->Update();
|
|
}
|
|
bVar2 = HasTrinket(this,0x19,0);
|
|
if ((bVar2 != 0) && (this->_variant == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Room *>((room)))->Room)::GetGridIndex(&this->_pos);
|
|
local_a08 = pEVar23;
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
pGVar12 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridEntity(GHIDRA_UINT(pEVar23));
|
|
GetTrinketMultiplier(this,0x19);
|
|
HasGoldenTrinket(this,0x19);
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
if (((iVar4 % 900 == 0) && (iVar4 = Isaac::Random(2), iVar4 == 0)) &&
|
|
(((pGVar12 == GHIDRA_CAST<GridEntity *>(0x0) || (iVar4 = (GHIDRA_CAST<GridEntity *>((pGVar12)))->GridEntity::GetType(), iVar4 == 1)) ||
|
|
(iVar4 = (GHIDRA_CAST<GridEntity *>((pGVar12)))->GridEntity::GetType(), iVar4 == 10)))) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
|
|
if (bVar2 == 0) {
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
bVar2 = HasGoldenTrinket(this,0x19);
|
|
if (bVar2 != 0) {
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(0x3);
|
|
}
|
|
local_9fc = pEVar23;
|
|
bVar2 = HasTrinket(this,0x5b,0);
|
|
if (bVar2 != 0) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x21);
|
|
iVar4 = GetTrinketMultiplier(this,0x5b);
|
|
if (iVar4 == 2) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x42);
|
|
}
|
|
else if (iVar4 == 3) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x64);
|
|
}
|
|
rngPtr = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
fVar11 = (float)(GHIDRA_CAST<RNG *>((rngPtr)))->RNG::RandomInt(100);
|
|
if (GHIDRA_UINT(fVar11) < local_9fc) {
|
|
pEVar23 = GHIDRA_CAST<Entity_Player *>(&DAT_00000005);
|
|
}
|
|
local_9fc = pEVar23;
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
rngPtr = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar22 = (GHIDRA_CAST<RNG *>((rngPtr)))->RNG::Next();
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x796de2);
|
|
in_stack_ffffe840 = local_a08;
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SpawnGridEntity(GHIDRA_INT(local_a08),0xe,GHIDRA_UINT(local_9fc),uVar22,0);
|
|
goto LAB_00796de7;
|
|
}
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
if ((iVar4 % 0x708 == 0) && (iVar4 = Isaac::Random(2), iVar4 == 0)) {
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(&this->_pos);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x797184);
|
|
Game::ButterBeanFart(g_game,GHIDRA_CAST<Vector *>(in_stack_ffffe840),120.0,GHIDRA_CAST<Entity *>(this),1,0);
|
|
}
|
|
}
|
|
LAB_00796de7:
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar22 = (GHIDRA_CAST<Room *>((room)))->Room::GetSpawnSeed();
|
|
bVar2 = HasTrinket(this,0x46,0);
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::IsClear();
|
|
if ((bVar2 == 0) &&
|
|
(((bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(900,uVar22 % 0x708), bVar2 != 0 &&
|
|
(iVar4 = Isaac::Random(2), iVar4 == 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x708,uVar22 % 0x708), bVar2 != 0)))) {
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x796e7c);
|
|
play_sound_with_fart_seed(0xb5,0.7,2,0,1.0);
|
|
iVar4 = GetTrinketMultiplier(this,0x46);
|
|
if (0 < iVar4) {
|
|
do {
|
|
ThrowBlueSpider(this,&this->_pos,&g_vectorZero);
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
}
|
|
}
|
|
}
|
|
bVar2 = HasTrinket(this,0x40,0);
|
|
if ((bVar2 != 0) && (iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount(), iVar4 % 0x5a == 0)) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x2e;
|
|
EvaluateItems(this);
|
|
}
|
|
bVar2 = HasPlayerForm(this,4);
|
|
pEVar23 = this;
|
|
if (bVar2 != 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(5,0);
|
|
if (bVar2 != 0) {
|
|
uVar22 = Random();
|
|
in_stack_ffffe834 = &g_vectorZero;
|
|
in_stack_ffffe830 = &this->_pos;
|
|
in_stack_ffffe82c = 0x2e;
|
|
in_stack_ffffe828 = 1000;
|
|
in_stack_ffffe824 = 0x796f36;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,in_stack_ffffe830,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar22);
|
|
queryList = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
fVar11 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x0))) = fVar11 * 0.5 + 0.2;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01)) + 0x4))) = extraout_var_00;
|
|
bobScaleFactor = (float)flags_01._l;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&bobCreepScale,&bobScaleFactor);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(queryList) + 0x3c);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(*pcVar1)();
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x796fc3);
|
|
queryList->Update();
|
|
pEVar23 = savedPlayer;
|
|
in_stack_ffffe838 = this;
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x1a9,0);
|
|
if (bVar2 != 0) {
|
|
uVar22 = 10;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
uVar22 = 0xe;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
outResult = GHIDRA_CAST<TypeDescriptor *>(local_a98);
|
|
uVar39 = 0x797030;
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(outResult),&pEVar23->_pos,200.0,uVar22);
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_14 = 2.8026e-45;
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_a98))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 == 0) {
|
|
LAB_007971e6:
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Type();
|
|
if (iVar4 == 9) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar39 = 0;
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x797223);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast());
|
|
if (local_9fc != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_9fc))))->Entity::Position(&spotlitProjectilePos);
|
|
bVar2 = IsPosInSpotLight(pEVar23,tmpVec);
|
|
if ((bVar2 != 0) &&
|
|
(projectileFlags =
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_9fc))))->Entity_Projectile::ProjectileFlags(),
|
|
(projectileFlags & 0x1000000) == 0)) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_9fc))))->Entity::Velocity(&spotlitProjectileVel);
|
|
projectileSlowFactor = 0.5;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&slowedProjectileVel,&projectileSlowFactor);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_9fc))))->Entity::SetVelocity(tmpVec);
|
|
outResult = GHIDRA_CAST<TypeDescriptor *>(0x7972bb);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_9fc))))->Entity_Projectile::AddProjectileFlags(0x1000000);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Type();
|
|
if (iVar4 == 2) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar39 = 0;
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
in_stack_ffffe83c = GHIDRA_CAST<EntityList_EL *>(0x7972f6);
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
if ((local_a0c != GHIDRA_CAST<Entity_Tear *>(0x0)) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a0c))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(pEVar23)), bVar2 == 0)
|
|
) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a0c))))->Entity::Position(&spotlitTearPos);
|
|
bVar2 = IsPosInSpotLight(pEVar23,tmpVec);
|
|
if (bVar2 != 0) {
|
|
outResult = GHIDRA_CAST<TypeDescriptor *>(0x79734b);
|
|
tmpFlags = GHIDRA_CAST<BitSet128 *>(FUN_00435bc0());
|
|
tmpFlags2 = (GHIDRA_CAST<Entity_Tear *>((local_a0c)))->Entity_Tear::TearFlags(¤tTearFlags);
|
|
tmpFlags = BitSet128::operator_and(&slowFlagMatch,tmpFlags2,tmpFlags);
|
|
bVar2 = (GHIDRA_CAST<BitSet128 *>((tmpFlags)))->BitSet128::IsZero();
|
|
if (bVar2 != 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a0c))))->Entity::Velocity(&spotlitTearVel);
|
|
tearSlowFactor = 0.5;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&slowedTearVel,&tearSlowFactor);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a0c))))->Entity::SetVelocity(tmpVec);
|
|
tmpFlags = GHIDRA_CAST<BitSet128 *>(FUN_00435bc0());
|
|
tmpFlags2 = (GHIDRA_CAST<Entity_Tear *>((local_a0c)))->Entity_Tear::TearFlags(currentTearFlags2);
|
|
tmpFlags = BitSet128::operator_or(&slowedTearFlags,tmpFlags2,tmpFlags);
|
|
flags_01 = *tmpFlags;
|
|
uVar39 = (undefined4)flags_01._l;
|
|
outResult = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x4)));
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(0x797406);
|
|
(GHIDRA_CAST<Entity_Tear *>((local_a0c)))->Entity_Tear::SetTearFlags(flags_01);
|
|
}
|
|
goto LAB_00797406;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Position(&spotlitEnemyPos);
|
|
bVar2 = IsPosInSpotLight(pEVar23,tmpVec);
|
|
if (bVar2 == 0) goto LAB_007971e6;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
queryList = GHIDRA_CAST<Entity *>(*puVar9);
|
|
fVar11 = 1.115285e-38;
|
|
(GHIDRA_CAST<EntityRef *>((&spotlightSlowSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
bVar2 = 0;
|
|
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x28,0x28,0x28);
|
|
color_00._tint[1] = (float)in_stack_ffffe828;
|
|
color_00._tint[0] = (float)in_stack_ffffe824;
|
|
color_00._tint[2] = (float)in_stack_ffffe82c;
|
|
color_00._tint[3] = (float)in_stack_ffffe830;
|
|
color_00._colorize[0] = (float)in_stack_ffffe834;
|
|
color_00._colorize[1] = (float)in_stack_ffffe838;
|
|
color_00._colorize[2] = (float)in_stack_ffffe83c;
|
|
color_00._colorize[3] = (float)in_stack_ffffe840;
|
|
color_00._offset[0] = (float)uVar39;
|
|
color_00._offset[1] = (float)outResult;
|
|
color_00._offset[2] = fVar11;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddSlowing(&spotlightSlowSource,2,0.9,color_00,bVar2);
|
|
}
|
|
else {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
queryList = GHIDRA_CAST<Entity *>(*puVar9);
|
|
std::vector<int>::operator_index();
|
|
iVar4 = FUN_00753710();
|
|
fVar11 = 1.1152604e-38;
|
|
(GHIDRA_CAST<EntityRef *>((&spotlightSlowSourcePvp)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(savedPlayer));
|
|
bVar2 = 1;
|
|
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x28,0x28,0x28);
|
|
color._tint[1] = (float)in_stack_ffffe828;
|
|
color._tint[0] = (float)in_stack_ffffe824;
|
|
color._tint[2] = (float)in_stack_ffffe82c;
|
|
color._tint[3] = (float)in_stack_ffffe830;
|
|
color._colorize[0] = (float)in_stack_ffffe834;
|
|
color._colorize[1] = (float)in_stack_ffffe838;
|
|
color._colorize[2] = (float)in_stack_ffffe83c;
|
|
color._colorize[3] = (float)in_stack_ffffe840;
|
|
color._offset[0] = (float)uVar39;
|
|
color._offset[1] = (float)outResult;
|
|
color._offset[2] = fVar11;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddSlowing(&spotlightSlowSourcePvp,2 - GHIDRA_UINT((iVar4 != 0)),0.9,color,bVar2);
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
LAB_00797406:
|
|
pEVar24 = local_a00;
|
|
}
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar24)) + 0x1))));
|
|
local_a00 = pEVar24;
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_a98))))->EntityList)::Size();
|
|
} while (pEVar24 < puVar10);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_a98)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x1a7,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar23,0x1a7,0);
|
|
if ((bVar2 == 0) && (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1454)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1454)))) + 0x28))();
|
|
}
|
|
}
|
|
else {
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1454))));
|
|
local_a3c = *GHIDRA_CAST<Entity **>(local_a08);
|
|
if (local_a3c == GHIDRA_CAST<Entity *>(0x0)) {
|
|
uVar22 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(7,8,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),3,uVar22);
|
|
queryList = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&haloOffset)))->Vector::Vector(0.0,-20.0);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetPositionOffset(tmpVec);
|
|
pEVar23 = savedPlayer;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(savedPlayer));
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpawnerEntity(GHIDRA_CAST<Entity *>(pEVar23));
|
|
set_field_358(queryList,3000.0);
|
|
pEVar43 = GHIDRA_CAST<Entity *>(0x0);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(queryList) + 0x40);
|
|
iVar4 = Isaac::Random(2);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(newHaloTearParams);
|
|
pTVar13 = GetTearHitParams(savedPlayer,GHIDRA_CAST<TearParams *>(in_stack_ffffe840),3,1.0,iVar4 * 2 + -1,
|
|
pEVar43);
|
|
flags_01 = (BitSet128)ZEXT416(GHIDRA_UINT(pTVar13->_tearDamage));
|
|
(*pcVar1)();
|
|
queryList->Update();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(local_a08))))->EntityPtr::SetReference(queryList);
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
else {
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(local_a3c) + 0x40);
|
|
iVar4 = Isaac::Random(2);
|
|
in_stack_ffffe840 = GHIDRA_CAST<Entity_Player *>(haloTearParams);
|
|
pTVar13 = GetTearHitParams(pEVar23,GHIDRA_CAST<TearParams *>(in_stack_ffffe840),3,1.0,iVar4 * 2 + -1,queryList
|
|
);
|
|
flags_01 = (BitSet128)ZEXT416(GHIDRA_UINT(pTVar13->_tearDamage));
|
|
(*pcVar1)();
|
|
}
|
|
}
|
|
ClampGoldenHearts(pEVar23,0);
|
|
bVar2 = HasCollectible(pEVar23,0x1a4,0);
|
|
dVar29 = (double)(ZEXT48(in_stack_ffffe840) << 0x20);
|
|
if (bVar2 != 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1adc)))) < 1) {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad4))));
|
|
iVar20 = pEVar23->_coopBabyBuffTimers[iVar4 + 0x25];
|
|
while ((iVar20 == 0 && (iVar4 != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8))))))) {
|
|
iVar4 = (iVar4 + 1) % 0x60;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad4)))) = iVar4;
|
|
iVar20 = pEVar23->_coopBabyBuffTimers[iVar4 + 0x25];
|
|
}
|
|
queryList = GHIDRA_CAST<Entity *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))) - iVar4));
|
|
local_a3c = GHIDRA_CAST<Entity *>(&(queryList->_sprite)._animDefaultName);
|
|
if (-1 < GHIDRA_INT(queryList)) {
|
|
local_a3c = queryList;
|
|
}
|
|
dVar29 = (double)(ZEXT48(in_stack_ffffe840) << 0x20);
|
|
if (GHIDRA_INT(local_a3c) < 0x5f) {
|
|
if (((0 < GHIDRA_INT(local_a3c)) &&
|
|
(local_a08 = (Entity_Player *)
|
|
pEVar23->_coopBabyBuffTimers
|
|
[(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))) + 0x5f) % 0x60 + 0x25],
|
|
local_a08 != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a08))))->Entity::IsDead(), cVar3 == '\0')) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a08))))->Entity::Position(&lastTrailPos);
|
|
FUN_00a0ff70();
|
|
dVar29 = (double)(ZEXT48(in_stack_ffffe840) << 0x20);
|
|
if ((float)flags_01._l < 100.0) goto LAB_00797b3b;
|
|
}
|
|
uVar22 = Random();
|
|
pEVar43 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x5c,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,
|
|
uVar22);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast());
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x3c);
|
|
effect->Update();
|
|
pEVar23->_coopBabyBuffTimers[*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))) + 0x25] = GHIDRA_INT(effect);
|
|
std::multiset<unsigned_int>::insert();
|
|
queryList = local_a3c;
|
|
dVar29 = (double)(ZEXT48(pEVar43) << 0x20);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))) = (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))) + 1) % 0x60;
|
|
if (0xb < GHIDRA_INT(local_a3c)) {
|
|
local_a30 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&averagePos))))->EntityPtr::clear();
|
|
dVar29 = (double)(ZEXT48(pEVar43) << 0x20);
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(queryList) / 2));
|
|
if (-1 < GHIDRA_INT(local_a14)) {
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
do {
|
|
if (-1 < GHIDRA_INT(pEVar24)) goto LAB_00797a7b;
|
|
pEVar21 = (Entity_Player *)
|
|
((GHIDRA_INT((&(local_a14->_sprite)._filename + -3)) +
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad4))))) % 0x60);
|
|
local_a3c = (Entity *)
|
|
pEVar23->_coopBabyBuffTimers[GHIDRA_INT((GHIDRA_INT(&pEVar21->_collisionIndex) + 1))];
|
|
local_a00 = pEVar21;
|
|
if (local_a3c == GHIDRA_CAST<Entity *>(0x0)) goto LAB_00797a5e;
|
|
entityColor = GHIDRA_CAST<Color *>((GHIDRA_CAST<Entity *>((local_a3c)))->Entity)::GetColor();
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Color *>((entityColor)))->Color)::A();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0))) = ZEXT812(0x3f000000);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0xc))) = 0;
|
|
if ((float)local_a08 < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0)))) {
|
|
LAB_00797a58:
|
|
pEVar24 = local_a30;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Entity *>((local_a3c)))->Entity::Position(&trailPointPos);
|
|
FUN_00a0ff70();
|
|
if (400.0 <= (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0)))) goto LAB_00797a58;
|
|
local_a30 = pEVar21;
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&farthestPos))))->EntityPtr::clear();
|
|
pEVar24 = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8))));
|
|
auVar32 = ZEXT816(0);
|
|
fVar11 = 0.0;
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
local_a08 = pEVar21;
|
|
if (pEVar21 != pEVar24) {
|
|
do {
|
|
local_a08 = (Entity_Player *)
|
|
pEVar23->_coopBabyBuffTimers
|
|
[GHIDRA_INT((GHIDRA_INT(&pEVar21->_collisionIndex) + 1))];
|
|
if (local_a08 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a08))))->Entity::Position(&trailPos);
|
|
FUN_00a0ff70();
|
|
local_a3c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0)));
|
|
if ((float)local_a0c < (float)local_a3c) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a08))))->Entity::Position(&farthestTrailPos);
|
|
(GHIDRA_CAST<Vector *>((&farthestPos)))->Vector::operator_assign(tmpVec);
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(local_a3c);
|
|
}
|
|
auVar32 = ZEXT416(local_a0c);
|
|
}
|
|
fVar11 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0)));
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar21)) + 0x1)))) % 0x60));
|
|
pEVar24 = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8))));
|
|
} while (pEVar21 != pEVar24);
|
|
pEVar21 = local_a00;
|
|
}
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((fVar11 * 0.5));
|
|
if ((float)local_a0c < 2500.0) {
|
|
local_a30 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
}
|
|
else {
|
|
pvVar28 = (void *)(GHIDRA_INT(pEVar24) - GHIDRA_INT(pEVar21));
|
|
local_a38 = (void *)(GHIDRA_INT(pvVar28) + 0x60);
|
|
if (-1 < GHIDRA_INT(pvVar28)) {
|
|
local_a38 = pvVar28;
|
|
}
|
|
(GHIDRA_CAST<Vector *>((&averagePos)))->Vector::operator_assign(&g_vectorZero);
|
|
local_9fc = pEVar21;
|
|
if (pEVar21 != *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8))))) {
|
|
do {
|
|
if ((Entity *)
|
|
pEVar23->_coopBabyBuffTimers[GHIDRA_INT((GHIDRA_INT(&local_9fc->_collisionIndex) + 1))]
|
|
!= GHIDRA_CAST<Entity *>(0x0)) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>(((Entity *)
|
|
pEVar23->_coopBabyBuffTimers
|
|
[GHIDRA_INT((GHIDRA_INT(&local_9fc->_collisionIndex) + 1))])))->Entity::Position(&trailSumPos);
|
|
(GHIDRA_CAST<Vector *>((&averagePos)))->Vector::operator_add_assign(tmpVec);
|
|
}
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_9fc)) + 0x1)))) % 0x60));
|
|
} while (local_9fc != *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))));
|
|
pEVar21 = local_a00;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0x0))) = SUB124(ZEXT812(0x3f800000),0) / (float)GHIDRA_INT(local_a38);
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0x4))) = SUB128(ZEXT812(0x3f800000),4);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0xc))) = 0;
|
|
invTrailCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0x0)));
|
|
(GHIDRA_CAST<Vector *>((&averagePos)))->Vector::operator_mul_assign(&invTrailCount);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (pEVar21 == *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8))))) goto LAB_00797a58;
|
|
do {
|
|
if ((Entity *)
|
|
pEVar23->_coopBabyBuffTimers[GHIDRA_INT((GHIDRA_INT(&pEVar21->_collisionIndex) + 1))] !=
|
|
GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>(((Entity *)
|
|
pEVar23->_coopBabyBuffTimers
|
|
[GHIDRA_INT((GHIDRA_INT(&pEVar21->_collisionIndex) + 1))])))->Entity::Position(&trailCheckPos);
|
|
FUN_00a0ff70();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0x0))) / (float)local_a0c;
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar33)) + 0x0))) < 0.25) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_9fc)) + 0x1))));
|
|
auVar33 = ZEXT416(GHIDRA_UINT(((float)GHIDRA_INT(local_a38) * 0.25)));
|
|
if ((float)GHIDRA_INT(local_a38) * 0.25 <
|
|
(float)((double)GHIDRA_INT(local_9fc) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_9fc) >> 0x1f)])) {
|
|
local_a30 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
}
|
|
}
|
|
}
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar21)) + 0x1)))) % 0x60));
|
|
pEVar24 = local_a30;
|
|
} while (pEVar21 != *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ad8)))));
|
|
}
|
|
}
|
|
LAB_00797a5e:
|
|
dVar29 = (double)(ZEXT48(pEVar43) << 0x20);
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a14[-1])) + 0x847))));
|
|
} while (-1 < GHIDRA_INT(local_a14));
|
|
if (-1 < GHIDRA_INT(pEVar24)) {
|
|
LAB_00797a7b:
|
|
pEVar8 = local_a0c;
|
|
FUN_00431260();
|
|
local_a14 = pEVar8;
|
|
uVar22 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x5d,&averagePos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22);
|
|
piVar14 = GHIDRA_CAST<int *>(__RTDynamicCast());
|
|
FUN_00435ed0();
|
|
(**(code **)(*piVar14 + 0xc))();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1adc)))) = 0x2d;
|
|
dVar29 = (double)averagePos.x;
|
|
KAGE_LogMessage(1,(byte *)
|
|
"closed black powder circle at %.2f, %.2f with radius %.2f\n");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1adc)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1adc)))) + -1;
|
|
dVar29 = (double)(ZEXT48(in_stack_ffffe840) << 0x20);
|
|
}
|
|
}
|
|
LAB_00797b3b:
|
|
piVar14 = GHIDRA_CAST<int *>(FUN_0042d040());
|
|
if (((piVar14 == GHIDRA_CAST<int *>(0x0)) || (bVar2 = HasCollectible(pEVar23,0x1b8,0), bVar2 == 0)) ||
|
|
(cVar3 = (**(code **)(*piVar14 + 0x3c))(), cVar3 == '\0')) {
|
|
if (pEVar23->_isUrethraBlocked != 0) {
|
|
pEVar23->_isUrethraBlocked = 0;
|
|
}
|
|
}
|
|
else if (((pEVar23->_peeBurstCooldown < 1) && (pEVar23->_isUrethraBlocked == 0)) &&
|
|
(iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount(), pEVar23->_nextUrethraBlockFrame <= iVar4)) {
|
|
pEVar23->_isUrethraBlocked = 1;
|
|
iVar4 = Isaac::Random(3);
|
|
pEVar23->_maxBladderCharge = (iVar4 + 1) * 0x1e;
|
|
pEVar23->_bladderCharge = 0;
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x1ba,0);
|
|
if (bVar2 != 0) {
|
|
cVar3 = FUN_007db360();
|
|
if (cVar3 == '\0') {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x1ba,1);
|
|
pcVar40 = "FloatNoGlow";
|
|
goto LAB_00797c41;
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1ba,1,1);
|
|
pcVar40 = "FloatGlow";
|
|
LAB_00797c41:
|
|
(GHIDRA_CAST<ANM2 *>((&pEVar23->_darkPrincesCrownSprite)))->ANM2::Play(GHIDRA_CAST<byte *>(pcVar40),0);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x19f,0);
|
|
if (bVar2 == 0) {
|
|
tmpVec = &g_vectorZero;
|
|
}
|
|
else {
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&crownOffset)))->Vector::Vector(0.0,-7.0);
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_darkPrincesCrownSprite))))->Sprite::set_offset(tmpVec);
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x201,0);
|
|
if ((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::IsFrame(5,0), bVar2 != 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
pGVar12 = GHIDRA_CAST<GridEntity *>(FUN_00428a60());
|
|
queryList = GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<GridEntity *>((pGVar12)))->GridEntity)::GetSprite();
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>(local_b94))))->EntityList_EL::constructor(queryList);
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_14 = 4.2039e-45;
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_b94))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 != 0) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(pEVar23));
|
|
if (bVar2 == 0) {
|
|
iVar4 = Isaac::Random(700);
|
|
if (iVar4 == 0) {
|
|
iVar4 = Isaac::Random(2);
|
|
if (iVar4 == 0) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
queryList = GHIDRA_CAST<Entity *>(*puVar9);
|
|
(GHIDRA_CAST<EntityRef *>((&charmSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
uVar22 = 0x797d84;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddCharmed(&charmSource,0xdc,0,0);
|
|
dVar29 = (double)((ulonglong)uVar22 << 0x20);
|
|
}
|
|
else {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
queryList = GHIDRA_CAST<Entity *>(*puVar9);
|
|
(GHIDRA_CAST<EntityRef *>((&fearSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddFear(&fearSource,0xdc,0);
|
|
}
|
|
pEVar24 = local_9fc;
|
|
}
|
|
}
|
|
}
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar24)) + 0x1))));
|
|
local_9fc = pEVar24;
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_b94))))->EntityList)::Size();
|
|
} while (pEVar24 < puVar10);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_b94)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x222,0);
|
|
if (bVar2 == 0) {
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x143c)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x143c)))) + 0x28))();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x143c)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(freezeQuery),&pEVar23->_pos,40.0,8);
|
|
local_14 = 5.60519e-45;
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(freezeQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
local_a08 = pEVar24;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 != 0) {
|
|
cVar3 = pEVar24->IsBoss();
|
|
iVar4 = -4;
|
|
if (cVar3 != '\0') {
|
|
iVar4 = -0x32;
|
|
}
|
|
(GHIDRA_CAST<EntityRef *>((&freezeSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a08))))->Entity::AddFreeze(&freezeSource,iVar4,0);
|
|
}
|
|
puVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a14)) + 0x1)));
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(puVar19);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(freezeQuery))))->EntityList)::Size();
|
|
} while (puVar19 < puVar10);
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x143c)))) == 0) {
|
|
uVar22 = Random();
|
|
tmpVec = &pEVar23->_pos;
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,tmpVec,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x143c)))))))->EntityPtr::SetReference(queryList);
|
|
dVar29 = (double)(ZEXT48(tmpVec) << 0x20);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((freezeQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
tempEffects = &pEVar23->_temporaryeffects;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x93);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(pEVar23,0x93,0), bVar2 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x93,-1);
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetNullEffect(0x30);
|
|
if (pvVar28 != (void *)0x0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveNullEffect(0x30,1);
|
|
}
|
|
if (pEVar23->_playerType == 0x25) {
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::Challenge();
|
|
if (iVar4 == 0x2c) {
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(FUN_005b1720());
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetNullEffectNum(0x6d);
|
|
if ((GHIDRA_INT(local_a08) <= iVar4) && ((iVar4 - GHIDRA_INT(local_a08)) % 6 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddNullEffect(0x6d,1,1);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::get_random_pickup_position(room,&darkEsauSpawnPos,1,0);
|
|
uVar22 = Random();
|
|
tmpVec = &darkEsauSpawnPos;
|
|
LAB_007980ae:
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(0x362,0,tmpVec,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22);
|
|
(GHIDRA_CAST<EntityPtr *>((&pEVar23->_darkEsau)))->EntityPtr::SetReference(queryList);
|
|
queryList->Update();
|
|
dVar29 = (double)(ZEXT48(tmpVec) << 0x20);
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x6d);
|
|
if ((bVar2 != 0) &&
|
|
(pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetNullEffect(0x6d),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) < 0xb)) {
|
|
if (pEVar23->_isControlsEnabled != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x6d,-1);
|
|
if (pEVar23->_darkEsau != (EntityPtr)0x0) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(pEVar23->_darkEsau) + 0x28))();
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::get_random_pickup_position(room,&darkEsauRespawnPos,1,0);
|
|
uVar22 = Random();
|
|
tmpVec = &darkEsauRespawnPos;
|
|
goto LAB_007980ae;
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetNullEffect(0x6d);
|
|
if (pvVar28 != (void *)0x0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar28) + 8)) = 10;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
tempEffects = &pEVar23->_temporaryeffects;
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(pEVar23->_redStewBonusDuration);
|
|
if (0 < GHIDRA_INT(local_a08)) {
|
|
stewDurationLeft = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetHitPointsLost();
|
|
stewDurationLeft = pEVar23->_redStewBonusDuration - stewDurationLeft;
|
|
local_b20[1] = 0.0;
|
|
piVar14 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
iVar4 = *piVar14;
|
|
pEVar23->_redStewBonusDuration = iVar4;
|
|
if (iVar4 / 10 < GHIDRA_INT(local_a08) / 10) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(tempEffects))))->Level::SetHeartPicked();
|
|
tempEffects->_cacheFlags = tempEffects->_cacheFlags | 1;
|
|
}
|
|
}
|
|
sfx = MusicManager::SFXManager();
|
|
local_a29 = (GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::IsPlaying(0x251);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c0);
|
|
if ((bVar2 == 0) ||
|
|
(local_a08 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(0x2c0),
|
|
local_a08 == GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
bVar2 = local_a29;
|
|
}
|
|
else {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a08) + 8));
|
|
bVar26 = false;
|
|
if (iVar4 == 0x2d) {
|
|
sfx = MusicManager::SFXManager();
|
|
uVar22 = 0x3f800000;
|
|
(GHIDRA_CAST<SoundEffects *>((sfx)))->SoundEffects::Play(0x251,1.0,0x3c,0,1.0,0.0);
|
|
dVar29 = (double)((ulonglong)uVar22 << 0x20);
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a08) + 8));
|
|
bVar26 = iVar4 == 0x2d;
|
|
}
|
|
bVar2 = !bVar26 && 0x2c < iVar4;
|
|
}
|
|
if (bVar2 != 0) {
|
|
sfx = MusicManager::SFXManager();
|
|
(GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::Stop(0x251);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x280);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(pEVar23,0x280,0), bVar2 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x280,-1);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x3c);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(deflectQuery),&pEVar23->_pos,120.0,10);
|
|
local_14 = 7.00649e-45;
|
|
local_a38 = (void *)0x0;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(deflectQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
local_a00 = pEVar24;
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::FrameCount();
|
|
if (2 < iVar4) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsProjectile();
|
|
if ((bVar2 == 0) ||
|
|
(projectileFlags = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar24))))->Entity_Projectile::ProjectileFlags(),
|
|
(projectileFlags & 0x80000000) != 0)) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsActiveEnemy(0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::HasEntityFlags(0x20000000), bVar2 == 0)) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&pushedEnemyPos);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__sub(&toPushedEnemy,&pEVar23->_pos);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_a98 + 0x10)),&pEVar23->_velocity);
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_a98 + 0x10)))))->Vector)::LengthSquared();
|
|
if (0.01 <= (float)local_a08) {
|
|
local_b2c[0] = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_a98 + 0x10)))))->Vector::LengthSquared();
|
|
local_b2c[0] = 60.0 / local_b2c[0];
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_a98 + 0x10)))))->Vector::operator_mul_assign(local_b2c);
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Velocity(&pushedEnemyVel);
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_a98 + 0x10)))))->Vector::Normalized(&pushDirNorm);
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__unm(&negPushDir);
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Dot(pVVar15);
|
|
if (0.0 < (float)local_a08) {
|
|
pushBoost = (float)local_a08 * 0.25 + 1.0;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_a98 + 0x10)))))->Vector::operator_mul_assign(&pushBoost);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::AddVelocity(GHIDRA_CAST<Vector *>((local_a98 + 0x10)),0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar5 = 0x47;
|
|
uVar22 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::InitSeed();
|
|
(GHIDRA_CAST<RNG *>((&deflectRng)))->RNG::game_constructor(uVar22,uVar5);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&deflectedProjPos);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__sub(&toProjectile,&pEVar23->_pos);
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((&toProjectile)))->Vector)::LengthSquared();
|
|
if (0.01 <= (float)local_a08) {
|
|
local_b20[0] = (GHIDRA_CAST<Vector *>((&toProjectile)))->Vector::LengthSquared();
|
|
local_b20[0] = 60.0 / local_b20[0];
|
|
(GHIDRA_CAST<Vector *>((&toProjectile)))->Vector::operator_mul_assign(local_b20);
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Velocity(&deflectedProjVel);
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Length();
|
|
projectileSpeed = (float)pEVar8;
|
|
if (0.0 < (float)pEVar8) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Velocity(&deflectedProjVel2);
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((&toProjectile)))->Vector)::Dot(tmpVec);
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
if ((float)local_a08 < 0.0) {
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&toProjectile)))->Vector::Normalized(&toProjectileNorm);
|
|
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::Velocity(&projVel);
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__div(&projDir,&projectileSpeed);
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::Rotated(&projPerp,90.0);
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__unm(&negProjPerp);
|
|
fVar11 = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Dot(pVVar15);
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((fVar11 - 0.01));
|
|
fVar11 = (GHIDRA_CAST<RNG *>((&deflectRng)))->RNG::RandomFloat();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>((fVar11 * 0.02 + (float)local_a08));
|
|
local_a14 = pEVar8;
|
|
Math::abs();
|
|
if ((float)pEVar8 < 0.5) {
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(0x3f000000);
|
|
FUN_00753550();
|
|
pEVar8 = local_a14;
|
|
if ((float)local_a14 <= 0.0) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(pEVar24) ^ 0x80000000));
|
|
FUN_00753550();
|
|
tmpVec = &rotatedLeft;
|
|
}
|
|
else {
|
|
local_9fc = pEVar24;
|
|
FUN_00753550();
|
|
tmpVec = &rotatedRight;
|
|
}
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&toProjectile)))->Vector::Rotated(tmpVec,
|
|
(((float)local_9fc - (float)pEVar8) * 180.0) /
|
|
3.1415927);
|
|
(GHIDRA_CAST<Vector *>((&toProjectile)))->Vector::operator_assign(tmpVec);
|
|
}
|
|
pEVar24 = local_a00;
|
|
}
|
|
}
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Velocity(&projVelBeforeBend);
|
|
FUN_004d3050();
|
|
bendFactor = (float)pEVar8;
|
|
pVVar15 = Vector::operator_mul(&bendOffset,&bendFactor,&toProjectile);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__add(&newVelocity,pVVar15);
|
|
local_b2c[1] = 5.0;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
if (0.4 < projectileSpeed) {
|
|
(GHIDRA_CAST<Vector *>((&newVelocity)))->Vector::Resize(*pfVar16);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::SetVelocity(&newVelocity);
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),5);
|
|
guard_check_icall();
|
|
}
|
|
else {
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),5);
|
|
guard_check_icall();
|
|
}
|
|
}
|
|
}
|
|
pvVar7 = (void *)(GHIDRA_INT(local_a38) + 1);
|
|
local_a38 = pvVar7;
|
|
pvVar28 = (void *)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(deflectQuery))))->EntityList::Size();
|
|
} while (pvVar7 < pvVar28);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((deflectQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
local_a0d = HasCollectible(pEVar23,0x22a,0);
|
|
local_a29 = HasCollectible(pEVar23,0x24f,0);
|
|
if ((local_a0d != 0) || (local_a29 != 0)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
local_a14 = (void *)0x42f00000;
|
|
}
|
|
else {
|
|
local_a14 = (void *)0x42a00000;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
if (local_a29 == 0) {
|
|
auVar30 = ZEXT812(0x42a00000);
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar30)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar30)) + 0x0))) = local_a14;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar34)) + 0xc))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar34)) + 0x0))) = auVar30;
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(auraQuery),&pEVar23->_pos,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar30)) + 0x0))),8);
|
|
local_14 = 9.80909e-45;
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(auraQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar2 != 0) && (pEVar24 != pEVar23)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
LAB_0079886f:
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_9fc) & 0xffffff00));
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::is_player();
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_9fc)) + 0x1))),1));
|
|
if (bVar2 == 0) goto LAB_0079886f;
|
|
}
|
|
if (local_a29 != 0) {
|
|
cVar3 = pEVar24->IsBoss();
|
|
if (cVar3 == '\0') {
|
|
iVar4 = FUN_00753700();
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((0x3c - iVar4));
|
|
if (GHIDRA_INT(local_a08) < 1) goto LAB_007988e6;
|
|
(GHIDRA_CAST<EntityRef *>((&auraCharmSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
sourceRef = &auraCharmSource;
|
|
pEVar21 = local_a08;
|
|
pEVar41 = local_9fc;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntityRef *>((&auraBossCharmSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
sourceRef = &auraBossCharmSource;
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>(&DAT_0000003c);
|
|
pEVar41 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
uVar22 = 0x7988e6;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::AddCharmed(sourceRef,GHIDRA_INT(pEVar21),(byte)pEVar41,0);
|
|
dVar29 = (double)((ulonglong)uVar22 << 0x20);
|
|
}
|
|
LAB_007988e6:
|
|
FUN_00417340();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar34)) + 0x0))) = GHIDRA_CAST<undefined1 *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar34)) + 0x0))) + 80.0));
|
|
local_a08 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(auVar34))) + 0x0)));
|
|
if (local_a0d != 0) {
|
|
if (local_a29 != 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&auraEnemyPos);
|
|
local_a3c = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::DistanceSquared(&pEVar23->_pos);
|
|
auVar34 = ZEXT416(local_a08);
|
|
if ((float)local_a08 < (float)local_a3c) goto LAB_0079898c;
|
|
}
|
|
cVar3 = pEVar24->IsBoss();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<EntityRef *>((&auraFearSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
sourceRef = &auraFearSource;
|
|
iVar4 = -0x14;
|
|
pEVar21 = local_9fc;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntityRef *>((&auraBossFearSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
iVar4 = -0x3c;
|
|
sourceRef = &auraBossFearSource;
|
|
pEVar21 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::AddFear(sourceRef,iVar4,(byte)pEVar21);
|
|
}
|
|
}
|
|
LAB_0079898c:
|
|
puVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a14)) + 0x1)));
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(puVar19);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(auraQuery))))->EntityList)::Size();
|
|
} while (puVar19 < puVar10);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((auraQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x22f,0);
|
|
if (((bVar2 != 0) && (iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetIntervalTicks(6.0,0.0), iVar4 != 0)) &&
|
|
(cVar3 = FUN_00758590(), cVar3 == '\0')) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
queryList = GHIDRA_CAST<EntityList_EL *>(chainLightningQuery);
|
|
uVar39 = 0x798a2e;
|
|
EntityList::QueryRadius(entityList,queryList,&pEVar23->_pos,60.0,8);
|
|
local_14 = 1.12104e-44;
|
|
uVar22 = 0;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(chainLightningQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
uVar42 = 0x798a64;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(pEVar23));
|
|
uVar38 = (undefined4)((ulonglong)dVar29 >> 0x20);
|
|
if (bVar2 != 0) {
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((pEVar23->_meleeDamage * 0.75));
|
|
pEVar24 = pEVar23;
|
|
FUN_00435bc0();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = uVar39;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = uVar38;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = queryList;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = uVar42;
|
|
queryList = spawn_chain_lightning
|
|
(&pEVar23->_pos,tearFlags,GHIDRA_CAST<Entity *>(pEVar24),(float)local_a08);
|
|
queryList->Update();
|
|
break;
|
|
}
|
|
uVar22 = uVar22 + 1;
|
|
uVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(chainLightningQuery))))->EntityList::Size();
|
|
} while (uVar22 < uVar5);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((chainLightningQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x23e,0);
|
|
local_a3c = (void *)0x41400000;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x0))) = ZEXT812(0x40800000);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0;
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(BVar35._l);
|
|
if ((bVar2 == 0) || (cVar3 = FUN_00758590(), cVar3 != '\0')) {
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e78)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e78)))) + 0x28))();
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
goto LAB_00798d8c;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x40800000);
|
|
}
|
|
else {
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x41400000);
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
auVar30 = ZEXT812(0x3f800000);
|
|
}
|
|
else {
|
|
auVar30 = ZEXT812(0x40000000);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x0))) = auVar30;
|
|
local_a38 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar30)) + 0x0)));
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetIntervalTicks((float)local_a14,0.0);
|
|
if (iVar4 != 0) {
|
|
damageAuraCenter.y = (pEVar23->_pos).y;
|
|
damageAuraCenter.x = (pEVar23->_pos).x;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(damageAuraQuery),&pEVar23->_pos,90.0,8);
|
|
local_14 = 1.26117e-44;
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(damageAuraQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
local_a00 = pEVar24;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar2 != 0) && (pEVar24 != pEVar23)) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&damageAuraTargetPos);
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Vector *>((&damageAuraCenter)))->Vector)::Distance(tmpVec);
|
|
FUN_00417340();
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(((float)local_a0c - (float)BVar35._l));
|
|
fVar11 = 0.4;
|
|
Config::GetCollectibles();
|
|
iVar4 = EntityPtr::Ref();
|
|
local_9fc = (Entity_Player *)
|
|
assert_lerp_range((float)local_9fc,30.0,90.0,
|
|
(float)iVar4 * 0.32 + (float)local_a38 * 3.6,fVar11,1);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar24) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&damageAuraSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
BVar35 = (BitSet128)ZEXT416(local_9fc);
|
|
(*pcVar1)();
|
|
}
|
|
puVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a14)) + 0x1)));
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(puVar19);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(damageAuraQuery))))->EntityList)::Size();
|
|
} while (puVar19 < puVar10);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((damageAuraQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e78)))) == 0) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),2,uVar22)
|
|
;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
LAB_00798d8c:
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e78)))))))->EntityPtr::SetReference(queryList);
|
|
}
|
|
}
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(0x2a1);
|
|
if (iVar4 == 1) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f04)))) == 0) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xb9,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22)
|
|
;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddEntityFlags(0x2000200000);
|
|
queryList->Update();
|
|
goto LAB_00798e34;
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f04)))) != 0) &&
|
|
((cVar3 = FUN_004173d0(), cVar3 == '\0' ||
|
|
(iVar4 = (GHIDRA_CAST<Entity_Tear *>((*GHIDRA_CAST<Entity_Tear **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f04)))))))->Entity_Tear::TearIndex(), iVar4 == 0))))
|
|
{
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f04)))) + 0x28))();
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
LAB_00798e34:
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f04)))))))->EntityPtr::SetReference(queryList);
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x253,0);
|
|
if (bVar2 == 0) {
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e7c)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e7c)))) + 0x28))();
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
goto LAB_007994c3;
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::IsFrame(2,0);
|
|
if (bVar2 != 0) {
|
|
Config::GetCollectibles();
|
|
iVar4 = _get_index_plus_one_if_kind_4_5();
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(((float)iVar4 * 0.5 + 3.0));
|
|
BVar35 = (BitSet128)ZEXT416(local_a14);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Room *>((room)))->Room)::GetEntities();
|
|
local_a38 = (void *)0x0;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_9fc))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
local_a00 = pEVar24;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsProjectile();
|
|
if ((((bVar2 == 0) || (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsDead(), cVar3 != '\0')) ||
|
|
(iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::EntityCollisionClass(), iVar4 == 0)) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::HasEntityFlags(0x80000000), bVar2 != 0)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (((cVar3 != '\0') && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsTear(), bVar2 != 0)) &&
|
|
((cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsDead(), cVar3 == '\0' &&
|
|
(iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::EntityCollisionClass(), iVar4 != 0)))) {
|
|
uVar5 = 0x17;
|
|
uVar22 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::InitSeed();
|
|
(GHIDRA_CAST<RNG *>((&tearRng)))->RNG::game_constructor(uVar22,uVar5);
|
|
local_14 = 1.54143e-44;
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<RNG *>((playerManager)))->RNG)::RandomFloat();
|
|
local_14 = -NAN;
|
|
guard_check_icall();
|
|
BVar35._l = (double)(float)local_a0c;
|
|
BVar35._h = 0;
|
|
if (BVar35._l < 0.15) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&orbitTearPos);
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Distance(&pEVar23->_pos);
|
|
BVar35 = (BitSet128)ZEXT416(local_a0c);
|
|
if (((float)local_a0c <= 100.0) && (85.0 <= (float)local_a0c)) {
|
|
tmpFlags2 = &g_tearFlagNoGridDamage;
|
|
tmpFlags = BitSet128::operator_or
|
|
(&orbitFlagsBase,&g_tearFlagOrbitAdvanced,&g_tearFlagSpectral
|
|
);
|
|
BitSet128::operator_or(&orbitTearFlags,tmpFlags,tmpFlags2);
|
|
tmpFlags2 = &g_tearFlagExplosive;
|
|
tmpFlags = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(pEVar24))))->Entity_Tear::TearFlags(&explosiveCheckFlags);
|
|
tmpFlags = BitSet128::operator_and(&explosiveFlagMatch,tmpFlags,tmpFlags2);
|
|
bVar2 = (GHIDRA_CAST<BitSet128 *>((tmpFlags)))->BitSet128::IsNonZero();
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&orbitTearFlags)))->BitSet128::operator__(&g_tearFlagExplosive);
|
|
}
|
|
tmpFlags2 = &g_tearFlagQuadsplit;
|
|
tmpFlags = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(pEVar24))))->Entity_Tear::TearFlags(&quadsplitCheckFlags);
|
|
tmpFlags = BitSet128::operator_and(&quadsplitFlagMatch,tmpFlags,tmpFlags2);
|
|
bVar2 = (GHIDRA_CAST<BitSet128 *>((tmpFlags)))->BitSet128::IsNonZero();
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&orbitTearFlags)))->BitSet128::operator__(&g_tearFlagQuadsplit);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(orbitTearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x0))) = (undefined4)orbitTearFlags._l;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x0))) = (undefined4)orbitTearFlags._h;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(orbitTearFlags._h)) + 0x4)));
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(pEVar24))))->Entity_Tear::SetTearFlags(flags_00);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar24) + 0x40);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_a00))))->Entity_Tear::Scale();
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((float)(fVar27 * (float10)(float)local_a14));
|
|
(*pcVar1)();
|
|
pEVar24 = local_a00;
|
|
(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(local_a00))))->Entity_Effect::set_state(1);
|
|
minTearHeight = 0xc1a00000;
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(pEVar24))))->Entity_Tear::Height();
|
|
orbitTearHeight = (float)fVar27;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(*pfVar16));
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar24))))->Entity_Projectile::SetHeight(*pfVar16);
|
|
FUN_00444c70();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar24))))->Entity_Projectile::set_falling_accel(-0.09);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::SetSpawnerEntity(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar5 = 0x17;
|
|
uVar22 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::InitSeed();
|
|
(GHIDRA_CAST<RNG *>((&projectileRng)))->RNG::game_constructor(uVar22,uVar5);
|
|
local_14 = 1.4013e-44;
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<RNG *>((music)))->RNG)::RandomFloat();
|
|
local_14 = -NAN;
|
|
guard_check_icall();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x0))) = ZEXT812(0x3ecccccd);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0;
|
|
if ((float)local_a0c < (float)BVar35._l) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&capturedProjPos);
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Distance(&pEVar23->_pos);
|
|
BVar35 = (BitSet128)ZEXT416(local_a0c);
|
|
if (((float)local_a0c <= 100.0) && (85.0 <= (float)local_a0c)) {
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(0x1);
|
|
uVar39 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Variant();
|
|
switch(uVar39) {
|
|
case 1:
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(&DAT_0000001d);
|
|
break;
|
|
case 4:
|
|
case 6:
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
break;
|
|
case 7:
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(&DAT_00000014);
|
|
break;
|
|
case 9:
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>(&DAT_0000002a);
|
|
}
|
|
uVar22 = Random();
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Velocity(&capturedProjVel);
|
|
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::Position(&capturedProjPos2);
|
|
pEVar23 = savedPlayer;
|
|
local_a30 = (Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,GHIDRA_UINT(local_a0c),pVVar15,tmpVec,
|
|
GHIDRA_CAST<Entity *>(savedPlayer),0,uVar22);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
tmpFlags2 = &g_tearFlagNoGridDamage;
|
|
tmpFlags = BitSet128::operator_or
|
|
(&capturedFlagsBase,&g_tearFlagOrbitAdvanced,
|
|
&g_tearFlagSpectral);
|
|
BitSet128::operator_or(&capturedTearFlags,tmpFlags,tmpFlags2);
|
|
pEVar24 = local_a00;
|
|
projectileFlags = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_a00))))->Entity_Projectile::ProjectileFlags()
|
|
;
|
|
if ((projectileFlags & 2) != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&capturedTearFlags)))->BitSet128::operator__(&g_tearFlagExplosive);
|
|
}
|
|
projectileFlags = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar24))))->Entity_Projectile::ProjectileFlags();
|
|
if ((projectileFlags & 0x10000) != 0) {
|
|
(GHIDRA_CAST<BitSet128 *>((&capturedTearFlags)))->BitSet128::operator__(&g_tearFlagQuadsplit);
|
|
}
|
|
pEVar24 = local_a30;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(capturedTearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = (undefined4)capturedTearFlags._l;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = (undefined4)capturedTearFlags._h;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(capturedTearFlags._h)) + 0x4)));
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_a30))))->Entity_Tear::SetTearFlags(flags);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar24) + 0x3c);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::GetColor();
|
|
(*pcVar1)();
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(local_a30) + 0x40);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_a00))))->Entity_Tear::Scale();
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((float)(fVar27 * (float10)(float)local_a14));
|
|
(*pcVar1)();
|
|
(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(local_a30))))->Entity_Effect::set_state(1);
|
|
pEVar24 = local_a00;
|
|
minTearHeight2 = -20.0;
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_a00))))->Entity_Tear::Height();
|
|
capturedTearHeight = (float)fVar27;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_a30))))->Entity_Projectile::SetHeight(*pfVar16);
|
|
FUN_00444c70();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_a30))))->Entity_Projectile::set_falling_accel(-0.09);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(pEVar24))))->Entity_Tear::Scale();
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((float)fVar27);
|
|
BVar35 = (BitSet128)ZEXT416(local_a0c);
|
|
FUN_00652ae0();
|
|
FUN_0067af30();
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_a30))))->Entity_Tear::SetScale((float)BVar35._l);
|
|
pEVar24->Remove();
|
|
}
|
|
}
|
|
}
|
|
pvVar7 = (void *)(GHIDRA_INT(local_a38) + 1);
|
|
local_a38 = pvVar7;
|
|
pvVar28 = (void *)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_9fc))))->EntityList::Size();
|
|
} while (pvVar7 < pvVar28);
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e7c)))) == 0) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),5,uVar22)
|
|
;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
LAB_007994c3:
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e7c)))))))->EntityPtr::SetReference(queryList);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x2b8,0);
|
|
salvationEffect = pEVar23->_salvationEffect;
|
|
if (bVar2 == 0) {
|
|
if (salvationEffect != (EntityPtr)0x0) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(salvationEffect) + 0x28))();
|
|
(GHIDRA_CAST<EntityPtr *>((&pEVar23->_salvationEffect)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else {
|
|
local_a0d = 0;
|
|
if (salvationEffect == (EntityPtr)0x0) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),6,uVar22)
|
|
;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<EntityPtr *>((&pEVar23->_salvationEffect)))->EntityPtr::SetReference(queryList);
|
|
local_a0d = 1;
|
|
if (pEVar23->_salvationEffect != (EntityPtr)0x0) goto LAB_00799548;
|
|
}
|
|
else {
|
|
LAB_00799548:
|
|
get_salvation_scale();
|
|
FUN_00435ed0();
|
|
salvationEffect = pEVar23->_salvationEffect;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&salvationOffset)))->Vector::Vector(0.0,-15.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(salvationEffect))))->Entity::SetPositionOffset(tmpVec);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23->_salvationEffect))))->Entity)::GetSprite();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
else {
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x3f000000);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::FrameCount();
|
|
fVar11 = (float)(iVar4 % 0x168) + (float)local_a14;
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(fVar11));
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetRotation(fVar11);
|
|
}
|
|
if (local_a0d != 0) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(pEVar23->_salvationEffect) + 0xc))();
|
|
}
|
|
}
|
|
local_a29 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x2c1);
|
|
if (local_a29 == 0) {
|
|
if (pEVar23->_darkArtsBlastPending != 0) {
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite)::Color();
|
|
BVar35 = (BitSet128)ZEXT816(0);
|
|
goto LAB_00799685;
|
|
}
|
|
}
|
|
else {
|
|
if (pEVar23->_darkArtsBlastPending == 0) {
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite)::Color();
|
|
fVar11 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = fVar11 * 0.1 + 0.1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x4))) = extraout_var_01;
|
|
pEVar8 = local_a14;
|
|
}
|
|
else {
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite)::Color();
|
|
BVar35 = (BitSet128)ZEXT816(0);
|
|
}
|
|
LAB_00799685:
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(pEVar8))))->Font::SetLineHeightModifier((float)BVar35._l);
|
|
FUN_00435d90();
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetNullEffect(0x6f);
|
|
if (pvVar28 != (void *)0x0) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) = ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) + 0x1d) / 0x1e) * 0x1e + 1;
|
|
}
|
|
}
|
|
if (((pEVar23->_darkArtsBlastPending != 0) &&
|
|
(SetMinDamageCooldown(pEVar23,8), pEVar23->_darkArtsBlastPending != 0)) &&
|
|
((pEVar23->_darkArtsLastSnare == (void *)0x0 || (cVar3 = (GHIDRA_CAST<Entity *>(()))->Entity::IsDead(), cVar3 != '\0')))) {
|
|
pEVar23->_darkArtsBlastPending = 0;
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&pEVar23->_darkArtsLastSnare))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
pEVar23->ResetColor();
|
|
play_sound_with_fart_seed(0x50,1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(10);
|
|
tmpColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::MakeGroundPoofAtSelf(tmpColor,0.8);
|
|
Game::DamageRadius(&pEVar23->_pos,GHIDRA_CAST<Entity *>(pEVar23),0,0,0,50.0,g_tearFlagsNone,
|
|
pEVar23->_darkArtsDamage,80.0);
|
|
BVar35 = (BitSet128)ZEXT816(0x3f800000);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
FUN_00435d90();
|
|
SetMinDamageCooldown(pEVar23,0xf);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddEntityFlags(0x1000000000);
|
|
(GHIDRA_CAST<std::vector *>((&pEVar23->_darkArtsHitList)))->std::vector::clear(0);
|
|
pEVar23->_darkArtsDamage = 0.0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x80,-1);
|
|
}
|
|
if (local_a29 == 0) {
|
|
if (*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))))))->Entity::SetParent(GHIDRA_CAST<Entity *>(0x0));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetCollisionCapsule(darkArtsCapsule,&g_vectorZero);
|
|
darkArtsCapsuleSize = darkArtsCapsuleSize + 10.0;
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(darkArtsCapsuleSize));
|
|
if ((pEVar23->_playerType == 0x18) && (bVar2 = HasCollectible(pEVar23,0x26b,0), bVar2 != 0)) {
|
|
darkArtsCapsuleSize = darkArtsCapsuleSize + 30.0;
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(darkArtsCapsuleSize));
|
|
local_a0d = 0;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))) == 0) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),8,
|
|
uVar22);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))))))->EntityPtr::SetReference(queryList);
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(darkArtsCapsuleSize));
|
|
local_a0d = 1;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))) != 0) goto LAB_007999a3;
|
|
}
|
|
else {
|
|
LAB_007999a3:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = (float)BVar35._l / 120.0;
|
|
FUN_00435ed0();
|
|
queryList = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88))));
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&darkArtsAuraOffset)))->Vector::Vector(0.0,-15.0);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetPositionOffset(tmpVec);
|
|
}
|
|
if (local_a0d != 0) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))) + 0xc))();
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::query_player_capsule_hits
|
|
(entityList,GHIDRA_CAST<EntityList_EL *>(darkArtsHits),darkArtsCapsule,10);
|
|
local_14 = 1.68156e-44;
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(darkArtsHits))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(*puVar9);
|
|
local_a0c = pEVar8;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::IsActiveEnemy(0);
|
|
if ((bVar2 == 0) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::HasEntityFlags(0x20000000), bVar2 != 0)) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::IsProjectile();
|
|
if (bVar2 != 0) {
|
|
projectileFlags = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar8))))->Entity_Projectile::ProjectileFlags();
|
|
if ((projectileFlags & 0x80000000) == 0) goto LAB_00799a98;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00799a98:
|
|
bVar2 = EntityList::HitListContains
|
|
(GHIDRA_CAST<EntityList *>(&pEVar23->_darkArtsHitList),GHIDRA_CAST<Entity *>(pEVar8));
|
|
if (bVar2 == 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::Position(&snareTargetPos);
|
|
local_a30 = GHIDRA_CAST<Entity_Player *>(&pEVar23->_pos);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__sub(&snareOffset,GHIDRA_CAST<Vector *>(local_a30));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))) == 0) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((pEVar23->_size + 10.0));
|
|
local_a38 = (void *)(GHIDRA_CAST<Vector *>((&snareOffset)))->Vector::Length();
|
|
}
|
|
else {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>((pEVar23->_size + 40.0));
|
|
local_a38 = (void *)(GHIDRA_CAST<Vector *>((&snareOffset)))->Vector::Length();
|
|
}
|
|
if ((float)local_9fc < (float)local_a38) {
|
|
(GHIDRA_CAST<Vector *>((&snareOffset)))->Vector::Resize((float)local_9fc);
|
|
}
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_pos)))->Vector::__add(&snarePos,&snareOffset);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::IsEnemy();
|
|
if (bVar2 != 0) {
|
|
queryList = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::GetStatusEffectTarget();
|
|
uVar22 = (GHIDRA_CAST<Entity *>((queryList)))->Entity::GetHitListIndex();
|
|
uVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a0c))))->Entity::GetHitListIndex();
|
|
if (uVar22 == uVar5) {
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a0c))))->Entity)::GetStatusEffectTarget();
|
|
}
|
|
}
|
|
FUN_00431620();
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
iVar4 = Isaac::Random(2);
|
|
GetTearHitParams(pEVar23,&TStack_408,1,2.0,iVar4 * 2 + -1,queryList);
|
|
uVar22 = Random();
|
|
pEVar24 = (Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xc2,&snarePos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,
|
|
uVar22);
|
|
local_a00 = pEVar24;
|
|
if (pEVar23->_darkArtsLastSnare != GHIDRA_CAST<Entity *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((pEVar23->_darkArtsLastSnare)))->Entity::SetChild(GHIDRA_CAST<Entity *>(pEVar24));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::SetParent(pEVar23->_darkArtsLastSnare);
|
|
(GHIDRA_CAST<Entity *>((pEVar23->_darkArtsLastSnare)))->Entity::SubType();
|
|
FUN_00435cd0();
|
|
}
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar24) + 0x40);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::SubType();
|
|
(*pcVar1)();
|
|
FUN_00665b80();
|
|
pEVar8 = local_a0c;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(local_a0c));
|
|
local_a00->Update();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&pEVar23->_darkArtsLastSnare))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(local_a00));
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::CollisionDamage();
|
|
local_a38 = (void *)(float)fVar27;
|
|
pEVar23->_darkArtsDamage = (float)local_a38 + pEVar23->_darkArtsDamage;
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a00))))->Entity::SubType();
|
|
fVar11 = (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * 0.05 + 1.5;
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(fVar11));
|
|
play_sound_with_fart_seed(0x1fb,0.8,1,0,fVar11);
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e88)))) != 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::Position(&snareTargetPos2);
|
|
local_a38 = (void *)(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Distance(&pEVar23->_pos);
|
|
FUN_00417340();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = (float)BVar35._l + pEVar23->_size + 10.0;
|
|
if ((float)BVar35._l < (float)local_a38) {
|
|
uVar22 = Random();
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xa6,&snarePos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,
|
|
uVar22);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar8));
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity)::GetSprite();
|
|
(GHIDRA_CAST<Color *>((&snareBlackColor)))->Color::Color(0.0,0.0,0.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color_02);
|
|
(GHIDRA_CAST<BlendMode *>((snareBlendMode)))->BlendMode::SetMode(1,0);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity)::GetSprite();
|
|
puVar10 = snareBlendMode;
|
|
layer = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
copy_20_bytes(layer->_blendMode,puVar10);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity)::GetSprite();
|
|
snareScaleFactor = 2.0;
|
|
tmpVec = Vector::operator_mul(&snareScale,&snareScaleFactor,&g_vectorOne);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(tmpVec);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetRadii(0.32,0.32);
|
|
effect->Update();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetPosition(GHIDRA_CAST<Vector *>(local_a30));
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity)::GetSprite();
|
|
snareScaleFactor2 = (void *)0x3f800000;
|
|
tmpVec = Vector::operator_mul(&snareScale2,GHIDRA_CAST<float *>(&snareScaleFactor2),&g_vectorOne)
|
|
;
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(tmpVec);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetRadii(0.16,0.16);
|
|
effect->Update();
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
puVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a14)) + 0x1)));
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(puVar19);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(darkArtsHits))))->EntityList)::Size();
|
|
} while (puVar19 < puVar10);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((darkArtsHits)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&pEVar23->_temporaryeffects);
|
|
local_a14 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetNullEffect(0x6f);
|
|
if (local_a14 != GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar4 != 0) {
|
|
if (local_a29 == 0) {
|
|
if (pEVar23->_darkArtsBlastPending == 0) {
|
|
smokeCountCap = (void *)0x10;
|
|
piVar14 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(((float)*piVar14 * 0.0625));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = random_float();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x4))) = extraout_var_02;
|
|
if ((float)BVar35._l < (float)local_9fc + 0.6) {
|
|
tmpVec = GHIDRA_CAST<Vector *>(TearsOffset(pEVar23));
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_pos)))->Vector::__add(&smokeOrigin,tmpVec);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&smokeSpread)))->Vector::Vector(1.0,0.8);
|
|
pVVar15 = MusicManager::RandomVector(&smokeRandomDir);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Mul(&smokeDirScaled,pVVar15);
|
|
smokeRandomScale = (void *)random_float();
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&smokeDirRandomized,GHIDRA_CAST<float *>(&smokeRandomScale));
|
|
smokeOffsetLength = 16.0;
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&smokeOffset,&smokeOffsetLength);
|
|
uVar22 = Random();
|
|
smokeVelFactor = 0.3;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&smokeOffset)))->Vector::__mul(&smokeOffsetVel,&smokeVelFactor);
|
|
smokeInheritFactor = 0.5;
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((&savedPlayer->_velocity)))->Vector::__mul(&smokeInheritedVel,&smokeInheritFactor);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__add(&smokeVelocity,pVVar15);
|
|
pVVar15 = GHIDRA_CAST<Vector *>(TearsOffset(savedPlayer));
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((&savedPlayer->_pos)))->Vector::__add(&smokeSpawnPos,pVVar15);
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6f,pVVar15,tmpVec,GHIDRA_CAST<Entity *>(0x0),0,uVar22);
|
|
smokeScaleWanted = (void *)((float)local_9fc * 1.33 + 0.66);
|
|
tmpVec = &g_vectorOne;
|
|
smokeScaleMax = 1.0;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
tmpVec = Vector::operator_mul(&smokeScale,pfVar16,tmpVec);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&smokeHeightOffset)))->Vector::Vector(0.0,-30.0);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__add(&smokePosOffset,&smokeOffset);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetPositionOffset(tmpVec);
|
|
anm = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((queryList)))->Entity)::GetSprite();
|
|
smokeSpeedMax = 1.0;
|
|
smokeSpeedWanted = 1.3 - (float)local_9fc * 0.5;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(*pfVar16));
|
|
set_PlaybackSpeed(anm,*pfVar16);
|
|
(GHIDRA_CAST<Color *>((smokeColor)))->Color::Color(0.03137255,0.0,0.0,1.0);
|
|
queryList->SetColor();
|
|
set_field_358(queryList,-20.0);
|
|
queryList->Update();
|
|
pEVar8 = local_a34;
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (GHIDRA_INT((GHIDRA_CAST<Vector *>((GHIDRA_INT(local_a14) + 8)))->x) % GHIDRA_INT(local_a1c) == 0) {
|
|
TemporaryEffects::RemoveNullEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>(pEVar8),0x6f,GHIDRA_INT(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a14)) + 0x4))))) / 0x1e + 1);
|
|
}
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetNullEffect(0x72);
|
|
if (pvVar28 != (void *)0x0) {
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar4 != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = random_float();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x4))) = extraout_var_03;
|
|
if ((float)BVar35._l < 1.6) {
|
|
tmpVec = GHIDRA_CAST<Vector *>(TearsOffset(pEVar23));
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_pos)))->Vector::__add(&smoke2Origin,tmpVec);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&smoke2Spread)))->Vector::Vector(1.0,0.8);
|
|
pVVar15 = MusicManager::RandomVector(&smoke2RandomDir);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Mul(&smoke2DirScaled,pVVar15);
|
|
smoke2RandomScale = random_float();
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&smoke2DirRandomized,&smoke2RandomScale);
|
|
smoke2OffsetLength = 16.0;
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&smoke2Offset,&smoke2OffsetLength);
|
|
uVar22 = Random();
|
|
smoke2VelFactor = 0.3;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&smoke2Offset)))->Vector::__mul(&smoke2OffsetVel,&smoke2VelFactor);
|
|
smoke2InheritFactor = 0.5;
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((&savedPlayer->_velocity)))->Vector::__mul(&smoke2InheritedVel,&smoke2InheritFactor);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__add(&smoke2Velocity,pVVar15);
|
|
pVVar15 = GHIDRA_CAST<Vector *>(TearsOffset(savedPlayer));
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((&savedPlayer->_pos)))->Vector::__add(&smoke2SpawnPos,pVVar15);
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6f,pVVar15,tmpVec,GHIDRA_CAST<Entity *>(0x0),0,uVar22);
|
|
smoke2ScaleWanted = (void *)0x3ffeb852;
|
|
smoke2ScaleMax = 1.0;
|
|
tmpVec = &g_vectorOne;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
tmpVec = Vector::operator_mul(&smoke2Scale,pfVar16,tmpVec);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&smoke2HeightOffset)))->Vector::Vector(0.0,-30.0);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__add(&smoke2PosOffset,&smoke2Offset);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetPositionOffset(tmpVec);
|
|
anm = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((queryList)))->Entity)::GetSprite();
|
|
smoke2SpeedWanted = 0.79999995;
|
|
smoke2SpeedMax = 1.0;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(*pfVar16));
|
|
set_PlaybackSpeed(anm,*pfVar16);
|
|
set_field_358(queryList,-20.0);
|
|
queryList->Update();
|
|
pEVar8 = local_a34;
|
|
}
|
|
}
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x73);
|
|
iVar4 = FUN_00930a00();
|
|
pEVar23 = savedPlayer;
|
|
if (iVar4 != 0) {
|
|
uVar22 = *GHIDRA_CAST<uint *>((iVar4 + 8)) & 0x80000007;
|
|
bVar26 = uVar22 == 0;
|
|
if (GHIDRA_INT(uVar22) < 0) {
|
|
bVar26 = (uVar22 - 1 | 0xfffffff8) == 0xffffffff;
|
|
}
|
|
if (bVar26) {
|
|
if (GHIDRA_INT(*GHIDRA_CAST<uint *>((iVar4 + 8))) < 0x3d) {
|
|
uVar22 = Random();
|
|
pEVar23 = savedPlayer;
|
|
local_a1c = (Entity_Familiar *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,9,&savedPlayer->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(savedPlayer),0,
|
|
uVar22);
|
|
if (local_a1c != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
tmpFlags = GetBombFlags(pEVar23,&fartBombFlags,0);
|
|
BVar35 = *tmpFlags;
|
|
FUN_006a6910();
|
|
}
|
|
}
|
|
else {
|
|
play_sound_with_fart_seed(0x25,1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((fartColor2)))->Color::Color();
|
|
tmpVec = &pEVar23->_pos;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(tmpVec,85.0,GHIDRA_CAST<Entity *>(pEVar23),1.0,0,color_03);
|
|
Game::ButterBeanFart(g_game,tmpVec,120.0,GHIDRA_CAST<Entity *>(pEVar23),0,0);
|
|
uVar22 = Random();
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x8d,tmpVec,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),1,uVar22);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(-1);
|
|
effect->Update();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&pEVar23->_temporaryeffects);
|
|
}
|
|
}
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x271);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(FUN_00930a00());
|
|
if (local_a1c != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c8120c) &&
|
|
(_Init_thread_header(), DAT_00c8120c == -1)) {
|
|
local_14 = 1.82169e-44;
|
|
BVar35 = (BitSet128)ZEXT816(0x3f800000);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
local_14 = -NAN;
|
|
_Init_thread_footer();
|
|
}
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<std_string *>(&local_a1c->_damageEvents))->_buf);
|
|
if (iVar4 < 0x1f) {
|
|
iVar4 = iVar4 % 10;
|
|
}
|
|
else {
|
|
if (iVar4 < 0x5b) {
|
|
iVar20 = 0xf;
|
|
}
|
|
else {
|
|
if (0x96 < iVar4) goto LAB_0079a6f8;
|
|
iVar20 = 0x1e;
|
|
}
|
|
iVar4 = iVar4 % iVar20;
|
|
}
|
|
if (iVar4 == 0) {
|
|
pEVar23->SetColor();
|
|
}
|
|
}
|
|
LAB_0079a6f8:
|
|
dashSpeed = 15.0;
|
|
if (pEVar23->_ponyCharge < 1) {
|
|
if (pEVar23->_suplexState == 1) {
|
|
if (8 < pEVar23->_suplexAimCountdown) {
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((pEVar23->_suplexAimCountdown + -8));
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x2c5);
|
|
dashSpeed = 12.0;
|
|
goto LAB_0079ad8f;
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x251);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x2ca);
|
|
if (((bVar2 != 0) && (pEVar23->_playerType == 0x23)) &&
|
|
(iVar4 = GetOtherTwin(pEVar23), iVar4 != 0)) {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x2ca);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2ca);
|
|
iVar4 = FUN_00930a00();
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((configItem->maxCooldown - *GHIDRA_CAST<int *>((iVar4 + 8))));
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector)::LengthSquared();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x0))) = ZEXT812(0x41c80000);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0;
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&pEVar23->_temporaryeffects);
|
|
if ((float)local_a1c < (float)BVar35._l) {
|
|
dashSpeed = 0.0;
|
|
}
|
|
goto LAB_0079ad8f;
|
|
}
|
|
}
|
|
else if (pEVar23->_marsCooldown == pEVar23->_marsUnk1) {
|
|
switch(pEVar23->_marsUnk2) {
|
|
case 0:
|
|
iVar4 = 0;
|
|
break;
|
|
case 1:
|
|
iVar4 = 2;
|
|
break;
|
|
case 2:
|
|
iVar4 = 1;
|
|
break;
|
|
case 3:
|
|
iVar4 = 3;
|
|
break;
|
|
default:
|
|
iVar4 = -1;
|
|
}
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&dashDir,iVar4);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::IsMirrorWorld();
|
|
if (bVar2 != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = -dashDir.x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x4))) = 0x80000000;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x0))) = 0x80000000;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0x80000000;
|
|
dashDir.x = (float)BVar35._l;
|
|
}
|
|
marsDashSpeed = (void *)0x40800000;
|
|
bVar2 = 0;
|
|
tmpVec = Vector::operator_mul(&marsDashVelocity,GHIDRA_CAST<float *>(&marsDashSpeed),&dashDir);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddVelocity(tmpVec,bVar2);
|
|
(GHIDRA_CAST<std::vector *>((&pEVar23->_contactHitList)))->std::vector::clear(0);
|
|
play_sound_with_fart_seed(0x77,1.0,2,0,1.0);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x3a);
|
|
RemoveCostume(pEVar23,configItem);
|
|
}
|
|
else {
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::GetCollectibleEffect(0x251);
|
|
if ((pvVar28 != (void *)0x0) &&
|
|
(local_a0c = *GHIDRA_CAST<Entity_Tear **>((GHIDRA_CAST<char *>(pvVar28) + 8)), 0 < GHIDRA_INT(local_a0c))) {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x251);
|
|
dashSpeed = 15.0;
|
|
itemConfig = Isaac::GetItemConfig();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig)::GetCollectible(0x2c0);
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>(FUN_00930a00());
|
|
if ((local_a14 != GHIDRA_CAST<Entity_Tear *>(0x0)) && (GHIDRA_INT((GHIDRA_CAST<Vector *>((GHIDRA_INT(local_a14) + 8)))->x) < 4)) {
|
|
(GHIDRA_CAST<TemporaryEffect *>((dashTempEffect)))->TemporaryEffect::TemporaryEffect(GHIDRA_CAST<ItemConfig_Item *>(local_a1c));
|
|
dashTempEffectCooldown = 4 - GHIDRA_INT((GHIDRA_CAST<Vector *>((GHIDRA_INT(local_a14) + 8)))->x);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::AddEffect(dashTempEffect,0,1);
|
|
}
|
|
goto LAB_0079ad8f;
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<std::vector *>((&pEVar23->_contactHitList)))->std::vector::clear(0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::ClearEntityFlags(0x4000000);
|
|
}
|
|
else {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x82);
|
|
local_a0c = GHIDRA_CAST<Entity_Tear *>((0x3c - pEVar23->_ponyCharge));
|
|
LAB_0079ad8f:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_UINT(local_a0c) & 0x80000003));
|
|
if (GHIDRA_INT(local_a1c) < 0) {
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(((GHIDRA_UINT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a1c[-1])) + 0xf47)))) | 0xfffffffc) + 1));
|
|
}
|
|
if (local_a1c == GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
local_a14 = *GHIDRA_CAST<Entity_Tear **>((*GHIDRA_CAST<int *>(pEVar23) + 0x3c));
|
|
if (local_a00 != GHIDRA_CAST<Entity_Player *>(0x2ca)) {
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*(code *)local_a14)();
|
|
goto LAB_0079aeb9;
|
|
}
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*(code *)local_a14)();
|
|
}
|
|
else {
|
|
LAB_0079aeb9:
|
|
if ((local_a00 == GHIDRA_CAST<Entity_Player *>(0x82)) && ((GHIDRA_UINT(local_a0c) & 1) == 0)) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0xb5);
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector)::Rotated(&ponySideDir,90.0);
|
|
if (local_a1c != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
local_a3c = (void *)0x40800000;
|
|
}
|
|
fVar11 = random_float();
|
|
beamSideOffset = (fVar11 - 0.5) * (float)local_a3c;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_a14))))->Vector::__mul(&beamOffset,&beamSideOffset);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&pEVar23->_pos)))->Vector::__add(&beamPos,tmpVec);
|
|
(GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&clampedBeamPos,tmpVec,10.0);
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x13,&clampedBeamPos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),2,
|
|
uVar22);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(queryList) + 0x40);
|
|
fVar27 = (float10)GetTearPoisonDamage(savedPlayer);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)(fVar27 * (float10)4.0 + (float10)10.0));
|
|
(*pcVar1)();
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__unm(&beamSizeMulti);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSize(64.0,*tmpVec,-1);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(savedPlayer));
|
|
queryList->Update();
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
}
|
|
}
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(dashSpeed));
|
|
if (0.0 < dashSpeed) {
|
|
local_a14 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_a3c = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector)::Length();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector)::GetAngleDegrees();
|
|
knockbackStrength = (void *)0x41700000;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(0x40000000);
|
|
}
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(((pEVar23->_meleeDamage + 2.0) * (float)local_a08));
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(0x41c00000);
|
|
if (local_a00 == GHIDRA_CAST<Entity_Player *>(0x82)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x41a00000);
|
|
}
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(((float)local_9fc + (float)local_a04));
|
|
}
|
|
else if ((local_a00 == GHIDRA_CAST<Entity_Player *>(0x2ca)) &&
|
|
(bVar2 = HasCollectible(pEVar23,0x164,0), bVar2 != 0)) {
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(((float)local_9fc + (float)local_9fc));
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(0x42100000);
|
|
}
|
|
BVar35 = (BitSet128)ZEXT416(local_a1c);
|
|
pEVar17 = local_a1c;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&dashCapsuleSize)))->Vector::Vector((float)local_a3c / 24.0,1.0);
|
|
(GHIDRA_CAST<Capsule *>((dashCapsule)))->Capsule::constructor(&pEVar23->_pos,tmpVec,(float)pEVar17,(float)local_a08);
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius
|
|
(entityList,GHIDRA_CAST<EntityList_EL *>(dashHits),&pEVar23->_pos,(float)local_a3c * 3.0,
|
|
0xffffffff);
|
|
local_14 = 1.96182e-44;
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(dashHits))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
local_a30 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::Position(&hitPos);
|
|
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::Position(&hitPos2);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::operator_ne(pVVar15);
|
|
if (bVar2 == 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::Position(&hitPos3);
|
|
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::Position(&selfPos);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::operator_eq(pVVar15);
|
|
pEVar24 = local_a30;
|
|
if ((bVar2 == 0) && (FUN_00417340(), 0.0 < (float)BVar35._l)) {
|
|
pfVar16 = GHIDRA_CAST<float *>(FUN_00417350());
|
|
BVar35 = (BitSet128)ZEXT816(0);
|
|
if (0.0 < *pfVar16) {
|
|
iVar4 = FUN_00417350();
|
|
BVar35 = (BitSet128)ZEXT816(0);
|
|
if ((0.0 < *GHIDRA_CAST<float *>((iVar4 + 4))) &&
|
|
(bVar2 = EntityList::HitListContains
|
|
(GHIDRA_CAST<EntityList *>(&pEVar23->_contactHitList),GHIDRA_CAST<Entity *>(pEVar24)),
|
|
bVar2 == 0)) {
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity)::GetSprite();
|
|
fVar27 = (float10)(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::Rotation();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
tmpVec = GHIDRA_CAST<Vector *>(FUN_00417350());
|
|
FUN_00417340();
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(BVar35._l);
|
|
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::Position(&hitCapsulePos);
|
|
BVar35 = (BitSet128)ZEXT416(local_a1c);
|
|
Capsule::constructor
|
|
(hitCapsule,pVVar15,tmpVec,(float)local_a1c,(float)local_a08);
|
|
(GHIDRA_CAST<EntityPtr *>((capsuleHitInfo)))->EntityPtr::clear();
|
|
cVar3 = FUN_00440e80();
|
|
pEVar24 = local_a30;
|
|
if (cVar3 != '\0') {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::Position(&hitEntityPos);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__sub(&toHitEntity,&pEVar23->_pos);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Normalized(&knockbackDir);
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsEnemy();
|
|
if (bVar2 != 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsType(0x21,-1,-1);
|
|
if (bVar2 == 0) {
|
|
if (local_a00 == GHIDRA_CAST<Entity_Player *>(0x2c5)) {
|
|
bVar2 = TryHoldEntity(pEVar23,GHIDRA_CAST<Entity *>(pEVar24));
|
|
if (bVar2 != 0) {
|
|
pEVar23->_itemState = 0x2c5;
|
|
pEVar23->_suplexAimCountdown = 0x3c;
|
|
pEVar23->_suplexState = 2;
|
|
play_sound_with_fart_seed(0x407,1.0,2,0,1.0);
|
|
fVar11 = random_float();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = fVar11 * 0.2 + 0.9;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x4))) = extraout_var_04;
|
|
play_sound_with_fart_seed(0xf9,1.0,2,0,(float)BVar35._l);
|
|
break;
|
|
}
|
|
}
|
|
else {
|
|
cVar3 = pEVar24->IsBoss();
|
|
if (cVar3 == '\0') {
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&knockbackDir)))->Vector::__mul(&knockbackVel,
|
|
GHIDRA_CAST<float *>(&knockbackStrength));
|
|
Entity::get_friction();
|
|
bVar2 = 0;
|
|
hitFriction = (void *)BVar35._l;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__div(&knockbackVelScaled,
|
|
GHIDRA_CAST<float *>(&hitFriction));
|
|
pEVar24 = local_a30;
|
|
}
|
|
else {
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&knockbackDir)))->Vector::__mul(&bossKnockbackVel,
|
|
GHIDRA_CAST<float *>(&knockbackStrength));
|
|
bVar2 = 0;
|
|
bossKnockbackFactor = 0.6;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&bossKnockbackScaled,
|
|
&bossKnockbackFactor);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::AddVelocity(tmpVec,bVar2);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar24) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&dashDamageSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
BVar35 = (BitSet128)ZEXT416(local_9fc);
|
|
cVar3 = (*pcVar1)();
|
|
pEVar24 = local_a30;
|
|
if ((cVar3 != '\0') &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0))
|
|
, bVar2 != 0)) {
|
|
play_sound_with_fart_seed(0x4d,1.0,10,0,1.5);
|
|
effect = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(pEVar24))))->Entity_NPC::MakeSplat(1.0);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(effect) + 0x3c);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_a30))))->Entity::SplatColor();
|
|
(*pcVar1)();
|
|
pEVar23 = savedPlayer;
|
|
Entity::ForceCollide(GHIDRA_CAST<Entity *>(savedPlayer),GHIDRA_CAST<Entity *>(local_a30),0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar24) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&fireplaceDamageSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(*pcVar1)();
|
|
}
|
|
}
|
|
FUN_00431620();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pVVar15 = GHIDRA_CAST<Vector *>((GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a04)) + 0x0)))) + 1));
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(pVVar15);
|
|
tmpVec = GHIDRA_CAST<Vector *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(dashHits))))->EntityList)::Size();
|
|
} while (pVVar15 < tmpVec);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((dashHits)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
if (local_a00 == GHIDRA_CAST<Entity_Player *>(0x2ca)) {
|
|
if ((pEVar23->_playerType != 0x23) || (iVar4 = GetOtherTwin(pEVar23), iVar4 == 0))
|
|
goto LAB_0079ba07;
|
|
queryList = GHIDRA_CAST<Entity *>(GetOtherTwin(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::Position(&twinPos);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(assert_lerp_range((float)GHIDRA_INT(local_a0c),0.0,15.0,1.0,16.0,1));
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&twinPos)))->Vector::__sub(&toTwin,&pEVar23->_pos);
|
|
BVar35 = (BitSet128)ZEXT416(local_a1c);
|
|
bVar2 = 0;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Resized(&twinPullVel,(float)local_a1c);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddVelocity(tmpVec,bVar2);
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar4 == 0) goto LAB_0079ba07;
|
|
uVar22 = Random();
|
|
trailVelFactor = 0.5;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector::__mul(&trailVel,&trailVelFactor);
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6f,&pEVar23->_pos,tmpVec,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22);
|
|
(GHIDRA_CAST<BlendMode *>((trailBlendMode)))->BlendMode::SetMode(2,0);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((queryList)))->Entity)::GetSprite();
|
|
puVar10 = trailBlendMode;
|
|
layer = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
copy_20_bytes(layer->_blendMode,puVar10);
|
|
pEVar23 = savedPlayer;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&trailHeightOffset)))->Vector::Vector(0.0,-8.0);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&pEVar23->_posOffset)))->Vector::__add(&trailPosOffset,tmpVec);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetPositionOffset(tmpVec);
|
|
fVar11 = random_float();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((fVar11 * 0.7 + 0.3));
|
|
(GHIDRA_CAST<Color *>((&trailColor)))->Color::Color(0.0,0.0,0.0,1.0);
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(((float)local_a1c * 0.7)));
|
|
(GHIDRA_CAST<Color *>((&trailColor)))->Color::SetOffset((float)local_a1c * 0.4,(float)local_a1c * 0.7,(float)local_a1c);
|
|
queryList->SetColor();
|
|
set_field_358(queryList,-5.0);
|
|
queryList->Update();
|
|
SetMinDamageCooldown(pEVar23,8);
|
|
LAB_0079ba25:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddEntityFlags(0x1000000000);
|
|
}
|
|
else {
|
|
if (pEVar23->_collidesWithGrid == 0) {
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector::operator_ne(&g_vectorZero);
|
|
if ((bVar2 != 0) && (pEVar23->_dead == 0)) {
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector::Normalize();
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector::operator_mul_assign(&dashSpeed);
|
|
}
|
|
}
|
|
else {
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((&pEVar23->_gridCollisionVelocity)))->Vector::Normalized(&gridHitDir);
|
|
tmpVec = &pEVar23->_gridCollisionNormal;
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((pVVar15)))->Vector)::Dot(tmpVec);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x0))) = ZEXT812(0x3e4ccccd);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0;
|
|
if ((float)BVar35._l <= (float)local_a1c) {
|
|
if (pEVar23->_suplexState == 1) {
|
|
suplexCountdownCap = 1.12104e-44;
|
|
piVar14 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
pEVar23->_suplexAimCountdown = *piVar14;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x251);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x251,-1);
|
|
pEVar23->_marsUnk2 = -1;
|
|
dash_impact(pEVar23);
|
|
}
|
|
pEVar23->_ponyCharge = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x82,-1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0xb5,-1);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(8);
|
|
bounceStrength = (void *)0xc1200000;
|
|
bVar2 = 0;
|
|
tmpVec = Vector::operator_mul
|
|
(&bounceVelocity,GHIDRA_CAST<float *>(&bounceStrength),
|
|
&pEVar23->_gridCollisionNormal);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddVelocity(tmpVec,bVar2);
|
|
}
|
|
else {
|
|
reflectDot = (GHIDRA_CAST<Vector *>((&pEVar23->_gridCollisionVelocity)))->Vector::Dot(tmpVec);
|
|
reflectDot = reflectDot + reflectDot;
|
|
tmpVec = Vector::operator_mul(&reflectNormal,&reflectDot,tmpVec);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&pEVar23->_gridCollisionVelocity)))->Vector::__sub(&reflectedVelocity,tmpVec);
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector::operator_assign(tmpVec);
|
|
}
|
|
}
|
|
local_b3c = 1.4013e-44;
|
|
FUN_007dd490();
|
|
FUN_007dc740();
|
|
LAB_0079ba07:
|
|
SetMinDamageCooldown(pEVar23,8);
|
|
if ((local_a00 != GHIDRA_CAST<Entity_Player *>(0x251)) || (pEVar23->_marsUnkBool == 0)) goto LAB_0079ba25;
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddEntityFlags(0x4000000);
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(&pEVar23->_temporaryeffects);
|
|
}
|
|
if (0 < pEVar23->_ponyCharge) {
|
|
pEVar23->_ponyCharge = pEVar23->_ponyCharge + -1;
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x251,0);
|
|
if (((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::HasEntityFlags(0x4000), bVar2 == 0)) &&
|
|
(-1 < pEVar23->_marsCooldown)) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(pEVar8))))->TemporaryEffects::HasCollectibleEffect(0x251);
|
|
if (bVar2 == 0) {
|
|
if (pEVar23->_marsUnkBool == 0) {
|
|
pEVar23->_marsUnkBool = 1;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::ClearEntityFlags(0x1000000000);
|
|
SetMinDamageCooldown(pEVar23,0x1e);
|
|
}
|
|
pEVar23->_marsUnk2 = -1;
|
|
}
|
|
iVar4 = 1;
|
|
bVar2 = HasCollectible(pEVar23,0x82,0);
|
|
if ((bVar2 != 0) || (bVar2 = HasCollectible(pEVar23,0xb5,0), bVar2 != 0)) {
|
|
iVar4 = 2;
|
|
}
|
|
minMarsCooldown = -NAN;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c3c)) + 0x10))) = pEVar23->_marsCooldown - iVar4;
|
|
piVar14 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
iVar4 = *piVar14;
|
|
pEVar23->_marsCooldown = iVar4;
|
|
if (iVar4 == -1) {
|
|
play_sound_with_fart_seed(0xab,1.0,2,0,0.8);
|
|
BVar35 = (BitSet128)ZEXT816(0x3f000000);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x3a);
|
|
AddCostume(pEVar23,configItem,bVar2);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x238,0);
|
|
if (((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::HasEntityFlags(0x4000), bVar2 == 0)) &&
|
|
(-1 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f9c)))))) {
|
|
jupiterCooldownNext = (float)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f9c)))) + -1);
|
|
jupiterCooldownMin = -NAN;
|
|
piVar14 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
iVar4 = *piVar14;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f9c)))) = iVar4;
|
|
if (iVar4 == -1) {
|
|
play_sound_with_fart_seed(0xab,1.0,2,0,0.8);
|
|
BVar35 = (BitSet128)ZEXT816(0x3f000000);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::HasEntityFlags(0x4000);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar23,0x297,0);
|
|
if (bVar2 == 0) {
|
|
if (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ea4))))) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ea4)))) = 0;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x3b);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x3b,1);
|
|
auVar31 = ZEXT812(0x3f000000);
|
|
goto LAB_0079bc57;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ea4)))) + 1;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ea4)))) = iVar4;
|
|
if (((iVar4 == 0x69) || (iVar4 == 0x78)) || (iVar4 == 0x87)) {
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((9 - iVar4 / 0xf));
|
|
if ((GHIDRA_UINT(local_a1c) & 1) == 0) {
|
|
fVar11 = 1.7;
|
|
}
|
|
else {
|
|
fVar11 = 1.4;
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x1d5,0.8 - (float)GHIDRA_INT(local_a1c) * 0.2,1,0,fVar11);
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = SUB128(ZEXT812(0x3f800000),4);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = SUB124(ZEXT812(0x3f800000),0) - (float)GHIDRA_INT(local_a1c) * 0.3;
|
|
LAB_0079bc57:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._h)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x0))) = auVar31;
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
}
|
|
else if (iVar4 == 0x96) {
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x3b);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x3b,1,1);
|
|
BVar35 = (BitSet128)ZEXT816(0x3f000000);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
play_sound_with_fart_seed(0xcd,1.0,2,0,1.0);
|
|
}
|
|
}
|
|
else if (0xb3 < iVar4) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x3b,1);
|
|
BVar35 = (BitSet128)ZEXT816(0x3f000000);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ea4)))) = 0;
|
|
}
|
|
}
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetNullEffect(0x3e);
|
|
if ((pvVar28 != (void *)0x0) && (uVar22 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar28) + 8)), GHIDRA_INT(uVar22) < 0x5a)) {
|
|
if (GHIDRA_INT(uVar22) < 0x20) {
|
|
uVar22 = uVar22 & 0x80000007;
|
|
if (GHIDRA_INT(uVar22) < 0) {
|
|
uVar22 = (uVar22 - 1 | 0xfffffff8) + 1;
|
|
}
|
|
}
|
|
else {
|
|
uVar22 = uVar22 & 0x8000000f;
|
|
if (GHIDRA_INT(uVar22) < 0) {
|
|
uVar22 = (uVar22 - 1 | 0xfffffff0) + 1;
|
|
}
|
|
uVar22 = GHIDRA_INT(uVar22) / 2;
|
|
}
|
|
bVar2 = IsNullItemCostumeVisible(pEVar23,0x3e,-1);
|
|
if (GHIDRA_INT(uVar22) < 4) {
|
|
if (bVar2 != 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x3e);
|
|
RemoveCostume(pEVar23,configItem);
|
|
}
|
|
}
|
|
else if (bVar2 == 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x3e);
|
|
AddCostume(pEVar23,configItem,bVar2);
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x42);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
FUN_00417920();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>(FUN_0090b0e0());
|
|
if (pEVar24 != pEVar23) goto LAB_0079bd65;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Darken(1.0,0x3c);
|
|
}
|
|
LAB_0079bd65:
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x45);
|
|
if (((bVar2 != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ed8)))) < 0)) &&
|
|
(bVar2 = CanPickupItem(pEVar23), bVar2 != 0)) {
|
|
FlushQueueItem(pEVar23);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x45,1);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetItemPool();
|
|
rngPtr = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar22 = (GHIDRA_CAST<RNG *>((rngPtr)))->RNG::Next();
|
|
iVar4 = ItemPool::GetPill(uVar22);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ed8)))) = iVar4;
|
|
AnimatePill(pEVar23,iVar4,GHIDRA_CAST<byte *>("UseItem"));
|
|
play_sound_with_fart_seed(0xfc,1.0,2,0,1.0);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x7a);
|
|
if (((bVar2 != 0) && (bVar2 = CanPickupItem(pEVar23), bVar2 != 0)) &&
|
|
(bVar2 = IsHoldingItem(pEVar23), bVar2 == 0)) {
|
|
FlushQueueItem(pEVar23);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x7a,1);
|
|
rngPtr = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(rngPtr);
|
|
FUN_00424510();
|
|
local_14 = 2.10195e-44;
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
if (bVar2 == 0) {
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0,100,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,1,0x1e,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,2,0x1e,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,3,10,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,4,10,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,5,2,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x1a,2,0);
|
|
iVar4 = 0xc;
|
|
}
|
|
else {
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x10,100,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x12,0x32,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x11,0x1e,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x13,10,0);
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,0x14,10,0);
|
|
iVar4 = 0x1a;
|
|
}
|
|
iVar20 = 0;
|
|
uVar38 = 2;
|
|
uVar39 = 0x79bf5d;
|
|
WeightedOutcomePicker::AddOutcomeWeight(poolPicker,iVar4,2,0);
|
|
uVar5 = 0x23;
|
|
uVar22 = (GHIDRA_CAST<RNG *>((rngPtr)))->RNG::Next();
|
|
(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((aCStackY_2e04[0x81]._colorize + 3)))))->RNG::game_constructor(uVar22,uVar5);
|
|
rng._shift1 = iVar4;
|
|
rng._seed = uVar39;
|
|
rng._shift2 = uVar38;
|
|
rng._shift3 = iVar20;
|
|
uVar22 = (GHIDRA_CAST<WeightedOutcomePicker *>((poolPicker)))->WeightedOutcomePicker::PickOutcome(rng);
|
|
Isaac::GetItemConfig();
|
|
FUN_00730de0();
|
|
itemPool = GHIDRA_CAST<ItemPool *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemPool();
|
|
uVar5 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_a1c))))->RNG::Next();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(ItemPool)::GetCollectible(itemPool,uVar22,uVar5,0,8,0);
|
|
Isaac::GetItemConfig();
|
|
FUN_00730e20();
|
|
pEVar23 = savedPlayer;
|
|
queryList = GHIDRA_CAST<Entity *>(AddItemWisp());
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity *>((queryList)))->Entity::HitPoints();
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetField380((float)(fVar27 * (float10)4.0));
|
|
itemConfig = Isaac::GetItemConfig();
|
|
pEVar17 = local_a1c;
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig)::GetCollectible(GHIDRA_INT(local_a1c));
|
|
if (local_a1c != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
hud = GHIDRA_CAST<HUD *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetHUD();
|
|
(GHIDRA_CAST<HUD *>((hud)))->HUD::ShowItemText(pEVar23,GHIDRA_CAST<ItemConfig_Item *>(local_a1c));
|
|
}
|
|
AnimateCollectible(pEVar23,GHIDRA_INT(pEVar17),GHIDRA_CAST<byte *>("UseItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
SoundEffects::PlayWithFartOverride(0x13c,1.0,2,0,1.0);
|
|
local_14 = -NAN;
|
|
std::vector<Vector>::_Tidy();
|
|
}
|
|
if (-1 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ed8))))) {
|
|
FUN_00420ae0();
|
|
cVar3 = FUN_0082ee30();
|
|
if (((cVar3 == '\0') && (bVar2 = AreControlsEnabled(pEVar23), bVar2 != 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((&pEVar23->_bodySprite)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>("UseItem")), bVar2 == 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(local_cd4),3,-1,-1,1,0);
|
|
local_14 = 2.24208e-44;
|
|
uVar22 = 0;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_cd4))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(*puVar9);
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Familiar *>((local_a1c)))->Entity_Familiar)::Player();
|
|
if (pEVar24 == pEVar23) {
|
|
(GHIDRA_CAST<Entity_Familiar *>((local_a1c)))->Entity_Familiar::farting_baby_fart();
|
|
}
|
|
uVar22 = uVar22 + 1;
|
|
uVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_cd4))))->EntityList::Size();
|
|
} while (uVar22 < uVar5);
|
|
}
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::IncreaseEventCounter(6,1);
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::AddToCollection(0x2b);
|
|
uVar22 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ed8))));
|
|
itemPool = GHIDRA_CAST<ItemPool *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemPool();
|
|
iVar4 = (GHIDRA_CAST<ItemPool *>((itemPool)))->ItemPool::GetPillEffect(uVar22,pEVar23);
|
|
UsePill(pEVar23,iVar4,uVar22,0x100);
|
|
if (pEVar23->_cacheFlags != 0) {
|
|
InvalidateCoPlayerItems(pEVar23);
|
|
EvaluateItems(pEVar23);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ed8)))) = 0xffffffff;
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_cd4)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x46);
|
|
if ((bVar2 != 0) && (bVar2 = IsExtraAnimationFinished(pEVar23), bVar2 != 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x46,1);
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x287,0);
|
|
if (bVar2 != 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ec8)))) < 1) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
FUN_00428a60();
|
|
FUN_007537b0();
|
|
}
|
|
else {
|
|
BVar35 = (BitSet128)
|
|
ZEXT416(GHIDRA_UINT((float)((double)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) +
|
|
__uint_to_double_fixup
|
|
[-(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) >> 0x1f)])));
|
|
}
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(BVar35._l);
|
|
if (0.0 < (float)local_a04) {
|
|
damage_charge_scale();
|
|
chargeLeft = (float)BVar35._l * (float)local_a04;
|
|
pAVar25 = pEVar23->_activeDesc;
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
do {
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(chargeLeft));
|
|
if (chargeLeft <= 0.0) break;
|
|
if (pAVar25->_item != 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(pAVar25->_item);
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(GetActiveMaxCharge(pEVar23,GHIDRA_INT(local_a00)));
|
|
iVar4 = GetActiveMaxCharge(pEVar23,GHIDRA_INT(local_a00));
|
|
if ((iVar4 == 0) &&
|
|
((pAVar25->_charge < GHIDRA_INT(local_a04) ||
|
|
((bVar2 = HasCollectible(pEVar23,0x3f,0), bVar2 != 0 &&
|
|
(pAVar25->_batteryCharge < GHIDRA_INT(local_a04))))))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b94)) + 0x10))) = 1.0 - (float)pAVar25->_partialCharge;
|
|
partialChargeMin = (void *)0x0;
|
|
std::max<float>();
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
chargeLeft = chargeLeft - *pfVar16;
|
|
BVar35 = (BitSet128)ZEXT416(GHIDRA_UINT(chargeLeft));
|
|
pAVar25->_partialCharge = GHIDRA_INT((*pfVar16 + (float)pAVar25->_partialCharge));
|
|
}
|
|
}
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a00)) + 0x1))));
|
|
pAVar25 = pAVar25 + 1;
|
|
} while (local_a00 < &DAT_00000004);
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetHitPointsLost();
|
|
voltCooldownLeft = (void *)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ec8)))) - iVar4);
|
|
voltCooldownMin = 0.0;
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::max<int>();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1ec8)))) = *puVar9;
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x2c0,0);
|
|
if (((bVar2 != 0) || (pEVar23->_playerType == 0x1b)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x2c0), bVar2 == 0)
|
|
) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
FUN_00428a60();
|
|
FUN_007537b0();
|
|
}
|
|
else {
|
|
BVar35 = (BitSet128)
|
|
ZEXT416(GHIDRA_UINT((float)((double)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) +
|
|
__uint_to_double_fixup
|
|
[-(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) >> 0x1f)])));
|
|
}
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(BVar35._l);
|
|
if (0.0 < (float)local_a04) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2c0);
|
|
damage_charge_scale();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = (float)BVar35._l * (float)local_a04 * 50000.0;
|
|
iVar4 = GHIDRA_INT((float)BVar35._l);
|
|
if (pEVar23->_playerType == 0x1b) {
|
|
add_samson_berserk_charge(pEVar23,iVar4);
|
|
}
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(pEVar23->_activeDesc);
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x0);
|
|
do {
|
|
if (iVar4 < 1) break;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a08)) + 0x0)))) == 0x2c0) {
|
|
iVar20 = AddActiveCharge(pEVar23,iVar4,GHIDRA_INT(local_a04),0,0,1);
|
|
iVar4 = iVar4 - iVar20;
|
|
}
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>((GHIDRA_INT(&(GHIDRA_CAST<Vector *>(local_a04))->x) + 1));
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_a08) + 0x20));
|
|
} while (local_a04 < GHIDRA_CAST<Vector *>(&DAT_00000004));
|
|
}
|
|
}
|
|
if (pEVar23->_playerType == 0x19) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
FUN_00428a60();
|
|
FUN_007537b0();
|
|
}
|
|
else {
|
|
BVar35 = (BitSet128)
|
|
ZEXT416(GHIDRA_UINT((float)((double)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) +
|
|
__uint_to_double_fixup
|
|
[-(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) >> 0x1f)])));
|
|
}
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(BVar35._l);
|
|
if (0.0 < (float)local_a04) {
|
|
damage_charge_scale();
|
|
fVar11 = (float)BVar35._l * (float)local_a04 * 1.5 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f74))));
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f74)))) = fVar11;
|
|
if (1.0 <= fVar11) {
|
|
pEVar17 = GHIDRA_CAST<Entity_Familiar *>(GHIDRA_INT(fVar11));
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f74)))) = fVar11 - (float)GHIDRA_INT(pEVar17);
|
|
local_a1c = pEVar17;
|
|
if (0 < GHIDRA_INT(pEVar17)) {
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(&pEVar23->_pos);
|
|
do {
|
|
uVar22 = Random();
|
|
tmpVec = GHIDRA_CAST<Vector *>(FUN_0058e240());
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x2a,GHIDRA_CAST<Vector *>(local_a04),tmpVec,GHIDRA_CAST<Entity *>(0x0),0,uVar22);
|
|
queryList->Update();
|
|
pEVar17 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pEVar17[-1])) + 0xf47))));
|
|
} while (pEVar17 != GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x22,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),10,uVar22);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(queryList) + 0x3c);
|
|
(GHIDRA_CAST<Color *>((poofColor)))->Color::Color();
|
|
(*pcVar1)();
|
|
poofScaleFactor = 0.5;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(poofScale,&poofScaleFactor);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
fVar11 = random_float();
|
|
pEVar23 = savedPlayer;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar35._l)) + 0x0))) = fVar11 * 0.2 + 1.8;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(BVar35)) + 0x4))) = extraout_var_05;
|
|
play_sound_with_fart_seed(0x25,0.8,2,0,(float)BVar35._l);
|
|
}
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x2d5,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
FUN_00428a60();
|
|
FUN_007537b0();
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(BVar35._l);
|
|
}
|
|
else {
|
|
local_a04 = (Entity_NPC *)
|
|
(float)((double)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) +
|
|
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x16b8)))) >> 0x1f)]);
|
|
}
|
|
if (0.0 < (float)local_a04) {
|
|
damage_charge_scale();
|
|
FUN_007d9360();
|
|
}
|
|
}
|
|
fVar11 = pEVar23->_ibsCharge;
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT(fVar11));
|
|
if (fVar11 < 0.0) {
|
|
ibsChargeNext = fVar11 + 0.016666668;
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT(ibsChargeNext));
|
|
ibsChargeMax = (void *)0x0;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
pEVar23->_ibsCharge = *pfVar16;
|
|
}
|
|
tempEffects = &pEVar23->_temporaryeffects;
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects)::GetCollectibleEffectNum(699);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if ((iVar4 == 3) || (local_a04 == GHIDRA_CAST<Entity_NPC *>(&DAT_00000005))) {
|
|
bVar2 = HasCollectible(pEVar23,699,0);
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveCollectibleEffect(699,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(699);
|
|
RemoveCostume(pEVar23,configItem);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x60);
|
|
RemoveCostume(pEVar23,configItem);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x61);
|
|
RemoveCostume(pEVar23,configItem);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x62);
|
|
RemoveCostume(pEVar23,configItem);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(99);
|
|
RemoveCostume(pEVar23,configItem);
|
|
}
|
|
else {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_a0d = (GHIDRA_CAST<Room *>((room)))->Room::IsClear();
|
|
pGVar12 = GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<GridEntity *>((pGVar12)))->GridEntity::GetVariant();
|
|
if (iVar4 == 0xb) {
|
|
LAB_0079c87f:
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::IsAmbushDone();
|
|
}
|
|
else {
|
|
pGVar12 = GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<GridEntity *>((pGVar12)))->GridEntity::GetVariant();
|
|
if (iVar4 == 0x11) goto LAB_0079c87f;
|
|
bVar2 = local_a0d;
|
|
}
|
|
if ((bVar2 == 0) &&
|
|
((local_a04 == GHIDRA_CAST<Entity_NPC *>(&DAT_00000004) || (local_a04 == GHIDRA_CAST<Entity_NPC *>(&DAT_00000005)))))
|
|
{
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddCollectibleEffect(699,0,6 - GHIDRA_INT(local_a04));
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
iVar4 = Isaac::Random(2);
|
|
GetTearHitParams(pEVar23,aTStack_8c0,3,1.5,iVar4 * 2 + -1,queryList);
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&rageDir,pEVar23->_headDirection);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&pEVar23->_aimDirection)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Vector *>((&rageDir)))->Vector::operator_assign(&pEVar23->_aimDirection);
|
|
}
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&rageDir)))->Vector)::GetAngleDegrees();
|
|
bVar2 = 0;
|
|
pEVar24 = pEVar23;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&rageLaserOffset)))->Vector::Vector(0.0,-30.0);
|
|
laser = Entity_Laser::ShootAngle
|
|
(0xb,&pEVar23->_pos,(float)local_a1c,0x5a,tmpVec,GHIDRA_CAST<Entity *>(pEVar24),bVar2);
|
|
laser->SetCollisionDamage();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f00)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(laser));
|
|
tmpFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagWait)))->BitSet128::__bnot(¬WaitFlags);
|
|
tmpFlags = BitSet128::operator_and(&rageLaserFlags,&aTStack_8c0[0]._flags,tmpFlags);
|
|
BVar36 = *tmpFlags;
|
|
FUN_00456830();
|
|
laser->SetColor();
|
|
laser->Update();
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(99);
|
|
AddCostume(pEVar23,configItem,bVar2);
|
|
(GHIDRA_CAST<std::string *>((headDownShoot)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadDownShoot"));
|
|
local_14 = 2.38221e-44;
|
|
(GHIDRA_CAST<std::string *>((headRightShoot)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadRightShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x12;
|
|
(GHIDRA_CAST<std::string *>((headUpShoot)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadUpShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x13;
|
|
(GHIDRA_CAST<std::string *>((headLeftShoot)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadLeftShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x14;
|
|
direction.y = rageDir.y;
|
|
direction.x = rageDir.x;
|
|
animName = string_from_direction
|
|
(rageHeadAnim,direction,headLeftShoot,headUpShoot,headRightShoot,
|
|
headDownShoot);
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x15);
|
|
play_null_costume_anim(pEVar23,99,0,animName,-1,0);
|
|
(GHIDRA_CAST<std::string *>((rageHeadAnim)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((headLeftShoot)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((headUpShoot)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((headRightShoot)))->std::string::_Tidy_deallocate();
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<std::string *>((headDownShoot)))->std::string::_Tidy_deallocate();
|
|
}
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x26b,0);
|
|
if (bVar2 != 0) {
|
|
if (pEVar23->_playerType == 5) {
|
|
cVar3 = IsCoopGhost(pEVar23);
|
|
if (((cVar3 == '\0') && (bVar2 = HasCollectible(pEVar23,0x75,0), bVar2 != 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x75),
|
|
bVar2 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x75,1,1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x75);
|
|
RemoveCostume(pEVar23,configItem);
|
|
}
|
|
}
|
|
else if (pEVar23->_playerType == 0x21) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(&pEVar23->_pos);
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(coinQuery),GHIDRA_CAST<Vector *>(local_a1c),80.0,0x10);
|
|
local_14 = 3.08286e-44;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(coinQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
uVar22 = 0;
|
|
do {
|
|
std::vector<int>::operator_index();
|
|
pickup = GHIDRA_CAST<Entity_Pickup *>(FUN_00435e30());
|
|
if (((pickup != GHIDRA_CAST<Entity_Pickup *>(0x0)) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pickup))))->Entity::IsType(5,0x14,-1), bVar2 != 0)) &&
|
|
((iVar4 = (GHIDRA_CAST<Entity_Pickup *>((pickup)))->Entity_Pickup::Timeout(), 0 < iVar4 &&
|
|
(cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pickup))))->Entity::IsDead(), cVar3 == '\0')))) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pickup))))->Entity::Position(&coinPos);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_a1c))))->Vector::__sub(GHIDRA_CAST<Vector *>((local_c84 + 0x10)),tmpVec);
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_c84 + 0x10)))))->Vector)::LengthSquared();
|
|
BVar36 = (BitSet128)ZEXT416(local_a04);
|
|
if (16.0 < (float)local_a04) {
|
|
tmpVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_c84 + 0x10)))))->Vector::Resized(&coinPullVel,10.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pickup))))->Entity::SetVelocity(tmpVec);
|
|
FUN_0044bfa0();
|
|
}
|
|
}
|
|
uVar22 = uVar22 + 1;
|
|
uVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(coinQuery))))->EntityList::Size();
|
|
} while (uVar22 < uVar5);
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((coinQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x75,0);
|
|
if ((((bVar2 != 0) && ((pEVar23->_playerType == 10 || (pEVar23->_playerType == 0x1f)))) &&
|
|
(cVar3 = IsCoopGhost(pEVar23), cVar3 == '\0')) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x75), bVar2 == 0))
|
|
{
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x75,1,1);
|
|
}
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x2c9);
|
|
if (pvVar28 != (void *)0x0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(familiarQuery),3,0xee,-1,1,0);
|
|
local_14 = 3.22299e-44;
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(familiarQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar17 = GHIDRA_CAST<Entity_Familiar *>(*puVar9);
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Familiar *>((pEVar17)))->Entity_Familiar)::Player();
|
|
if (((pEVar24 == pEVar23) && (iVar4 = FUN_0060d110(), iVar4 == 0)) &&
|
|
(iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar17))))->Entity::SubType(), iVar4 != 7)) {
|
|
FUN_00436200();
|
|
bVar2 = HasCollectible(pEVar23,0x248,0);
|
|
if (bVar2 != 0) {
|
|
AddWisp(pEVar23,0x2c9,&pEVar23->_pos,0,0);
|
|
}
|
|
goto LAB_0079ce72;
|
|
}
|
|
puVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a04)) + 0x1)));
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(puVar19);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(familiarQuery))))->EntityList)::Size();
|
|
} while (puVar19 < puVar10);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x2c9,-1);
|
|
LAB_0079ce72:
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((familiarQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x27a,0);
|
|
if ((bVar2 != 0) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::IsFrame(0x1e,0), bVar2 != 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar2 = (GHIDRA_CAST<Room *>((room)))->Room::IsClear();
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetAmbush();
|
|
cVar3 = FUN_005cd630();
|
|
if (cVar3 == '\0') goto LAB_0079cfcb;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(riftQuery),1000,0xbd,0,0,0);
|
|
local_14 = 3.36312e-44;
|
|
uVar22 = 0;
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(riftQuery))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar24 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity)::SpawnerEntity();
|
|
if (pEVar24 == pEVar23) goto LAB_0079cfb9;
|
|
uVar22 = uVar22 + 1;
|
|
uVar5 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(riftQuery))))->EntityList::Size();
|
|
} while (uVar22 < uVar5);
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::get_random_pickup_position(room,&riftSpawnPos,1,0);
|
|
rngPtr = GHIDRA_CAST<RNG *>(rng_vector_at());
|
|
uVar22 = (GHIDRA_CAST<RNG *>((rngPtr)))->RNG::Next();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xbd,&riftSpawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22);
|
|
queryList->Update();
|
|
LAB_0079cfb9:
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((riftQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
LAB_0079cfcb:
|
|
bVar2 = HasCollectible(pEVar23,0x114,0);
|
|
if (bVar2 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
entityList = (GHIDRA_CAST<Room *>((room)))->Room::GetEntities();
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>(local_c84))))->EntityList_EL::constructor(GHIDRA_CAST<EntityList_EL *>(entityList));
|
|
local_14 = 3.50325e-44;
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_c84))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
std::vector<int>::operator_index();
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(FUN_004aad40());
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
queryList = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity)::to_npc_or_coop_player();
|
|
pEVar18 = local_a04;
|
|
if (local_a04 == GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
if (queryList != GHIDRA_CAST<Entity *>(0x0)) {
|
|
FUN_00417340();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar36._l)) + 0x0))) = (float)BVar36._l + pEVar23->_size + 8.0;
|
|
pushRadius = (float)BVar36._l;
|
|
iVar4 = (GHIDRA_CAST<Entity *>((queryList)))->Entity::EntityCollisionClass();
|
|
if (iVar4 != 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((queryList)))->Entity::Position(&heartPushPosX);
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT((tmpVec->x - (pEVar23->_pos).x)));
|
|
Math::abs();
|
|
if ((float)BVar36._l < pushRadius) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((queryList)))->Entity::Position(&heartPushPosY);
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT((tmpVec->y - (pEVar23->_pos).y)));
|
|
Math::abs();
|
|
if ((float)BVar36._l < pushRadius) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((queryList)))->Entity::Position(&heartPushPos);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__sub(&pushDir,&pEVar23->_pos);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&pushDir)))->Vector)::Length();
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT(pushRadius));
|
|
if (((float)local_a1c < pushRadius) && (0.0 < (float)local_a1c)) {
|
|
(GHIDRA_CAST<Vector *>((&pushDir)))->Vector::__div_assign(&pushRadius);
|
|
tmpVec = (GHIDRA_CAST<Entity *>((queryList)))->Entity::Velocity(&heartPushVel);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Dot(&pushDir);
|
|
BVar36 = (BitSet128)ZEXT416(local_a1c);
|
|
if ((float)local_a1c < 0.0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar36._l)) + 0x0))) = -(float)local_a1c;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar36._l)) + 0x4))) = 0x80000000;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar36._h)) + 0x0))) = 0x80000000;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(BVar36._h)) + 0x4))) = 0x80000000;
|
|
bVar2 = 0;
|
|
pushStrength = (float)BVar36._l;
|
|
tmpVec = Vector::operator_mul(&pushVelocity,&pushStrength,&pushDir);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::AddVelocity_divided(tmpVec,bVar2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
FUN_00417340();
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(((float)BVar36._l + pEVar23->_size + 20.0));
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(pEVar18))))->Entity_Tear::Height();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
BVar36 = (BitSet128)ZEXT416(local_a1c);
|
|
if (-90.0 < (float)local_a1c) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::Position(&heartProjPosX);
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT((tmpVec->x - (pEVar23->_pos).x)));
|
|
Math::abs();
|
|
if ((float)BVar36._l < (float)local_a34) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::Position(&heartProjPosY);
|
|
BVar36 = (BitSet128)ZEXT416(GHIDRA_UINT((tmpVec->y - (pEVar23->_pos).y)));
|
|
Math::abs();
|
|
if ((float)BVar36._l < (float)local_a34) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::Position(&heartProjPos);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Distance(&pEVar23->_pos);
|
|
BVar36 = (BitSet128)ZEXT416(local_a34);
|
|
if ((float)local_a1c < (float)local_a34) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::Die();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pAVar25 = GHIDRA_CAST<ActiveItemDesc *>((GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a08)) + 0x0)))) + 1));
|
|
local_a08 = GHIDRA_CAST<Entity_Player *>(pAVar25);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_c84))))->EntityList)::Size();
|
|
} while (pAVar25 < puVar10);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_c84)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
bVar2 = HasTrinket(pEVar23,0x7d,0);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(local_c3c),3,-1,-1,0,0);
|
|
local_14 = 3.64338e-44;
|
|
FUN_00424510();
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x1b);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_c3c))))->EntityList::Size();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
FUN_0042c820();
|
|
pvVar28 = (void *)0x0;
|
|
local_a04 = (void *)0x0;
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
pEVar24 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(pvVar28));
|
|
if (((pEVar24 != pEVar23) && (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::IsDead(), cVar3 == '\0'))
|
|
&& (cVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Visible(), cVar3 != '\0')) {
|
|
cordPlayer = pEVar24;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
pvVar28 = (void *)(GHIDRA_INT(local_a04) + 1);
|
|
local_a04 = pvVar28;
|
|
pvVar7 = (void *)(GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
} while (pvVar28 < pvVar7);
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_c3c))))->EntityList::Size();
|
|
FUN_0042c820();
|
|
}
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_c3c))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
std::vector<int>::operator_index();
|
|
queryList = GHIDRA_CAST<Entity *>(FUN_00435de0());
|
|
if (((queryList != GHIDRA_CAST<Entity *>(0x0)) && (cVar3 = FUN_00753d20(), cVar3 == '\0')) &&
|
|
(cVar3 = (GHIDRA_CAST<Entity *>((queryList)))->Entity::Visible(), cVar3 != '\0')) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if ((cVar3 == '\0') ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((queryList)))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(pEVar23)), bVar2 != 0)) {
|
|
cordFamiliar = queryList;
|
|
std::vector<unsigned_int>::push_back();
|
|
}
|
|
}
|
|
puVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a04)) + 0x1)));
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(puVar19);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_c3c))))->EntityList)::Size();
|
|
} while (puVar19 < puVar10);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
if (iVar4 != 0) {
|
|
iVar4 = 2;
|
|
iVar20 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
if (iVar20 == 1) {
|
|
iVar4 = 0x3c;
|
|
}
|
|
else {
|
|
iVar20 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
if (iVar20 == 2) {
|
|
iVar4 = 10;
|
|
}
|
|
else {
|
|
uVar22 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
if ((2 < uVar22) && (uVar22 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size(), uVar22 < 9)) {
|
|
iVar4 = 4;
|
|
}
|
|
}
|
|
}
|
|
iVar20 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
if (iVar20 % iVar4 == 0) {
|
|
if (pEVar23->_extensionCordIndex == -1) {
|
|
LAB_0079d585:
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
iVar4 = iVar4 + -1;
|
|
pEVar23->_extensionCordIndex = iVar4;
|
|
}
|
|
else {
|
|
iVar4 = pEVar23->_extensionCordIndex;
|
|
iVar20 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
if (iVar20 <= iVar4) goto LAB_0079d585;
|
|
}
|
|
if (-1 < iVar4) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Position(GHIDRA_CAST<Vector *>((local_adc + 0x10)));
|
|
cordEnd.x = (pEVar23->_pos).x;
|
|
cordEnd.y = (pEVar23->_pos).y;
|
|
if (0 < pEVar23->_extensionCordIndex) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Position(&prevCordPos);
|
|
(GHIDRA_CAST<Vector *>((&cordEnd)))->Vector::operator_assign(tmpVec);
|
|
}
|
|
local_a1c = (Entity_Familiar *)
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_adc + 0x10)))))->Vector::DistanceSquared(&cordEnd);
|
|
if (400.0 < (float)local_a1c) {
|
|
iVar4 = GetTrinketMultiplier(pEVar23,0x7d);
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(((float)iVar4 * 6.0));
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(FUN_0042c810());
|
|
queryList = GHIDRA_CAST<Entity *>(*puVar9);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&cordLaserOffset)))->Vector::Vector(0.0,-20.0);
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((&cordEnd)))->Vector::__sub(&cordDelta,GHIDRA_CAST<Vector *>((local_adc + 0x10)));
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((pVVar15)))->Vector)::GetAngleDegrees();
|
|
laser = Entity_Laser::ShootAngle
|
|
(2,GHIDRA_CAST<Vector *>((local_adc + 0x10)),(float)local_a1c,3,tmpVec,queryList,0);
|
|
FUN_00435cd0();
|
|
fVar11 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_adc + 0x10)))))->Vector::Distance(&cordEnd);
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::SetMaxDistance(fVar11);
|
|
laser->SetCollisionDamage();
|
|
set_field_0x37c();
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(laser) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*pcVar1)();
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::set_disable_init_sound();
|
|
laser->Update();
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
piVar14 = &pEVar23->_extensionCordIndex;
|
|
*piVar14 = *piVar14 + -1;
|
|
if (*piVar14 < 0) {
|
|
iVar4 = (GHIDRA_CAST<std::vector *>((cordEntities)))->std::vector::size();
|
|
pEVar23->_extensionCordIndex = iVar4 + -1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
FID_conflict__Tidy(cordEntities);
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_c3c)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
if ((0 < pEVar23->_megaBlastDuration) && (bVar2 = AreControlsEnabled(pEVar23), bVar2 != 0)) {
|
|
pEVar23->_megaBlastDuration = pEVar23->_megaBlastDuration + -1;
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
iVar4 = Isaac::Random(2);
|
|
GetTearHitParams(pEVar23,&local_338,3,1.0,iVar4 * 2 + -1,queryList);
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&megaBlastDir,pEVar23->_headDirection);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&pEVar23->_aimDirection)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Vector *>((&megaBlastDir)))->Vector::operator_assign(&pEVar23->_aimDirection);
|
|
}
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Vector *>((&megaBlastDir)))->Vector)::GetAngleDegrees();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(&pEVar23->_megaBlastLaser);
|
|
if ((*(void **)local_a1c == (void *)0x0) && (0xf < pEVar23->_megaBlastDuration)) {
|
|
iVar4 = 6;
|
|
bVar2 = HasCollectible(savedPlayer,0x44,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = 0xf;
|
|
}
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&megaBlastOffset)))->Vector::Vector(0.0,-30.0);
|
|
minLaserTimeout = (void *)0x0;
|
|
laserTimeout = (float)(savedPlayer->_megaBlastDuration + -0xf);
|
|
piVar14 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
laser = Entity_Laser::ShootAngle
|
|
(iVar4,&savedPlayer->_pos,(float)local_a04,*piVar14,tmpVec,
|
|
GHIDRA_CAST<Entity *>(savedPlayer),0);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(laser) + 0x40);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 == '\0') {
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(0x40a00000);
|
|
}
|
|
(*pcVar1)();
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::set_disable_init_sound();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(local_a1c))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(laser));
|
|
tmpFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagWait)))->BitSet128::__bnot(¬WaitFlags2);
|
|
BitSet128::operator_and(&megaBlastFlags,&local_338._flags,tmpFlags);
|
|
FUN_00456830();
|
|
pEVar23 = savedPlayer;
|
|
laser->SetColor();
|
|
laser->Update();
|
|
}
|
|
pEVar18 = GHIDRA_CAST<Entity_NPC *>(__RTDynamicCast());
|
|
if (pEVar18 != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar18))))->Entity_Projectile::Damage();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
fVar11 = LerpAngleDeg((float)local_a1c,(float)local_a04,0.3);
|
|
(GHIDRA_CAST<Entity_NPC *>((pEVar18)))->Entity_NPC::SetAimAngle(fVar11);
|
|
GetLaserOffset(pEVar23,&megaBlastLaserOffset,4,&megaBlastDir);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::SetPositionOffset(offset);
|
|
tmpFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagWait)))->BitSet128::__bnot(¬WaitFlags3);
|
|
BitSet128::operator_and(&megaBlastFlags2,&local_338._flags,tmpFlags);
|
|
FUN_00456830();
|
|
pEVar18->SetColor();
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::Child();
|
|
if (iVar4 != 0) {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity)::Child();
|
|
(**(code **)(*piVar14 + 0x3c))();
|
|
}
|
|
if (megaBlastDir.y <= -0.5) {
|
|
fVar11 = -10.0;
|
|
}
|
|
else {
|
|
fVar11 = 3000.0;
|
|
}
|
|
set_field_358(pEVar18,fVar11);
|
|
}
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&megaBlastDir)))->Vector::__unm(&megaBlastRecoilDir);
|
|
bVar2 = 0;
|
|
megaBlastRecoil = (void *)0x3f59999a;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&megaBlastRecoilVel,GHIDRA_CAST<float *>(&megaBlastRecoil));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddVelocity_divided(tmpVec,bVar2);
|
|
pEVar23->_blinkTime = 7;
|
|
if (pEVar23->_megaBlastDuration < 1) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x1f);
|
|
RemoveCostume(pEVar23,configItem);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f00)))) != 0) && (bVar2 = AreControlsEnabled(pEVar23), bVar2 != 0)) {
|
|
queryList = GHIDRA_CAST<Entity *>(0x0);
|
|
iVar4 = Isaac::Random(2);
|
|
GetTearHitParams(pEVar23,&TStack_928,3,1.0,iVar4 * 2 + -1,queryList);
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&rageLaserDir,pEVar23->_headDirection);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&pEVar23->_aimDirection)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<Vector *>((&rageLaserDir)))->Vector::operator_assign(&pEVar23->_aimDirection);
|
|
}
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&rageLaserDir)))->Vector)::GetAngleDegrees();
|
|
pEVar18 = GHIDRA_CAST<Entity_NPC *>(FUN_00435df0());
|
|
if (pEVar18 != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar18))))->Entity_Projectile::Damage();
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>((float)fVar27);
|
|
fVar11 = LerpAngleDeg((float)local_a28,(float)local_a1c,0.3);
|
|
(GHIDRA_CAST<Entity_NPC *>((pEVar18)))->Entity_NPC::SetAimAngle(fVar11);
|
|
GetLaserOffset(pEVar23,&rageLaserOffset2,4,&rageLaserDir);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::SetPositionOffset(offset_00);
|
|
tmpFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagWait)))->BitSet128::__bnot(¬WaitFlags4);
|
|
BitSet128::operator_and(&rageLaserFlags2,&TStack_928._flags,tmpFlags);
|
|
FUN_00456830();
|
|
pEVar18->SetColor();
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity::Child();
|
|
if (iVar4 != 0) {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar18))))->Entity)::Child();
|
|
(**(code **)(*piVar14 + 0x3c))();
|
|
}
|
|
if (rageLaserDir.y <= -0.5) {
|
|
fVar11 = -10.0;
|
|
}
|
|
else {
|
|
fVar11 = 3000.0;
|
|
}
|
|
set_field_358(pEVar18,fVar11);
|
|
}
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&rageLaserDir)))->Vector::__unm(&rageRecoilDir);
|
|
bVar2 = 0;
|
|
rageRecoil = 0.15;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__mul(&rageRecoilVel,&rageRecoil);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::AddVelocity_divided(tmpVec,bVar2);
|
|
(GHIDRA_CAST<std::string *>((headDownShoot2)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadDownShoot"));
|
|
local_14 = 3.92364e-44;
|
|
(GHIDRA_CAST<std::string *>((headRightShoot2)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadRightShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1d;
|
|
(GHIDRA_CAST<std::string *>((headUpShoot2)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadUpShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1e;
|
|
(GHIDRA_CAST<std::string *>((headLeftShoot2)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("HeadLeftShoot"));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1f;
|
|
direction_00.y = rageLaserDir.y;
|
|
direction_00.x = rageLaserDir.x;
|
|
string_from_direction
|
|
(local_78 + 0x2c,direction_00,headLeftShoot2,headUpShoot2,headRightShoot2,
|
|
headDownShoot2);
|
|
(GHIDRA_CAST<std::string *>((headLeftShoot2)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((headUpShoot2)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((headRightShoot2)))->std::string::_Tidy_deallocate();
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x24);
|
|
(GHIDRA_CAST<std::string *>((headDownShoot2)))->std::string::_Tidy_deallocate();
|
|
play_null_costume_anim(pEVar23,99,0,GHIDRA_CAST<std_string *>((local_78 + 0x2c)),-2,0);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(99);
|
|
iVar4 = get_costume_anim_frame(pEVar23,Weapon::is_held_item,configItem,0);
|
|
if (0xf < iVar4) {
|
|
play_item_costume_anim
|
|
(pEVar23,Weapon::is_held_item,configItem,0,GHIDRA_CAST<std_string *>((local_78 + 0x2c)),8);
|
|
}
|
|
pEVar23->_blinkTime = 7;
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<std::string *>((local_78 + 0x2c)))->std::string::_Tidy_deallocate();
|
|
}
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffectNum(699);
|
|
if ((5 < iVar4) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1f00)))) == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(699,-1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(99);
|
|
RemoveCostume(pEVar23,configItem);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar2 = 0;
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(699);
|
|
AddCostume(pEVar23,configItem,bVar2);
|
|
}
|
|
if ((pEVar23->_montezumaLaser != (void *)0x0) && (bVar2 = AreControlsEnabled(pEVar23), bVar2 != 0)
|
|
) {
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>((pEVar23->_bodyAngle + 180.0));
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(FUN_00435df0());
|
|
if (local_a04 != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
Vector::FromAngle(&montezumaDir,(float)local_a28);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_a04))))->Entity_Projectile::Damage();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
fVar11 = LerpAngleDeg((float)local_a1c,(float)local_a28,0.3);
|
|
(GHIDRA_CAST<Entity_NPC *>((local_a04)))->Entity_NPC::SetAimAngle(fVar11);
|
|
}
|
|
}
|
|
if ((0 < pEVar23->_planCKillCountdown) &&
|
|
(iVar4 = pEVar23->_planCKillCountdown + -1, pEVar23->_planCKillCountdown = iVar4, iVar4 == 0))
|
|
{
|
|
if ((pEVar23->_playerType == 3) &&
|
|
((bVar2 = HasCollectible(pEVar23,0x26b,0), bVar2 != 0 &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1db),
|
|
bVar2 == 0)))) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1db,0,1);
|
|
}
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar23) + 0x24);
|
|
(GHIDRA_CAST<EntityRef *>((&planCSource)))->EntityRef::EntityRef();
|
|
(*pcVar1)();
|
|
*GHIDRA_CAST<undefined4 *>(&pEVar23->_lastDamageFlags) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar23->_lastDamageFlags) + 4)) = 0;
|
|
(pEVar23->_lastDamageSource)._type = 0;
|
|
(pEVar23->_lastDamageSource)._variant = 0;
|
|
}
|
|
bVar2 = HasPlayerForm(pEVar23,0xd);
|
|
if (bVar2 != 0) {
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector)::LengthSquared();
|
|
if (1.0 < (float)local_a1c) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::IsFrame(5,0);
|
|
if (bVar2 != 0) {
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(Random());
|
|
stompyDustVelFactor = (void *)0x3f333333;
|
|
local_a28 = (Entity_Tear *)
|
|
(GHIDRA_CAST<Vector *>((&pEVar23->_velocity)))->Vector::__mul(&stompyDustVel,GHIDRA_CAST<float *>(&stompyDustVelFactor));
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::Position(&stompyPos);
|
|
pVVar15 = MusicManager::RandomVector(&stompyRandomDir);
|
|
stompyDustSpread = random_float();
|
|
stompyDustSpread = stompyDustSpread * 20.0;
|
|
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&stompyDustOffset,&stompyDustSpread);
|
|
tmpVec = (GHIDRA_CAST<Vector *>((tmpVec)))->Vector::__add(&stompyDustPos,pVVar15);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,tmpVec,GHIDRA_CAST<Vector *>(local_a28),GHIDRA_CAST<Entity *>(0x0),0,GHIDRA_UINT(local_a1c));
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast());
|
|
iVar4 = Isaac::Random(2);
|
|
if (iVar4 == 0) {
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(0x3f800000);
|
|
}
|
|
else {
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(&DAT_bf800000);
|
|
}
|
|
fVar11 = random_float();
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_rotation(fVar11 * 5.0 * (float)local_a28);
|
|
iVar4 = Isaac::Random(0xf);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(iVar4 + 0xf);
|
|
effect->Update();
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x1bf,0);
|
|
if (bVar2 != 0) {
|
|
FUN_00428b50();
|
|
cVar3 = FUN_0082ee30();
|
|
if ((((cVar3 == '\0') && (bVar2 = AreControlsEnabled(pEVar23), bVar2 != 0)) &&
|
|
(pEVar23->_fireBlockCooldown < 1)) &&
|
|
((*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x18f0)))) % 0xf0 < 2 && (1 < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x18f0)))))))) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x69,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),0,uVar22)
|
|
;
|
|
bVar2 = HasTrinket(pEVar23,0x86,0);
|
|
if (bVar2 != 0) {
|
|
tmpVec = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((queryList)))->Entity)::SpriteScale();
|
|
cloudScaleFactor = (void *)0x40000000;
|
|
tmpVec = Vector::operator_mul(&cloudScale,GHIDRA_CAST<float *>(&cloudScaleFactor),tmpVec);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetSpriteScale(tmpVec);
|
|
}
|
|
queryList->Update();
|
|
SoundEffects::PlayWithFartOverride(0x35c,1.0,2,0,1.0);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (((cVar3 != '\0') && (bVar2 = HasCollectible(pEVar23,0x2b5,0), bVar2 != 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::IsFrame(300,0), bVar2 != 0)) {
|
|
AddSwarmFlyOrbital(pEVar23,&pEVar23->_pos);
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if ((((cVar3 != '\0') && (pEVar23->_dead == 0)) && (pEVar23->_variant == 0)) &&
|
|
(cVar3 = IsCoopGhost(pEVar23), cVar3 == '\0')) {
|
|
local_a28 = GHIDRA_CAST<Entity_Tear *>(0x4e6e6b28);
|
|
puVar10 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
local_9fc = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
pEVar24 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(puVar10));
|
|
if (pEVar24 != pEVar23) {
|
|
bVar2 = HasCollectible(pEVar24,0x2b8,0);
|
|
if (bVar2 != 0) {
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar24))))->Entity::Position(&otherPlayerPos);
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::DistanceSquared(&pEVar23->_pos);
|
|
auVar32 = ZEXT416(local_a28);
|
|
if ((float)local_a34 < (float)local_a28) {
|
|
get_salvation_scale();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar37)) + 0x4))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar37)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0))) * 70.0 + pEVar23->_size;
|
|
FUN_006daa90();
|
|
if ((double)(float)local_a34 < (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar37)) + 0x0)))) {
|
|
local_a28 = local_a34;
|
|
local_9fc = pEVar24;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
puVar10 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a04)) + 0x1)));
|
|
local_a04 = GHIDRA_CAST<Entity_NPC *>(puVar10);
|
|
puVar19 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetNumPlayers();
|
|
pEVar24 = local_9fc;
|
|
} while (puVar10 < puVar19);
|
|
if (local_9fc != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar4 = EntityPtr::Ref();
|
|
if (iVar4 == 0) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x13,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar24),3,
|
|
uVar22);
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetTarget(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_9fc));
|
|
queryList->SetCollisionDamage();
|
|
queryList->Update();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1e84)))))))->EntityPtr::Set(queryList);
|
|
}
|
|
iVar4 = EntityPtr::Ref();
|
|
if (iVar4 != 0) {
|
|
effect = GHIDRA_CAST<Entity_Effect *>(EntityPtr)::Ref();
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_state(1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
FUN_00863be0();
|
|
level = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
bVar2 = (GHIDRA_CAST<Level *>((level)))->Level::GetStateFlag(0x19);
|
|
if (bVar2 == 0) {
|
|
if (0 < pEVar23->_imExcitedSpeedupCountdown) {
|
|
iVar4 = pEVar23->_imExcitedSpeedupCountdown + -1;
|
|
pEVar23->_imExcitedSpeedupCountdown = iVar4;
|
|
if (iVar4 == (iVar4 / 900) * 900) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SetBrokenWatchState(2);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1c,0,1);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SetBrokenWatchState(2);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1c,0,1);
|
|
pEVar23->_imExcitedSpeedupCountdown = 0;
|
|
}
|
|
tempEffects = &pEVar23->_temporaryeffects;
|
|
if ((0 < pEVar23->_rUaWizardTimer) &&
|
|
(iVar4 = pEVar23->_rUaWizardTimer + -1, pEVar23->_rUaWizardTimer = iVar4, iVar4 == 0)) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(6);
|
|
RemoveCostume(pEVar23,configItem);
|
|
}
|
|
local_9fc = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(0x20a);
|
|
if (local_9fc == (void *)0x0) {
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1440)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1440)))) + 0x28))();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1440)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
else {
|
|
uVar22 = 2;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (cVar3 != '\0') {
|
|
uVar22 = 6;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_adc),&pEVar23->_pos,50.0,uVar22);
|
|
local_14 = 5.1848e-44;
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_adc))))->EntityList::Size();
|
|
if (iVar4 != 0) {
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::Type();
|
|
if (iVar4 == 9) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(*puVar9);
|
|
local_a28 = pEVar8;
|
|
projectileFlags = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar8))))->Entity_Projectile::ProjectileFlags();
|
|
if ((projectileFlags & 0x80000000) == 0) {
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((pEVar8)))->Entity_Tear::Height();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
if (-50.0 < (float)local_a1c) {
|
|
bVar2 = HasCollectible(pEVar23,0x248,0);
|
|
if (bVar2 == 0) {
|
|
projectileFlags = (GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(pEVar8))))->Entity_Projectile::ProjectileFlags();
|
|
Entity_Projectile::set_projectile_flags
|
|
(GHIDRA_CAST<Entity_Projectile *>(local_a28),
|
|
CONCAT44(GHIDRA_UINT((projectileFlags >> 0x20)) & _DAT_00c5d0e4,
|
|
(GHIDRA_UINT(projectileFlags) | 0x80000080) & _DAT_00c5d0e0) |
|
|
0x500000000);
|
|
pEVar8 = local_a28;
|
|
FUN_004aad90();
|
|
Isaac::Random(0xf);
|
|
FUN_004aadd0();
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::Velocity(&capturedShotVel);
|
|
(GHIDRA_CAST<Vector *>((tmpVec)))->Vector::Length();
|
|
FUN_004aadb0();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
pEVar23 = savedPlayer;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetParent(GHIDRA_CAST<Entity *>(savedPlayer));
|
|
position.y = g_vectorZero.y;
|
|
position.x = g_vectorZero.x;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetTargetPosition(position);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((pEVar8)))->Entity_Tear::FallingAcceleration();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
if (0.0 < (float)local_a1c) {
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((pEVar8)))->Entity_Tear::FallingSpeed();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
if (0.0 < (float)local_a1c) {
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((pEVar8)))->Entity_Tear::FallingSpeed();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
FUN_00444c70();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
isDontUpdateWisp = 0;
|
|
bVar2 = 0;
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::Position(&wispSpawnPos);
|
|
AddWisp(pEVar23,0x20a,tmpVec,bVar2,isDontUpdateWisp);
|
|
pEVar8->Remove();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(pEVar23));
|
|
if (bVar2 == 0) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar9))))->Entity::IsTear();
|
|
if (bVar2 != 0) {
|
|
std::vector<int>::operator_index();
|
|
iVar4 = __RTDynamicCast();
|
|
if (iVar4 != 0) {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>(*puVar9);
|
|
fVar27 = (float10)(GHIDRA_CAST<Entity_Tear *>((pEVar8)))->Entity_Tear::Height();
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((float)fVar27);
|
|
if (-50.0 < (float)local_a1c) {
|
|
bVar2 = HasCollectible(pEVar23,0x248,0);
|
|
if (bVar2 == 0) {
|
|
tmpFlags = BitSet128::operator_or
|
|
(&capturedTearFlags2,GHIDRA_CAST<BitSet128 *>(&DAT_00c346d0),
|
|
GHIDRA_CAST<BitSet128 *>(&DAT_00c346b0));
|
|
(GHIDRA_CAST<Entity_Tear *>((pEVar8)))->Entity_Tear::SetTearFlags(*tmpFlags);
|
|
FUN_00665b30();
|
|
Isaac::Random(0xf);
|
|
FUN_00753740();
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::Velocity(&capturedTearVel);
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((tmpVec)))->Vector)::Length();
|
|
FUN_00753730();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetSpawnerEntity(GHIDRA_CAST<Entity *>(pEVar23));
|
|
position_00.y = g_vectorZero.y;
|
|
position_00.x = g_vectorZero.x;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::SetTargetPosition(position_00);
|
|
}
|
|
else {
|
|
isDontUpdateWisp = 0;
|
|
bVar2 = 0;
|
|
tmpVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::Position(&wispSpawnPos2);
|
|
AddWisp(pEVar23,0x20a,tmpVec,bVar2,isDontUpdateWisp);
|
|
pEVar8->Remove();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a34)) + 0x1))));
|
|
pEVar8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_adc))))->EntityList)::Size();
|
|
} while (local_a34 < pEVar8);
|
|
}
|
|
effect = *GHIDRA_CAST<Entity_Effect **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1440))));
|
|
if (effect == GHIDRA_CAST<Entity_Effect *>(0x0)) {
|
|
uVar22 = Random();
|
|
queryList = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7b,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),1,uVar22)
|
|
;
|
|
(GHIDRA_CAST<Entity *>((queryList)))->Entity::SetParent(GHIDRA_CAST<Entity *>(pEVar23));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1440)))))))->EntityPtr::SetReference(queryList);
|
|
effect = *GHIDRA_CAST<Entity_Effect **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x1440))));
|
|
if (effect != GHIDRA_CAST<Entity_Effect *>(0x0)) goto LAB_0079e9c1;
|
|
}
|
|
else {
|
|
LAB_0079e9c1:
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_state(GHIDRA_UINT((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_9fc) + 8)) < 0x3c)));
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_adc)))->EntityList_Query::~EntityList_Query();
|
|
tempEffects = &pEVar23->_temporaryeffects;
|
|
}
|
|
if ((0 < pEVar23->_hallowedGroundCountdown) &&
|
|
(iVar4 = pEVar23->_hallowedGroundCountdown + -1, pEVar23->_hallowedGroundCountdown = iVar4,
|
|
iVar4 < 1)) {
|
|
AddCacheFlags(pEVar23,99);
|
|
EvaluateItems(pEVar23);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::IsFrame(3,0);
|
|
if (bVar2 != 0) {
|
|
bVar2 = IsHologram(pEVar23);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar23,0xbd,0);
|
|
if (((((bVar2 == 0) && (bVar2 = IsHeadless(pEVar23), bVar2 == 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0xd6), bVar2 == 0)) &&
|
|
((bVar2 = HasCollectible(pEVar23,0x281,0), bVar2 == 0 &&
|
|
(iVar4 = pEVar23->_playerType, iVar4 != 0x26)))) &&
|
|
(((iVar4 != 0x1d && (iVar4 != 0x1a)) || (iVar4 = Isaac::Random(4), iVar4 != 0)))) {
|
|
bVar2 = HasCollectible(pEVar23,0x240,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar23,0x26a,0);
|
|
if (bVar2 == 0) {
|
|
bVar2 = HasCollectible(pEVar23,0x2a0,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = 6;
|
|
goto LAB_0079eac8;
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x255,0);
|
|
if (bVar2 != 0) {
|
|
iVar4 = Isaac::Random(2);
|
|
if (iVar4 == 0) {
|
|
fVar11 = random_float();
|
|
effect = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(pEVar23))))->Entity_NPC::MakeSplat(fVar11 * 0.5 + 0.2);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(effect) + 0x3c);
|
|
(GHIDRA_CAST<Color *>((splatColor)))->Color::Color(0.0,0.0,0.0,0.08);
|
|
(*pcVar1)();
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = Isaac::Random(8);
|
|
if (iVar4 == 0) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c8126c) &&
|
|
(_Init_thread_header(), DAT_00c8126c == -1)) {
|
|
local_14 = 5.46506e-44;
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
local_14 = -NAN;
|
|
_Init_thread_footer();
|
|
}
|
|
fVar11 = random_float();
|
|
effect = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(pEVar23))))->Entity_NPC::MakeSplat(fVar11 * 0.5 + 0.2);
|
|
effect->SetColor();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = Isaac::Random(4);
|
|
if (iVar4 == 0) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c8123c) &&
|
|
(_Init_thread_header(), DAT_00c8123c == -1)) {
|
|
local_14 = 5.32493e-44;
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
local_14 = -NAN;
|
|
_Init_thread_footer();
|
|
}
|
|
fVar11 = random_float();
|
|
effect = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(pEVar23))))->Entity_NPC::MakeSplat(fVar11 * 0.5 + 0.2);
|
|
effect->SetColor();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = 2;
|
|
LAB_0079eac8:
|
|
iVar4 = Isaac::Random(iVar4);
|
|
if (iVar4 == 0) {
|
|
fVar11 = random_float();
|
|
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(pEVar23))))->Entity_NPC::MakeSplat(fVar11 * 0.5 + 0.2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar3 = DeathmatchManager::is_active();
|
|
if (((cVar3 != '\0') && (bVar2 = HasCollectible(pEVar23,0x240,0), bVar2 != 0)) &&
|
|
(iVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::GetIntervalTicks(210.0,0.0), iVar4 != 0)) {
|
|
rngPtr = GetCollectibleRNG(pEVar23,0x240);
|
|
uVar22 = (GHIDRA_CAST<RNG *>((rngPtr)))->RNG::RandomInt(100);
|
|
if (uVar22 < 0x1e) {
|
|
uVar22 = 0;
|
|
}
|
|
else if (uVar22 < 0x2c) {
|
|
uVar22 = 1;
|
|
}
|
|
else if (uVar22 < 0x3a) {
|
|
uVar22 = 0xd;
|
|
}
|
|
else if (uVar22 < 0x48) {
|
|
uVar22 = 3;
|
|
}
|
|
else {
|
|
uVar22 = (-GHIDRA_UINT((uVar22 < 0x56)) & 0xfffffffe) + 6;
|
|
}
|
|
uVar5 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xc9,&pEVar23->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar23),uVar22,uVar5);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x32);
|
|
if (bVar2 != 0) {
|
|
if (pEVar23->_activeDesc[0]._item == 0x28f) {
|
|
AddActiveCharge(pEVar23,-1,0,0,0,0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x32,1);
|
|
}
|
|
}
|
|
if ((0 < pEVar23->_grantedCollectibleCountdown) &&
|
|
(iVar4 = pEVar23->_grantedCollectibleCountdown + -1,
|
|
pEVar23->_grantedCollectibleCountdown = iVar4, iVar4 < 1)) {
|
|
pEVar23->_grantedCollectibleFlags = 0;
|
|
AddCacheFlags(pEVar23,99);
|
|
EvaluateItems(pEVar23);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(3);
|
|
if (((bVar2 == 0) && (bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(6), bVar2 == 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1f1), bVar2 == 0)
|
|
) {
|
|
pvVar28 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetTrinketEffect(0x45);
|
|
if (pvVar28 == (void *)0x0) goto LAB_0079ef52;
|
|
if (0x1d < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8))) goto LAB_0079ee43;
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(sinf_wrapper((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar28) + 8)) * 0.1));
|
|
if ((float)local_a34 <= 0.0) goto LAB_0079ef52;
|
|
}
|
|
else {
|
|
LAB_0079ee43:
|
|
local_a34 = (void *)0x3f800000;
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (iVar4 < 2) {
|
|
fVar11 = 1.0;
|
|
}
|
|
else {
|
|
fVar11 = 0.1;
|
|
}
|
|
tmpColor = Color::Lerp(footprintColor,&pEVar23->_footprintColor2,&pEVar23->_footprintColor1,0.5);
|
|
Color::Lerp(GHIDRA_CAST<ColorMod *>(local_78),GHIDRA_CAST<ColorMod *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x170c)))),tmpColor,fVar11);
|
|
entityColor = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite)::Color();
|
|
fVar11 = (GHIDRA_CAST<Color *>((entityColor)))->Color::A();
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_78))))->Font::SetLineHeightModifier(fVar11);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_78))))->Color::SetTint(0.01,0.01,0.01,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar23)) + 0x170c)))))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(local_78));
|
|
tmpColor = GHIDRA_CAST<ColorMod *>(local_78);
|
|
pEVar8 = local_a34;
|
|
from = GHIDRA_CAST<ColorMod *>(FUN_00757980());
|
|
tmpColor = Color::Lerp(&fadedSpriteColor,from,tmpColor,(float)pEVar8);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_78))))->Color::operator_assign(tmpColor);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_78));
|
|
LAB_0079ef52:
|
|
local_a34 = (void *)0x3f800000;
|
|
layerIndex = GHIDRA_CAST<byte *>(0x0);
|
|
iVar4 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite::GetLayerCount();
|
|
if (iVar4 != 0) {
|
|
anm = &pEVar23->_sprite;
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>(anm);
|
|
do {
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(anm))))->Sprite::GetLayer(layerIndex);
|
|
layerIndex = layerIndex + 1;
|
|
local_a34 = GHIDRA_CAST<Entity_Tear *>(((float)local_a34 + (layer->_size).x));
|
|
layerCount = GHIDRA_CAST<byte *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(anm))))->Sprite)::GetLayerCount();
|
|
} while (layerIndex < layerCount);
|
|
pEVar23 = savedPlayer;
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar23->_sprite))))->Sprite::GetLayerCount();
|
|
local_a00 = (Entity_Player *)
|
|
Math::clamp(0.3,1.0,((float)local_a34 /
|
|
(float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]))
|
|
* (pEVar23->_playerSpriteScale).x);
|
|
collisionPointCount = *(void **)(GHIDRA_CAST<char *>(pEVar23->_config) + 0x48);
|
|
bVar2 = HasCollectible(pEVar23,0x47,0);
|
|
if (bVar2 != 0) {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(((float)local_a00 * 0.75));
|
|
}
|
|
bVar2 = HasCollectible(pEVar23,0x256,0);
|
|
if ((bVar2 != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x2b0), bVar2 != 0)
|
|
) {
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(((float)local_a00 * 0.5));
|
|
maxCollisionPoints = 0xc;
|
|
piVar14 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
collisionPointCount = (void *)*piVar14;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar23->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
if (bVar2 == 0) {
|
|
fVar11 = 1.0;
|
|
}
|
|
else {
|
|
doubledSizeScale = (float)local_a00 + (float)local_a00;
|
|
maxSizeScale = 2.0;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
local_a00 = GHIDRA_CAST<Entity_Player *>(*pfVar16);
|
|
shadowScale = 3.0;
|
|
fVar11 = shadowScale;
|
|
}
|
|
if (pEVar23->_isCoopGhost != 0) {
|
|
shadowScale = fVar11 * 0.5;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0xe);
|
|
if (bVar2 != 0) {
|
|
shadowScale = 0.0;
|
|
}
|
|
local_a20 = (pEVar23->_sizeMulti).x;
|
|
local_a1c = GHIDRA_CAST<Entity_Familiar *>((pEVar23->_sizeMulti).y);
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pEVar23->_config) + 0x48));
|
|
entityConfig = GHIDRA_CAST<EntityConfig *>(FUN_00417910());
|
|
entityConfigEntry = (GHIDRA_CAST<EntityConfig *>((entityConfig)))->EntityConfig::GetEntity(pEVar23->_type,pEVar23->_variant,0);
|
|
sizeMulti.y = (float)local_a1c;
|
|
sizeMulti.x = local_a20;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar23))))->Entity::SetSize((float)local_a00 * entityConfigEntry->collisionRadius,sizeMulti,
|
|
iVar4);
|
|
pEVar23->_shadowSize = shadowScale * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pEVar23->_config) + 0x24));
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0079f3c0
|
|
void Entity_Player::update_ladder()
|
|
{
|
|
code *pcVar1;
|
|
longlong lVar2;
|
|
longlong lVar3;
|
|
longlong lVar4;
|
|
byte bVar5;
|
|
char isBanned;
|
|
uint uVar6;
|
|
int *piVar7;
|
|
int iVar8;
|
|
uint upGridIdx;
|
|
GridEntity_Pit *pit;
|
|
uint uVar9;
|
|
int unusedArg;
|
|
void *pvVar10;
|
|
int *piVar11;
|
|
int iVar12;
|
|
PlayerManager *playerManager;
|
|
Game *game;
|
|
bool bVar13;
|
|
float deltaX;
|
|
float deltaY;
|
|
float fVar14;
|
|
ulonglong timeNs;
|
|
undefined1 auStack_b8 [4];
|
|
int *local_b4;
|
|
void *room;
|
|
int *local_ac;
|
|
uint local_a8;
|
|
Game *local_a4;
|
|
void *local_a0;
|
|
char isLadderOwner;
|
|
int *spawnSubType;
|
|
Entity *local_94;
|
|
float local_90;
|
|
uint local_8c;
|
|
int *piStack_88;
|
|
float fStack_84;
|
|
uint spawnType;
|
|
Entity_Player *local_7c;
|
|
int *apiStack_78 [3];
|
|
uint spawnVariant;
|
|
int *local_68;
|
|
EntityPtr *local_64;
|
|
int *local_60;
|
|
int *ladderSlot;
|
|
int local_58 [3];
|
|
int triggerKeyType;
|
|
int triggerKeyVariant;
|
|
undefined8 rngShifts;
|
|
undefined4 rngShift3;
|
|
undefined1 auStack_34 [4];
|
|
undefined1 local_30 [8];
|
|
int local_28;
|
|
undefined1 auStack_24 [8];
|
|
RNG cardRng;
|
|
uint stackCookie;
|
|
float moveDirY;
|
|
Entity *ladder;
|
|
Manager *manager;
|
|
Entity_Player *otherPlayer;
|
|
EntityPtr *spawnerSlot;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(auStack_b8);
|
|
local_7c = this;
|
|
bVar5 = HasCollectible(this,0x3c,0);
|
|
if ((bVar5 == 0) || (local_7c->_variant != 0)) {
|
|
local_b4 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_7c)) + 0x1424))));
|
|
isLadderOwner = '\0';
|
|
if (local_b4 == GHIDRA_CAST<int *>(0x0)) {
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
local_b4 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_7c)) + 0x1424))));
|
|
isLadderOwner = '\x01';
|
|
}
|
|
piVar7 = local_b4;
|
|
ladderSlot = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_7c)) + 0x1424))));
|
|
room = g_game->_room;
|
|
if (local_b4 != GHIDRA_CAST<int *>(0x0)) goto LAB_0079fa87;
|
|
local_8c = Random();
|
|
local_a4 = g_game;
|
|
spawnVariant = 8;
|
|
spawnType = 1000;
|
|
spawnSubType = piVar7;
|
|
lua_callback_run_pre_entity_spawn
|
|
(GHIDRA_CAST<int *>(&spawnType),GHIDRA_CAST<int *>(&spawnVariant),&g_vectorZero,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
GHIDRA_CAST<int *>(&spawnSubType),&local_8c);
|
|
uVar9 = spawnVariant;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
LAB_0079f708:
|
|
local_b4 = spawnSubType;
|
|
}
|
|
else {
|
|
local_ac = (g_game->_deathmatchManager)._type;
|
|
uVar6 = Random();
|
|
piVar11 = spawnSubType;
|
|
piVar7 = local_ac;
|
|
rngShifts = 0x900000005;
|
|
local_94 = GHIDRA_CAST<Entity *>(0x7);
|
|
rngShift3 = 7;
|
|
local_a8 = uVar6;
|
|
if (spawnType != 5) goto LAB_0079f708;
|
|
if (uVar9 < 0x12d) {
|
|
if (uVar9 == 300) {
|
|
while ((local_b4 = spawnSubType, spawnSubType == GHIDRA_CAST<int *>(0x0) ||
|
|
(isBanned = (**(code **)(*local_ac + 0x24))(spawnSubType), isBanned != '\0'))) {
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((byte)rngShifts & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)local_94 & 0x1f) ^ uVar6;
|
|
iVar8 = ItemPool::GetCardEx(uVar6,0x19,10,10,1);
|
|
cardRng._shift1 = 5;
|
|
cardRng._shift2 = 9;
|
|
cardRng._shift3 = 7;
|
|
cardRng._seed = uVar6;
|
|
spawnSubType = GHIDRA_CAST<int *>(lua_callback_run_get_card(&cardRng,iVar8,1,1,0));
|
|
}
|
|
}
|
|
else {
|
|
if (uVar9 == 0x46) {
|
|
local_68 = GHIDRA_CAST<int *>((GHIDRA_UINT(spawnSubType) >> 0xb));
|
|
do {
|
|
local_b4 = spawnSubType;
|
|
if (spawnSubType != GHIDRA_CAST<int *>(0x0)) {
|
|
pcVar1 = *(code **)(*local_ac + 0x28);
|
|
iVar8 = ItemPool::GetPillEffect
|
|
(&g_game->_itemPool,GHIDRA_UINT(spawnSubType),GHIDRA_CAST<Entity_Player *>(0x0));
|
|
isBanned = (*pcVar1)(iVar8);
|
|
if (isBanned == '\0') goto LAB_0079f710;
|
|
uVar6 = local_a8;
|
|
}
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((byte)rngShifts & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)local_94 & 0x1f) ^ uVar6;
|
|
local_a8 = uVar6;
|
|
uVar9 = ItemPool::GetPill(uVar6);
|
|
spawnSubType = GHIDRA_CAST<int *>((uVar9 | (GHIDRA_UINT(local_68) & 1) << 0xb));
|
|
} while( true );
|
|
}
|
|
if (uVar9 != 100) goto LAB_0079f708;
|
|
local_b4 = spawnSubType;
|
|
if (spawnSubType == GHIDRA_CAST<int *>(0x19)) {
|
|
LAB_0079f54a:
|
|
bVar13 = false;
|
|
}
|
|
else {
|
|
local_68 = spawnSubType;
|
|
std::set<int>::find_node(local_30,&local_68);
|
|
if (((*GHIDRA_CAST<char *>((local_28 + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((local_28 + 0x10)) <= GHIDRA_INT(piVar11)))
|
|
&& (local_28 != piVar7[8])) goto LAB_0079f54a;
|
|
bVar13 = true;
|
|
}
|
|
if ((piVar11 == GHIDRA_CAST<int *>(0x0)) || (bVar13)) {
|
|
local_b4 = GHIDRA_CAST<int *>((**(code **)(*piVar7 + 0x84))(0));
|
|
spawnSubType = local_b4;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (uVar9 != 0x15e) goto LAB_0079f708;
|
|
while ((local_b4 = spawnSubType, spawnSubType == GHIDRA_CAST<int *>(0x0) ||
|
|
(isBanned = (**(code **)(*local_ac + 0x2c))(spawnSubType), isBanned != '\0'))) {
|
|
spawnSubType = GHIDRA_CAST<int *>((GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool)::GetTrinket(0);
|
|
}
|
|
}
|
|
}
|
|
LAB_0079f710:
|
|
local_94 = (GHIDRA_CAST<EntityFactory *>((local_a4->_entityFactory)))->EntityFactory::Create(spawnType,0);
|
|
lVar2 = CONCAT44(local_60,local_a8);
|
|
if (local_94 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
timeNs = GetTimeNs();
|
|
ladder = local_94;
|
|
local_a8 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar2 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
local_64 = GHIDRA_CAST<EntityPtr *>(((ulonglong)lVar2 >> 0x20));
|
|
local_a0 = (void *)((ulonglong)local_a8 * 0xd7b634db >> 0x20);
|
|
timeNs = (ulonglong)local_a8 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar6 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar2 = lVar2 + (timeNs & 0xffffffff);
|
|
local_58[0] = GHIDRA_INT(lVar2);
|
|
uVar9 = GHIDRA_UINT(((ulonglong)lVar2 >> 0x20));
|
|
lVar2 = (ulonglong)local_a8 * 0x431bde82 +
|
|
(ulonglong)CONCAT14(CARRY4(uVar6,uVar9),uVar6 + uVar9);
|
|
local_94->_spawnerType = 0;
|
|
uVar9 = GHIDRA_UINT(((ulonglong)lVar2 >> 0x20));
|
|
local_94->_spawnerVariant = 0;
|
|
local_ac = GHIDRA_CAST<int *>((GHIDRA_UINT(lVar2) >> 0x12 | uVar9 * 0x4000));
|
|
local_90 = (float)(uVar9 >> 0x12);
|
|
spawnerSlot = &local_94->_spawnerEntity;
|
|
if (*spawnerSlot != (EntityPtr)0x0) {
|
|
local_64 = spawnerSlot;
|
|
std::multiset<unsigned_int>::erase(&local_64);
|
|
}
|
|
iVar8 = *GHIDRA_CAST<int *>(ladder);
|
|
*spawnerSlot = (EntityPtr)0x0;
|
|
(ladder->_pos).x = g_vectorZero.x;
|
|
(ladder->_pos).y = g_vectorZero.y;
|
|
(ladder->_velocity).x = g_vectorZero.x;
|
|
(ladder->_velocity).y = g_vectorZero.y;
|
|
(**(code **)(iVar8 + 4))(spawnType,spawnVariant,local_b4,local_8c);
|
|
game = local_a4;
|
|
pvVar10 = local_a4->_room;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + 0x1214));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + 0x1214)) = iVar8 + 1;
|
|
ladder->_index = iVar8;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar10) + 0x1218)))))->EntityList::AddEntity(ladder);
|
|
bVar5 = Game::ShouldEraseEnemy(ladder);
|
|
if (bVar5 != 0) {
|
|
Entity::RemoveWithPoof(ladder,unusedArg);
|
|
}
|
|
if ((ladder->_exists != 0) &&
|
|
((game->_proceduralItemManager)._proceduralItems._begin !=
|
|
(game->_proceduralItemManager)._proceduralItems._end)) {
|
|
triggerKeyVariant = ladder->_variant;
|
|
triggerKeyType = ladder->_type;
|
|
std::map<unsigned_long_long>::find(&local_a0,&triggerKeyType);
|
|
if (local_a0 == (game->_proceduralItemManager)._spawnTriggerTargets._head) {
|
|
local_58[0] = ladder->_type;
|
|
local_58[1] = 0xffffffff;
|
|
piVar7 = GHIDRA_CAST<int *>(std)::map<unsigned_long_long>::find(auStack_34,local_58);
|
|
local_a0 = (void *)*piVar7;
|
|
if (local_a0 == (game->_proceduralItemManager)._spawnTriggerTargets._head)
|
|
goto LAB_0079f990;
|
|
}
|
|
playerManager = &g_game->_playerManager;
|
|
local_a4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin)
|
|
>> 2 != 0) {
|
|
do {
|
|
pvVar10 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar10) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar10 = (playerManager->_playerList)._end;
|
|
}
|
|
piVar7 = (playerManager->_playerList)._begin;
|
|
if (local_a4 < GHIDRA_CAST<Game *>((GHIDRA_INT(pvVar10) - GHIDRA_INT(piVar7) >> 2))) {
|
|
piVar7 = piVar7 + GHIDRA_INT(local_a4);
|
|
}
|
|
trigger_set_dispatch((void *)(*piVar7 + 0x1fc8),6,ladder,&g_vectorZero,&g_vectorZero);
|
|
playerManager = &g_game->_playerManager;
|
|
local_a4 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_a4->_stage) + 1));
|
|
} while (local_a4 <
|
|
GHIDRA_CAST<Game *>((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
LAB_0079f990:
|
|
timeNs = GetTimeNs();
|
|
uVar9 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
local_b4 = GHIDRA_CAST<int *>(((ulonglong)lVar3 >> 0x20));
|
|
lVar4 = (ulonglong)uVar9 * 0xd7b634db;
|
|
local_a4 = GHIDRA_CAST<Game *>(((ulonglong)lVar4 >> 0x20));
|
|
lVar2 = (ulonglong)uVar9 * 0x431bde82;
|
|
timeNs = lVar4 + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar6 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar3 = lVar3 + (timeNs & 0xffffffff);
|
|
apiStack_78[0] = GHIDRA_CAST<int *>(lVar3);
|
|
uVar9 = GHIDRA_UINT(((ulonglong)lVar3 >> 0x20));
|
|
lVar3 = lVar2 + (ulonglong)CONCAT14(CARRY4(uVar6,uVar9),uVar6 + uVar9);
|
|
uVar6 = GHIDRA_UINT(((ulonglong)lVar3 >> 0x20));
|
|
piVar7 = GHIDRA_CAST<int *>((GHIDRA_UINT(lVar3) >> 0x12 | uVar6 * 0x4000));
|
|
uVar9 = GHIDRA_INT(piVar7) - GHIDRA_INT(local_ac);
|
|
bVar13 = CARRY4(GHIDRA_UINT(g_entitySpawnTimeMs),uVar9);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x0))) = GHIDRA_UINT(g_entitySpawnTimeMs) + uVar9;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) =
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) + (((uVar6 >> 0x12) - GHIDRA_INT(local_90)) - GHIDRA_UINT((piVar7 < local_ac)))
|
|
+ GHIDRA_UINT(bVar13);
|
|
}
|
|
piVar7 = ladderSlot;
|
|
ladder = local_94;
|
|
local_a8 = GHIDRA_UINT(lVar2);
|
|
local_94->_visible = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_94[1])) + 0x40)))) = 0xffffffff;
|
|
if (*ladderSlot != 0) {
|
|
local_60 = ladderSlot;
|
|
std::multiset<unsigned_int>::erase(&local_60);
|
|
lVar2 = CONCAT44(local_60,local_a8);
|
|
}
|
|
local_60 = GHIDRA_CAST<int *>(((ulonglong)lVar2 >> 0x20));
|
|
local_a8 = GHIDRA_UINT(lVar2);
|
|
*piVar7 = GHIDRA_INT(ladder);
|
|
piStack_88 = piVar7;
|
|
std::set<unsigned_int>::insert_unique(auStack_24,&piStack_88);
|
|
local_b4 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_7c)) + 0x1424))));
|
|
LAB_0079fa87:
|
|
local_90 = (local_7c->_pos).x;
|
|
local_94 = GHIDRA_CAST<Entity *>((local_7c->_pos).y);
|
|
local_ac = GHIDRA_CAST<int *>((local_7c->_velocity).x);
|
|
local_a4 = GHIDRA_CAST<Game *>((local_7c->_velocity).y);
|
|
local_a8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc));
|
|
piVar7 = local_b4;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_b4) + 0x171)) != '\0') {
|
|
uVar9 = local_b4[0x114];
|
|
uVar6 = 0;
|
|
fVar14 = (float)(GHIDRA_INT(uVar9) % GHIDRA_INT(local_a8)) * 40.0 + 40.0;
|
|
piVar7 = GHIDRA_CAST<int *>(((float)(GHIDRA_INT(uVar9) / GHIDRA_INT(local_a8)) * 40.0 + 120.0));
|
|
game = g_game;
|
|
fStack_84 = fVar14;
|
|
apiStack_78[0] = piVar7;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar10 = (game->_playerManager)._playerList._end;
|
|
piVar11 = (game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar10) - GHIDRA_INT(piVar11) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar10 = (game->_playerManager)._playerList._end;
|
|
piVar11 = (game->_playerManager)._playerList._begin;
|
|
game = g_game;
|
|
fVar14 = fStack_84;
|
|
piVar7 = apiStack_78[0];
|
|
}
|
|
if (uVar6 < GHIDRA_UINT((GHIDRA_INT(pvVar10) - GHIDRA_INT(piVar11) >> 2))) {
|
|
piVar11 = piVar11 + uVar6;
|
|
}
|
|
otherPlayer = GHIDRA_CAST<Entity_Player *>(*piVar11);
|
|
if (((otherPlayer == local_7c) || (otherPlayer->_entityGridCollisionClass == 5)) &&
|
|
(deltaX = (otherPlayer->_pos).x - fVar14, deltaY = (otherPlayer->_pos).y - (float)piVar7,
|
|
deltaY * deltaY + deltaX * deltaX <= 3249.0)) {
|
|
piVar7 = local_b4;
|
|
goto LAB_0079fc67;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((game->_playerManager)._playerList._begin) >> 2)));
|
|
uVar9 = local_b4[0x114];
|
|
}
|
|
piVar7 = local_b4;
|
|
if (((-1 < GHIDRA_INT(uVar9)) && (uVar9 < 0x1c0)) &&
|
|
((pit = *GHIDRA_CAST<GridEntity_Pit **>((GHIDRA_CAST<char *>(room) + uVar9 * 4 + 0x24)), pit != GHIDRA_CAST<GridEntity_Pit *>(0x0) &&
|
|
((pit->_desc)._type == 7)))) {
|
|
pit->_hasLadder = 0;
|
|
(GHIDRA_CAST<GridEntity_Pit *>((pit)))->GridEntity_Pit::UpdateCollision();
|
|
}
|
|
piVar7[0x114] = -1;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(piVar7) + 0x171)) = 0;
|
|
}
|
|
LAB_0079fc67:
|
|
if (isLadderOwner == '\0') {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar7) + 0x171)) == '\0') {
|
|
(**(code **)(*piVar7 + 0x28))();
|
|
piVar7 = ladderSlot;
|
|
if (*ladderSlot != 0) {
|
|
apiStack_78[0] = ladderSlot;
|
|
std::multiset<unsigned_int>::erase(apiStack_78);
|
|
}
|
|
*piVar7 = 0;
|
|
}
|
|
}
|
|
else {
|
|
iVar12 = GHIDRA_INT(((local_90 - 40.0) / 40.0 + 0.5));
|
|
iVar8 = GHIDRA_INT((((float)local_94 - 120.0) / 40.0 + 0.5));
|
|
if (((-1 < iVar12) && (iVar12 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc)))) &&
|
|
((-1 < iVar8 &&
|
|
((iVar8 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x10)) &&
|
|
(piStack_88 = GHIDRA_CAST<int *>((iVar8 * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc)) + iVar12)), -1 < GHIDRA_INT(piStack_88)))))
|
|
)) {
|
|
fStack_84 = (float)local_ac;
|
|
apiStack_78[0] = &local_a4->_stage;
|
|
fVar14 = sqrtf((float)local_ac * (float)local_ac + (float)local_a4 * (float)local_a4);
|
|
piVar11 = local_b4;
|
|
if (fVar14 <= 0.0) {
|
|
moveDirY = (float)apiStack_78[0];
|
|
}
|
|
else {
|
|
fStack_84 = (1.0 / fVar14) * (float)local_ac;
|
|
moveDirY = (1.0 / fVar14) * (float)local_a4;
|
|
}
|
|
iVar8 = GHIDRA_INT((((fStack_84 * 40.0 + local_90) - 40.0) / 40.0 + 0.5));
|
|
iVar12 = GHIDRA_INT((((moveDirY * 40.0 + (float)local_94) - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar8 < 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc)) <= iVar8)) || (iVar12 < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x10)) <= iVar12)) {
|
|
uVar9 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar9 = iVar12 * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc)) + iVar8;
|
|
}
|
|
if (piVar7[0x114] != uVar9) {
|
|
if (GHIDRA_INT(piStack_88) < 0x1c0) {
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + GHIDRA_INT(piStack_88) * 4 + 0x24));
|
|
}
|
|
else {
|
|
iVar8 = 0;
|
|
}
|
|
if (uVar9 < 0x1c0) {
|
|
local_8c = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(room) + uVar9 * 4 + 0x24));
|
|
}
|
|
else {
|
|
local_8c = 0;
|
|
}
|
|
if (((((iVar8 == 0) || (*GHIDRA_CAST<int *>((iVar8 + 4)) != 7)) || (1 < *GHIDRA_CAST<uint *>((iVar8 + 0xc)))) &&
|
|
((local_8c != 0 && (*GHIDRA_CAST<int *>((local_8c + 4)) == 7)))) && (*GHIDRA_CAST<int *>((local_8c + 0xc)) == 0))
|
|
{
|
|
fStack_84 = (float)(uVar9 + 1);
|
|
uVar6 = uVar9 - 1;
|
|
upGridIdx = uVar9 - local_a8;
|
|
piStack_88 = GHIDRA_CAST<int *>((uVar9 + local_a8));
|
|
if (((((ABS((float)local_ac) <= ABS((float)local_a4)) || (GHIDRA_INT(uVar6) < 0)) ||
|
|
(GHIDRA_INT((local_a8 * local_a8)) <= GHIDRA_INT(uVar6))) ||
|
|
(((uVar6 < 0x1c0 &&
|
|
(apiStack_78[0] = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(room) + uVar9 * 4 + 0x20)),
|
|
apiStack_78[0] != GHIDRA_CAST<int *>(0x0))) && (apiStack_78[0][1] == 7)))) ||
|
|
((GHIDRA_INT((local_a8 * local_a8)) <= GHIDRA_INT(fStack_84) ||
|
|
(((uVar9 + 1 < 0x1c0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + uVar9 * 4 + 0x28)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + uVar9 * 4 + 0x28)) + 4)) == 7)))))) {
|
|
if (ABS((float)local_a4) <= ABS((float)local_ac)) {
|
|
return;
|
|
}
|
|
if (GHIDRA_INT(upGridIdx) < 0) {
|
|
return;
|
|
}
|
|
if (GHIDRA_INT((local_a8 * local_a8)) <= GHIDRA_INT(upGridIdx)) {
|
|
return;
|
|
}
|
|
if (((upGridIdx < 0x1c0) &&
|
|
(iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + upGridIdx * 4 + 0x24)), iVar8 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar8 + 4)) == 7)) {
|
|
return;
|
|
}
|
|
if (GHIDRA_INT(piStack_88) < 0) {
|
|
return;
|
|
}
|
|
if (GHIDRA_INT((local_a8 * local_a8)) <= GHIDRA_INT(piStack_88)) {
|
|
return;
|
|
}
|
|
if (((piStack_88 < GHIDRA_CAST<int *>(0x1c0)) &&
|
|
(iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + GHIDRA_INT(piStack_88) * 4 + 0x24)), iVar8 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar8 + 4)) == 7)) {
|
|
return;
|
|
}
|
|
local_a0 = (void *)0x2;
|
|
}
|
|
else {
|
|
local_a0 = (void *)0x1;
|
|
}
|
|
uVar6 = local_b4[0x114];
|
|
if (((-1 < GHIDRA_INT(uVar6)) && (uVar6 < 0x1c0)) &&
|
|
((pit = *GHIDRA_CAST<GridEntity_Pit **>((GHIDRA_CAST<char *>(room) + uVar6 * 4 + 0x24)),
|
|
pit != GHIDRA_CAST<GridEntity_Pit *>(0x0) && ((pit->_desc)._type == 7)))) {
|
|
pit->_hasLadder = 0;
|
|
(GHIDRA_CAST<GridEntity_Pit *>((pit)))->GridEntity_Pit::UpdateCollision();
|
|
}
|
|
pit = (GridEntity_Pit *)
|
|
__RTDynamicCast(local_8c,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0);
|
|
pit->_hasLadder = 1;
|
|
(GHIDRA_CAST<GridEntity_Pit *>((pit)))->GridEntity_Pit::UpdateCollision();
|
|
piVar11[0x114] = uVar9;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc));
|
|
piVar11[0xcf] = GHIDRA_INT(((float)(GHIDRA_INT(uVar9) % iVar8) * 40.0 + 40.0));
|
|
piVar11[0xd0] = GHIDRA_INT(((float)(GHIDRA_INT(uVar9) / iVar8) * 40.0 + 120.0));
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(piVar11) + 0x171)) = 1;
|
|
manager = g_manager;
|
|
if (local_a0 == (void *)0x1) {
|
|
iVar8 = 0x42b40000;
|
|
}
|
|
else {
|
|
iVar8 = 0;
|
|
}
|
|
piVar11[0x3b] = iVar8;
|
|
local_a0 = (void *)0x43e;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_a0));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_a0),1.0,2,0,1.0,0.0);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a0080
|
|
void Entity_Player::trigger_npc_death(Entity *npc)
|
|
{
|
|
byte bVar1;
|
|
int iVar2;
|
|
uint uVar3;
|
|
Entity *pEVar4;
|
|
ItemConfig_Item *collectibleID;
|
|
Entity_Player *firstPlayer;
|
|
void *pvVar5;
|
|
int *effect;
|
|
int iVar6;
|
|
bool bVar7;
|
|
bool bVar8;
|
|
float distance;
|
|
Entity *pEVar9;
|
|
TemporaryEffects *pTVar10;
|
|
undefined1 local_3c [12];
|
|
float local_30;
|
|
int tmpEffect [2];
|
|
Vector local_24;
|
|
Entity *killedNpc;
|
|
TemporaryEffects *local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
int local_8;
|
|
void *collectibles;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
pEVar4 = npc;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff8d0;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
killedNpc = (Entity *)
|
|
__RTDynamicCast(npc,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,
|
|
__security_cookie ^ GHIDRA_UINT((tmpEffect + 10)));
|
|
if ((pEVar4->_flags & 0x40000000000) == 0) {
|
|
pTVar10 = &this->_temporaryeffects;
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::HasCollectibleEffect(0x5d);
|
|
game = g_game;
|
|
if ((((bVar1 != 0) && ((this->_flags & 0x4000) == 0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar1 == 0)) && ((~(byte)game->_frameCount & 1) != 0)) {
|
|
AddHearts(this,1,0,0);
|
|
}
|
|
bVar1 = HasCollectible(this,0x19b,0);
|
|
if (bVar1 != 0) {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x19b < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) >> 2) &&
|
|
(iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x66c)), iVar6 != 0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x8))) = *GHIDRA_CAST<int *>((iVar6 + 0x78));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))) = (void *)0x0;
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x0))) = iVar6;
|
|
(GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::AddEffect(local_3c,0,1);
|
|
}
|
|
if ((npc->_type == 1) && (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager))) {
|
|
iVar6 = 4;
|
|
do {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x19b < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) >> 2) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x66c)), iVar2 != 0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x8))) = *GHIDRA_CAST<int *>((iVar2 + 0x78));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))) = (void *)0x0;
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x0))) = iVar2;
|
|
(GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::AddEffect(local_3c,0,1);
|
|
}
|
|
iVar6 = iVar6 + -1;
|
|
} while (iVar6 != 0);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x3a)) {
|
|
iVar6 = GetTrinketMultiplier(this,0x3a);
|
|
bVar8 = false;
|
|
bVar7 = iVar6 == 0;
|
|
LAB_007a0232:
|
|
if (!bVar7 && bVar8 == iVar6 < 0) goto LAB_007a023d;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x3a);
|
|
bVar8 = SBORROW4(iVar2,1);
|
|
iVar6 = iVar2 + -1;
|
|
bVar7 = iVar2 == 1;
|
|
goto LAB_007a0232;
|
|
}
|
|
LAB_007a023d:
|
|
iVar2 = 0x29a;
|
|
iVar6 = GetTrinketMultiplier(this,0x3a);
|
|
if (iVar6 == 2) {
|
|
iVar2 = 0x514;
|
|
}
|
|
else if (2 < iVar6) {
|
|
iVar2 = 0x9c4;
|
|
}
|
|
iVar6 = __ftoui3();
|
|
uVar3 = Random();
|
|
if (uVar3 % 10000 < GHIDRA_UINT((iVar2 + iVar6))) {
|
|
pvVar5 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar5) >> 2 < 0x3b) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x0))) = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x0))) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0xe8));
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x8))) = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x0))) + 0x78));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))) = (void *)0x0;
|
|
local_30 = 0.0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::AddEffect(local_3c,1,1);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x3c)) {
|
|
iVar6 = GetTrinketMultiplier(this,0x3c);
|
|
bVar8 = false;
|
|
bVar7 = iVar6 == 0;
|
|
LAB_007a0306:
|
|
if (!bVar7 && bVar8 == iVar6 < 0) goto LAB_007a030d;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x3c);
|
|
bVar8 = SBORROW4(iVar2,1);
|
|
iVar6 = iVar2 + -1;
|
|
bVar7 = iVar2 == 1;
|
|
goto LAB_007a0306;
|
|
}
|
|
LAB_007a030d:
|
|
iVar6 = 0x32;
|
|
iVar2 = GetTrinketMultiplier(this,0x3c);
|
|
if (iVar2 == 2) {
|
|
iVar6 = 100;
|
|
}
|
|
else if (2 < iVar2) {
|
|
iVar6 = 0x96;
|
|
}
|
|
iVar2 = __ftoui3();
|
|
uVar3 = Random();
|
|
if (uVar3 % 1000 < GHIDRA_UINT((iVar6 + iVar2))) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::AddTrinketEffect(0x3c,1,1);
|
|
}
|
|
}
|
|
trigger_vampire_charm_kill(this);
|
|
bVar1 = HasCollectible(this,0x208,0);
|
|
if ((bVar1 != 0) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x160c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x160c)))) + 1,
|
|
0xe < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x160c)))))) {
|
|
uVar3 = Random();
|
|
pEVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar3,0);
|
|
iVar6 = __RTDynamicCast(pEVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0);
|
|
uVar3 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0x358)) = 0x3f800000;
|
|
do {
|
|
AddActiveCharge(this,1,uVar3,0,0,0);
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < 4);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x160c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x160c)))) + -0xf;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x76)) {
|
|
iVar6 = GetTrinketMultiplier(this,0x76);
|
|
bVar8 = false;
|
|
bVar7 = iVar6 == 0;
|
|
LAB_007a0440:
|
|
if (!bVar7 && bVar8 == iVar6 < 0) goto LAB_007a044b;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x76);
|
|
bVar8 = SBORROW4(iVar2,1);
|
|
iVar6 = iVar2 + -1;
|
|
bVar7 = iVar2 == 1;
|
|
goto LAB_007a0440;
|
|
}
|
|
LAB_007a044b:
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::HasTrinketEffect(0x76);
|
|
if (bVar1 == 0) {
|
|
uVar3 = 0x14;
|
|
iVar6 = GetTrinketMultiplier(this,0x76);
|
|
if (iVar6 == 2) {
|
|
uVar3 = 10;
|
|
}
|
|
else if (iVar6 == 3) {
|
|
uVar3 = 7;
|
|
}
|
|
uVar3 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0x760)))))->RNG::RandomInt(uVar3);
|
|
if (uVar3 == 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((pTVar10)))->TemporaryEffects::AddTrinketEffect(0x76,1,1);
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) >> 2 < 0x29) {
|
|
collectibleID = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
collectibleID = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0xa0));
|
|
}
|
|
AddCostume(this,collectibleID,0);
|
|
}
|
|
}
|
|
}
|
|
pEVar4 = killedNpc;
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 1)) != '\0') && (killedNpc != GHIDRA_CAST<Entity *>(0x0))) &&
|
|
(-1 < killedNpc->_spawnGridIndex)) &&
|
|
(firstPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0), this == firstPlayer)) {
|
|
award_fly_kill_points(&g_game->_scoreSheet,pEVar4);
|
|
}
|
|
bVar1 = HasCollectible(this,0x212,0);
|
|
pEVar4 = npc;
|
|
if ((bVar1 != 0) && (pvVar5 = g_game->_room, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar5) + 0x1bbc)) == '\0')) {
|
|
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(pvVar5) + 0x1bb8)) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
if ((npc != *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(pvVar5) + 0x1bb8))) && ((npc->_flags & 0x20000000) == 0)) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(pvVar5) + 0x1bbc)) = 1;
|
|
}
|
|
npc = GHIDRA_CAST<Entity *>((GHIDRA_INT(pvVar5) + 0x1bb8));
|
|
std::multiset<unsigned_int>::erase(&npc);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x1bb8)) = 0;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar5) + 0x1bbc)) == '\0') {
|
|
distance = (pEVar4->_pos).y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x1bc0)) = (pEVar4->_pos).x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x1bc4)) = distance;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (0 < this->_redStewBonusDuration) {
|
|
iVar2 = this->_redStewBonusDuration + 0x1e;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
iVar6 = 9000;
|
|
if (iVar2 < 9000) {
|
|
iVar6 = iVar2;
|
|
}
|
|
(this->_temporaryeffects)._cacheFlags = (this->_temporaryeffects)._cacheFlags | 1;
|
|
this->_redStewBonusDuration = iVar6;
|
|
}
|
|
if (((pEVar4->_flags & 0x80000000000000) != 0) &&
|
|
(pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x2c0),
|
|
pvVar5 != (void *)0x0)) {
|
|
collectibles = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibles) >> 2 < 0x2c1) {
|
|
tmpEffect[0] = 0;
|
|
}
|
|
else {
|
|
tmpEffect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibles) + 0xb00));
|
|
}
|
|
distance = (float)(*GHIDRA_CAST<int *>((tmpEffect[0] + 0x78)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 8)));
|
|
tmpEffect[1] = 0;
|
|
local_24.y = 0.0;
|
|
if (this->_playerType == 0x1b) {
|
|
bVar1 = HasCollectible(this,0x26b,0);
|
|
local_24.x = 1.26117e-43;
|
|
if (bVar1 == 0) goto LAB_007a0661;
|
|
}
|
|
else {
|
|
LAB_007a0661:
|
|
local_24.x = 4.2039e-44;
|
|
}
|
|
if (GHIDRA_INT(distance) < GHIDRA_INT(local_24.x)) {
|
|
local_24.x = distance;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(tmpEffect,0,1);
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_3c),&this->_pos,
|
|
60.0,2);
|
|
uVar3 = 0;
|
|
if (local_30 != 0.0) {
|
|
do {
|
|
iVar6 = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))) + uVar3 * 4));
|
|
if (((*GHIDRA_CAST<int *>((iVar6 + 0x28)) == 9) && (*GHIDRA_CAST<char *>((iVar6 + 0x173)) == '\0')) &&
|
|
((*GHIDRA_CAST<uint *>((iVar6 + 0x438)) & 0x80000000) == 0)) {
|
|
*GHIDRA_CAST<undefined1 *>((iVar6 + 0x173)) = 1;
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < GHIDRA_UINT(local_30));
|
|
}
|
|
if (local_3c[0] == '\0') {
|
|
local_8 = 0;
|
|
tracked_alloc(1,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_3c)) + 0x4))),0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
}
|
|
npc = GHIDRA_CAST<Entity *>(((pEVar4->_pos).y - (this->_pos).y));
|
|
local_24.x = (pEVar4->_pos).x - (this->_pos).x;
|
|
local_24.y = (float)npc;
|
|
local_18 = GHIDRA_CAST<TemporaryEffects *>(local_24.x);
|
|
distance = sqrtf((float)npc * (float)npc + local_24.x * local_24.x);
|
|
pEVar9 = npc;
|
|
pTVar10 = local_18;
|
|
if (0.0 < distance) {
|
|
pEVar9 = GHIDRA_CAST<Entity *>(((float)npc * (1.0 / distance)));
|
|
pTVar10 = GHIDRA_CAST<TemporaryEffects *>(((float)local_18 * (1.0 / distance)));
|
|
local_24.x = (float)pTVar10;
|
|
local_24.y = (float)pEVar9;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x8))) = (pEVar4->_pos).x - (float)pTVar10 * pEVar4->_size;
|
|
local_30 = (pEVar4->_pos).y - (float)pEVar9 * pEVar4->_size;
|
|
trigger_set_dispatch(&this->_proceduralItems,3,pEVar4,GHIDRA_CAST<Vector *>((local_3c + 8)),&local_24);
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0xbd)) {
|
|
iVar6 = GetTrinketMultiplier(this,0xbd);
|
|
bVar8 = false;
|
|
bVar7 = iVar6 == 0;
|
|
LAB_007a0809:
|
|
if (bVar7 || bVar8 != iVar6 < 0) goto LAB_007a0930;
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0xbd);
|
|
bVar8 = SBORROW4(iVar2,1);
|
|
iVar6 = iVar2 + -1;
|
|
bVar7 = iVar2 == 1;
|
|
goto LAB_007a0809;
|
|
}
|
|
pTVar10 = GHIDRA_CAST<TemporaryEffects *>(0x1e);
|
|
iVar2 = 0x96;
|
|
iVar6 = GetTrinketMultiplier(this,0xbd);
|
|
manager = g_manager;
|
|
if (iVar6 == 2) {
|
|
pTVar10 = GHIDRA_CAST<TemporaryEffects *>(0x2d);
|
|
iVar2 = 0xe1;
|
|
}
|
|
else if (iVar6 == 3) {
|
|
pTVar10 = GHIDRA_CAST<TemporaryEffects *>(&DAT_0000003c);
|
|
iVar2 = 300;
|
|
}
|
|
local_18 = &this->_temporaryeffects;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (effect = (this->_temporaryeffects)._effects._begin;
|
|
effect != (this->_temporaryeffects)._effects._end; effect = effect + 4) {
|
|
iVar6 = *GHIDRA_CAST<int *>(*effect);
|
|
if ((((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) && ((GHIDRA_CAST<int *>(*effect))[1] == 0x3a)) {
|
|
if (iVar2 <= effect[2]) goto LAB_007a0930;
|
|
goto LAB_007a088a;
|
|
}
|
|
}
|
|
}
|
|
effect = GHIDRA_CAST<int *>(0x0);
|
|
LAB_007a088a:
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0xe9) {
|
|
tmpEffect[0] = 0;
|
|
}
|
|
else {
|
|
tmpEffect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0xe8));
|
|
}
|
|
tmpEffect[1] = 0;
|
|
local_24.y = 0.0;
|
|
local_24.x = (float)pTVar10;
|
|
if (effect == GHIDRA_CAST<int *>(0x0)) {
|
|
npc = GHIDRA_CAST<Entity *>(0x404);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&npc));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(npc),1.0,2,0,1.0,0.0);
|
|
local_24.y = 1.4013e-45;
|
|
}
|
|
else if (iVar2 - effect[2] < GHIDRA_INT(pTVar10)) {
|
|
local_24.x = (float)(iVar2 - effect[2]);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((local_18)))->TemporaryEffects::AddEffect(tmpEffect,1,1);
|
|
LAB_007a0930:
|
|
if (killedNpc != GHIDRA_CAST<Entity *>(0x0)) {
|
|
PersistentGameData::AddBestiaryKill
|
|
(&g_manager->_persistentGameData,killedNpc->_type,killedNpc->_variant);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007a0970
|
|
Entity_Bomb * Entity_Player::FireBomb(Vector *pos, Vector *vel, Entity *source)
|
|
{
|
|
BitSet128 tearFlags;
|
|
qword qVar1;
|
|
Entity_Player *pEVar2;
|
|
byte bVar3;
|
|
uint uVar4;
|
|
uint seed;
|
|
Entity *spawned;
|
|
Entity_Bomb *bomb;
|
|
int iVar5;
|
|
Entity_Player *refSlot;
|
|
float unaff_ESI;
|
|
bool bVar6;
|
|
bool bVar7;
|
|
float fVar8;
|
|
int *piVar9;
|
|
int iVar10;
|
|
Entity_Player *local_a8;
|
|
float bombScale;
|
|
Entity_Player *local_a0;
|
|
Vector local_9c;
|
|
Vector *local_94;
|
|
float fStack_90;
|
|
Entity_Player *playerCopy;
|
|
Vector spawnX;
|
|
Vector VStack_80;
|
|
TearParams local_78;
|
|
uint local_c;
|
|
undefined4 flagsHigh;
|
|
int *laser;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_a8);
|
|
local_a0 = GHIDRA_CAST<Entity_Player *>(0x1e);
|
|
spawnX.x = pos->x + (this->_tearsOffset).x;
|
|
local_94 = vel;
|
|
spawnX.y = (this->_tearsOffset).y + pos->y;
|
|
local_9c.x = vel->x;
|
|
local_a8 = GHIDRA_CAST<Entity_Player *>(vel->y);
|
|
playerCopy = this;
|
|
bVar3 = HasCollectible(this,0xe9,0);
|
|
if (bVar3 != 0) {
|
|
uVar4 = Random();
|
|
local_a0 = GHIDRA_CAST<Entity_Player *>(0x28);
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 2.4;
|
|
local_a8 = GHIDRA_CAST<Entity_Player *>((fVar8 * (float)local_a8));
|
|
local_9c.x = fVar8 * local_9c.x;
|
|
}
|
|
bVar3 = HasCollectible(this,0xe0,0);
|
|
if (bVar3 != 0) {
|
|
local_9c.x = local_9c.x * 1.2;
|
|
local_a8 = GHIDRA_CAST<Entity_Player *>(((float)local_a8 * 1.2));
|
|
}
|
|
bombScale = 1.0;
|
|
GetTearHitParams(this,&local_78,5,1.0,GHIDRA_INT((char)this->_tearDisplacement),source);
|
|
uVar4 = 0;
|
|
bVar3 = HasCollectible(this,0x247,0);
|
|
if (bVar3 != 0) {
|
|
uVar4 = 0x13;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_78._flags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = (undefined4)local_78._flags._l;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = (undefined4)local_78._flags._h;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_78._flags._h)) + 0x4)));
|
|
fStack_90 = check_bomb_tearflags(this,tearFlags);
|
|
if (0.55 < local_78._tearScale) {
|
|
if (local_78._tearScale <= 0.75) {
|
|
bombScale = 0.8;
|
|
fStack_90 = fStack_90 * 0.6;
|
|
}
|
|
else if (2.0 < local_78._tearScale) {
|
|
fStack_90 = fStack_90 * 1.2;
|
|
}
|
|
}
|
|
else {
|
|
fStack_90 = fStack_90 * 0.45;
|
|
bombScale = 0.65;
|
|
}
|
|
local_9c.y = local_78._tearDamage;
|
|
fVar8 = local_78._tearDamage * 10.0;
|
|
local_78._tearDamage = local_78._tearDamage * 5.0 + 30.0;
|
|
if (fVar8 <= local_78._tearDamage) {
|
|
local_78._tearDamage = fVar8;
|
|
}
|
|
if (1.5 <= fStack_90) {
|
|
local_78._tearDamage = local_78._tearDamage + 25.0;
|
|
}
|
|
seed = Random();
|
|
VStack_80.y = -this->_tearheight / 23.75;
|
|
VStack_80.x = local_9c.x * VStack_80.y;
|
|
VStack_80.y = (float)local_a8 * VStack_80.y;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(4,uVar4,&spawnX,&VStack_80,GHIDRA_CAST<Entity *>(this),0,seed,0);
|
|
bomb = (Entity_Bomb *)
|
|
__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor);
|
|
*GHIDRA_CAST<uint *>(&bomb->_flags) = GHIDRA_UINT(bomb->_flags) | 0x4000000;
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&bomb->_flags) + 4));
|
|
bomb->_entityGridCollisionClass = 6;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&bomb->_flags) + 4)) = flagsHigh;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x85)) {
|
|
iVar5 = GetTrinketMultiplier(this,0x85);
|
|
bVar7 = false;
|
|
bVar6 = iVar5 == 0;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) != '\0') {
|
|
bVar6 = true;
|
|
goto LAB_007a0c76;
|
|
}
|
|
iVar10 = GetTrinketMultiplier(this,0x85);
|
|
bVar7 = SBORROW4(iVar10,1);
|
|
iVar5 = iVar10 + -1;
|
|
bVar6 = iVar10 == 1;
|
|
}
|
|
bVar6 = !bVar6 && bVar7 == iVar5 < 0;
|
|
LAB_007a0c76:
|
|
iVar5 = *GHIDRA_CAST<int *>(bomb);
|
|
*GHIDRA_CAST<undefined4 *>(&(bomb->_tearFlags)._l) = (undefined4)local_78._flags._l;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(bomb->_tearFlags)._l) + 4)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_78._flags._l)) + 0x4)));
|
|
*GHIDRA_CAST<undefined4 *>(&(bomb->_tearFlags)._h) = (undefined4)local_78._flags._h;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(bomb->_tearFlags)._h) + 4)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_78._flags._h)) + 0x4)));
|
|
bomb->_loadCostumes = 1;
|
|
local_a8 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0[-1])) + 0x2ef1))));
|
|
if (!bVar6) {
|
|
local_a8 = local_a0;
|
|
}
|
|
bomb->_explosionCountdown1 = GHIDRA_INT(local_a8);
|
|
*GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((bomb)) + 0x414)))) = local_a8;
|
|
bomb->_scale = fStack_90;
|
|
iVar10 = 0xff;
|
|
bomb->_explosionDamage = local_78._tearDamage;
|
|
bomb->_radiusMultiplier = bombScale;
|
|
bomb->_isFetus = 1;
|
|
(**(code **)(iVar5 + 0x3c))(&local_78._tearColor,0xffffffff,0xff,0);
|
|
if (bomb->_parent != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase((&local_78)[-1]._tearColor._colorize);
|
|
}
|
|
bomb->_parent = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(&bomb->_parent);
|
|
if (((GHIDRA_UINT((bomb->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagPiercing._l)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(bomb->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPiercing._l)) + 0x4)))) != 0) ||
|
|
((GHIDRA_UINT((bomb->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagPiercing._h)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(bomb->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPiercing._h)) + 0x4)))) != 0)) {
|
|
bomb->SetCollisionDamage(unaff_ESI * 2.5);
|
|
}
|
|
if ((bomb->_variant == 0x13) || (bomb->_variant == 0x14)) {
|
|
fVar8 = atan2f(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_a8)) + 0x4)))),*GHIDRA_CAST<float *>(local_a8));
|
|
bomb->_explosionCountdown1 = iVar10 + 0x3c;
|
|
bomb->_rocketAngle = fVar8 * 57.295776;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((bomb)) + 0x414)))) = iVar10 + 0x3c;
|
|
}
|
|
bVar3 = HasCollectible(this,0x18b,0);
|
|
if (bVar3 != 0) {
|
|
uVar4 = Random();
|
|
bVar3 = HasCollectible(local_a0,0x76,0);
|
|
pEVar2 = local_a0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(7,2 - (bVar3 != 0),&local_9c,&g_vectorZero,GHIDRA_CAST<Entity *>(local_a0),3,
|
|
uVar4,0);
|
|
laser = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0));
|
|
laser[0xd3] = 0;
|
|
laser[0xd4] = -0x3f600000;
|
|
refSlot = GHIDRA_CAST<Entity_Player *>((laser + 0xef));
|
|
if (*GHIDRA_CAST<float *>(refSlot) != 0.0) {
|
|
local_a8 = refSlot;
|
|
std::multiset<unsigned_int>::erase(&local_a8);
|
|
}
|
|
*GHIDRA_CAST<Entity_Bomb **>(refSlot) = bomb;
|
|
std::multiset<unsigned_int>::insert(refSlot);
|
|
piVar9 = GHIDRA_CAST<int *>(0x0);
|
|
laser[0xd6] = 0x453b8000;
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(pEVar2->_tearFlags)._l) + 4));
|
|
qVar1 = (pEVar2->_tearFlags)._h;
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(pEVar2->_tearFlags)._h) + 4));
|
|
laser[0x10a] = GHIDRA_INT((pEVar2->_tearFlags)._l);
|
|
laser[0x10b] = iVar5;
|
|
laser[0x10c] = GHIDRA_INT(qVar1);
|
|
laser[0x10d] = iVar10;
|
|
(**(code **)(*laser + 0x3c))(&pEVar2->_laserColor,0xffffffff,0xff,0,1);
|
|
(**(code **)(*piVar9 + 0x40))(pEVar2->_damage);
|
|
laser[0x12f] = 0x42480000;
|
|
refSlot = GHIDRA_CAST<Entity_Player *>((laser + 0xf2));
|
|
if (laser[0xf2] != 0) {
|
|
local_a8 = refSlot;
|
|
std::multiset<unsigned_int>::erase(&local_a8);
|
|
}
|
|
*GHIDRA_CAST<Entity_Player **>(refSlot) = pEVar2;
|
|
std::multiset<unsigned_int>::insert(refSlot);
|
|
}
|
|
if ((bomb->_variant == 0x13) || (bomb->_variant == 0x14)) {
|
|
bomb->Update();
|
|
}
|
|
return bomb;
|
|
}
|
|
|
|
// 007a1090
|
|
byte Entity_Player::TriggerDeath(byte checkOnly)
|
|
{
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
uint uVar3;
|
|
Entity_Player *tmpPlayer;
|
|
ColorMod *color;
|
|
int *piVar4;
|
|
int iVar5;
|
|
RNG *guppysCollarRng;
|
|
Entity_Player *pEVar6;
|
|
ColorMod *extraout_EAX;
|
|
ColorMod *extraout_EAX_00;
|
|
Entity_Player **ppEVar7;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
short newDeadCatLives;
|
|
uint slotIndex;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *extraout_ECX_00;
|
|
Entity_Player *extraout_ECX_01;
|
|
Entity_Player *extraout_ECX_02;
|
|
Entity_Player *extraout_ECX_03;
|
|
void *extraout_ECX_04;
|
|
Entity_Player *extraout_ECX_05;
|
|
Entity_Player *extraout_ECX_06;
|
|
Entity_Player *extraout_ECX_07;
|
|
Entity_Player *extraout_ECX_08;
|
|
Entity_Player *extraout_ECX_09;
|
|
Entity_Player *extraout_ECX_10;
|
|
Entity_Player *extraout_ECX_11;
|
|
Entity_Player *extraout_ECX_12;
|
|
Entity_Player *extraout_ECX_13;
|
|
Entity_Player *extraout_ECX_14;
|
|
Entity_Player *extraout_ECX_15;
|
|
Entity_Player *extraout_ECX_16;
|
|
Entity_Player *extraout_ECX_17;
|
|
void *pvVar8;
|
|
int unused;
|
|
Entity_Player *extraout_ECX_18;
|
|
Entity_Player *extraout_ECX_19;
|
|
Entity_Player *extraout_ECX_20;
|
|
int unused_00;
|
|
Entity_Player *extraout_ECX_21;
|
|
Entity_Player *extraout_ECX_22;
|
|
Entity_Player *extraout_ECX_23;
|
|
Entity_Player *extraout_ECX_24;
|
|
Entity_Player *extraout_ECX_25;
|
|
Entity_Player *extraout_ECX_26;
|
|
Entity_Player *pEVar9;
|
|
char *pocketCopySrc;
|
|
Entity_Player **playerIter;
|
|
uint uVar10;
|
|
int iVar11;
|
|
undefined4 *pocketCopyDst;
|
|
uint *puVar12;
|
|
ColorMod *color_00;
|
|
Entity_Player *local_84;
|
|
EntityPtr local_80;
|
|
Vector local_7c;
|
|
int effectKey [3];
|
|
undefined4 local_68;
|
|
Color gibColor;
|
|
Color boneGibColor;
|
|
uint stackCookie;
|
|
Entity_Player *deathPlayer;
|
|
float forgottenBodyY;
|
|
Manager *manager;
|
|
EntityPtr parentPlayer;
|
|
void *rngArray;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(&local_84);
|
|
local_84 = this;
|
|
if (this->_variant == 1) {
|
|
if (checkOnly == 0) {
|
|
coop_baby_death_effect(this);
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_coop_baby_death(this);
|
|
this->_visible = 0;
|
|
return 0;
|
|
}
|
|
return 0;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c8129c) &&
|
|
(_Init_thread_header(&DAT_00c8129c), DAT_00c8129c == -1)) {
|
|
_atexit(GHIDRA_CAST<_func_4879 *>(&LAB_00b15b90));
|
|
_Init_thread_footer(&DAT_00c8129c);
|
|
}
|
|
g_triggerDeathPlayersEnd = g_triggerDeathPlayers;
|
|
local_80 = this->_twinPlayer;
|
|
if (local_80 == (EntityPtr)0x0) {
|
|
LAB_007a114f:
|
|
local_80 = (EntityPtr)this;
|
|
if (g_triggerDeathPlayersEnd == DAT_00c812a8) {
|
|
LAB_007a11cc:
|
|
std::vector<unsigned_int>::_Emplace_reallocate(g_triggerDeathPlayersEnd,&local_80);
|
|
}
|
|
else {
|
|
*g_triggerDeathPlayersEnd = this;
|
|
g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1;
|
|
}
|
|
}
|
|
else {
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_80) + 0x161c)) != -1) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_80) + 0x161c)) < this->_playerIndex)) && (local_80 != (EntityPtr)this)) {
|
|
if (g_triggerDeathPlayers == DAT_00c812a8) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(g_triggerDeathPlayers,&local_80);
|
|
}
|
|
else {
|
|
*g_triggerDeathPlayers = GHIDRA_CAST<Entity_Player *>(local_80);
|
|
g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1;
|
|
}
|
|
goto LAB_007a114f;
|
|
}
|
|
if (g_triggerDeathPlayers == DAT_00c812a8) {
|
|
local_80 = (EntityPtr)this;
|
|
std::vector<unsigned_int>::_Emplace_reallocate(g_triggerDeathPlayers,&local_80);
|
|
}
|
|
else {
|
|
*g_triggerDeathPlayers = this;
|
|
g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1;
|
|
}
|
|
local_80 = this->_twinPlayer;
|
|
if (g_triggerDeathPlayersEnd == DAT_00c812a8) goto LAB_007a11cc;
|
|
*g_triggerDeathPlayersEnd = GHIDRA_CAST<Entity_Player *>(local_80);
|
|
g_triggerDeathPlayersEnd = g_triggerDeathPlayersEnd + 1;
|
|
}
|
|
if (((checkOnly == 0) && (bVar2 = HasTrinket(this,0x17,0), bVar2 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0xd)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x52);
|
|
}
|
|
local_80 = (EntityPtr)(*g_triggerDeathPlayers)->_playerType;
|
|
for (ppEVar7 = g_triggerDeathPlayers; ppEVar7 != g_triggerDeathPlayersEnd; ppEVar7 = ppEVar7 + 1)
|
|
{
|
|
pEVar9 = *ppEVar7;
|
|
if ((pEVar9->_temporaryeffects)._disabled == 0) {
|
|
for (piVar4 = (pEVar9->_temporaryeffects)._effects._begin;
|
|
piVar4 != (pEVar9->_temporaryeffects)._effects._end; piVar4 = piVar4 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar4) == 0) && ((GHIDRA_CAST<int *>(*piVar4))[1] == 0x71)) goto LAB_007a15d3;
|
|
}
|
|
}
|
|
}
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
uVar10 = 0;
|
|
uVar3 = GetMaxPocketItems(*ppEVar7);
|
|
if (uVar3 != 0) {
|
|
do {
|
|
pEVar9 = *ppEVar7;
|
|
uVar3 = uVar10;
|
|
if (GHIDRA_INT(uVar10) < 1) {
|
|
uVar3 = 0;
|
|
}
|
|
slotIndex = 3;
|
|
if (GHIDRA_INT(uVar3) < 3) {
|
|
slotIndex = uVar3;
|
|
}
|
|
if ((pEVar9->_pocketSlots[slotIndex * 2 + 1] == 1) &&
|
|
(pEVar9->_pocketSlots[slotIndex * 2] == 0x59)) goto LAB_007a15d3;
|
|
uVar10 = uVar10 + 1;
|
|
uVar3 = GetMaxPocketItems(pEVar9);
|
|
} while (uVar10 < uVar3);
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
LAB_007a12d4:
|
|
tmpPlayer = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
pEVar9 = local_84;
|
|
if (tmpPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
RemoveCollectible(tmpPlayer,0xb,0,0,1);
|
|
pEVar6 = extraout_ECX;
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
pEVar9 = *ppEVar7;
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(pEVar9))))->LuaEngine::RunScript(0xb,tmpPlayer == pEVar9);
|
|
pEVar6 = extraout_ECX_00;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
goto LAB_007a1331;
|
|
}
|
|
if (local_84->_playerType == 8) {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(*g_triggerDeathPlayers))))->LuaEngine::RunScript(0x14c,1);
|
|
pEVar6 = extraout_ECX_09;
|
|
}
|
|
else {
|
|
tmpPlayer = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
if (tmpPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
tmpPlayer = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
if (tmpPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
tmpPlayer = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
if ((tmpPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(guppysCollarRng = GetCollectibleRNG(tmpPlayer,0xd4), (guppysCollarRng->_seed & 1) == 0))
|
|
{
|
|
tmpPlayer = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
if (tmpPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
if (pEVar6 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(FUN_007a1020());
|
|
if (pEVar6 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar11 = GetTrinketMultiplier(pEVar6,0x1c);
|
|
if (iVar11 == 1) {
|
|
uVar3 = 0x16;
|
|
}
|
|
else {
|
|
iVar11 = GetTrinketMultiplier(pEVar6,0x1c);
|
|
uVar3 = 0x32;
|
|
if (iVar11 == 2) {
|
|
uVar3 = 0x21;
|
|
}
|
|
}
|
|
pvVar8 = (pEVar6->_trinketRNGs)._end;
|
|
if (GHIDRA_INT((GHIDRA_INT(pvVar8) - GHIDRA_INT((pEVar6->_trinketRNGs)._begin) & 0xfffffff0U)) < 0x1c1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Trinket ID out of bounds!\n"));
|
|
pvVar8 = (pEVar6->_trinketRNGs)._end;
|
|
}
|
|
rngArray = (pEVar6->_trinketRNGs)._begin;
|
|
uVar10 = (GHIDRA_INT(pvVar8) - GHIDRA_INT(rngArray) >> 4) - 1;
|
|
if (0x1c < uVar10) {
|
|
uVar10 = 0x1c;
|
|
}
|
|
uVar10 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((uVar10 * 0x10 + GHIDRA_INT(rngArray))))))->RNG::RandomInt(100);
|
|
if (uVar10 < uVar3) {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
ReviveFromTrinket(*g_triggerDeathPlayers,0x1c,unused);
|
|
pEVar6 = extraout_ECX_18;
|
|
goto LAB_007a1335;
|
|
}
|
|
}
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(FUN_007a0fe0());
|
|
if (pEVar6 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
tmpPlayer = GHIDRA_CAST<Entity_Player *>(FUN_007a1020());
|
|
pEVar6 = extraout_ECX_20;
|
|
if (tmpPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if ((pEVar9->_playerType == 0x1f) &&
|
|
(bVar2 = HasCollectible(pEVar9,0x26b,0), pEVar6 = extraout_ECX_22, bVar2 != 0))
|
|
{
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
RemoveCollectible(pEVar9,0x26b,0,0,1);
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(*g_triggerDeathPlayers))))->LuaEngine::RunScript(0x26b,1);
|
|
pEVar6 = extraout_ECX_23;
|
|
}
|
|
else if (checkOnly != 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
else if (((g_manager->_persistentGameData)._achievements[0x52] == 0) &&
|
|
(((g_manager->_state != 2 || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) {
|
|
if (checkOnly != 0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0xd) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
TryRemoveTrinket(tmpPlayer,0x17);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::RemoveTrinketEffect(0x17,-1);
|
|
ReviveFromTrinket(*g_triggerDeathPlayers,0x17,unused_00);
|
|
pEVar6 = extraout_ECX_21;
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
RemoveCollectible(pEVar6,0x137,0,0,1);
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(*g_triggerDeathPlayers))))->LuaEngine::RunScript(0x137,1);
|
|
pEVar6 = extraout_ECX_19;
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
RemoveCollectible(pEVar6,0xa1,0,0,1);
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(*g_triggerDeathPlayers))))->LuaEngine::RunScript(0xa1,1);
|
|
pEVar6 = extraout_ECX_17;
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
RemoveCollectible(tmpPlayer,0x14c,0,0,1);
|
|
pEVar6 = extraout_ECX_15;
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
deathPlayer = *ppEVar7;
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (deathPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(deathPlayer))))->LuaEngine::RunScript(0x14c,tmpPlayer == deathPlayer);
|
|
pEVar6 = extraout_ECX_16;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
pEVar6 = extraout_ECX_13;
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
deathPlayer = *ppEVar7;
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (deathPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(deathPlayer))))->LuaEngine::RunScript(0xd4,tmpPlayer == deathPlayer);
|
|
pEVar6 = extraout_ECX_14;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
RemoveCollectible(tmpPlayer,0x2b0,0,0,1);
|
|
pEVar6 = extraout_ECX_11;
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
deathPlayer = *ppEVar7;
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (deathPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(deathPlayer))))->LuaEngine::RunScript(0x2b0,tmpPlayer == deathPlayer);
|
|
pEVar6 = extraout_ECX_12;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
iVar11 = tmpPlayer->_deadCatLives + -1;
|
|
newDeadCatLives = 0;
|
|
if (0 < iVar11) {
|
|
newDeadCatLives = (short)iVar11;
|
|
}
|
|
tmpPlayer->_deadCatLives = newDeadCatLives;
|
|
pEVar6 = (Entity_Player *)
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT((tmpPlayer->_collectibleCounts)._begin) + 0x144)) * 9 + -8);
|
|
if (GHIDRA_INT(newDeadCatLives) < GHIDRA_INT(pEVar6)) {
|
|
do {
|
|
RemoveCollectible(tmpPlayer,0x51,0,0,1);
|
|
pEVar6 = (Entity_Player *)
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT((tmpPlayer->_collectibleCounts)._begin) + 0x144)) * 9 + -8);
|
|
} while (GHIDRA_INT(tmpPlayer->_deadCatLives) < GHIDRA_INT(pEVar6));
|
|
}
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
deathPlayer = *ppEVar7;
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (deathPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(deathPlayer))))->LuaEngine::RunScript(0x51,tmpPlayer == deathPlayer);
|
|
pEVar6 = extraout_ECX_10;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
}
|
|
}
|
|
LAB_007a1335:
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
pEVar6 = *ppEVar7;
|
|
if (pEVar6 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar6->_pitfallState = 0;
|
|
pEVar6->_isControlsEnabled = 1;
|
|
pEVar6->_entityCollisionClass = 4;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
tmpPlayer = *g_triggerDeathPlayers;
|
|
if ((tmpPlayer->_dead != 0) && (tmpPlayer->_parent == (EntityPtr)0x0)) {
|
|
local_7c.x = (float)&g_game->_playerManager;
|
|
bVar2 = (GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(local_7c.x))))->PlayerManager::IsCoopPlay();
|
|
pEVar6 = extraout_ECX_01;
|
|
if ((bVar2 != 0) &&
|
|
(((uVar3 = (GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(local_7c.x))))->PlayerManager::GetNumAlivePlayers(),
|
|
pEVar6 = extraout_ECX_02, 1 < uVar3 && (tmpPlayer->_isCoopGhost == 0)) &&
|
|
(ppEVar7 != g_triggerDeathPlayersEnd)))) {
|
|
do {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (*ppEVar7 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
MorphToCoopGhost(*ppEVar7);
|
|
pEVar6 = extraout_ECX_03;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
}
|
|
tmpPlayer = *g_triggerDeathPlayers;
|
|
if (tmpPlayer->_dead == 0) {
|
|
if (((local_80 == (EntityPtr)0x3) && (tmpPlayer->_playerType != 0xc)) &&
|
|
(bVar2 = HasCollectible(tmpPlayer,0x26b,0), pEVar6 = extraout_ECX_24, bVar2 != 0)) {
|
|
tmpPlayer = *g_triggerDeathPlayers;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1db);
|
|
pEVar6 = extraout_ECX_25;
|
|
if (bVar2 != 0) {
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x76c < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) &
|
|
0xfffffffcU))) && (iVar11 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x76c)), iVar11 != 0)) {
|
|
effectKey[2] = *GHIDRA_CAST<undefined4 *>((iVar11 + 0x78));
|
|
effectKey[1] = 0;
|
|
local_68 = 0;
|
|
effectKey[0] = iVar11;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::RemoveEffect(effectKey,-1);
|
|
}
|
|
(*g_triggerDeathPlayers)->_maxHearts = 0;
|
|
(*g_triggerDeathPlayers)->_redHearts = 0;
|
|
(*g_triggerDeathPlayers)->_playerType = 0xc;
|
|
pEVar9->_cacheFlags = pEVar9->_cacheFlags | 0xffff;
|
|
update_player_skin(pEVar9);
|
|
EvaluateItems(pEVar9);
|
|
TryPreventDeath(pEVar9);
|
|
pEVar6 = extraout_ECX_26;
|
|
}
|
|
}
|
|
RemoveCollectible(*g_triggerDeathPlayers,local_80,pEVar6);
|
|
ppEVar7 = g_triggerDeathPlayersEnd;
|
|
playerIter = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers == g_triggerDeathPlayersEnd) {
|
|
return 1;
|
|
}
|
|
do {
|
|
pEVar9 = *playerIter;
|
|
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pvVar8 = (pEVar9->_collectibleRNGs)._end;
|
|
if (GHIDRA_INT((GHIDRA_INT(pvVar8) - GHIDRA_INT((pEVar9->_collectibleRNGs)._begin) & 0xfffffff0U)) < 0xd41) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Collectible ID out of bounds!\n"));
|
|
pvVar8 = (pEVar9->_collectibleRNGs)._end;
|
|
}
|
|
rngArray = (pEVar9->_collectibleRNGs)._begin;
|
|
uVar3 = (GHIDRA_INT(pvVar8) - GHIDRA_INT(rngArray) >> 4) - 1;
|
|
uVar10 = 0xd4;
|
|
if (uVar3 < 0xd4) {
|
|
uVar10 = uVar3;
|
|
}
|
|
puVar12 = GHIDRA_CAST<uint *>((uVar10 * 0x10 + GHIDRA_INT(rngArray)));
|
|
uVar3 = *puVar12;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar3 = *puVar12;
|
|
if (uVar3 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
bVar2 = (*pcVar1)();
|
|
return bVar2;
|
|
}
|
|
}
|
|
uVar3 = uVar3 >> ((byte)puVar12[1] & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((byte)puVar12[2] & 0x1f) ^ uVar3;
|
|
*puVar12 = uVar3 >> ((byte)puVar12[3] & 0x1f) ^ uVar3;
|
|
pvVar8 = (pEVar9->_trinketRNGs)._end;
|
|
if (GHIDRA_INT((GHIDRA_INT(pvVar8) - GHIDRA_INT((pEVar9->_trinketRNGs)._begin) & 0xfffffff0U)) < 0x1c1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Trinket ID out of bounds!\n"));
|
|
pvVar8 = (pEVar9->_trinketRNGs)._end;
|
|
}
|
|
rngArray = (pEVar9->_trinketRNGs)._begin;
|
|
uVar3 = (GHIDRA_INT(pvVar8) - GHIDRA_INT(rngArray) >> 4) - 1;
|
|
if (0x1c < uVar3) {
|
|
uVar3 = 0x1c;
|
|
}
|
|
puVar12 = GHIDRA_CAST<uint *>((uVar3 * 0x10 + GHIDRA_INT(rngArray)));
|
|
uVar3 = *puVar12;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar3 = *puVar12;
|
|
if (uVar3 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
bVar2 = (*pcVar1)();
|
|
return bVar2;
|
|
}
|
|
}
|
|
uVar3 = uVar3 >> ((byte)puVar12[1] & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((byte)puVar12[2] & 0x1f) ^ uVar3;
|
|
*puVar12 = uVar3 >> ((byte)puVar12[3] & 0x1f) ^ uVar3;
|
|
init_forgotten_twin(pEVar9);
|
|
UpdateCanShoot(pEVar9);
|
|
pEVar9->ResetColor();
|
|
ppEVar7 = g_triggerDeathPlayersEnd;
|
|
}
|
|
playerIter = playerIter + 1;
|
|
} while (playerIter != ppEVar7);
|
|
return 1;
|
|
}
|
|
parentPlayer = tmpPlayer->_parent;
|
|
if (((parentPlayer == (EntityPtr)0x0) || (tmpPlayer->_variant != 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parentPlayer) + 0x28)) != 1)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_coop_baby_death(pEVar9);
|
|
pEVar9->_visible = 0;
|
|
return 1;
|
|
}
|
|
local_7c.x = (float)&tmpPlayer->_temporaryeffects;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(local_7c.x))))->TemporaryEffects::HasCollectibleEffect(0x29b);
|
|
manager = g_manager;
|
|
if (bVar2 != 0) {
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0xa6c < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) & 0xfffffffcU))
|
|
) && (iVar11 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0xa6c)), iVar11 != 0)) {
|
|
effectKey[2] = *GHIDRA_CAST<undefined4 *>((iVar11 + 0x78));
|
|
effectKey[1] = 0;
|
|
local_68 = 0;
|
|
effectKey[0] = iVar11;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(local_7c.x))))->TemporaryEffects::RemoveEffect(effectKey,-1);
|
|
pvVar8 = extraout_ECX_04;
|
|
}
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(*g_triggerDeathPlayers,(byte)pvVar8);
|
|
RemoveCollectible(GHIDRA_CAST<Entity_Player *>(parentPlayer),0x29b,0,0,1);
|
|
iVar11 = 5;
|
|
do {
|
|
iVar5 = iVar11;
|
|
local_7c.x = ((*g_triggerDeathPlayers)->_pos).x;
|
|
local_7c.y = ((*g_triggerDeathPlayers)->_pos).y;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parentPlayer) + 0x1370)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parentPlayer) + 0x1370)) + 1;
|
|
spawn_blue_spider(&local_7c,GHIDRA_CAST<Entity *>(parentPlayer),&g_vectorZero);
|
|
manager = g_manager;
|
|
iVar11 = iVar5 + -1;
|
|
} while (iVar11 != 0);
|
|
iVar11 = (*g_triggerDeathPlayers)->_playerType;
|
|
if ((iVar11 == 0x10) || (iVar11 == 0x23)) {
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(0x1b);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_84));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_84),1.0,2,0,1.0,0.0);
|
|
gibColor._offset[0] = 0.0;
|
|
gibColor._tint[0] = 1.0;
|
|
gibColor._tint[1] = 1.0;
|
|
gibColor._tint[2] = 1.0;
|
|
gibColor._tint[3] = 1.0;
|
|
gibColor._offset[1] = 0.0;
|
|
gibColor._offset[2] = 0.0;
|
|
gibColor._colorize[0] = 0.0;
|
|
gibColor._colorize[1] = 0.0;
|
|
gibColor._colorize[2] = 0.0;
|
|
gibColor._colorize[3] = 0.0;
|
|
local_7c.x = 2.10195e-44;
|
|
spawn_gibs(&(*g_triggerDeathPlayers)->_pos,0xe,80.0,GHIDRA_CAST<uint *>(&local_7c),GHIDRA_CAST<Entity *>(pEVar9),
|
|
GHIDRA_CAST<ColorMod *>(&gibColor),&g_vectorZero,1.0);
|
|
return 1;
|
|
}
|
|
if (((iVar11 == 10) || (iVar11 == 0x1f)) || (iVar11 == 0x27)) {
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(0x50);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_84));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_84),1.0,2,0,1.0,0.0);
|
|
uVar3 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&(*g_triggerDeathPlayers)->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar3,0);
|
|
return 1;
|
|
}
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(0x1e);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_84));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_84),1.0,2,0,1.0,0.0);
|
|
uVar3 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,&(*g_triggerDeathPlayers)->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),3,uVar3,
|
|
0);
|
|
(GHIDRA_CAST<Color *>((&gibColor)))->Color::Color();
|
|
local_7c.x = 9.80909e-45;
|
|
spawn_gibs(&pEVar9->_pos,iVar5 + 7,80.0,GHIDRA_CAST<uint *>(&local_7c),GHIDRA_CAST<Entity *>(pEVar9),color,&g_vectorZero,
|
|
1.0);
|
|
return 1;
|
|
}
|
|
iVar11 = tmpPlayer->_playerType;
|
|
if ((iVar11 == 0x10) || (iVar11 == 0x23)) {
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(0x1b);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_84));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_84),1.25,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Color *>((&boneGibColor)))->Color::Color();
|
|
local_80 = (EntityPtr)0xf;
|
|
puVar12 = GHIDRA_CAST<uint *>(&local_80);
|
|
iVar11 = 0xe;
|
|
color_00 = extraout_EAX_00;
|
|
}
|
|
else {
|
|
bVar2 = extraout_CL;
|
|
if (((iVar11 == 10) || (iVar11 == 0x1f)) || (iVar11 == 0x27)) goto LAB_007a1f38;
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(0x1e);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_84));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_84),1.0,2,0,1.0,0.0);
|
|
uVar3 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,&pEVar9->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2,uVar3,0);
|
|
(GHIDRA_CAST<Color *>((&gibColor)))->Color::Color();
|
|
iVar11 = 8;
|
|
local_7c.x = (float)&DAT_00000007;
|
|
puVar12 = GHIDRA_CAST<uint *>(&local_7c);
|
|
color_00 = extraout_EAX;
|
|
}
|
|
spawn_gibs(&pEVar9->_pos,iVar11,80.0,puVar12,GHIDRA_CAST<Entity *>(pEVar9),color_00,&g_vectorZero,1.0);
|
|
bVar2 = extraout_CL_00;
|
|
LAB_007a1f38:
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(*g_triggerDeathPlayers,bVar2);
|
|
return 1;
|
|
LAB_007a15d3:
|
|
if (pEVar9 == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_007a12d4;
|
|
if (checkOnly != 0) {
|
|
return 1;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&pEVar9->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x71);
|
|
if (bVar2 == 0) {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
piVar4 = pEVar9->_pocketSlots;
|
|
LAB_007a1630:
|
|
if ((piVar4[1] != 1) || (*piVar4 != 0x59)) goto LAB_007a163b;
|
|
if (pEVar6 < GHIDRA_CAST<Entity_Player *>(0x3)) {
|
|
pocketCopySrc = (pEVar9->_sprite)._filename._buf + GHIDRA_INT(&pEVar6->_baitedCountdown) * 8 + -0x40;
|
|
pocketCopyDst =
|
|
(undefined4 *)
|
|
(GHIDRA_INT((&(pEVar9->_sprite)._filename + -3)) + GHIDRA_INT(&pEVar6->_baitedCountdown) * 8);
|
|
for (uVar3 = (3 - GHIDRA_INT(pEVar6)) * 2 & 0x3ffffffe; pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0), uVar3 != 0;
|
|
uVar3 = uVar3 - 1) {
|
|
*pocketCopyDst = *GHIDRA_CAST<undefined4 *>(pocketCopySrc);
|
|
pocketCopySrc = pocketCopySrc + 4;
|
|
pocketCopyDst = pocketCopyDst + 1;
|
|
}
|
|
}
|
|
pEVar9->_pocketSlots[6] = 0;
|
|
pEVar9->_pocketSlots[7] = 1;
|
|
goto LAB_007a1683;
|
|
}
|
|
pEVar6 = extraout_ECX_05;
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (*ppEVar7 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&(*ppEVar7)->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x71,1);
|
|
pEVar6 = extraout_ECX_06;
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
LAB_007a1683:
|
|
ppEVar7 = g_triggerDeathPlayers;
|
|
if (g_triggerDeathPlayers != g_triggerDeathPlayersEnd) {
|
|
do {
|
|
pEVar9 = *ppEVar7;
|
|
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if (-1 < pEVar9->_playerIndex) {
|
|
Revive(pEVar9);
|
|
}
|
|
pEVar9->_soulHearts = 0;
|
|
pEVar9->_blackHearts = 0;
|
|
pEVar9->_eternalHearts = 0;
|
|
pEVar9->_boneHeartsMask = 0;
|
|
pEVar9->_boneHearts = 0;
|
|
pEVar9->_rottenHearts = 0;
|
|
if (pEVar9->_maxHearts < 1) {
|
|
iVar11 = GetHealthType(pEVar9);
|
|
if (iVar11 == 4) {
|
|
pEVar9->_redHearts = 0;
|
|
AddBoneHearts(pEVar9,1);
|
|
}
|
|
else {
|
|
iVar11 = GetHealthType(pEVar9);
|
|
if (iVar11 == 3) {
|
|
pEVar9->_redHearts = 2;
|
|
pEVar9->_maxHearts = 2;
|
|
}
|
|
else if (pEVar9->_playerType == 0x12) {
|
|
pEVar9->_maxHearts = 2;
|
|
pEVar9->_redHearts = 1;
|
|
}
|
|
else {
|
|
pEVar9->_redHearts = 0;
|
|
pEVar9->_soulHearts = 1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
pEVar9->_redHearts = 1;
|
|
iVar11 = GetHealthType(pEVar9);
|
|
if (iVar11 == 3) {
|
|
pEVar9->_redHearts = 2;
|
|
}
|
|
}
|
|
pvVar8 = pEVar9->_forgottenBody;
|
|
pEVar9->_visible = 1;
|
|
pEVar9->_damageCooldown = 0x5a;
|
|
if (pvVar8 != (void *)0x0) {
|
|
forgottenBodyY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x340));
|
|
(pEVar9->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x33c));
|
|
(pEVar9->_pos).y = forgottenBodyY;
|
|
}
|
|
UpdateHeartDependentEffects(pEVar9);
|
|
pEVar6 = extraout_ECX_07;
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (pEVar9->_dead == 0)) &&
|
|
(iVar11 = pEVar9->_goldenHearts, 0 < iVar11)) {
|
|
iVar5 = pEVar9->_redHearts;
|
|
if (pEVar9->_maxHearts < pEVar9->_redHearts) {
|
|
iVar5 = pEVar9->_maxHearts;
|
|
}
|
|
pEVar6 = (Entity_Player *)
|
|
((iVar5 + 1) / 2 + (pEVar9->_soulHearts + 1) / 2 + pEVar9->_boneHearts);
|
|
local_7c.x = (float)pEVar6;
|
|
if (GHIDRA_INT(pEVar6) < iVar11) {
|
|
BreakGoldenHearts(pEVar9,iVar11 - GHIDRA_INT(pEVar6));
|
|
pEVar9->_goldenHearts = GHIDRA_INT(local_7c.x);
|
|
pEVar6 = extraout_ECX_08;
|
|
}
|
|
}
|
|
}
|
|
ppEVar7 = ppEVar7 + 1;
|
|
} while (ppEVar7 != g_triggerDeathPlayersEnd);
|
|
}
|
|
LAB_007a1331:
|
|
pEVar9 = local_84;
|
|
goto LAB_007a1335;
|
|
LAB_007a163b:
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar6)) + 0x1))));
|
|
piVar4 = piVar4 + 2;
|
|
if (GHIDRA_CAST<undefined1 *>(0x3) < pEVar6) goto LAB_007a1683;
|
|
goto LAB_007a1630;
|
|
}
|
|
|
|
// 007a2220
|
|
void Entity_Player::Revive()
|
|
{
|
|
int iVar1;
|
|
Vector *safePos;
|
|
LayerState *layer;
|
|
int reducedBrokenHearts;
|
|
Vector local_10;
|
|
uint *flagsHigh;
|
|
qword oldFlags;
|
|
EntityPtr twinPlayer;
|
|
|
|
if (this->_dead != 0) {
|
|
this->_dead = 0;
|
|
this->_damageCooldown = 1;
|
|
iVar1 = GetHeartLimit(this,0);
|
|
if (iVar1 < 1) {
|
|
reducedBrokenHearts = this->_brokenHearts + -1;
|
|
iVar1 = 0;
|
|
if (0 < reducedBrokenHearts) {
|
|
iVar1 = reducedBrokenHearts;
|
|
}
|
|
this->_brokenHearts = iVar1;
|
|
}
|
|
if (this->_maxHearts < 1) {
|
|
if (this->_boneHearts < 1) {
|
|
this->_redHearts = 0;
|
|
this->_soulHearts = 1;
|
|
}
|
|
}
|
|
else {
|
|
this->_redHearts = 1;
|
|
this->_soulHearts = 0;
|
|
}
|
|
if ((this->_variant == 1) || (this->_isCoopGhost != 0)) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Appear"));
|
|
local_10.x = (this->_pos).x;
|
|
local_10.y = (this->_pos).y;
|
|
safePos = PlayerManager::find_safe_spawn_position(&local_10,this->_pos);
|
|
(this->_pos).x = safePos->x;
|
|
(this->_pos).y = safePos->y;
|
|
this->_damageCooldown = 0x96;
|
|
}
|
|
if (this->_playerType == 0x23) {
|
|
twinPlayer = this->_twinPlayer;
|
|
if (twinPlayer != (EntityPtr)0x0) {
|
|
if (*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(twinPlayer) + 0x1410)) == this) {
|
|
if (*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(twinPlayer) + 0x1410)) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_10.x = (float)(GHIDRA_INT(twinPlayer) + 0x1410);
|
|
std::multiset<unsigned_int>::erase(&local_10);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(twinPlayer) + 0x1410)) = 0;
|
|
oldFlags = this->_flags;
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
*flagsHigh = *flagsHigh & 0xf9ffffff;
|
|
*GHIDRA_CAST<int *>(&this->_flags) = GHIDRA_INT(oldFlags);
|
|
}
|
|
}
|
|
this->_cacheFlags = 0xffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f0)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13fc)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1400))) = 0;
|
|
EvaluateItems(this);
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0xc));
|
|
layer->_visible = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a3430
|
|
void Entity_Player::ReviveFromTrinket(uint trinketId, int unused)
|
|
{
|
|
Entity_Player *game = this;
|
|
int *piVar1;
|
|
int *cooldownSource;
|
|
ItemConfig_Item *trinketConfig;
|
|
void *pvVar2;
|
|
uint uVar3;
|
|
uint leaveDoor;
|
|
int heartTotal;
|
|
int iVar4;
|
|
int minCooldown;
|
|
void *trinketName [5];
|
|
uint trinketNameCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
Game *game;
|
|
bool isBeastRoom;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00aff10d;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((trinketName + 10));
|
|
ExceptionList = &local_10;
|
|
if (-1 < game->_playerIndex) {
|
|
Revive(game);
|
|
}
|
|
piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10));
|
|
if (((piVar1 == GHIDRA_CAST<int *>(0x0)) || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) {
|
|
isBeastRoom = false;
|
|
}
|
|
else {
|
|
isBeastRoom = true;
|
|
}
|
|
if (trinketId == 0x17) {
|
|
RemoveSkinCostume(game);
|
|
game->_maxHearts = 0;
|
|
game->_redHearts = 0;
|
|
game->_soulHearts = 1;
|
|
game->_blackHearts = 0;
|
|
game->_boneHeartsMask = 0;
|
|
game->_boneHearts = 0;
|
|
game->_rottenHearts = 0;
|
|
game->_eternalHearts = 0;
|
|
if (game->_playerType != 0x1f) {
|
|
game->_playerType = 10;
|
|
}
|
|
game->_cacheFlags = game->_cacheFlags | 0xffff;
|
|
EvaluateItems(game);
|
|
update_player_skin(game);
|
|
if (game->_parent == (EntityPtr)0x0) {
|
|
if (!isBeastRoom) {
|
|
iVar4 = 0xe;
|
|
LAB_007a3769:
|
|
game = g_game;
|
|
uVar3 = g_game->_enterDoor;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
leaveDoor = 0xffffffff;
|
|
}
|
|
else {
|
|
leaveDoor = uVar3;
|
|
if (6 < GHIDRA_INT(uVar3)) {
|
|
leaveDoor = 7;
|
|
}
|
|
}
|
|
g_game->_leaveDoor = leaveDoor;
|
|
uVar3 = uVar3 & 0x80000003;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
Game::StartRoomTransition(game,game->_lastRoomIdx,uVar3,iVar4,game,-1);
|
|
goto LAB_007a3558;
|
|
}
|
|
}
|
|
else {
|
|
game->_visible = 1;
|
|
game->_damageCooldown = 0x78;
|
|
AnimateTrinket(game,0x17,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
}
|
|
}
|
|
else if (trinketId == 0x1c) {
|
|
RemoveSkinCostume(game);
|
|
game->_soulHearts = 6;
|
|
game->_blackHearts = 0;
|
|
game->_boneHeartsMask = 0;
|
|
game->_boneHearts = 0;
|
|
game->_rottenHearts = 0;
|
|
game->_eternalHearts = 0;
|
|
game->_maxHearts = 0;
|
|
game->_redHearts = 0;
|
|
if (game->_playerType != 0x19) {
|
|
game->_playerType = 4;
|
|
}
|
|
game->_cacheFlags = game->_cacheFlags | 0xffff;
|
|
EvaluateItems(game);
|
|
update_player_skin(game);
|
|
if (game->_parent == (EntityPtr)0x0) {
|
|
if (!isBeastRoom) {
|
|
iVar4 = 5;
|
|
goto LAB_007a3769;
|
|
}
|
|
}
|
|
else {
|
|
game->_visible = 1;
|
|
game->_damageCooldown = 0x78;
|
|
AnimateCollectible(game,0xa1,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
}
|
|
}
|
|
else {
|
|
pvVar2 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT((trinketId & 0x7fff)) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar2) >> 2)
|
|
{
|
|
trinketConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + (trinketId & 0x7fff) * 4));
|
|
}
|
|
else {
|
|
trinketConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig_Item *>((trinketConfig)))->ItemConfig_Item::GetLocalizedName(GHIDRA_CAST<std_string *>(trinketName),0);
|
|
local_8 = (void *)0x0;
|
|
KAGE_LogMessage(4,GHIDRA_CAST<byte *>("No revival effect associated with trinket %d (%s)\n"));
|
|
local_8 = (void *)0xffffffff;
|
|
if (0xf < trinketNameCapacity) {
|
|
uVar3 = trinketNameCapacity + 1;
|
|
pvVar2 = trinketName[0];
|
|
if (0xfff < uVar3) {
|
|
pvVar2 = *(void **)(GHIDRA_INT(trinketName[0]) + -4);
|
|
uVar3 = trinketNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(trinketName[0]) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar3);
|
|
}
|
|
}
|
|
piVar1 = &game->_damageCooldown;
|
|
game->_visible = 1;
|
|
minCooldown = 0x5a;
|
|
cooldownSource = &minCooldown;
|
|
if (0x59 < *piVar1) {
|
|
cooldownSource = piVar1;
|
|
}
|
|
*piVar1 = *cooldownSource;
|
|
LAB_007a3558:
|
|
UpdateHeartDependentEffects(game);
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (game->_dead == 0)) &&
|
|
(iVar4 = game->_goldenHearts, 0 < iVar4)) {
|
|
heartTotal = game->_redHearts;
|
|
if (game->_maxHearts < game->_redHearts) {
|
|
heartTotal = game->_maxHearts;
|
|
}
|
|
heartTotal = (heartTotal + 1) / 2 + (game->_soulHearts + 1) / 2 + game->_boneHearts;
|
|
if (heartTotal < iVar4) {
|
|
BreakGoldenHearts(game,iVar4 - heartTotal);
|
|
game->_goldenHearts = heartTotal;
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007a37c0
|
|
void Entity_Player::remove_twin()
|
|
{
|
|
int iVar1;
|
|
ItemConfig_Item *item;
|
|
int twinSmeltedTrinkets;
|
|
byte extraout_CL;
|
|
byte unusedBool;
|
|
Entity_Player *in_ECX;
|
|
void *pvVar2;
|
|
Game *game;
|
|
EntityPtr player;
|
|
uint uVar3;
|
|
EntityPtr *twinSlot;
|
|
EntityPtr *local_c [2];
|
|
int *countSlot;
|
|
bool isBackupPlayer;
|
|
short *smeltedCount;
|
|
|
|
isBackupPlayer = false;
|
|
player = in_ECX->_twinPlayer;
|
|
if (player == (EntityPtr)0x0) {
|
|
player = (EntityPtr)in_ECX->_backupPlayer;
|
|
if (player == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
isBackupPlayer = true;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(player) + 0x1508)))))->TemporaryEffects::ClearEffects(1);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x13c0)) != 0x28) {
|
|
uVar3 = 0;
|
|
if (GHIDRA_INT((in_ECX->_collectibleCounts)._end) - GHIDRA_INT((in_ECX->_collectibleCounts)._begin) >> 2 != 0)
|
|
{
|
|
game = g_game;
|
|
do {
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar3)) goto LAB_007a386d;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
if ((GHIDRA_INT(uVar3) < 0) &&
|
|
(GHIDRA_INT(~uVar3) <
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) -
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._begin) >> 2)) {
|
|
item = (ItemConfig_Item *)
|
|
**(undefined4 **)
|
|
(GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._begin) + ~uVar3 * 4);
|
|
}
|
|
else {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_007a386d:
|
|
pvVar2 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar2) >> 2 <= GHIDRA_INT(uVar3))
|
|
goto LAB_007a38d8;
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + uVar3 * 4));
|
|
}
|
|
if (((item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (item->type != 3)) &&
|
|
(local_c[0] = *GHIDRA_CAST<EntityPtr **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x16c8)) + uVar3 * 4)),
|
|
0 < GHIDRA_INT(local_c[0]))) {
|
|
countSlot = GHIDRA_CAST<int *>((GHIDRA_INT((in_ECX->_collectibleCounts)._begin) + uVar3 * 4));
|
|
*countSlot = GHIDRA_INT((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_c[0])) + 0x0))) + *countSlot));
|
|
game = g_game;
|
|
*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x16c8)) + uVar3 * 4)) = 0;
|
|
if (item->addCostumeOnPickup != 0) {
|
|
AddCostume(in_ECX,item,0);
|
|
game = g_game;
|
|
}
|
|
}
|
|
}
|
|
LAB_007a38d8:
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < GHIDRA_UINT((GHIDRA_INT((in_ECX->_collectibleCounts)._end) -
|
|
GHIDRA_INT((in_ECX->_collectibleCounts)._begin) >> 2)));
|
|
}
|
|
pvVar2 = (in_ECX->_smeltedTrinkets)._begin;
|
|
local_c[0] = GHIDRA_CAST<EntityPtr *>(0x0);
|
|
if (GHIDRA_INT((in_ECX->_smeltedTrinkets)._end) - GHIDRA_INT(pvVar2) >> 2 != 0) {
|
|
do {
|
|
twinSmeltedTrinkets = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x1748));
|
|
iVar1 = GHIDRA_INT(local_c[0]) * 4;
|
|
if (((0 < *GHIDRA_CAST<short *>((twinSmeltedTrinkets + iVar1))) ||
|
|
(0 < *GHIDRA_CAST<short *>((twinSmeltedTrinkets + 2 + iVar1)))) &&
|
|
((*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar2) + iVar1)) < 1 && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar2) + iVar1 + 2)) < 1)))) {
|
|
pvVar2 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT((GHIDRA_UINT(local_c[0]) & 0x7fff)) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar2) >> 2) {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + (GHIDRA_UINT(local_c[0]) & 0x7fff) * 4));
|
|
}
|
|
else {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
AddCostume(in_ECX,item,0);
|
|
pvVar2 = (in_ECX->_smeltedTrinkets)._begin;
|
|
twinSmeltedTrinkets = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x1748));
|
|
}
|
|
local_c[0] = GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_c[0])) + 0x1))));
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar2) + iVar1)) =
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar2) + iVar1)) + *GHIDRA_CAST<short *>((twinSmeltedTrinkets + iVar1));
|
|
smeltedCount = GHIDRA_CAST<short *>((GHIDRA_INT((in_ECX->_smeltedTrinkets)._begin) + iVar1 + 2));
|
|
*smeltedCount = *smeltedCount + *GHIDRA_CAST<short *>((iVar1 + 2 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x1748))));
|
|
*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x1748)) + iVar1)) = 0;
|
|
pvVar2 = (in_ECX->_smeltedTrinkets)._begin;
|
|
} while (local_c[0] < GHIDRA_CAST<undefined1 *>((GHIDRA_INT((in_ECX->_smeltedTrinkets)._end) - GHIDRA_INT(pvVar2) >> 2)))
|
|
;
|
|
}
|
|
uVar3 = 0;
|
|
pvVar2 = (in_ECX->_pillEffectUses)._begin;
|
|
if (GHIDRA_INT((in_ECX->_pillEffectUses)._end) - GHIDRA_INT(pvVar2) >> 2 != 0) {
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x16d4)) + uVar3 * 4));
|
|
if (0 < iVar1) {
|
|
countSlot = GHIDRA_CAST<int *>((GHIDRA_INT(pvVar2) + uVar3 * 4));
|
|
*countSlot = *countSlot + iVar1;
|
|
*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x16d4)) + uVar3 * 4)) = 0;
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
pvVar2 = (in_ECX->_pillEffectUses)._begin;
|
|
} while (uVar3 < GHIDRA_UINT((GHIDRA_INT((in_ECX->_pillEffectUses)._end) - GHIDRA_INT(pvVar2) >> 2)));
|
|
}
|
|
std::vector<4byte>::insert_range
|
|
((in_ECX->_voidedCollectibles)._end,*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(player) + 0x1754)),
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(player) + 0x1758)),local_c[0]);
|
|
std::vector<8byte>::insert_range
|
|
((in_ECX->_voidedPassives)._end,*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(player) + 0x1760)),
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(player) + 0x1764)),local_c[0]);
|
|
(GHIDRA_CAST<History *>((&in_ECX->_history)))->History::merge((void *)(GHIDRA_INT(player) + 0x1dec));
|
|
in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff;
|
|
(in_ECX->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
twinSlot = &in_ECX->_twinPlayer;
|
|
if (isBackupPlayer) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(in_ECX->_backupPlayer) + 0x44))();
|
|
if (in_ECX->_backupPlayer != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(in_ECX->_backupPlayer))(1);
|
|
in_ECX->_backupPlayer = (void *)0x0;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
unusedBool = 0;
|
|
if (*twinSlot != (EntityPtr)0x0) {
|
|
local_c[0] = twinSlot;
|
|
std::multiset<unsigned_int>::erase(local_c);
|
|
*twinSlot = (EntityPtr)0x0;
|
|
unusedBool = extraout_CL;
|
|
}
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(GHIDRA_CAST<Entity_Player *>(player),unusedBool);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a3af0
|
|
void Entity_Player::AddPocketItem(int id, uint pocketItemType)
|
|
{
|
|
uint maxPocketItems;
|
|
int *slotType;
|
|
uint slot;
|
|
int remaining;
|
|
void **slotEntry;
|
|
uint insertSlot;
|
|
Game *game;
|
|
void *movedType;
|
|
|
|
maxPocketItems = GetMaxPocketItems(this);
|
|
if (pocketItemType == 2) {
|
|
maxPocketItems = maxPocketItems + 1;
|
|
}
|
|
if (((this->_pocketSlots[0] != 0) && (this->_pocketSlots[maxPocketItems * 2 + -2] != 0)) &&
|
|
(slot = 0, maxPocketItems != 0)) {
|
|
slotType = this->_pocketSlots + 1;
|
|
do {
|
|
if ((slotType[-1] != 0) && (*slotType != 2)) {
|
|
DropPocketItem(this,slot,&this->_pos);
|
|
break;
|
|
}
|
|
slot = slot + 1;
|
|
slotType = slotType + 2;
|
|
} while (slot < maxPocketItems);
|
|
}
|
|
insertSlot = 0;
|
|
if (this->_pocketSlots[1] == 2) {
|
|
insertSlot = GHIDRA_UINT((0 < this->_pocketSlots[0]));
|
|
}
|
|
if ((this->_pocketSlots[maxPocketItems * 2 + -2] == 0) &&
|
|
(GHIDRA_INT(insertSlot) <= GHIDRA_INT((maxPocketItems - 2)))) {
|
|
remaining = ((maxPocketItems - 2) - insertSlot) + 1;
|
|
slotEntry = (void **)(this->_pocketSlots + maxPocketItems * 2 + -2);
|
|
do {
|
|
movedType = (GHIDRA_CAST<std_vector *>((slotEntry + -1)))->_begin;
|
|
*slotEntry = slotEntry[-2];
|
|
slotEntry[1] = movedType;
|
|
remaining = remaining + -1;
|
|
slotEntry = slotEntry + -2;
|
|
} while (remaining != 0);
|
|
}
|
|
this->_pocketSlots[insertSlot * 2] = id;
|
|
this->_pocketSlots[insertSlot * 2 + 1] = pocketItemType;
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::UpdateRedKey();
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
if ((this->_parent != (EntityPtr)0x0) && (pocketItemType != 2)) {
|
|
DropPocketItem(this,insertSlot,&this->_pos);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a3c10
|
|
void Entity_Player::AddCard(int card)
|
|
{
|
|
AddPocketItem(this,card,1);
|
|
return;
|
|
}
|
|
|
|
// 007a3c30
|
|
void Entity_Player::AddPill(int pillColor)
|
|
{
|
|
AddPocketItem(this,pillColor,0);
|
|
return;
|
|
}
|
|
|
|
// 007a3c50
|
|
int Entity_Player::GetCard(int slot)
|
|
{
|
|
if (((slot < 0) || (3 < GHIDRA_UINT(slot))) || (this->_pocketSlots[slot * 2 + 1] != 1)) {
|
|
return 0;
|
|
}
|
|
return this->_pocketSlots[slot * 2];
|
|
}
|
|
|
|
// 007a3c80
|
|
int Entity_Player::GetPill(int slot)
|
|
{
|
|
if (((slot < 0) || (3 < GHIDRA_UINT(slot))) || (this->_pocketSlots[slot * 2 + 1] != 0)) {
|
|
return 0;
|
|
}
|
|
return this->_pocketSlots[slot * 2];
|
|
}
|
|
|
|
// 007a3cb0
|
|
void Entity_Player::SetCard(int slot, int card)
|
|
{
|
|
if ((-1 < slot) && (GHIDRA_UINT(slot) < 4)) {
|
|
this->_pocketSlots[slot * 2] = card;
|
|
this->_pocketSlots[slot * 2 + 1] = 1;
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::UpdateRedKey();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a3cf0
|
|
void Entity_Player::SetPill(int slot, int pillColor)
|
|
{
|
|
if ((-1 < slot) && (GHIDRA_UINT(slot) < 4)) {
|
|
this->_pocketSlots[slot * 2] = pillColor;
|
|
this->_pocketSlots[slot * 2 + 1] = 0;
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::UpdateRedKey();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a3d30
|
|
void Entity_Player::pocket_use_input()
|
|
{
|
|
byte bVar1;
|
|
byte isDropHeld;
|
|
char cVar2;
|
|
uint uVar3;
|
|
void *inputDevice;
|
|
int iVar4;
|
|
Vector *copySpawnPos;
|
|
uint uVar5;
|
|
int unused;
|
|
int unused_00;
|
|
int unused_01;
|
|
int pocketKind;
|
|
bool isClassicTwinControls;
|
|
EntityList_EL familiars;
|
|
Vector VStack_24;
|
|
uint pocketId;
|
|
float fStack_18;
|
|
char isJacobOrEsau;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 uStack_8;
|
|
Game *game;
|
|
bool isUseBombAction;
|
|
int swapTmp;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff93d;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_stageTransition) != 0) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&g_game->_roomTransition) != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
bVar1 = IsHologram(this);
|
|
if (bVar1 != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_playerType == 0x13) || (this->_playerType == 0x14)) {
|
|
isJacobOrEsau = '\x01';
|
|
cVar2 = FUN_00753bf0(uVar3);
|
|
if (cVar2 != '\0') {
|
|
isUseBombAction = true;
|
|
goto LAB_007a3da4;
|
|
}
|
|
}
|
|
else {
|
|
isJacobOrEsau = '\0';
|
|
}
|
|
isUseBombAction = false;
|
|
LAB_007a3da4:
|
|
isClassicTwinControls = (g_manager->_optionsConfig)._jacobEsauControls == 0;
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) &&
|
|
(inputDevice = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::GetDeviceByPlayerEntity(this),
|
|
inputDevice != (void *)0x0)) {
|
|
isClassicTwinControls = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(inputDevice) + 0x3d0)) == 0;
|
|
}
|
|
iVar4 = 10;
|
|
if ((isUseBombAction) && (isClassicTwinControls)) {
|
|
iVar4 = 9;
|
|
}
|
|
bVar1 = input_is_action_triggered(g_manager,iVar4,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),0);
|
|
if (isJacobOrEsau != '\0') {
|
|
if (isClassicTwinControls) {
|
|
if ((this->_twinPlayer != (EntityPtr)0x0) &&
|
|
(isDropHeld = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused),
|
|
isDropHeld == 0)) {
|
|
bVar1 = 0;
|
|
}
|
|
}
|
|
else {
|
|
cVar2 = FUN_00753bf0();
|
|
if ((cVar2 == '\0') ||
|
|
(isDropHeld = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_00),
|
|
isDropHeld == 0)) {
|
|
cVar2 = FUN_006f0040();
|
|
if (cVar2 != '\0') {
|
|
isDropHeld = input_is_action_pressed(0xb,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_01);
|
|
bVar1 = bVar1 & -(isDropHeld != 0);
|
|
}
|
|
}
|
|
else {
|
|
bVar1 = 0;
|
|
}
|
|
}
|
|
}
|
|
if (((this->_flags & 0x800) != 0) || (this->_isCoopGhost != 0)) {
|
|
bVar1 = 0;
|
|
}
|
|
if ((this->_pocketSlots[1] == 2) && (0 < this->_pocketSlots[0])) {
|
|
ControlActiveItem(this,this->_pocketSlots[0] + -1);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (this->_isControlsEnabled == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (0 < this->_controlsCooldown) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (bVar1 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>("UseItem"));
|
|
if (bVar1 != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
Game::save_rewind_state(-1);
|
|
g_game->_isPocketItemRewindSaved = 1;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Action PillCard Triggered\n"));
|
|
iVar4 = this->_pocketSlots[0];
|
|
if (iVar4 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_lastActionTriggers = this->_lastActionTriggers | 8;
|
|
pocketKind = this->_pocketSlots[1];
|
|
pocketId = this->_pocketSlots[0];
|
|
fStack_18 = (float)pocketKind;
|
|
if (pocketKind == 1) {
|
|
if ((iVar4 == 0x4e) &&
|
|
(cVar2 = KAGE_Filesys_FileManager::OpenRead
|
|
(GHIDRA_CAST<KAGE_Filesys_FileManager *>(this),0x244,0xffffffff), cVar2 == '\0')) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::AddToCollection(0x3d);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0xc4,1);
|
|
iVar4 = this->_pocketSlots[0];
|
|
this->_pocketSlots[1] = this->_pocketSlots[3];
|
|
swapTmp = this->_pocketSlots[5];
|
|
this->_pocketSlots[0] = this->_pocketSlots[2];
|
|
this->_pocketSlots[3] = swapTmp;
|
|
this->_pocketSlots[2] = this->_pocketSlots[4];
|
|
this->_pocketSlots[5] = this->_pocketSlots[7];
|
|
this->_pocketSlots[4] = this->_pocketSlots[6];
|
|
this->_pocketSlots[6] = 0;
|
|
TriggerEchoChamber(this,1,pocketId);
|
|
UseCard(this,iVar4,4);
|
|
if ((iVar4 != 0x50) && (iVar4 != 0x30)) {
|
|
this->_wildCardItemType = 1;
|
|
this->_wildCardItem = iVar4;
|
|
this->_wildCardVarData = 0;
|
|
}
|
|
}
|
|
else if (pocketKind == 0) {
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,-1,-1,1,0);
|
|
uVar5 = 0;
|
|
uStack_8 = 0;
|
|
uVar3 = familiars._size;
|
|
if (familiars._size != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(familiars._data) + uVar5 * 4)) + 0x410)) == this) {
|
|
(GHIDRA_CAST<Entity_Familiar *>(()))->Entity_Familiar::farting_baby_fart();
|
|
uVar3 = familiars._size;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < uVar3);
|
|
pocketKind = GHIDRA_INT(fStack_18);
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(6,1);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::AddToCollection(0x2b);
|
|
uVar3 = this->_pocketSlots[0];
|
|
fStack_18 = (float)(GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetPillEffect(uVar3,this);
|
|
if (((uVar3 & 0x7ff) != 0xe) ||
|
|
(uVar5 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0x4b0)))))->RNG::RandomInt(100), uVar5 < 5
|
|
)) {
|
|
iVar4 = this->_pocketSlots[3];
|
|
this->_pocketSlots[0] = this->_pocketSlots[2];
|
|
this->_pocketSlots[1] = iVar4;
|
|
this->_pocketSlots[2] = this->_pocketSlots[4];
|
|
this->_pocketSlots[3] = this->_pocketSlots[5];
|
|
this->_pocketSlots[4] = this->_pocketSlots[6];
|
|
this->_pocketSlots[5] = this->_pocketSlots[7];
|
|
this->_pocketSlots[6] = 0;
|
|
}
|
|
TriggerEchoChamber(this,pocketKind,pocketId);
|
|
UsePill(this,GHIDRA_INT(fStack_18),uVar3,0);
|
|
this->_wildCardItemType = 0;
|
|
this->_wildCardItem = GHIDRA_INT(fStack_18);
|
|
this->_wildCardVarData = uVar3;
|
|
if (this->_cacheFlags != 0) {
|
|
InvalidateCoPlayerItems(this);
|
|
EvaluateItems(this);
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&familiars)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else if (pocketKind == 2) {
|
|
ControlActiveItem(this,iVar4 + -1);
|
|
}
|
|
bVar1 = HasTrinket(this,0x4f,0);
|
|
if ((bVar1 != 0) && ((pocketKind == 1 || (pocketKind == 0)))) {
|
|
fStack_18 = 0.25;
|
|
iVar4 = GetTrinketMultiplier(this,0x4f);
|
|
if (iVar4 == 2) {
|
|
fStack_18 = 0.33;
|
|
}
|
|
else if (iVar4 == 3) {
|
|
fStack_18 = 0.5;
|
|
}
|
|
VStack_24.y = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0x4f0)))))->RNG::RandomFloat();
|
|
if (VStack_24.y < fStack_18) {
|
|
uVar3 = Random();
|
|
copySpawnPos = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,&VStack_24,&this->_pos,40.0,0,0,0);
|
|
uVar5 = 0x46;
|
|
if (pocketKind == 1) {
|
|
uVar5 = 300;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar5,copySpawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),pocketId,uVar3);
|
|
}
|
|
}
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007a42b0
|
|
void Entity_Player::pockets_rotate()
|
|
{
|
|
byte bVar1;
|
|
char isTrinketDroppable;
|
|
HUD *hud;
|
|
int iVar2;
|
|
byte *craftSlot;
|
|
Game *game;
|
|
float fVar3;
|
|
Vector *pos;
|
|
Entity_Player *in_ECX;
|
|
int extraout_ECX;
|
|
uint uVar4;
|
|
int extraout_ECX_00;
|
|
int extraout_ECX_01;
|
|
uint uVar5;
|
|
int *pocketSlot;
|
|
int iVar6;
|
|
Vector local_18;
|
|
Vector local_10;
|
|
void *cards;
|
|
undefined4 *cardsBegin;
|
|
undefined4 firstCard;
|
|
bool isAnythingToDrop;
|
|
Manager *manager;
|
|
int swapItem;
|
|
|
|
if (in_ECX->_variant != 0) {
|
|
return;
|
|
}
|
|
if (in_ECX->_isCoopGhost != 0) {
|
|
return;
|
|
}
|
|
bVar1 = IsHologram(in_ECX);
|
|
if (bVar1 != 0) {
|
|
return;
|
|
}
|
|
local_10.x = (float)in_ECX->_controllerIndex;
|
|
if (0 < in_ECX->_forgottenSwapFormCooldown) {
|
|
in_ECX->_forgottenSwapFormCooldown = in_ECX->_forgottenSwapFormCooldown + -1;
|
|
}
|
|
bVar1 = input_is_action_triggered(g_manager,0xb,GHIDRA_INT(local_10.x),GHIDRA_CAST<Entity *>(in_ECX),0);
|
|
iVar6 = extraout_ECX;
|
|
if (bVar1 == 0) goto LAB_007a457c;
|
|
bVar1 = SwapForgottenForm(in_ECX,0,0);
|
|
if (bVar1 == 0) {
|
|
local_18.x = 0.0;
|
|
pocketSlot = in_ECX->_pocketSlots;
|
|
do {
|
|
pocketSlot = pocketSlot + 2;
|
|
if (*pocketSlot == 0) break;
|
|
iVar6 = *pocketSlot;
|
|
iVar2 = pocketSlot[1];
|
|
*pocketSlot = pocketSlot[-2];
|
|
game = g_game;
|
|
pocketSlot[1] = pocketSlot[-1];
|
|
pocketSlot[-2] = iVar6;
|
|
pocketSlot[-1] = iVar2;
|
|
if ((game->_hud)._hudRefreshType != 2) {
|
|
(game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
local_18.x = (float)(GHIDRA_INT(local_18.x) + 1);
|
|
} while (GHIDRA_UINT(local_18.x) < 3);
|
|
game = g_game;
|
|
if (in_ECX->_itemState == 0) {
|
|
if (in_ECX->_activeDesc[0]._item == 0x1e9) {
|
|
uVar4 = in_ECX->_activeDesc[0]._varData;
|
|
uVar5 = ((GHIDRA_INT(uVar4) >> 0x10) + 1U) % 10;
|
|
in_ECX->_activeDesc[0]._varData = uVar5 << 0x10 | uVar4 & 0xffff;
|
|
hud = &game->_hud;
|
|
uVar4 = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<Entity_Player **>(hud->_playerHUD) == in_ECX) {
|
|
hud->_playerHUD[400] = 0;
|
|
hud->_playerHUD[0x191] = 0;
|
|
hud->_playerHUD[0x192] = 0;
|
|
hud->_playerHUD[0x193] = 0;
|
|
break;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
hud = GHIDRA_CAST<HUD *>((hud->_playerHUD + 0x6dc));
|
|
} while (uVar4 < 8);
|
|
if (uVar5 != 0) goto LAB_007a43f6;
|
|
}
|
|
SwapActiveItems(in_ECX);
|
|
}
|
|
}
|
|
LAB_007a43f6:
|
|
if (in_ECX->_playerType == 0x15) {
|
|
bVar1 = HasCollectible(in_ECX,0x26b,0);
|
|
iVar2 = 0;
|
|
iVar6 = GHIDRA_UINT((bVar1 != 0)) * 4 + 8;
|
|
do {
|
|
if (in_ECX->_inventory[iVar2] < 0) {
|
|
iVar6 = iVar2;
|
|
break;
|
|
}
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < iVar6);
|
|
if (1 < iVar6) {
|
|
iVar2 = 0;
|
|
if (0 < iVar6 + -1) {
|
|
do {
|
|
swapItem = in_ECX->_inventory[iVar2];
|
|
in_ECX->_inventory[iVar2] = in_ECX->_inventory[iVar2 + 1];
|
|
in_ECX->_inventory[iVar2 + 1] = swapItem;
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < iVar6 + -1);
|
|
}
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
}
|
|
}
|
|
if (in_ECX->_playerType == 0x17) {
|
|
bVar1 = in_ECX->_bagOfCraftingContent[0];
|
|
craftSlot = in_ECX->_bagOfCraftingContent;
|
|
if ((bVar1 != 0) && (in_ECX->_bagOfCraftingContent[1] != 0)) {
|
|
uVar4 = 0;
|
|
do {
|
|
if (craftSlot[1] == 0) break;
|
|
*craftSlot = craftSlot[1];
|
|
uVar4 = uVar4 + 1;
|
|
craftSlot = craftSlot + 1;
|
|
} while (uVar4 < 7);
|
|
in_ECX->_bagOfCraftingContent[uVar4] = bVar1;
|
|
}
|
|
cardsBegin = (in_ECX->_itemCards)._begin;
|
|
uVar4 = GHIDRA_INT((in_ECX->_itemCards)._end) - GHIDRA_INT(cardsBegin) >> 2;
|
|
if (1 < uVar4) {
|
|
firstCard = *cardsBegin;
|
|
uVar5 = 0;
|
|
if (uVar4 != 1) {
|
|
do {
|
|
cards = (in_ECX->_itemCards)._begin;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cards) + uVar5 * 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cards) + uVar5 * 4 + 4));
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < (GHIDRA_INT((in_ECX->_itemCards)._end) - GHIDRA_INT((in_ECX->_itemCards)._begin) >> 2) -
|
|
1U);
|
|
}
|
|
hud = &g_game->_hud;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((in_ECX->_itemCards)._end) + -4)) = firstCard;
|
|
HUD::mark_all_slots_dirty(hud,0,0);
|
|
}
|
|
}
|
|
iVar2 = is_achievement_79_unlocked(in_ECX);
|
|
manager = g_manager;
|
|
iVar6 = extraout_ECX_00;
|
|
if (0 < iVar2) {
|
|
local_18.x = 1.16028e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_18));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18.x),1.2,1,0,1.0,0.0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(8);
|
|
iVar6 = extraout_ECX_01;
|
|
}
|
|
LAB_007a457c:
|
|
bVar1 = input_is_action_pressed(0xb,GHIDRA_INT(local_10.x),GHIDRA_CAST<Entity *>(in_ECX),iVar6);
|
|
if (bVar1 == 0) {
|
|
in_ECX->_actionHoldDrop = 0;
|
|
return;
|
|
}
|
|
in_ECX->_actionHoldDrop = in_ECX->_actionHoldDrop + 1;
|
|
game = g_game;
|
|
if ((GHIDRA_UINT(in_ECX->_actionHoldDrop) < 0x79) || ((g_game->_dailyChallenge)._specialDailyId == 4)) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1880)))) = 0;
|
|
}
|
|
else {
|
|
uVar4 = 0;
|
|
in_ECX->_actionHoldDrop = 0;
|
|
isAnythingToDrop = false;
|
|
local_18.x = (float)in_ECX->_trinketsID;
|
|
do {
|
|
iVar6 = *GHIDRA_CAST<int *>(local_18.x);
|
|
if (iVar6 != 0) {
|
|
if (*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) {
|
|
if ((iVar6 != 0x35) && ((iVar6 != 0x40 || (game->_challenge != 0x1c)))) goto LAB_007a461f;
|
|
}
|
|
else {
|
|
isTrinketDroppable = (**(code **)(*GHIDRA_CAST<int *>((game->_deathmatchManager)._type) + 0x50))();
|
|
game = g_game;
|
|
if (isTrinketDroppable != '\0') {
|
|
LAB_007a461f:
|
|
isAnythingToDrop = true;
|
|
}
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
local_18.x = (float)(GHIDRA_INT(local_18.x) + 4);
|
|
} while (uVar4 < 2);
|
|
local_18.x = 0.0;
|
|
uVar4 = GetMaxPocketItems(in_ECX);
|
|
if (uVar4 != 0) {
|
|
pocketSlot = in_ECX->_pocketSlots + 1;
|
|
do {
|
|
if ((pocketSlot[-1] != 0) && (*pocketSlot != 2)) {
|
|
isAnythingToDrop = true;
|
|
}
|
|
local_18.x = (float)(GHIDRA_INT(local_18.x) + 1);
|
|
pocketSlot = pocketSlot + 2;
|
|
fVar3 = (float)GetMaxPocketItems(in_ECX);
|
|
} while (GHIDRA_UINT(local_18.x) < GHIDRA_UINT(fVar3));
|
|
}
|
|
game = g_game;
|
|
if (isAnythingToDrop) {
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
in_ECX->_lastActionTriggers = in_ECX->_lastActionTriggers | 0x20;
|
|
iVar6 = 2;
|
|
while( true ) {
|
|
Room::FindFreePickupSpawnPosition(game->_room,&local_10,&in_ECX->_pos,0.0,0,0,0);
|
|
DropTrinket(in_ECX,&local_10,0);
|
|
if ((in_ECX->_variant == 0) && (in_ECX->_isCoopGhost == 0)) {
|
|
InvalidateCoPlayerItems(in_ECX);
|
|
}
|
|
iVar6 = iVar6 + -1;
|
|
if (iVar6 == 0) break;
|
|
game = g_game;
|
|
}
|
|
iVar6 = 4;
|
|
do {
|
|
pos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_18,&in_ECX->_pos,0.0,0,0,0);
|
|
DropPocketItem(in_ECX,-1,pos);
|
|
iVar6 = iVar6 + -1;
|
|
} while (iVar6 != 0);
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a4760
|
|
void Entity_Player::SwapActiveItems()
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
byte bVar4;
|
|
HUD *playerHudIt;
|
|
uint hudIndex;
|
|
int oldBatteryCharge;
|
|
int oldCharge;
|
|
int oldItem;
|
|
int oldPartialCharge;
|
|
int oldSubCharge;
|
|
int oldTimeRechargeCooldown;
|
|
int oldUnk;
|
|
int oldVarData;
|
|
|
|
if (this->_activeDesc[1]._item == 0) {
|
|
return;
|
|
}
|
|
ResetItemState(this);
|
|
this->_itemStateCooldown = 0;
|
|
iVar1 = this->_activeDesc[1]._unk;
|
|
iVar2 = this->_activeDesc[1]._charge;
|
|
iVar3 = this->_activeDesc[1]._batteryCharge;
|
|
oldItem = this->_activeDesc[0]._item;
|
|
oldUnk = this->_activeDesc[0]._unk;
|
|
oldCharge = this->_activeDesc[0]._charge;
|
|
oldBatteryCharge = this->_activeDesc[0]._batteryCharge;
|
|
oldSubCharge = this->_activeDesc[0]._subCharge;
|
|
oldTimeRechargeCooldown = this->_activeDesc[0]._timeRechargeCooldown;
|
|
oldPartialCharge = this->_activeDesc[0]._partialCharge;
|
|
oldVarData = this->_activeDesc[0]._varData;
|
|
this->_activeDesc[0]._item = this->_activeDesc[1]._item;
|
|
this->_activeDesc[0]._unk = iVar1;
|
|
this->_activeDesc[0]._charge = iVar2;
|
|
this->_activeDesc[0]._batteryCharge = iVar3;
|
|
iVar1 = this->_activeDesc[1]._timeRechargeCooldown;
|
|
iVar2 = this->_activeDesc[1]._partialCharge;
|
|
iVar3 = this->_activeDesc[1]._varData;
|
|
this->_activeDesc[0]._subCharge = this->_activeDesc[1]._subCharge;
|
|
this->_activeDesc[0]._timeRechargeCooldown = iVar1;
|
|
this->_activeDesc[0]._partialCharge = iVar2;
|
|
this->_activeDesc[0]._varData = iVar3;
|
|
this->_activeDesc[1]._item = oldItem;
|
|
this->_activeDesc[1]._unk = oldUnk;
|
|
this->_activeDesc[1]._charge = oldCharge;
|
|
this->_activeDesc[1]._batteryCharge = oldBatteryCharge;
|
|
this->_activeDesc[1]._subCharge = oldSubCharge;
|
|
this->_activeDesc[1]._timeRechargeCooldown = oldTimeRechargeCooldown;
|
|
this->_activeDesc[1]._partialCharge = oldPartialCharge;
|
|
this->_activeDesc[1]._varData = oldVarData;
|
|
this->_itemHoldCooldown = 0;
|
|
bVar4 = HasTrinket(this,0x65,0);
|
|
if ((bVar4 != 0) || (bVar4 = HasTrinket(this,100,0), bVar4 != 0)) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x41f;
|
|
EvaluateItems(this);
|
|
}
|
|
playerHudIt = &g_game->_hud;
|
|
hudIndex = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<Entity_Player **>(playerHudIt->_playerHUD) == this) {
|
|
playerHudIt->_playerHUD[400] = 0;
|
|
playerHudIt->_playerHUD[0x191] = 0;
|
|
playerHudIt->_playerHUD[0x192] = 0;
|
|
playerHudIt->_playerHUD[0x193] = 0;
|
|
playerHudIt->_playerHUD[0x1ac] = 0;
|
|
playerHudIt->_playerHUD[0x1ad] = 0;
|
|
playerHudIt->_playerHUD[0x1ae] = 0;
|
|
playerHudIt->_playerHUD[0x1af] = 0;
|
|
playerHudIt->_playerHUD[0x1c8] = 0;
|
|
playerHudIt->_playerHUD[0x1c9] = 0;
|
|
playerHudIt->_playerHUD[0x1ca] = 0;
|
|
playerHudIt->_playerHUD[0x1cb] = 0;
|
|
playerHudIt->_playerHUD[0x1e4] = 0;
|
|
playerHudIt->_playerHUD[0x1e5] = 0;
|
|
playerHudIt->_playerHUD[0x1e6] = 0;
|
|
playerHudIt->_playerHUD[0x1e7] = 0;
|
|
return;
|
|
}
|
|
hudIndex = hudIndex + 1;
|
|
playerHudIt = GHIDRA_CAST<HUD *>((playerHudIt->_playerHUD + 0x6dc));
|
|
} while (hudIndex < 8);
|
|
return;
|
|
}
|
|
|
|
// 007a4850
|
|
void Entity_Player::RemovePocketItem(int slot)
|
|
{
|
|
uint dwordsLeft;
|
|
int *slotIt;
|
|
int *destSlot;
|
|
Game *game;
|
|
|
|
if (slot == -1) {
|
|
slot = 0;
|
|
slotIt = this->_pocketSlots + 1;
|
|
while ((slotIt[-1] == 0 || (*slotIt == 2))) {
|
|
slot = slot + 1;
|
|
slotIt = slotIt + 2;
|
|
if (3 < GHIDRA_UINT(slot)) {
|
|
return;
|
|
}
|
|
}
|
|
if (slot == 0xffffffff) {
|
|
return;
|
|
}
|
|
}
|
|
if ((this->_pocketSlots[slot * 2] != 0) && (this->_pocketSlots[slot * 2 + 1] != 2)) {
|
|
if (GHIDRA_UINT(slot) < 3) {
|
|
slotIt = this->_pocketSlots + slot * 2 + 2;
|
|
destSlot = this->_pocketSlots + slot * 2;
|
|
for (dwordsLeft = (3 - slot) * 2 & 0x3ffffffe; dwordsLeft != 0; dwordsLeft = dwordsLeft - 1) {
|
|
*destSlot = *slotIt;
|
|
slotIt = slotIt + 1;
|
|
destSlot = destSlot + 1;
|
|
}
|
|
}
|
|
game = g_game;
|
|
this->_pocketSlots[6] = 0;
|
|
this->_pocketSlots[7] = 1;
|
|
(GHIDRA_CAST<Room *>((game->_room)))->Room::UpdateRedKey();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a48f0
|
|
void Entity_Player::DropPocketItem(int slot, Vector *pos)
|
|
{
|
|
int *pocketCursor;
|
|
uint uVar1;
|
|
uint variant;
|
|
Entity *pickup;
|
|
int *copyDst;
|
|
Game *game;
|
|
|
|
if (slot == -1) {
|
|
slot = 0;
|
|
pocketCursor = this->_pocketSlots + 1;
|
|
while ((pocketCursor[-1] == 0 || (*pocketCursor == 2))) {
|
|
slot = slot + 1;
|
|
pocketCursor = pocketCursor + 2;
|
|
if (3 < GHIDRA_UINT(slot)) {
|
|
return;
|
|
}
|
|
}
|
|
if (slot == 0xffffffff) {
|
|
return;
|
|
}
|
|
}
|
|
if ((this->_pocketSlots[slot * 2] != 0) && (this->_pocketSlots[slot * 2 + 1] != 2)) {
|
|
uVar1 = Random();
|
|
variant = 0x46;
|
|
if (this->_pocketSlots[slot * 2 + 1] == 1) {
|
|
variant = 300;
|
|
}
|
|
pickup = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,variant,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),
|
|
this->_pocketSlots[slot * 2],uVar1);
|
|
if (pickup != GHIDRA_CAST<Entity *>(0x0)) {
|
|
pickup[1]._sprite._championColor._offset[0] = 5.60519e-45;
|
|
}
|
|
if (GHIDRA_UINT(slot) < 3) {
|
|
pocketCursor = this->_pocketSlots + slot * 2 + 2;
|
|
copyDst = this->_pocketSlots + slot * 2;
|
|
for (uVar1 = (3 - slot) * 2 & 0x3ffffffe; uVar1 != 0; uVar1 = uVar1 - 1) {
|
|
*copyDst = *pocketCursor;
|
|
pocketCursor = pocketCursor + 1;
|
|
copyDst = copyDst + 1;
|
|
}
|
|
}
|
|
game = g_game;
|
|
this->_pocketSlots[6] = 0;
|
|
this->_pocketSlots[7] = 1;
|
|
(GHIDRA_CAST<Room *>((game->_room)))->Room::UpdateRedKey();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a49e0
|
|
void Entity_Player::spawn_low_health_blood_splat()
|
|
{
|
|
int iVar1;
|
|
byte isHasKidneyStone;
|
|
uint rngResult;
|
|
Entity *bloodSplat;
|
|
ColorMod *splatColor;
|
|
float scaleX;
|
|
float fVar2;
|
|
undefined1 colorParams [44];
|
|
uint local_c;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(colorParams);
|
|
if (((((this->_variant == 0) && (this->_boneHearts + this->_soulHearts + this->_redHearts < 2)) &&
|
|
(iVar1 = this->_playerType, iVar1 != 10)) &&
|
|
((((iVar1 != 0x10 && (iVar1 != 0x11)) &&
|
|
((iVar1 != 0x1f && ((iVar1 != 0x23 && (iVar1 != 0x28)))))) && (iVar1 != 0x27)))) &&
|
|
(this->_isCoopGhost == 0)) {
|
|
rngResult = Random();
|
|
bloodSplat = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,7,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,rngResult,0);
|
|
rngResult = Random();
|
|
fVar2 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.3;
|
|
scaleX = fVar2 * g_vectorOne.x;
|
|
(bloodSplat->_sprite)._scale.y = fVar2 * g_vectorOne.y;
|
|
(bloodSplat->_sprite)._scale.x = scaleX;
|
|
rngResult = Random();
|
|
(bloodSplat->_sprite)._rotation = ((float)(rngResult & 3) + 0.0) * 90.0;
|
|
rngResult = Random();
|
|
(bloodSplat->_sprite)._flipX = ~(byte)rngResult & 1;
|
|
isHasKidneyStone = HasCollectible(this,0x1b8,0);
|
|
if (((isHasKidneyStone == 0) && (this->_playerType != 5)) && (this->_playerType != 0x1a)) {
|
|
splatColor = ColorParams::set_from_bytes(GHIDRA_CAST<ColorParams *>(colorParams),0,0,0,0xb4,0xf4,0xf4,0);
|
|
bloodSplat->SetColor(splatColor,0xffffffff,0xff,0,1);
|
|
}
|
|
bloodSplat->Update();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007a4ba0
|
|
void Entity_Player::level_start(byte isForced)
|
|
{
|
|
float fVar1;
|
|
Entity_Player *pEVar2;
|
|
EntityPtr EVar3;
|
|
code *pcVar4;
|
|
qword qVar5;
|
|
byte bVar6;
|
|
int iVar7;
|
|
Vector *outPosition;
|
|
uint forcedCurses;
|
|
uint preventedCurses;
|
|
uint forcedCurses;
|
|
int *piVar9;
|
|
Vector *spawnPos;
|
|
int iVar10;
|
|
void *pvVar11;
|
|
ItemConfig_Item *Item;
|
|
void *pvVar12;
|
|
Room *room_00;
|
|
Entity_Player *familiar;
|
|
Entity_Player *this_01;
|
|
int extraout_ECX;
|
|
Game *game;
|
|
uint extraout_ECX_00;
|
|
uint extraout_ECX_01;
|
|
undefined4 extraout_ECX_02;
|
|
int extraout_EDX;
|
|
int extraout_EDX_00;
|
|
qword *allocatedBytes;
|
|
uint uVar13;
|
|
Room *room;
|
|
uint *rngSeed;
|
|
void **roomData;
|
|
undefined4 local_100 [3];
|
|
Vector heartPos2;
|
|
Vector heartPos;
|
|
Vector sackPos;
|
|
Vector greedStartPos;
|
|
Vector startPos;
|
|
Vector homeStartPos;
|
|
EntityList_EL familiars;
|
|
int redemptionEffect [3];
|
|
undefined4 local_a8;
|
|
undefined4 nullEffect;
|
|
undefined4 local_a0;
|
|
int local_9c;
|
|
undefined4 local_98;
|
|
int foundSoulEffect [3];
|
|
undefined4 local_88;
|
|
int salvationEffect [3];
|
|
undefined4 local_78;
|
|
EntityList_EL darkEsaus;
|
|
Vector greedBasePos;
|
|
Vector trapdoorPos;
|
|
Vector homeBasePos;
|
|
undefined8 local_48;
|
|
Vector startX;
|
|
undefined4 local_34;
|
|
Game *local_30;
|
|
char local_29;
|
|
undefined8 local_24;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
uint local_8;
|
|
Entity_Familiar *familiar;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff978;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((salvationEffect + 0x20));
|
|
ExceptionList = &local_10;
|
|
this->_delayedSfxId = 0;
|
|
this->_delayedSfxDelay = 0;
|
|
(this->_moveToTarget).x = g_vectorZero.x;
|
|
(this->_moveToTarget).y = g_vectorZero.y;
|
|
game = g_game;
|
|
local_34 = this;
|
|
if ((this->_variant == 0) && (isForced == 0)) {
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
greedBasePos.x = 320.0;
|
|
spawnPos = &greedBasePos;
|
|
greedBasePos.y = 280.0;
|
|
outPosition = &greedStartPos;
|
|
}
|
|
else {
|
|
iVar7 = _get_index_plus_one_if_kind_4_5(local_18);
|
|
if ((iVar7 != 1) || (bVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsAscent(), bVar6 != 0)) {
|
|
spawnPos = PlayerManager::get_player_start_position
|
|
(&game->_playerManager,&startPos,this,&g_vectorZero,
|
|
GHIDRA_INT(&game->_playerManager));
|
|
fVar1 = spawnPos->x;
|
|
(this->_pos).x = fVar1;
|
|
(this->_pos).y = spawnPos->y;
|
|
if ((game->_challenge == 0x1f) && (game->_stage == 0xb)) {
|
|
(this->_pos).x = fVar1 + 0.0;
|
|
(this->_pos).y = (this->_pos).y + 100.0;
|
|
}
|
|
forcedCurses = game->_debugCurses;
|
|
iVar7 = game->_stage;
|
|
uVar13 = game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
game = g_game;
|
|
iVar10 = iVar7 + 1;
|
|
if ((~preventedCurses & (forcedCurses | forcedCurses | uVar13) & 2) == 0) {
|
|
iVar10 = iVar7;
|
|
}
|
|
bVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsAscent();
|
|
if ((bVar6 == 0) || ((iVar10 == 6 && (bVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsAltPath(), bVar6 != 0)))
|
|
) {
|
|
this = local_34;
|
|
}
|
|
else {
|
|
room = game->_room;
|
|
startX.x = g_vectorZero.x;
|
|
startX.y = g_vectorZero.y;
|
|
roomData = room->_doors;
|
|
forcedCurses = 0;
|
|
do {
|
|
uVar13 = forcedCurses + 1;
|
|
if (8 < uVar13) break;
|
|
if (*roomData != (void *)0x0) {
|
|
if (forcedCurses != 0xffffffff) goto LAB_007a4df2;
|
|
break;
|
|
}
|
|
roomData = roomData + 1;
|
|
forcedCurses = uVar13;
|
|
} while (uVar13 < 8);
|
|
forcedCurses = Random();
|
|
forcedCurses = forcedCurses & 7;
|
|
uVar13 = 0;
|
|
room = g_game->_room;
|
|
do {
|
|
if ((forcedCurses < 8) &&
|
|
((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>(((GHIDRA_CAST<Game *>(room))->_stageType + 0x10)) + 0x38 + (forcedCurses >> 5) * 4)) &
|
|
1 << ((byte)forcedCurses & 0x1f)) != 0)) break;
|
|
forcedCurses = forcedCurses + 1 & 0x80000007;
|
|
if (GHIDRA_INT(forcedCurses) < 0) {
|
|
forcedCurses = (forcedCurses - 1 | 0xfffffff8) + 1;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < 8);
|
|
game = g_game;
|
|
local_30 = GHIDRA_CAST<Game *>(room);
|
|
LAB_007a4df2:
|
|
this = local_34;
|
|
startX.x = g_vectorZero.x;
|
|
startX.y = g_vectorZero.y;
|
|
if (forcedCurses < 8) {
|
|
startX.x = (float)(room->_doorGridPositions[forcedCurses] % room->_gridWidth) * 40.0 + 40.0;
|
|
startX.y = (float)(room->_doorGridPositions[forcedCurses] / room->_gridWidth) * 40.0 + 120.0;
|
|
}
|
|
forcedCurses = forcedCurses & 0x80000003;
|
|
if (GHIDRA_INT(forcedCurses) < 0) {
|
|
forcedCurses = (forcedCurses - 1 | 0xfffffffc) + 1;
|
|
}
|
|
switch(forcedCurses) {
|
|
case 0:
|
|
startX.x = startX.x + 40.0;
|
|
startX.y = startX.y + 0.0;
|
|
break;
|
|
case 1:
|
|
startX.y = startX.y + 40.0;
|
|
startX.x = startX.x + 0.0;
|
|
break;
|
|
case 2:
|
|
startX.x = startX.x - 40.0;
|
|
startX.y = startX.y - 0.0;
|
|
break;
|
|
case 3:
|
|
startX.y = startX.y - 40.0;
|
|
startX.x = startX.x - 0.0;
|
|
}
|
|
forcedCurses = 0;
|
|
(local_34->_pos).x = startX.x;
|
|
(local_34->_pos).y = startX.y;
|
|
room_00 = game->_room;
|
|
if (0 < room_00->_gridHeight * room_00->_gridWidth) {
|
|
local_30 = GHIDRA_CAST<Game *>(0x24);
|
|
do {
|
|
if (forcedCurses < 0x1c0) {
|
|
local_34 = *(Entity_Player **)
|
|
(GHIDRA_INT(local_30->_roomList[0]._doors) +
|
|
GHIDRA_INT((room_00->_gridEntities + -0xe)) + -0x1c);
|
|
if ((local_34 != GHIDRA_CAST<Entity_Player *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_34)) + 0x4)))) == 0x11)) {
|
|
trapdoorPos.x =
|
|
(float)(local_34->_collisionIndex % room_00->_gridWidth) * 40.0 + 40.0;
|
|
trapdoorPos.y =
|
|
(float)(local_34->_collisionIndex / room_00->_gridWidth) * 40.0 + 120.0;
|
|
bVar6 = pathfinder_can_reach_pos(&trapdoorPos,&startX,room_00);
|
|
if (bVar6 != 0) {
|
|
iVar7 = local_34->_collisionIndex;
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
(this->_pos).x = (float)(iVar7 % iVar10) * 40.0 + 40.0;
|
|
(this->_pos).y = (float)(iVar7 / iVar10) * 40.0 + 120.0;
|
|
break;
|
|
}
|
|
game = g_game;
|
|
}
|
|
}
|
|
room_00 = game->_room;
|
|
forcedCurses = forcedCurses + 1;
|
|
local_30 = GHIDRA_CAST<Game *>(&local_30->_stageType);
|
|
} while (GHIDRA_INT(forcedCurses) < room_00->_gridHeight * room_00->_gridWidth);
|
|
}
|
|
}
|
|
goto LAB_007a4fdc;
|
|
}
|
|
homeBasePos.x = 320.0;
|
|
spawnPos = &homeBasePos;
|
|
homeBasePos.y = 380.0;
|
|
outPosition = &homeStartPos;
|
|
}
|
|
spawnPos = PlayerManager::get_player_start_position
|
|
(&game->_playerManager,outPosition,this,spawnPos,GHIDRA_INT(&game->_playerManager)
|
|
);
|
|
(this->_pos).x = spawnPos->x;
|
|
(this->_pos).y = spawnPos->y;
|
|
}
|
|
LAB_007a4fdc:
|
|
if (this->_postLevelInitFinished == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
spawn_low_health_blood_splat(this);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ae0)))) = 0;
|
|
if (this->_variant == 1) {
|
|
if (this->_isGlitchBaby != 0) {
|
|
this->_babySkin = 0x19;
|
|
InitBabySkin(this);
|
|
game = g_game;
|
|
forcedCurses = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0xa8))));
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
forcedCurses = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_playerManager))) + 0xa8))));
|
|
if (forcedCurses == 0) {
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
}
|
|
forcedCurses = forcedCurses >> ((byte)*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_playerManager))) + 0xac)))) & 0x1f) ^ forcedCurses;
|
|
pEVar2 = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_playerManager))) + 0xb4))));
|
|
forcedCurses = forcedCurses << ((byte)*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_playerManager))) + 0xb0)))) & 0x1f) ^ forcedCurses;
|
|
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_playerManager))) + 0xa8)))) = forcedCurses >> ((byte)pEVar2 & 0x1f) ^ forcedCurses;
|
|
forcedCurses = GetGlitchBabySubType(pEVar2);
|
|
this->_subtype = forcedCurses;
|
|
if (0x46 < forcedCurses) {
|
|
forcedCurses = 0x47;
|
|
}
|
|
this->_babySkin = forcedCurses;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Glitch"));
|
|
if (this->_variant != 1) goto LAB_007a50ce;
|
|
}
|
|
EVar3 = this->_parent;
|
|
if (EVar3 != (EntityPtr)0x0) {
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar3) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar3) + 0x33c));
|
|
(this->_pos).y = fVar1;
|
|
}
|
|
}
|
|
LAB_007a50ce:
|
|
this->_isLevelStartPending = 0;
|
|
FUN_007daff0();
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x42,-1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x4a,-1);
|
|
pvVar11 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x2b8 < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2) &&
|
|
(iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0xae0)), iVar7 != 0)) {
|
|
salvationEffect[2] = *GHIDRA_CAST<undefined4 *>((iVar7 + 0x78));
|
|
salvationEffect[1] = 0;
|
|
local_78 = 0;
|
|
salvationEffect[0] = iVar7;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(salvationEffect,-1);
|
|
}
|
|
pvVar11 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((0xb4 < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar11) >> 2) &&
|
|
(iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x2d0)), iVar7 != 0)) {
|
|
foundSoulEffect[2] = *GHIDRA_CAST<undefined4 *>((iVar7 + 0x78));
|
|
foundSoulEffect[1] = 0;
|
|
local_88 = 0;
|
|
foundSoulEffect[0] = iVar7;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(foundSoulEffect,-1);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x6d,-1);
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&darkEsaus,0x362,-1,-1,0,0);
|
|
local_8 = 0;
|
|
forcedCurses = 0;
|
|
if (darkEsaus._size != 0) {
|
|
pvVar11 = darkEsaus._data;
|
|
do {
|
|
piVar9 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar11) + forcedCurses * 4));
|
|
if (GHIDRA_CAST<Entity_Player *>(piVar9[0xf2]) == this) {
|
|
(**(code **)(*piVar9 + 0x28))();
|
|
pvVar11 = darkEsaus._data;
|
|
}
|
|
forcedCurses = forcedCurses + 1;
|
|
} while (forcedCurses < GHIDRA_UINT(darkEsaus._size));
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x81,1);
|
|
if (this->_playerType == 0x27) {
|
|
iVar7 = 0x25;
|
|
LAB_007a5236:
|
|
ChangePlayerType(this,iVar7,0);
|
|
}
|
|
else if (this->_playerType == 0xb) {
|
|
iVar7 = 8;
|
|
goto LAB_007a5236;
|
|
}
|
|
if ((this->_playerType == 0x25) && (g_game->_challenge != 0x2c)) {
|
|
pvVar11 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar11) >> 2 < 0x6e) {
|
|
nullEffect = 0;
|
|
}
|
|
else {
|
|
nullEffect = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x1b4));
|
|
}
|
|
forcedCurses = (g_game->_devilAngelRoomRNG)._seed;
|
|
local_a0 = 0;
|
|
local_98 = 0;
|
|
local_24 = 0x70000000b;
|
|
local_30 = GHIDRA_CAST<Game *>(0xc);
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
forcedCurses = forcedCurses >> 0xb ^ forcedCurses;
|
|
forcedCurses = forcedCurses << 7 ^ forcedCurses;
|
|
local_9c = ((forcedCurses >> 0xc ^ forcedCurses) % 0x14) * 0x1e + 0x262;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&nullEffect,1,1);
|
|
}
|
|
bVar6 = HasCollectible(this,0x2a4,0);
|
|
if (bVar6 != 0) {
|
|
iVar7 = GetHealthType(this);
|
|
if (((iVar7 == 0) && (iVar7 = GetHeartLimit(familiar,0), this->_maxHearts < iVar7)) &&
|
|
(this->_redHearts < 3)) {
|
|
AddMaxHearts(this,2,0);
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x29,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
pEVar2 = GHIDRA_CAST<Entity_Player *>(this->_subPlayer);
|
|
if (((pEVar2 != GHIDRA_CAST<Entity_Player *>(0x0)) && (iVar7 = GetHealthType(pEVar2), iVar7 == 0)) &&
|
|
((iVar7 = GetHeartLimit(this_01,0), pEVar2->_maxHearts < iVar7 && (pEVar2->_redHearts < 3))))
|
|
{
|
|
AddMaxHearts(pEVar2,2,0);
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x29,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar9 = (this->_temporaryeffects)._effects._begin;
|
|
piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) {
|
|
iVar7 = *GHIDRA_CAST<int *>(*piVar9);
|
|
if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) && ((GHIDRA_CAST<int *>(*piVar9))[1] == 0x2a1)) {
|
|
if (0 < piVar9[1]) {
|
|
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f04))));
|
|
if (((iVar7 != 0) && (*GHIDRA_CAST<int *>((iVar7 + 0x28)) == 1000)) && (piVar9[1] == 1)) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar7 + 0x450)) = 2;
|
|
}
|
|
pvVar11 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x2a1 < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2) &&
|
|
(iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0xa84)), iVar7 != 0)) {
|
|
redemptionEffect[2] = *GHIDRA_CAST<undefined4 *>((iVar7 + 0x78));
|
|
redemptionEffect[1] = 0;
|
|
local_a8 = 0;
|
|
redemptionEffect[0] = iVar7;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(redemptionEffect,-1);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
this->_forgottenBodyRoomIdx = -99999;
|
|
bVar6 = HasTrinket(this,0xa0,0);
|
|
if ((bVar6 != 0) && (local_30 = GHIDRA_CAST<Game *>(GetTrinketMultiplier(this,0xa0)), 0 < GHIDRA_INT(local_30))) {
|
|
do {
|
|
pvVar11 = (this->_trinketRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar11) + 0xa00));
|
|
forcedCurses = *rngSeed;
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
forcedCurses = *rngSeed;
|
|
if (forcedCurses == 0) {
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
}
|
|
game = g_game;
|
|
forcedCurses = forcedCurses >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0xa04)) & 0x1f) ^ forcedCurses;
|
|
forcedCurses = forcedCurses << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0xa08)) & 0x1f) ^ forcedCurses;
|
|
forcedCurses = forcedCurses >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0xa0c)) & 0x1f) ^ forcedCurses;
|
|
*rngSeed = forcedCurses;
|
|
spawnPos = Room::FindFreePickupSpawnPosition(game->_room,&sackPos,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x45,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,forcedCurses);
|
|
local_30 = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_30[-1]._console)) + 0x3))));
|
|
} while (local_30 != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
if ((isForced == 0) && (this->_backupPlayer != (void *)0x0)) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x1fc4)) = 1;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x20e8)) != '\0') {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x2620)) = 1;
|
|
}
|
|
}
|
|
if (0 < this->_eternalHearts) {
|
|
this->_eternalHearts = 0;
|
|
iVar10 = GetHealthType(this);
|
|
iVar7 = extraout_EDX;
|
|
if ((iVar10 == 1) && ((this->_playerType == 0xc || (iVar7 = 6, this->_playerType == 0x18)))) {
|
|
iVar7 = 0x2e;
|
|
}
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(iVar7,1,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
AddMaxHearts(this,2,0);
|
|
AddHearts(this,2,0,0);
|
|
}
|
|
iVar7 = this->_subPlayer;
|
|
if ((iVar7 != 0) && (0 < *GHIDRA_CAST<int *>((iVar7 + 0x1348)))) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar7 + 0x1348)) = 0;
|
|
iVar10 = GetHealthType(GHIDRA_CAST<Entity_Player *>(this->_subPlayer));
|
|
iVar7 = extraout_EDX_00;
|
|
if ((iVar10 == 1) &&
|
|
((*GHIDRA_CAST<int *>((extraout_ECX + 0x13c0)) == 0xc ||
|
|
(iVar7 = 6, *GHIDRA_CAST<int *>((extraout_ECX + 0x13c0)) == 0x18)))) {
|
|
iVar7 = 0x2e;
|
|
}
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(iVar7,1,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
AddMaxHearts(GHIDRA_CAST<Entity_Player *>(this->_subPlayer),2,0);
|
|
AddHearts(GHIDRA_CAST<Entity_Player *>(this->_subPlayer),2,0,0);
|
|
}
|
|
if (this->_isCoopGhost == 0) {
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,0xe8,1,0,0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
forcedCurses = 0;
|
|
if (familiars._size != 0) {
|
|
do {
|
|
iVar7 = __RTDynamicCast(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(familiars._data) + forcedCurses * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
if ((iVar7 != 0) && (*GHIDRA_CAST<Entity_Player **>((iVar7 + 0x410)) == this)) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar7 + 0x30)) = 0;
|
|
}
|
|
forcedCurses = forcedCurses + 1;
|
|
} while (forcedCurses < GHIDRA_UINT(familiars._size));
|
|
}
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (familiars._data != (void *)0x0) {
|
|
forcedCurses = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(familiars._data) + -4));
|
|
qVar5 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - forcedCurses;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar5) < forcedCurses));
|
|
free((void *)(GHIDRA_INT(familiars._data) + -4));
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
}
|
|
bVar6 = HasCollectible(this,0x36,0);
|
|
if ((bVar6 != 0) || (bVar6 = HasCollectible(this,0x14d,0), bVar6 != 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyMapEffect();
|
|
}
|
|
bVar6 = HasCollectible(this,0xf6,0);
|
|
if ((bVar6 != 0) || (bVar6 = HasCollectible(this,0x14d,0), bVar6 != 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyBlueMapEffect();
|
|
}
|
|
local_29 = '\0';
|
|
bVar6 = HasTrinket(this,0x3b,0);
|
|
if (bVar6 != 0) {
|
|
GetTrinketMultiplier(this,0x3b);
|
|
iVar7 = __ftoui3();
|
|
forcedCurses = Random();
|
|
local_29 = forcedCurses % 100 < GHIDRA_UINT((iVar7 * 0x19));
|
|
}
|
|
bVar6 = HasCollectible(this,0x15,0);
|
|
if (((bVar6 != 0) || (bVar6 = HasCollectible(this,0x14d,0), bVar6 != 0)) || (local_29 != '\0')) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyCompassEffect(1);
|
|
}
|
|
bVar6 = HasTrinket(this,0x37,0);
|
|
if (bVar6 != 0) {
|
|
iVar7 = GetTrinketMultiplier(this,0x37);
|
|
AddEternalHearts(this,iVar7);
|
|
}
|
|
bVar6 = HasCollectible(this,0x24c,0);
|
|
game = g_game;
|
|
if (bVar6 != 0) {
|
|
if (-1 < g_game->_lastBossRoomListIdx) {
|
|
piVar9 = &g_game->_roomList[g_game->_lastBossRoomListIdx].DisplayFlags;
|
|
*piVar9 = *piVar9 | 4;
|
|
}
|
|
(GHIDRA_CAST<Minimap *>((&game->_minimap)))->Minimap::Refresh();
|
|
piVar9 = &game->_levelStateFlags;
|
|
*piVar9 = *piVar9 | 0x40000;
|
|
}
|
|
bVar6 = HasCollectible(this,0x24d,0);
|
|
if (bVar6 != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::reveal_secret_room();
|
|
}
|
|
bVar6 = HasTrinket(this,0x17,0);
|
|
if (bVar6 != 0) {
|
|
iVar7 = GetTrinketMultiplier(this,0x17);
|
|
local_30 = GHIDRA_CAST<Game *>(0x21);
|
|
if (iVar7 == 2) {
|
|
local_30 = GHIDRA_CAST<Game *>(0x42);
|
|
}
|
|
else if (2 < iVar7) {
|
|
local_30 = GHIDRA_CAST<Game *>(0x64);
|
|
}
|
|
pvVar11 = (this->_trinketRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar11) + 0x170));
|
|
forcedCurses = *rngSeed;
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
forcedCurses = *rngSeed;
|
|
if (forcedCurses == 0) {
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
}
|
|
forcedCurses = forcedCurses >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x174)) & 0x1f) ^ forcedCurses;
|
|
forcedCurses = forcedCurses << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x178)) & 0x1f) ^ forcedCurses;
|
|
forcedCurses = forcedCurses >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x17c)) & 0x1f) ^ forcedCurses;
|
|
*rngSeed = forcedCurses;
|
|
if (GHIDRA_CAST<Game *>((forcedCurses % 100)) < local_30) {
|
|
iVar7 = 0;
|
|
local_30 = g_game;
|
|
if (0 < g_game->_nbRooms) {
|
|
roomData = &g_game->_roomList[0].Data;
|
|
game = g_game;
|
|
do {
|
|
pvVar11 = *roomData;
|
|
if (pvVar11 == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("[error] Room %d is not initialized\n"));
|
|
pvVar11 = *roomData;
|
|
game = local_30;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 8)) == 8) {
|
|
piVar9 = &game->_roomList[iVar7].DisplayFlags;
|
|
*piVar9 = *piVar9 | 4;
|
|
break;
|
|
}
|
|
iVar7 = iVar7 + 1;
|
|
roomData = roomData + 0x2e;
|
|
} while (iVar7 < game->_nbRooms);
|
|
}
|
|
(GHIDRA_CAST<Minimap *>((&g_game->_minimap)))->Minimap::Refresh();
|
|
}
|
|
}
|
|
bVar6 = HasCollectible(this,0x236,0);
|
|
if (bVar6 != 0) {
|
|
AddSoulHearts(this,1,0);
|
|
}
|
|
forcedCurses = 0;
|
|
do {
|
|
uVar13 = this->_activeDesc[forcedCurses]._item;
|
|
if (uVar13 == 0x93) {
|
|
if (forcedCurses == 3) {
|
|
iVar7 = 0;
|
|
}
|
|
else if (((forcedCurses == 2) && (this->_activeDesc[2]._item == 0x244)) &&
|
|
(g_game->_challenge == 0x2c)) {
|
|
iVar7 = 0;
|
|
}
|
|
else {
|
|
iVar7 = GetCollectibleMaxCharge(this,0x93,this->_activeDesc[forcedCurses]._varData,0x93);
|
|
}
|
|
LAB_007a5a54:
|
|
AddActiveCharge(this,iVar7,forcedCurses,0,0,1);
|
|
uVar13 = extraout_ECX_01;
|
|
}
|
|
else if (uVar13 == 0x1a6) {
|
|
this->_activeDesc[forcedCurses]._varData = 0;
|
|
SetActiveCharge(this,0,forcedCurses);
|
|
uVar13 = extraout_ECX_00;
|
|
}
|
|
else if (uVar13 == 0x27e) {
|
|
iVar7 = 1;
|
|
goto LAB_007a5a54;
|
|
}
|
|
forcedCurses = forcedCurses + 1;
|
|
} while (forcedCurses < 4);
|
|
if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) &&
|
|
(2 < this->_playerForms[0xf])) {
|
|
uVar13 = uVar13 & 0xffffff00;
|
|
forcedCurses = 0;
|
|
local_29 = '\0';
|
|
do {
|
|
if (this->_activeDesc[forcedCurses]._item == 0x23) {
|
|
if ((char)uVar13 == '\0') {
|
|
if (this->_activeDesc[forcedCurses]._varData == 1) {
|
|
if (forcedCurses == 3) {
|
|
iVar7 = 0;
|
|
}
|
|
else {
|
|
iVar7 = GetCollectibleMaxCharge(this,0x23,1,uVar13);
|
|
}
|
|
AddActiveCharge(this,iVar7,forcedCurses,0,0,1);
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x2f,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
manager = g_manager;
|
|
local_30 = GHIDRA_CAST<Game *>(0x419);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_30));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_30),1.0,2,0,1.0,0.0);
|
|
local_29 = '\x01';
|
|
}
|
|
}
|
|
else {
|
|
this->_activeDesc[forcedCurses]._varData = 0;
|
|
}
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::InvalidateActiveItem(this,forcedCurses);
|
|
uVar13 = CONCAT31((int3)(GHIDRA_UINT(extraout_ECX_02) >> 8),local_29);
|
|
}
|
|
forcedCurses = forcedCurses + 1;
|
|
} while (forcedCurses < 4);
|
|
if ((char)uVar13 == '\0') {
|
|
this->_activeDesc[0]._varData = 1;
|
|
iVar7 = GetCollectibleMaxCharge(this,this->_activeDesc[0]._item,1,uVar13);
|
|
AddActiveCharge(this,iVar7,0,0,0,1);
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(0x2f,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
}
|
|
bVar6 = HasTrinket(this,0x8e,0);
|
|
if (bVar6 != 0) {
|
|
iVar7 = GetTrinketMultiplier(this,0x8e);
|
|
iVar7 = iVar7 << 2;
|
|
if (iVar7 != 0) {
|
|
do {
|
|
AddWisp(this,0x248,&this->_pos,0,0);
|
|
iVar7 = iVar7 + -1;
|
|
} while (iVar7 != 0);
|
|
}
|
|
}
|
|
bVar6 = HasTrinket(this,0xa8,0);
|
|
if (bVar6 != 0) {
|
|
iVar7 = GetTrinketMultiplier(this,0xa8);
|
|
AddBoneHearts(this,iVar7);
|
|
}
|
|
bVar6 = HasCollectible(this,0x102,0);
|
|
if (bVar6 != 0) {
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_34) + 2)),0x11c,1,-1,0);
|
|
this->_isPlayingItemAnimation = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::Reset();
|
|
(this->_sprite)._playbackSpeed = 1.0;
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
bVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Glitch"),1);
|
|
if (bVar6 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
this->_isPlayingExtraAnimation = 1;
|
|
this->_isPlayingItemAnimation = 0;
|
|
}
|
|
bVar6 = HasCollectible(this,0x188,0);
|
|
if (bVar6 != 0) {
|
|
bVar6 = HasCollectible(this,299,0);
|
|
if (bVar6 == 0) {
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar9 = (this->_temporaryeffects)._effects._begin;
|
|
piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) {
|
|
iVar7 = *GHIDRA_CAST<int *>(*piVar9);
|
|
if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) && ((GHIDRA_CAST<int *>(*piVar9))[1] == 299))
|
|
goto LAB_007a5d32;
|
|
}
|
|
}
|
|
pvVar11 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2 < 300) {
|
|
Item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
Item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar11) + 0x4ac));
|
|
}
|
|
RemoveCostume(this,Item);
|
|
}
|
|
LAB_007a5d32:
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
}
|
|
bVar6 = HasTrinket(this,0x77,0);
|
|
if (bVar6 != 0) {
|
|
iVar7 = GetTrinketMultiplier(this,0x77);
|
|
if (iVar7 == 1) {
|
|
iVar7 = GetHealthType(this);
|
|
if ((iVar7 == 1) || (iVar7 == 2)) {
|
|
iVar7 = this->_maxHearts;
|
|
}
|
|
else {
|
|
iVar7 = this->_maxHearts + this->_boneHearts * 2;
|
|
}
|
|
iVar7 = (iVar7 - this->_redHearts) / 2;
|
|
}
|
|
else {
|
|
if (iVar7 != 2) {
|
|
if (iVar7 == 3) {
|
|
iVar7 = GetHealthType(this);
|
|
if ((iVar7 == 1) || (iVar7 == 2)) {
|
|
iVar7 = this->_maxHearts;
|
|
}
|
|
else {
|
|
iVar7 = this->_maxHearts + this->_boneHearts * 2;
|
|
}
|
|
iVar7 = iVar7 - this->_redHearts;
|
|
iVar10 = 1;
|
|
if (1 < iVar7) {
|
|
iVar10 = iVar7;
|
|
}
|
|
AddHearts(this,iVar10,0,0);
|
|
forcedCurses = Random();
|
|
spawnPos = Room::get_random_pickup_position(g_game->_room,&heartPos,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,forcedCurses);
|
|
forcedCurses = Random();
|
|
spawnPos = Room::get_random_pickup_position(g_game->_room,&heartPos2,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,forcedCurses);
|
|
}
|
|
goto LAB_007a5eb3;
|
|
}
|
|
iVar7 = GetHealthType(this);
|
|
if ((iVar7 == 1) || (iVar7 == 2)) {
|
|
iVar7 = this->_maxHearts - this->_redHearts;
|
|
}
|
|
else {
|
|
iVar7 = (this->_maxHearts + this->_boneHearts * 2) - this->_redHearts;
|
|
}
|
|
}
|
|
iVar10 = 1;
|
|
if (1 < iVar7) {
|
|
iVar10 = iVar7;
|
|
}
|
|
AddHearts(this,iVar10,0,0);
|
|
}
|
|
LAB_007a5eb3:
|
|
if (g_game->_challenge == 0x1f) {
|
|
pvVar11 = (this->_history)._historyItems._begin;
|
|
local_34 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar10 = GHIDRA_INT((this->_history)._historyItems._end) - GHIDRA_INT(pvVar11);
|
|
iVar7 = iVar10 >> 0x1f;
|
|
if (iVar10 / 0x1c + iVar7 != iVar7) {
|
|
iVar7 = 0;
|
|
do {
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar11) + iVar7 + 4)) == '\0') &&
|
|
(bVar6 = HasCollectible(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + iVar7 + 8)),0), bVar6 != 0)) {
|
|
RemoveCollectible(this,*GHIDRA_CAST<uint *>((GHIDRA_INT((this->_history)._historyItems._begin) +
|
|
GHIDRA_INT(local_34) * 0x1c + 8)),0,0,1);
|
|
break;
|
|
}
|
|
pvVar11 = (this->_history)._historyItems._begin;
|
|
iVar7 = iVar7 + 0x1c;
|
|
local_34 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_34) + 1));
|
|
} while (local_34 < GHIDRA_UINT(((GHIDRA_INT((this->_history)._historyItems._end) - GHIDRA_INT(pvVar11)) / 0x1c)));
|
|
}
|
|
AddMaxHearts(this,-2,0);
|
|
if (((this->_redHearts < 1) && (this->_soulHearts < 1)) && (this->_boneHearts < 1)) {
|
|
AddSoulHearts(this,1,0);
|
|
}
|
|
}
|
|
pvVar11 = (this->_collectibleRNGs)._begin;
|
|
local_48 = 0x500000001;
|
|
forcedCurses = g_game->_dungeonPlacementSeed;
|
|
local_34 = GHIDRA_CAST<Entity_Player *>(0x13);
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
forcedCurses = forcedCurses >> 1 ^ forcedCurses;
|
|
forcedCurses = forcedCurses << 5 ^ forcedCurses;
|
|
*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(pvVar11) + 0x2c4)) = 0x700000002;
|
|
local_30 = GHIDRA_CAST<Game *>((forcedCurses >> 0x13 ^ forcedCurses));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x2cc)) = 9;
|
|
*GHIDRA_CAST<Game **>((GHIDRA_CAST<char *>(pvVar11) + 0x2c0)) = local_30;
|
|
pvVar11 = (this->_collectibleRNGs)._begin;
|
|
startX.y = (float)(GHIDRA_INT(pvVar11) + 0x1440);
|
|
if (local_30 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
forcedCurses = GHIDRA_UINT(local_30) >> 1 ^ GHIDRA_UINT(local_30);
|
|
forcedCurses = forcedCurses << 5 ^ forcedCurses;
|
|
forcedCurses = forcedCurses >> 0x13 ^ forcedCurses;
|
|
*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(pvVar11) + 0x1444)) = 0x700000002;
|
|
*GHIDRA_CAST<uint *>(startX.y) = forcedCurses;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x144c)) = 9;
|
|
pvVar11 = (this->_collectibleRNGs)._begin;
|
|
startX.y = (float)(GHIDRA_INT(pvVar11) + 0x13c0);
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
forcedCurses = forcedCurses >> 1 ^ forcedCurses;
|
|
forcedCurses = forcedCurses << 5 ^ forcedCurses;
|
|
forcedCurses = forcedCurses >> 0x13 ^ forcedCurses;
|
|
*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(pvVar11) + 0x13c4)) = 0x700000002;
|
|
*GHIDRA_CAST<uint *>(startX.y) = forcedCurses;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x13cc)) = 9;
|
|
pvVar11 = (this->_trinketRNGs)._begin;
|
|
startX.y = (float)(GHIDRA_INT(pvVar11) + 0x2b0);
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
forcedCurses = forcedCurses >> 1 ^ forcedCurses;
|
|
forcedCurses = forcedCurses << 5 ^ forcedCurses;
|
|
forcedCurses = forcedCurses >> 0x13 ^ forcedCurses;
|
|
*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(pvVar11) + 0x2b4)) = 0x700000002;
|
|
*GHIDRA_CAST<uint *>(startX.y) = forcedCurses;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 700)) = 9;
|
|
pvVar11 = (this->_pillRNGs)._begin;
|
|
startX.y = (float)(GHIDRA_INT(pvVar11) + 0x130);
|
|
if (forcedCurses == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
forcedCurses = forcedCurses >> 1 ^ forcedCurses;
|
|
forcedCurses = forcedCurses << 5 ^ forcedCurses;
|
|
*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(pvVar11) + 0x134)) = 0x700000002;
|
|
*GHIDRA_CAST<uint *>(startX.y) = forcedCurses >> 0x13 ^ forcedCurses;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x13c)) = 9;
|
|
if (isForced == 0) {
|
|
this->_hasGoldenKey = 0;
|
|
this->_hasGoldenBomb = 0;
|
|
}
|
|
pvVar11 = (this->_levelEffectItems)._begin;
|
|
if ((pvVar11 != (this->_levelEffectItems)._end) &&
|
|
(GHIDRA_CAST<std_vector *>(local_100) != &this->_levelEffectItems)) {
|
|
pvVar12 = (this->_levelEffectItems)._capacity;
|
|
(this->_levelEffectItems)._begin = (void *)0x0;
|
|
(this->_levelEffectItems)._end = (void *)0x0;
|
|
(this->_levelEffectItems)._capacity = (void *)0x0;
|
|
if (pvVar11 != (void *)0x0) {
|
|
forcedCurses = GHIDRA_INT(pvVar12) - GHIDRA_INT(pvVar11) & 0xfffffffc;
|
|
pvVar12 = pvVar11;
|
|
if (0xfff < forcedCurses) {
|
|
pvVar12 = *(void **)(GHIDRA_CAST<char *>(pvVar11) + -4);
|
|
forcedCurses = forcedCurses + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar11) + (-4 - GHIDRA_INT(pvVar12))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar12,forcedCurses);
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
this->_bloodLustCounter = 0;
|
|
pvVar11 = (manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2 < 0x9e) {
|
|
iVar7 = 0;
|
|
}
|
|
else {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x274));
|
|
}
|
|
forcedCurses = *GHIDRA_CAST<uint *>((iVar7 + 0x54)) | this->_cacheFlags;
|
|
this->_cacheFlags = forcedCurses;
|
|
pvVar11 = (manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2 < 0x2b8) {
|
|
iVar7 = 0;
|
|
}
|
|
else {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0xadc));
|
|
}
|
|
this->_cacheFlags = forcedCurses | *GHIDRA_CAST<uint *>((iVar7 + 0x54));
|
|
EvaluateItems(this);
|
|
if (isForced != 0) {
|
|
forcedCurses = 0;
|
|
pvVar11 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x1264)) != 0) {
|
|
do {
|
|
familiar = *GHIDRA_CAST<Entity_Familiar **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x125c)) + forcedCurses * 4));
|
|
if (((familiar != GHIDRA_CAST<Entity_Familiar *>(0x0)) && (familiar->_type == 3)) &&
|
|
(familiar->_player == this)) {
|
|
(GHIDRA_CAST<Entity_Familiar *>((familiar)))->Entity_Familiar::level_start();
|
|
}
|
|
forcedCurses = forcedCurses + 1;
|
|
} while (forcedCurses < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar11) + 0x1264)));
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(darkEsaus)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (darkEsaus._data != (void *)0x0) {
|
|
forcedCurses = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(darkEsaus._data) + -4));
|
|
qVar5 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - forcedCurses;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar5) < forcedCurses));
|
|
free(GHIDRA_CAST<uint *>((GHIDRA_INT(darkEsaus._data) + -4)));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007a6300
|
|
void Entity_Player::ShootCandle(Vector *direction)
|
|
{
|
|
byte isHasBirdsEye;
|
|
byte isHasGhostPepper;
|
|
uint rngResult;
|
|
Vector fireDirection;
|
|
|
|
if ((NAN(g_vectorZero.x)) || (NAN(g_vectorZero.y))) {
|
|
fireDirection.x = g_vectorZero.x;
|
|
fireDirection.y = g_vectorZero.y;
|
|
}
|
|
else {
|
|
fireDirection.x = (this->_movementVector).x;
|
|
if ((fireDirection.x == g_vectorZero.x) && ((this->_movementVector).y == g_vectorZero.y)) {
|
|
fireDirection.x = 0.0;
|
|
fireDirection.y = (float)&DAT_bf800000;
|
|
}
|
|
else {
|
|
fireDirection.x = -fireDirection.x;
|
|
fireDirection.y = (float)(GHIDRA_UINT((this->_movementVector).y) ^ 0x80000000);
|
|
}
|
|
}
|
|
isHasBirdsEye = HasCollectible(this,0x268,0);
|
|
isHasGhostPepper = HasCollectible(this,0x1ef,0);
|
|
if (isHasBirdsEye == 0) {
|
|
if (isHasGhostPepper == 0) {
|
|
return;
|
|
}
|
|
}
|
|
else if ((isHasGhostPepper == 0) || (rngResult = Random(), (rngResult & 1) == 0)) {
|
|
ShootRedCandle(this,&fireDirection);
|
|
return;
|
|
}
|
|
ShootBlueCandle(this,&fireDirection);
|
|
return;
|
|
}
|
|
|
|
// 007a6430
|
|
int Entity_Player::GetTrinket(uint slot)
|
|
{
|
|
if (slot < 2) {
|
|
return this->_trinketsID[slot];
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007a6450
|
|
void Entity_Player::SetControllerIndex(int index, byte isIncludePlayerOwned)
|
|
{
|
|
int iVar1;
|
|
uint entityCount;
|
|
int *piVar3;
|
|
undefined4 *puVar4;
|
|
void *playerListEnd;
|
|
int iVar5;
|
|
uint entityIndex;
|
|
PlayerManager *playerManager;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 uStack_8;
|
|
uint entityCount;
|
|
Game *game;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00aff9bd;
|
|
local_10 = ExceptionList;
|
|
entityCount = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
KAGE_LogMessage(1,(byte *)
|
|
"Entity_Player::SetControllerId() Setting controller ID to %d, (Prev: %d) \n");
|
|
game = g_game;
|
|
if ((index != -1) && (iVar1 = this->_controllerIndex, iVar1 != index)) {
|
|
if (iVar1 == -1) {
|
|
FUN_009b94e0(index);
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x5c))) != '\0') {
|
|
iVar5 = 0;
|
|
piVar3 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x60))));
|
|
do {
|
|
if (*piVar3 == iVar1) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Reassigning Player Color (%d) Prev(%d) New(%d) \n"));
|
|
(game->_seedEffects)._stageSeeds[iVar5 + -0x25] = index;
|
|
goto LAB_007a650d;
|
|
}
|
|
iVar5 = iVar5 + 1;
|
|
piVar3 = piVar3 + 1;
|
|
} while (iVar5 < 4);
|
|
KAGE_LogMessage(8,(byte *)
|
|
"PlayerManager::ReassignPlayerColor(%d, %d) cannot reassign the color, because there is no color assigned to the original controller ID \n"
|
|
);
|
|
}
|
|
}
|
|
LAB_007a650d:
|
|
if (this->_controllerIndex != -1) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x125c));
|
|
entityCount = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1264));
|
|
entityIndex = 0;
|
|
uStack_8 = 0;
|
|
if (entityCount != 0) {
|
|
do {
|
|
iVar5 = __RTDynamicCast(*GHIDRA_CAST<undefined4 *>((iVar1 + entityIndex * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,entityCount);
|
|
if ((iVar5 != 0) && (*GHIDRA_CAST<int *>((iVar5 + 0xf1c)) == this->_controllerIndex)) {
|
|
*GHIDRA_CAST<int *>((iVar5 + 0xf1c)) = index;
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < entityCount);
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
}
|
|
this->_controllerIndex = index;
|
|
if (isIncludePlayerOwned != 0) {
|
|
if (GHIDRA_CAST<Entity_Player *>(this->_subPlayer) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
SetControllerIndex(GHIDRA_CAST<Entity_Player *>(this->_subPlayer),index,0);
|
|
}
|
|
if (this->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
SetControllerIndex(this->_backupPlayer,this->_controllerIndex,0);
|
|
}
|
|
if (this->_twinPlayer != (EntityPtr)0x0) {
|
|
SetControllerIndex(GHIDRA_CAST<Entity_Player *>(this->_twinPlayer),this->_controllerIndex,0);
|
|
}
|
|
if (this->_parent == (EntityPtr)0x0) {
|
|
entityCount = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin)
|
|
>> 2 != 0) {
|
|
do {
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
}
|
|
puVar4 = (playerManager->_playerList)._begin;
|
|
if (entityCount < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(puVar4) >> 2))) {
|
|
puVar4 = puVar4 + entityCount;
|
|
}
|
|
if ((GHIDRA_CAST<Entity_Player *>(*puVar4))->_parent == (EntityPtr)this) {
|
|
SetControllerIndex(GHIDRA_CAST<Entity_Player *>(*puVar4),this->_controllerIndex,1);
|
|
}
|
|
entityCount = entityCount + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (entityCount < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007a6680
|
|
void Entity_Player::room_exit(byte isKeepHolyMantle)
|
|
{
|
|
void **ppvVar1;
|
|
byte bVar2;
|
|
ItemConfig_Item *costumeItem;
|
|
void *pvVar3;
|
|
int *piVar4;
|
|
int *piVar5;
|
|
int *piVar6;
|
|
int familiarCount;
|
|
int iVar7;
|
|
ItemConfig_Item *activeConfig;
|
|
int local_44;
|
|
ActiveItemDesc *activeDesc;
|
|
int effectDesc [3];
|
|
undefined4 uStack_24;
|
|
int removeDesc [3];
|
|
undefined4 uStack_14;
|
|
uint activeItemId;
|
|
int roomEntity;
|
|
TemporaryEffects *tempEffects;
|
|
|
|
FlushQueueItem(this);
|
|
if (isKeepHolyMantle == 0) {
|
|
this->_holyMantleState = 0;
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13b5)))) = 0;
|
|
this->_cursedPennyPending = 0;
|
|
this->_roomDamageTaken = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16b8)))) = 0;
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x15);
|
|
if ((bVar2 != 0) && (bVar2 = HasCollectible(this,0x15,0), bVar2 == 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::RemoveCompassEffect();
|
|
}
|
|
local_44 = this->_metronomeCollectibleID;
|
|
if (local_44 != 0) {
|
|
pvVar3 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x7a0 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar3) & 0xfffffffcU))
|
|
) && (iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x7a0)), iVar7 != 0)) {
|
|
effectDesc[2] = *GHIDRA_CAST<int *>((iVar7 + 0x78));
|
|
effectDesc[1] = 0;
|
|
uStack_24 = 0;
|
|
effectDesc[0] = iVar7;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveEffect(effectDesc,1);
|
|
local_44 = this->_metronomeCollectibleID;
|
|
}
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(local_44);
|
|
this->_metronomeCollectibleID = 0;
|
|
if ((this->_activeDesc[0]._item != local_44) &&
|
|
(bVar2 = HasCollectible(this,local_44,0), bVar2 == 0)) {
|
|
RemoveCostume(this,costumeItem);
|
|
}
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
piVar5 != (this->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar5) == 2) && ((GHIDRA_CAST<int *>(*piVar5))[1] == 0x76)) {
|
|
pvVar3 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar3) & 0xfffffffcU)) < 0xa1)
|
|
{
|
|
costumeItem = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
costumeItem = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar3) + 0xa0));
|
|
}
|
|
RemoveCostume(this,costumeItem);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if ((((this->_temporaryeffects)._disabled == 0) &&
|
|
(pvVar3 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(0x246), pvVar3 != (void *)0x0))
|
|
&& (local_44 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 4)), 0 < local_44)) {
|
|
do {
|
|
pvVar3 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (0x11c < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar3) & 0xfffffffcU)))
|
|
{
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x11c));
|
|
if (iVar7 != 0) {
|
|
effectDesc[2] = *GHIDRA_CAST<int *>((iVar7 + 0x78));
|
|
effectDesc[1] = 0;
|
|
uStack_24 = 0;
|
|
effectDesc[0] = iVar7;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
piVar5 = (this->_temporaryeffects)._effects._end;
|
|
for (piVar4 = (this->_temporaryeffects)._effects._begin; piVar4 != piVar5;
|
|
piVar4 = piVar4 + 4) {
|
|
if (*piVar4 == iVar7) {
|
|
piVar4[1] = piVar4[1] + 1;
|
|
piVar4[2] = piVar4[2] + effectDesc[2];
|
|
goto LAB_007a68f1;
|
|
}
|
|
}
|
|
if (piVar5 == (this->_temporaryeffects)._effects._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(piVar5,effectDesc);
|
|
}
|
|
else {
|
|
*piVar5 = iVar7;
|
|
piVar5[1] = 0;
|
|
piVar5[2] = effectDesc[2];
|
|
piVar5[3] = 0;
|
|
ppvVar1 = &(this->_temporaryeffects)._effects._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x10);
|
|
}
|
|
pvVar3 = (this->_temporaryeffects)._effects._begin;
|
|
*(undefined4 *)
|
|
(((GHIDRA_INT((this->_temporaryeffects)._effects._end) - GHIDRA_INT(pvVar3) & 0xfffffff0U) - 0xc) +
|
|
GHIDRA_INT(pvVar3)) = 1;
|
|
LAB_007a68f1:
|
|
tempEffects->_cacheFlags = tempEffects->_cacheFlags | *GHIDRA_CAST<uint *>((effectDesc[0] + 0x54));
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
}
|
|
pvVar3 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x918 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar3) &
|
|
0xfffffffcU))) && (iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x918)), iVar7 != 0)) {
|
|
removeDesc[2] = *GHIDRA_CAST<undefined4 *>((iVar7 + 0x78));
|
|
removeDesc[1] = 0;
|
|
uStack_14 = 0;
|
|
removeDesc[0] = iVar7;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveEffect(removeDesc,1);
|
|
}
|
|
local_44 = local_44 + -1;
|
|
} while (local_44 != 0);
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
piVar4 = (this->_temporaryeffects)._effects._end;
|
|
if (piVar5 != piVar4) {
|
|
LAB_007a6984:
|
|
if ((*GHIDRA_CAST<int *>(*piVar5) != 0) || ((GHIDRA_CAST<int *>(*piVar5))[1] != 0x6e)) goto LAB_007a6991;
|
|
if ((this->_playerType != 0x1a) ||
|
|
(this->_boneHearts + this->_goldenHearts + this->_soulHearts + this->_eternalHearts +
|
|
this->_redHearts != 1)) goto LAB_007a6a2f;
|
|
familiarCount = 0;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1254));
|
|
if (iVar7 != 0) {
|
|
piVar5 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(g_game->_room) + 0x124c));
|
|
do {
|
|
roomEntity = *piVar5;
|
|
if (((((roomEntity != 0) && (*GHIDRA_CAST<int *>((roomEntity + 0x28)) == 3)) &&
|
|
(*GHIDRA_CAST<Entity_Player **>((roomEntity + 0x410)) == this)) &&
|
|
((*GHIDRA_CAST<int *>((roomEntity + 0x2c)) == 0xee && (*GHIDRA_CAST<int *>((roomEntity + 0x30)) != 7)))) &&
|
|
(*GHIDRA_CAST<char *>((roomEntity + 0x173)) == '\0')) {
|
|
familiarCount = familiarCount + 1;
|
|
}
|
|
piVar5 = piVar5 + 1;
|
|
iVar7 = iVar7 + -1;
|
|
} while (iVar7 != 0);
|
|
if (familiarCount != 0) {
|
|
LAB_007a6a2f:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x6e,-1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007a6a3a:
|
|
ClearTemporaryEffects(this);
|
|
activeDesc = this->_activeDesc;
|
|
local_44 = 4;
|
|
do {
|
|
activeItemId = activeDesc->_item;
|
|
if (activeItemId != 0) {
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
piVar5 != (this->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
iVar7 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) &&
|
|
(*GHIDRA_CAST<uint *>((*piVar5 + 4)) == activeItemId)) {
|
|
if (activeItemId != 0x31) goto LAB_007a6b37;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(activeItemId)) goto LAB_007a6af0;
|
|
LAB_007a6b0a:
|
|
activeConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(activeItemId) < 0) {
|
|
if ((GHIDRA_INT(activeItemId) < 0) &&
|
|
(pvVar3 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~activeItemId) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar3) >> 2)) {
|
|
activeConfig = GHIDRA_CAST<ItemConfig_Item *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar3) + ~activeItemId * 4)));
|
|
}
|
|
else {
|
|
activeConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_007a6af0:
|
|
pvVar3 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar3) >> 2 <= GHIDRA_INT(activeItemId)
|
|
) goto LAB_007a6b0a;
|
|
activeConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar3) + activeItemId * 4));
|
|
}
|
|
if ((activeConfig->addCostumeOnPickup == 0) ||
|
|
(bVar2 = HasCollectible(this,activeItemId,0), bVar2 == 0)) {
|
|
RemoveCostume(this,activeConfig);
|
|
}
|
|
}
|
|
LAB_007a6b37:
|
|
activeDesc = activeDesc + 1;
|
|
local_44 = local_44 + -1;
|
|
} while (local_44 != 0);
|
|
if ((this->_itemState != 0x25c) || (*GHIDRA_CAST<int *>(&g_game->_stageTransition) != 0)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::Reset();
|
|
this->_isPlayingItemAnimation = 0;
|
|
ResetItemState(this);
|
|
this->_itemStateCooldown = 0;
|
|
}
|
|
if (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d78)))) <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c54)))) &&
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c54)))) != *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d78))))) {
|
|
list_anm2_state_assign(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b34))));
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c5c)))) != 0) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c60)))) = **GHIDRA_CAST<undefined4 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c58))));
|
|
}
|
|
std::deque<12byte>::_Tidy();
|
|
if ((this->_parent != (EntityPtr)0x0) && ((this->_temporaryeffects)._disabled == 0)) {
|
|
piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
piVar4 = (this->_temporaryeffects)._effects._end;
|
|
piVar6 = piVar5;
|
|
if (piVar5 != piVar4) {
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>(*piVar6) == 0) && ((GHIDRA_CAST<int *>(*piVar6))[1] == 0x78)) goto LAB_007a6c2c;
|
|
piVar6 = piVar6 + 4;
|
|
} while (piVar6 != piVar4);
|
|
while ((piVar6 = GHIDRA_CAST<int *>(*piVar5), *piVar6 != 0 || (piVar6[1] != 0x79))) {
|
|
piVar5 = piVar5 + 4;
|
|
if (piVar5 == piVar4) {
|
|
return;
|
|
}
|
|
}
|
|
LAB_007a6c2c:
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(this,(byte)piVar6);
|
|
}
|
|
}
|
|
return;
|
|
LAB_007a6991:
|
|
piVar5 = piVar5 + 4;
|
|
if (piVar5 == piVar4) goto LAB_007a6a3a;
|
|
goto LAB_007a6984;
|
|
}
|
|
|
|
// 007a6c50
|
|
void Entity_Player::room_enter()
|
|
{
|
|
Room *pRVar1;
|
|
code *pcVar2;
|
|
ANM2 *pAVar3;
|
|
byte bVar4;
|
|
int iVar5;
|
|
uint uVar6;
|
|
ItemConfig_Item *collectible;
|
|
RoomDescriptor *roomDesc;
|
|
uint uVar7;
|
|
Entity *spawned;
|
|
byte *format;
|
|
void *pvVar8;
|
|
int *piVar9;
|
|
ItemConfig *itemConfig;
|
|
int iVar10;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *extraout_ECX_00;
|
|
Entity_Player *extraout_ECX_01;
|
|
Entity_Player *extraout_ECX_02;
|
|
Entity_Player *itemConfig;
|
|
EntityConfig_Entity *entityConfig;
|
|
std_string *psVar11;
|
|
uint *activesCapacity;
|
|
uint *puVar12;
|
|
Game *game;
|
|
undefined1 *wispChance;
|
|
void *ptr;
|
|
EntityPtr *pEVar13;
|
|
EntityPtr followedPlayer;
|
|
float fVar14;
|
|
float fVar15;
|
|
float enemyPosX;
|
|
undefined4 uVar16;
|
|
TypeDescriptor *pTVar17;
|
|
TypeDescriptor *pTVar18;
|
|
byte unk2;
|
|
undefined4 uVar19;
|
|
EntityRef charmRef;
|
|
EntityRef sourceRef;
|
|
ColorMod cloudColor;
|
|
undefined1 lowerBound [8];
|
|
void *configNode;
|
|
EntityList_EL queryList;
|
|
float nullEffect;
|
|
undefined4 local_c4;
|
|
undefined4 nullEffectCooldown;
|
|
undefined4 local_bc;
|
|
int collectibleEffect;
|
|
undefined4 local_b4;
|
|
undefined4 collectibleEffectCooldown;
|
|
undefined4 local_ac;
|
|
Vector launchVelocity;
|
|
Vector enterPos;
|
|
uint configKey;
|
|
uint collectibleId;
|
|
EntityPtr local_90;
|
|
void *actives;
|
|
uint *activesEnd;
|
|
uint *activesCapacityEnd;
|
|
float *local_80;
|
|
void *local_7c;
|
|
EntityPtr *local_78;
|
|
uint *local_74;
|
|
undefined1 *local_70;
|
|
std_string *entityName [5];
|
|
uint entityNameCapacity;
|
|
byte message [64];
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
GridEntity_Door *door;
|
|
Manager *manager;
|
|
undefined4 *nextNode;
|
|
undefined4 *node;
|
|
float *playerPos;
|
|
float targetX;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00affa03;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((message + 0x50));
|
|
if (this->_postLevelInitFinished == 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
local_90 = (EntityPtr)this;
|
|
if ((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) >> 0xd & 1) != 0) {
|
|
AddCurseMistEffect(this);
|
|
}
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0xf) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x40)) == 1)) &&
|
|
(bVar4 = HasTrinket(this,0xb6,0), bVar4 != 0)) {
|
|
wispChance = GHIDRA_CAST<undefined1 *>(0x0);
|
|
local_70 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
iVar5 = GetTrinketMultiplier(this,0xb6);
|
|
if (iVar5 == 2) {
|
|
wispChance = GHIDRA_CAST<undefined1 *>(0x32);
|
|
LAB_007a6d0d:
|
|
local_70 = wispChance;
|
|
}
|
|
else if (iVar5 == 3) {
|
|
wispChance = GHIDRA_CAST<undefined1 *>(0x64);
|
|
goto LAB_007a6d0d;
|
|
}
|
|
local_7c = (void *)0x0;
|
|
do {
|
|
if (wispChance == GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
LAB_007a6f9e:
|
|
AddWisp(this,0x248,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),1,0);
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x177c));
|
|
puVar12 = GHIDRA_CAST<uint *>((iVar5 + 0xb60));
|
|
uVar6 = *puVar12;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar6 = *puVar12;
|
|
if (uVar6 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0xb64)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0xb68)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0xb6c)) & 0x1f) ^ uVar6;
|
|
*puVar12 = uVar6;
|
|
if (wispChance <= GHIDRA_CAST<undefined1 *>((uVar6 % 100))) goto LAB_007a6f9e;
|
|
actives = (void *)0x0;
|
|
puVar12 = GHIDRA_CAST<uint *>(0x0);
|
|
local_74 = GHIDRA_CAST<uint *>(0x0);
|
|
activesEnd = GHIDRA_CAST<uint *>(0x0);
|
|
activesCapacityEnd = GHIDRA_CAST<uint *>(0x0);
|
|
local_8 = 0;
|
|
uVar6 = 0;
|
|
itemConfig = &g_manager->_itemConfig;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((itemConfig->_collectibles)._begin) >> 2 != 0) {
|
|
activesCapacity = GHIDRA_CAST<uint *>(0x0);
|
|
do {
|
|
collectible = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(uVar6);
|
|
if (collectible != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
if (collectible->type == 3) {
|
|
if (collectible[1].type != 0) {
|
|
if (0 < *GHIDRA_CAST<short *>((collectible[1].type + 400))) {
|
|
collectibleId = uVar6;
|
|
if (puVar12 == activesCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(puVar12,&collectibleId);
|
|
activesCapacity = activesCapacityEnd;
|
|
puVar12 = activesEnd;
|
|
}
|
|
else {
|
|
*puVar12 = uVar6;
|
|
activesEnd = puVar12 + 1;
|
|
puVar12 = activesEnd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
itemConfig = &g_manager->_itemConfig;
|
|
} while (uVar6 < GHIDRA_UINT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((itemConfig->_collectibles)._begin) >> 2)));
|
|
this = GHIDRA_CAST<Entity_Player *>(local_90);
|
|
local_74 = activesCapacity;
|
|
}
|
|
pvVar8 = actives;
|
|
uVar6 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x177c)) + 0xb60)))))->RNG::RandomInt(GHIDRA_INT(puVar12) - GHIDRA_INT(actives) >> 2);
|
|
AddWisp(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + uVar6 * 4)),GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),1,0);
|
|
local_8 = 0xffffffff;
|
|
if (pvVar8 != (void *)0x0) {
|
|
uVar6 = (GHIDRA_INT(local_74) - GHIDRA_INT(pvVar8) >> 2) * 4;
|
|
ptr = pvVar8;
|
|
if (0xfff < uVar6) {
|
|
ptr = *(void **)(GHIDRA_CAST<char *>(pvVar8) + -4);
|
|
uVar6 = uVar6 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar8) + (-4 - GHIDRA_INT(ptr))))) goto LAB_007a7912;
|
|
}
|
|
operator_delete(ptr,uVar6);
|
|
actives = (void *)0x0;
|
|
activesEnd = GHIDRA_CAST<uint *>(0x0);
|
|
activesCapacityEnd = GHIDRA_CAST<uint *>(0x0);
|
|
}
|
|
wispChance = local_70;
|
|
}
|
|
manager = g_manager;
|
|
local_7c = (void *)(GHIDRA_INT(local_7c) + 1);
|
|
} while (GHIDRA_INT(local_7c) < 5);
|
|
local_7c = (void *)0x1d7;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_7c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_7c),1.0,2,0,1.0,0.0);
|
|
}
|
|
piVar9 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10));
|
|
if (((piVar9 != GHIDRA_CAST<int *>(0x0)) && (piVar9[2] == 0x10)) &&
|
|
((*piVar9 == 0x23 &&
|
|
((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16c8)) + 0x9e4)) < 1 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x28)
|
|
))))) {
|
|
AddCollectible(this,0x279,0,1,0,0,0);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x23) && (g_game->_challenge == 0x2a)) {
|
|
pvVar8 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar8) >> 2 < 0x6b) {
|
|
iVar5 = 0;
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1a8));
|
|
}
|
|
uVar6 = 0;
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x122c));
|
|
do {
|
|
if (((-1 < *piVar9) && ((char)piVar9[3] == '\0')) &&
|
|
(iVar10 = *piVar9 * 0x130 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1220)), *GHIDRA_CAST<int *>((iVar10 + 0x114)) == iVar5
|
|
)) {
|
|
if (*GHIDRA_CAST<int *>((iVar10 + 0x54)) != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((iVar10 + 0x50)))))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
break;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
piVar9 = piVar9 + 4;
|
|
} while (uVar6 < 0xf);
|
|
}
|
|
bVar4 = HasTrinket(this,0xb7,0);
|
|
if (bVar4 != 0) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x177c));
|
|
iVar10 = GetTrinketMultiplier(this,0xb7);
|
|
uVar6 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((iVar5 + 0xb70)))))->RNG::RandomInt(iVar10 + 1);
|
|
twins_duplicate_familiars(this,uVar6);
|
|
}
|
|
bVar4 = HasCollectible(this,0x3b,0);
|
|
itemConfig = extraout_ECX;
|
|
if (bVar4 != 0) {
|
|
bVar4 = HasCollectible(this,0x1da,0);
|
|
itemConfig = extraout_ECX_00;
|
|
if (bVar4 != 0) {
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::HasCollectibleEffect(0xd6);
|
|
if (bVar4 == 0) {
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2 < 0xd7) {
|
|
collectibleEffect = 0;
|
|
}
|
|
else {
|
|
collectibleEffect = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x358));
|
|
}
|
|
collectibleEffectCooldown = *GHIDRA_CAST<undefined4 *>((collectibleEffect + 0x78));
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
collectibleEffectCooldown = 300;
|
|
}
|
|
local_b4 = 0;
|
|
local_ac = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddEffect(&collectibleEffect,1,1)
|
|
;
|
|
}
|
|
bVar4 = HasCollectible(this,0x3b,0);
|
|
itemConfig = extraout_ECX_01;
|
|
if (((bVar4 != 0) &&
|
|
(itemConfig = (g_manager->_itemConfig)._nullItems._begin,
|
|
0x7b < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(itemConfig) >> 2)) &&
|
|
(fVar14 = (itemConfig->_splatColor)._tint[2], fVar14 != 0.0)) {
|
|
nullEffectCooldown = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(fVar14) + 0x78));
|
|
local_c4 = 0;
|
|
local_bc = 0;
|
|
nullEffect = fVar14;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this) + 0x1508)))))->TemporaryEffects::AddEffect(&nullEffect,1,4);
|
|
itemConfig = extraout_ECX_02;
|
|
}
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1b1c)) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1b20)) = g_vectorZero.y;
|
|
GetEnterPosition(itemConfig,&enterPos);
|
|
game = g_game;
|
|
if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) &&
|
|
(uVar6 = g_game->_greedLastBeatenWave, uVar6 < GHIDRA_UINT(g_game->_greedModeWave))) {
|
|
uVar6 = -GHIDRA_UINT((uVar6 != 0)) & uVar6;
|
|
uVar7 = 0xc;
|
|
if (uVar6 < 0xc) {
|
|
uVar7 = uVar6;
|
|
}
|
|
g_game->_greedModeWave = uVar7;
|
|
}
|
|
local_80 = GHIDRA_CAST<float *>((GHIDRA_INT(this) + 0x33c));
|
|
*local_80 = enterPos.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) = enterPos.y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x360)) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x364)) = g_vectorZero.y;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x18a0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1e70)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0;
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) & 0x4000000) != 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x168)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x168));
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) & 0xfbffffff;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x410)) = 1;
|
|
}
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(game->_lastRoomIdx,game->_lastRoomDimensionIdx);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 8)) == 0x10) &&
|
|
((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 0x10000) != 0)) {
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&queryList,0x38f,0,-1,0,0);
|
|
local_8 = 1;
|
|
if (queryList._size != 0) {
|
|
uVar16 = *GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>(queryList._data) + 0x340));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x33c)) = *GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>(queryList._data) + 0x33c));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x340)) = uVar16;
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x54);
|
|
uVar6 = Random();
|
|
local_70 = (undefined1 *)
|
|
((((float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 - 0.5) * 70.0 + 90.0) * 0.017453292);
|
|
local_74 = GHIDRA_CAST<uint *>(sin((float)local_70));
|
|
fVar14 = cos((float)local_70);
|
|
launchVelocity.x = fVar14 * 6.0;
|
|
launchVelocity.y = (float)local_74 * 6.0;
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(0x0));
|
|
(*pcVar2)(&sourceRef,&launchVelocity,0x41900000);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(queryList)) + 0x0))) == '\0') {
|
|
local_8 = 2;
|
|
tracked_alloc(1,queryList._data,0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
}
|
|
bVar4 = HasCollectible(this,0x253,0);
|
|
if (bVar4 != 0) {
|
|
fire_saturnus_tears(this);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x3fc)) != 0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x173)) == '\0')) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x400)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x3fc)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x1398)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x139a)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x410)) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x188)) = 4;
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x189c))) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x410)) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x188)) = 4;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x189c)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x171)) = 1;
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) & 0x2000000) == 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x188)) = 4;
|
|
}
|
|
bVar4 = HasTrinket(this,0x4b,0);
|
|
if ((bVar4 != 0) || (bVar4 = HasTrinket(this,0xa6,0), bVar4 != 0)) {
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0xffff;
|
|
EvaluateItems(this);
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
}
|
|
bVar4 = HasTrinket(this,0x35,0);
|
|
if (((bVar4 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 5)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 1)) != '\0')) {
|
|
unk2 = 0;
|
|
bVar4 = 0;
|
|
iVar5 = GetTrinketMultiplier(this,0x35);
|
|
AddHearts(this,iVar5 * 2,bVar4,unk2);
|
|
}
|
|
bVar4 = HasCollectible(this,0x24e,0);
|
|
if ((bVar4 != 0) && (pvVar8 = g_game->_room, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 8)) == 1)) {
|
|
uVar6 = 0;
|
|
do {
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(pvVar8) + uVar6 * 4 + 0x724));
|
|
if ((door != GHIDRA_CAST<GridEntity_Door *>(0x0)) && (door->_targetRoomType == 1)) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::Open();
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 8);
|
|
}
|
|
bVar4 = HasTrinket(this,0x7c,0);
|
|
if (bVar4 != 0) {
|
|
uVar6 = g_game->_enterDoor;
|
|
if (uVar6 == 0xffffffff) {
|
|
uVar6 = 0;
|
|
do {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + uVar6 * 4 + 0x724));
|
|
if ((iVar5 != 0) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((iVar5 + 0x24)), iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc)),
|
|
fVar15 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c)) - ((float)(iVar5 % iVar10) * 40.0 + 40.0),
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) - ((float)(iVar5 / iVar10) * 40.0 + 120.0),
|
|
fVar14 * fVar14 + fVar15 * fVar15 < 10000.0)) goto LAB_007a75ef;
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 8);
|
|
}
|
|
else {
|
|
LAB_007a75ef:
|
|
if (-1 < GHIDRA_INT(uVar6)) {
|
|
if (GHIDRA_INT(uVar6) < 8) {
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(g_game->_room) + uVar6 * 4 + 0x724));
|
|
iVar5 = GetTrinketMultiplier(this,0x7c);
|
|
if ((door == GHIDRA_CAST<GridEntity_Door *>(0x0)) || ((GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::Open(), iVar5 < 3))
|
|
goto LAB_007a7642;
|
|
if ((GHIDRA_UINT(door->_doorFlags) >> 3 & 1) != 0) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryUnlock(this,1);
|
|
}
|
|
}
|
|
else {
|
|
iVar5 = GetTrinketMultiplier(this,0x7c);
|
|
LAB_007a7642:
|
|
if (iVar5 < 2) goto LAB_007a766b;
|
|
}
|
|
if (g_game->_lastRoomIdx == -5) {
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TrySpawnBossRushDoor(1,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007a766b:
|
|
if (g_game->_isLevelGenerating == 0) {
|
|
spawn_low_health_blood_splat(this);
|
|
}
|
|
bVar4 = HasCollectible(this,0x15e,0);
|
|
if ((bVar4 != 0) && ((*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) {
|
|
cloudColor._tint[0] = 1.0;
|
|
cloudColor._tint[1] = 1.0;
|
|
cloudColor._tint[2] = 1.0;
|
|
cloudColor._tint[3] = 1.0;
|
|
cloudColor._offset[0] = 0.0;
|
|
cloudColor._offset[1] = 0.0;
|
|
cloudColor._offset[2] = 0.0;
|
|
cloudColor._colorize[0] = _DAT_00bac030;
|
|
cloudColor._colorize[1] = _UNK_00bac034;
|
|
cloudColor._colorize[2] = _UNK_00bac038;
|
|
cloudColor._colorize[3] = _UNK_00bac03c;
|
|
(GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>((GHIDRA_INT(g_game->_room) + 0x1618)))))->Game::start_poop_cloud_screen_effect(&cloudColor);
|
|
}
|
|
bVar4 = HasCollectible(this,0x1f9,0);
|
|
if (((bVar4 != 0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 1)) != '\0')) &&
|
|
((*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 6000));
|
|
puVar12 = GHIDRA_CAST<uint *>((iVar5 + 0x1f90));
|
|
uVar6 = *puVar12;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar6 = *puVar12;
|
|
if (uVar6 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1f94)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1f98)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1f9c)) & 0x1f) ^ uVar6;
|
|
*puVar12 = uVar6;
|
|
if (uVar6 == (uVar6 / 5) * 5) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 6000));
|
|
puVar12 = GHIDRA_CAST<uint *>((iVar5 + 0x1f90));
|
|
uVar6 = *puVar12;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar6 = *puVar12;
|
|
if (uVar6 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1f94)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1f98)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((iVar5 + 0x1f9c)) & 0x1f) ^ uVar6;
|
|
*puVar12 = uVar6;
|
|
uVar6 = *GHIDRA_CAST<uint *>((&DAT_00b6bc74 + (uVar6 % 6) * 4));
|
|
uVar7 = Random();
|
|
uVar19 = 0;
|
|
pTVar18 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor;
|
|
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar16 = 0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(uVar6,0,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
spawned = GHIDRA_CAST<Entity *>(__RTDynamicCast(spawned,uVar16,pTVar17,pTVar18,uVar19));
|
|
(GHIDRA_CAST<EntityRef *>((&charmRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((spawned)))->Entity::AddCharmed(&charmRef,-1,0,0);
|
|
spawned->Update();
|
|
(GHIDRA_CAST<Entity *>((spawned)))->Entity::SetVisibleFlag(0);
|
|
manager = g_manager;
|
|
uVar6 = uVar6 << 0x14;
|
|
configKey = uVar6;
|
|
_Find_lower_bound<>(lowerBound,&configKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(configNode) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(configNode) + 0x10)) <= uVar6)) &&
|
|
(configNode != (manager->_entityConfig)._entities._head)) {
|
|
entityConfig = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(configNode) + 0x18));
|
|
}
|
|
else {
|
|
entityConfig = GHIDRA_CAST<EntityConfig_Entity *>(0x0);
|
|
}
|
|
(GHIDRA_CAST<EntityConfig_Entity *>((entityConfig)))->EntityConfig_Entity::GetName(GHIDRA_CAST<std_string *>(entityName),0x14);
|
|
local_8 = 3;
|
|
psVar11 = GHIDRA_CAST<std_string *>(entityName);
|
|
if (0xf < entityNameCapacity) {
|
|
psVar11 = entityName[0];
|
|
}
|
|
format = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#POKE_GO_APPEAR_NOTIFY"));
|
|
sprintf(message,format);
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::show_fortune_line(message,GHIDRA_INT(format),GHIDRA_INT(psVar11));
|
|
local_8 = 0xffffffff;
|
|
if (0xf < entityNameCapacity) {
|
|
uVar6 = entityNameCapacity + 1;
|
|
psVar11 = entityName[0];
|
|
if (0xfff < uVar6) {
|
|
psVar11 = GHIDRA_CAST<std_string *>(entityName[0][-1]._capacity);
|
|
uVar6 = entityNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(entityName[0]) + (-4 - GHIDRA_INT(psVar11))))) {
|
|
LAB_007a7912:
|
|
local_8 = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(psVar11,uVar6);
|
|
}
|
|
entityName[0] = GHIDRA_CAST<std_string *>((GHIDRA_UINT(entityName[0]) & 0xffffff00));
|
|
}
|
|
}
|
|
bVar4 = HasCollectible(this,0x1bd,0);
|
|
game = g_game;
|
|
if (bVar4 != 0) {
|
|
local_70 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(g_game->_room) + 0x724));
|
|
uVar6 = 0;
|
|
do {
|
|
iVar5 = *GHIDRA_CAST<int *>((local_70 + uVar6 * 4));
|
|
if (((iVar5 != 0) && (*GHIDRA_CAST<int *>((iVar5 + 0xc)) != 2)) &&
|
|
((*GHIDRA_CAST<int *>((iVar5 + 0x160)) == 7 || (*GHIDRA_CAST<int *>((iVar5 + 0x160)) == 8)))) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(*GHIDRA_CAST<int *>((iVar5 + 0x394)),-1);
|
|
manager = g_manager;
|
|
if (roomDesc->VisitedCount == 0) {
|
|
if ((*GHIDRA_CAST<undefined1 **>((GHIDRA_CAST<char *>(this) + 0x1b24)) != GHIDRA_CAST<undefined1 *>(0x0)) &&
|
|
(0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b2c)))) {
|
|
local_74 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(this) + 0x1b28));
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b30));
|
|
local_70 = *GHIDRA_CAST<undefined1 **>((GHIDRA_CAST<char *>(this) + 0x1b24));
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_70));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_70),(float)local_74,iVar5,0,1.0,0.0);
|
|
}
|
|
game = g_game;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b24)) = 0x1ba;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b28)) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b2c)) = 0x1e;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b30)) = 2;
|
|
break;
|
|
}
|
|
game = g_game;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 8);
|
|
manager = g_manager;
|
|
if (((((((game->_levelStateFlags & 0x2000U) == 0) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x768)), -1 < iVar5)) && (iVar5 < 0x1c0)) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + iVar5 * 4 + 0x24)), iVar5 != 0)) &&
|
|
((iVar10 = *GHIDRA_CAST<int *>((iVar5 + 4)), iVar10 == 2 ||
|
|
((iVar10 != 3 &&
|
|
((((iVar10 == 4 || (iVar10 == 5)) || ((iVar10 == 6 || (iVar10 == 0x16)))) ||
|
|
((iVar10 != 0x18 && (((iVar10 == 0x19 || (iVar10 == 0x1a)) || (iVar10 == 0x1b))))))))))))
|
|
&& (*GHIDRA_CAST<int *>((iVar5 + 0xc)) != 2)) {
|
|
if ((*GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(this) + 0x1b24)) != GHIDRA_CAST<uint *>(0x0)) && (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b2c)))) {
|
|
local_78 = *GHIDRA_CAST<EntityPtr **>((GHIDRA_CAST<char *>(this) + 0x1b28));
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b30));
|
|
local_74 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(this) + 0x1b24));
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_74));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_74),(float)local_78,iVar5,0,1.0,0.0);
|
|
game = g_game;
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b24)) = 0x1b9;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b28)) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b2c)) = 0x3c;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b30)) = 2;
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x44)) & 1) == 0) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(game->_room) + 1)) != '\0')) {
|
|
spawn_locusts(this);
|
|
game = g_game;
|
|
}
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c));
|
|
if (iVar5 == 1) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0x1b10)) = 1;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1aec)) != 0x3a) goto LAB_007a7cd9;
|
|
followedPlayer = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc));
|
|
if ((followedPlayer == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(followedPlayer) + 0x28)) != 1)) {
|
|
pEVar13 = (game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(pEVar13) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pEVar13 = (game->_playerManager)._playerList._begin;
|
|
}
|
|
followedPlayer = *pEVar13;
|
|
}
|
|
uVar6 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x72,GHIDRA_CAST<Vector *>((GHIDRA_INT(followedPlayer) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),0,uVar6);
|
|
if (spawned->_child != (EntityPtr)0x0) {
|
|
local_78 = &spawned->_child;
|
|
std::multiset<unsigned_int>::erase(&local_78);
|
|
}
|
|
spawned->_child = followedPlayer;
|
|
if (followedPlayer != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::insert(&spawned->_child);
|
|
}
|
|
pEVar13 = &spawned->_target;
|
|
if (spawned->_target != (EntityPtr)0x0) {
|
|
local_78 = pEVar13;
|
|
std::multiset<unsigned_int>::erase(&local_78);
|
|
}
|
|
*pEVar13 = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(pEVar13);
|
|
iVar5 = *GHIDRA_CAST<int *>(spawned);
|
|
pAVar3 = &spawned[1]._sprite;
|
|
(pAVar3->_animDefaultName)._buf[8] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[9] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[10] = -0x10;
|
|
(pAVar3->_animDefaultName)._buf[0xb] = 'B';
|
|
(**(code **)(iVar5 + 0xc))();
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c));
|
|
game = g_game;
|
|
}
|
|
if ((iVar5 == 0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(game->_room) + 1)) != '\0')) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1820)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1820)) + 1;
|
|
bVar4 = HasCollectible(this,0x151,0);
|
|
if ((bVar4 != 0) && ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1820)) & 3) == 0)) {
|
|
pRVar1 = g_game->_room;
|
|
uVar6 = Random();
|
|
manager = g_manager;
|
|
pRVar1->_brokenWatchState = 2 - GHIDRA_UINT((uVar6 % 10 != 0));
|
|
fVar14 = (GHIDRA_CAST<Room *>((pRVar1)))->Room::time_scale_update();
|
|
(manager->_musicManager)._targetPitch = fVar14;
|
|
}
|
|
game = g_game;
|
|
}
|
|
LAB_007a7cd9:
|
|
if ((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x3bc)) != 0)) &&
|
|
(roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(game->_currentRoomIdx,-1),
|
|
roomDesc->ListIndex == g_game->_lastBossRoomListIdx)) && (g_game->_stage == 6)) {
|
|
uVar16 = *GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x3bc)) + 0x340));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x33c)) = *GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x3bc)) + 0x33c));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x340)) = uVar16;
|
|
}
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x13e0));
|
|
iVar5 = 4;
|
|
do {
|
|
if (GHIDRA_CAST<int *>(*piVar9) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*piVar9) + 0x2c))();
|
|
}
|
|
piVar9 = piVar9 + 1;
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x13dc)) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x13dc)) + 0x2c))();
|
|
}
|
|
pRVar1 = g_game->_room;
|
|
iVar10 = GHIDRA_INT(((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c)) - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) - 120.0) / 40.0 + 0.5));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x1570)) == '\0') {
|
|
if (((((-1 < iVar10) && (iVar10 < pRVar1->_gridWidth)) &&
|
|
((-1 < iVar5 &&
|
|
((iVar5 < pRVar1->_gridHeight &&
|
|
(uVar6 = pRVar1->_gridWidth * iVar5 + iVar10, uVar6 < 0x1c0)))))) &&
|
|
(pRVar1->_gridEntities[uVar6] != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT(pRVar1->_gridEntities[uVar6]) + 4)) == 0xe)) {
|
|
(GHIDRA_CAST<Room *>((pRVar1)))->Room::RemoveGridEntity(pRVar1->_gridWidth * iVar5 + iVar10,900,1);
|
|
}
|
|
}
|
|
else if ((((-1 < iVar10) && (iVar10 < pRVar1->_gridWidth)) && (-1 < iVar5)) &&
|
|
(((iVar5 < pRVar1->_gridHeight &&
|
|
(uVar6 = pRVar1->_gridWidth * iVar5 + iVar10, uVar6 < 0x1c0)) &&
|
|
(((pvVar8 = pRVar1->_gridEntities[uVar6], pvVar8 != (void *)0x0 &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 4)) == 0xe && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 8)) == 1)))) &&
|
|
(iVar5 = __RTDynamicCast(pvVar8,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor
|
|
,&IsaacRepentancePlus::GridEntity_Poop::RTTI_Type_Descriptor,0)
|
|
, *GHIDRA_CAST<int *>((iVar5 + 8)) == 1)))))) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0xc)) = 1000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x154)) = 0x78;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x3c)) = 0;
|
|
pvVar8 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar5 + 0x40)))))->ANM2::GetAnimationData(GHIDRA_CAST<byte *>("State5"));
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x30));
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar5 + 0x40)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("State5"),1);
|
|
if (((bVar4 != 0) && (*GHIDRA_CAST<int *>((iVar5 + 0x74)) != 0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((iVar5 + 0x70)))))->AnimationState::SetFrameFloat((float)iVar10),
|
|
*GHIDRA_CAST<int *>((iVar5 + 0x74)) != 0)) {
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x84)) = 0;
|
|
}
|
|
}
|
|
pvVar8 = g_game->_room;
|
|
if (g_game->_enterDoor + 1U < 9) {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + g_game->_enterDoor * 4 + 0x724));
|
|
}
|
|
else {
|
|
iVar5 = 0;
|
|
}
|
|
local_7c = pvVar8;
|
|
uVar6 = Random();
|
|
fVar14 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_78 = GHIDRA_CAST<EntityPtr *>((fVar14 + fVar14));
|
|
local_74 = GHIDRA_CAST<uint *>(cos((float)local_78));
|
|
local_70 = GHIDRA_CAST<undefined1 *>(sin((float)local_78));
|
|
playerPos = local_80;
|
|
if (iVar5 != 0) {
|
|
switch(*GHIDRA_CAST<undefined4 *>((iVar5 + 0x164))) {
|
|
case 0:
|
|
local_74 = GHIDRA_CAST<uint *>(0x3f800000);
|
|
local_70 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
break;
|
|
case 1:
|
|
local_74 = GHIDRA_CAST<uint *>(0x0);
|
|
local_70 = GHIDRA_CAST<undefined1 *>(0x3f800000);
|
|
break;
|
|
case 2:
|
|
local_74 = GHIDRA_CAST<uint *>(&DAT_bf800000);
|
|
local_70 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
break;
|
|
case 3:
|
|
local_74 = GHIDRA_CAST<uint *>(0x0);
|
|
local_70 = &DAT_bf800000;
|
|
}
|
|
}
|
|
uVar6 = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1254)) != 0) {
|
|
do {
|
|
if ((g_game->_isRestoringGlowingHourglassState == 0) ||
|
|
(piVar9 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x124c)) + uVar6 * 4)), piVar9[10] != 0x322)) {
|
|
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x124c)) + uVar6 * 4));
|
|
if (((*GHIDRA_CAST<uint *>((iVar5 + 0x168)) & 0x20000000) != 0) &&
|
|
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 1)) ||
|
|
(*GHIDRA_CAST<int *>((iVar5 + 0x28)) - 10U < 0x3de)))) {
|
|
piVar9 = GHIDRA_CAST<int *>(__RTDynamicCast(iVar5,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
|
|
,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0))
|
|
;
|
|
uVar7 = Random();
|
|
local_80 = GHIDRA_CAST<float *>(((float)GHIDRA_INT((uVar7 % 0x5a - 0x2d)) * 0.017453292));
|
|
local_78 = GHIDRA_CAST<EntityPtr *>(cos((float)local_80));
|
|
fVar14 = sin((float)local_80);
|
|
local_80 = GHIDRA_CAST<float *>(((float)local_78 * (float)local_74 - fVar14 * (float)local_70));
|
|
local_78 = GHIDRA_CAST<EntityPtr *>((fVar14 * (float)local_74 + (float)local_78 * (float)local_70));
|
|
uVar7 = Random();
|
|
iVar5 = piVar9[10];
|
|
fVar14 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 10.0;
|
|
if (((iVar5 == 0x24) || (iVar5 == 0x106)) || (iVar5 == 0x107)) {
|
|
fVar14 = (float)piVar9[0xdc];
|
|
}
|
|
fVar15 = (float)piVar9[0xce];
|
|
targetX = (float)piVar9[0xcd];
|
|
enemyPosX = (float)local_80 * fVar14 + *playerPos;
|
|
fVar14 = (float)local_78 * fVar14 + playerPos[1];
|
|
if (3600.0 < targetX * targetX + fVar15 * fVar15) {
|
|
piVar9[0xcd] = GHIDRA_INT(((targetX - (float)piVar9[0xcf]) + enemyPosX));
|
|
piVar9[0xce] = GHIDRA_INT(((fVar15 - (float)piVar9[0xd0]) + fVar14));
|
|
}
|
|
piVar9[0xcf] = GHIDRA_INT(enemyPosX);
|
|
piVar9[0xd0] = GHIDRA_INT(fVar14);
|
|
piVar9[0x106] = GHIDRA_INT(g_vectorZero.x);
|
|
piVar9[0x107] = GHIDRA_INT(g_vectorZero.y);
|
|
piVar9[0x108] = GHIDRA_INT(g_vectorZero.x);
|
|
piVar9[0x109] = GHIDRA_INT(g_vectorZero.y);
|
|
if (piVar9[10] == 0x1e) {
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
piVar9[0xcd] = piVar9[0xcf];
|
|
piVar9[0xce] = piVar9[0xd0];
|
|
}
|
|
pvVar8 = local_7c;
|
|
}
|
|
}
|
|
else {
|
|
(**(code **)(*piVar9 + 0x28))();
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar8) + 0x1254)));
|
|
this = GHIDRA_CAST<Entity_Player *>(local_90);
|
|
}
|
|
bVar4 = HasTrinket(this,0x5d,0);
|
|
if (((bVar4 != 0) &&
|
|
(pvVar8 = g_game->_room, (*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 4)) + 0x44)) & 1) == 0)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar8) + 1)) != '\0')) {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x12c4)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x12c0));
|
|
iVar5 = 0;
|
|
if (0 < iVar10) {
|
|
iVar5 = iVar10;
|
|
}
|
|
if (((0 < iVar5) && (g_game->_isRestoringGlowingHourglassState == 0)) &&
|
|
(iVar5 = GetTrinketMultiplier(this,0x5d), 0 < iVar5)) {
|
|
do {
|
|
AddBlueFlies(this,1,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),GHIDRA_CAST<Entity *>(0x0));
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
}
|
|
}
|
|
bVar4 = HasTrinket(this,0xb0,0);
|
|
if (bVar4 != 0) {
|
|
spawn_lil_clot_familiars(this);
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x11) {
|
|
spawn_forgotten_body(this);
|
|
}
|
|
preload_item_sounds(this);
|
|
node = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(this) + 0x1b34));
|
|
*GHIDRA_CAST<undefined4 *>(node[1]) = 0;
|
|
node = GHIDRA_CAST<undefined4 *>(*node);
|
|
while (node != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
/* WARNING: Read-only address (ram,0x00bac030) is written */
|
|
nextNode = GHIDRA_CAST<undefined4 *>(*node);
|
|
operator_delete(node,0x28);
|
|
node = nextNode;
|
|
}
|
|
/* WARNING: Read-only address (ram,0x00bac030) is written */
|
|
*GHIDRA_CAST<undefined4 *>(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b34))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b34));
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b34)) + 4)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1b34));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b38)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1b3c)) = **GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(this) + 0x1b34));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1c54)) = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1c5c)) != 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1c60)) = **GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(this) + 0x1c58));
|
|
}
|
|
/* WARNING: Read-only address (ram,0x00bac030) is written */
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007a8350
|
|
void Entity_Player::TriggerNewRoom_TemporaryEffects()
|
|
{
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
char isCrownActive;
|
|
int iVar3;
|
|
uint uVar4;
|
|
ItemConfig_Item *item;
|
|
RoomDescriptor *roomDesc;
|
|
void *pvVar5;
|
|
int trinketMultiplier;
|
|
int *effectIter;
|
|
Game *game;
|
|
uint *trinketSeed;
|
|
int local_38 [8];
|
|
RNG RStack_18;
|
|
uint local_8;
|
|
char *crownAnim;
|
|
uint levelEffectItemId;
|
|
Manager *manager;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((local_38 + 0xd));
|
|
bVar2 = HasTrinket(this,0x20,0);
|
|
if (bVar2 != 0) {
|
|
iVar3 = GetTrinketMultiplier(this,0x20);
|
|
if ((GHIDRA_INT((4 / (longlong)iVar3)) == 0) ||
|
|
(uVar4 = Random(), GHIDRA_INT(((ulonglong)uVar4 % (4 / (longlong)iVar3 & 0xffffffffU))) == 0)) {
|
|
pvVar5 = (this->_trinketRNGs)._begin;
|
|
trinketSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar5) + 0x200));
|
|
local_38[6] = 0xc;
|
|
local_38[7] = 0x47;
|
|
RStack_18._seed = 0x79;
|
|
RStack_18._shift1 = 0x78;
|
|
RStack_18._shift2 = 0x156;
|
|
RStack_18._shift3 = 0x18e;
|
|
uVar4 = *trinketSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *trinketSeed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x204)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x208)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x20c)) & 0x1f) ^ uVar4;
|
|
*trinketSeed = uVar4;
|
|
RStack_18._seed =
|
|
GHIDRA_INT((GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig)::GetCollectible(local_38[uVar4 % 6 + 6]);
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT((GHIDRA_CAST<ItemConfig_Item *>(RStack_18._seed))->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
}
|
|
bVar2 = HasTrinket(this,0x84,0);
|
|
if (bVar2 != 0) {
|
|
iVar3 = GetTrinketMultiplier(this,0x84);
|
|
if ((GHIDRA_INT((4 / (longlong)iVar3)) == 0) ||
|
|
(uVar4 = Random(), GHIDRA_INT(((ulonglong)uVar4 % (4 / (longlong)iVar3 & 0xffffffffU))) == 0)) {
|
|
add_random_drug_item_effect(this);
|
|
}
|
|
}
|
|
bVar2 = HasTrinket(this,0x99,0);
|
|
if (bVar2 != 0) {
|
|
iVar3 = GetTrinketMultiplier(this,0x99);
|
|
if ((GHIDRA_INT((4 / (longlong)iVar3)) == 0) ||
|
|
(uVar4 = Random(), GHIDRA_INT(((ulonglong)uVar4 % (4 / (longlong)iVar3 & 0xffffffffU))) == 0)) {
|
|
AddRandomMomItemEffect(this);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x2a1,0);
|
|
if (bVar2 != 0) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4));
|
|
if ((((iVar3 != 0) && (*GHIDRA_CAST<int *>((iVar3 + 0x40)) == 1)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0xe || ((*GHIDRA_CAST<uint *>((iVar3 + 0x44)) >> 0xb & 1) != 0))))
|
|
&& (bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x2a1),
|
|
bVar2 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x2a1,1,1);
|
|
}
|
|
}
|
|
iVar3 = this->_modelingClayEffect;
|
|
this->_modelingClayEffect = 0;
|
|
if (iVar3 != 0) {
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar3);
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
this->_cacheFlags = this->_cacheFlags | item->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
TryRemoveCollectibleCostume(this,iVar3,0);
|
|
}
|
|
bVar2 = HasTrinket(this,0xa6,0);
|
|
if (bVar2 != 0) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1);
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(roomDesc->SpawnSeed) != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
RStack_18._shift1 = 7;
|
|
RStack_18._shift2 = 0x11;
|
|
RStack_18._shift3 = 0x15;
|
|
RStack_18._seed = roomDesc->SpawnSeed;
|
|
iVar3 = GetTrinketMultiplier(this,0xa6);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&RStack_18)))->RNG::RandomInt(GHIDRA_UINT((2 / (longlong)iVar3)));
|
|
if (uVar4 == 0) {
|
|
ModelingClay_roll(this,&RStack_18);
|
|
}
|
|
}
|
|
}
|
|
if (this->_holyMantleState == 0) {
|
|
bVar2 = HasCollectible(this,0x139,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x139), bVar2 == 0))
|
|
{
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x139,1,1);
|
|
}
|
|
bVar2 = HasCollectible(this,0x217,0);
|
|
if ((bVar2 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 5)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x139,1,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x217,1,1);
|
|
}
|
|
}
|
|
else {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x4e4 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU))
|
|
) && (item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x4e4)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(&RStack_18,1);
|
|
}
|
|
manager = g_manager;
|
|
if ((((this->_temporaryeffects)._disabled != 0) ||
|
|
(pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x139),
|
|
pvVar5 == (void *)0x0)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 4)) < 1)) {
|
|
pvVar5 = (manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0x4e5)
|
|
{
|
|
RemoveCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
}
|
|
else {
|
|
RemoveCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x4e4)));
|
|
}
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,299,0);
|
|
if ((bVar2 != 0) || (iVar3 = GetZodiacEffect(this), iVar3 == 299)) {
|
|
this->_taurusSpeedBonus = 0.0;
|
|
local_38[5] = 0;
|
|
local_38[6] = 0;
|
|
local_38[7] = 0;
|
|
RStack_18._seed = 0;
|
|
RStack_18._shift1 = 0;
|
|
RStack_18._shift2 = 0;
|
|
RStack_18._shift3 = 0;
|
|
local_38[1] = 0x3f800000;
|
|
local_38[2] = 0x3f800000;
|
|
local_38[3] = 0x3f800000;
|
|
local_38[4] = 0x3f800000;
|
|
this->SetColor(local_38 + 1,0xffffffff,0xff,0,1);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 1)) != '\0') &&
|
|
((pvVar5 = (g_manager->_itemConfig)._collectibles._begin,
|
|
0x4ac < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU))
|
|
&& (item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x4ac)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x7a,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x7a), bVar2 == 0)) {
|
|
TryRemoveCollectibleCostume(this,0x7a,0);
|
|
if ((this->_redHearts < 2) ||
|
|
((this->_playerType == 5 &&
|
|
((this->_redHearts < 3 || (bVar2 = HasCollectible(this,0x26b,0), bVar2 != 0)))))) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x7a,1,1);
|
|
}
|
|
}
|
|
bVar2 = HasTrinket(this,0x21,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(100), bVar2 == 0)) {
|
|
trinketMultiplier = GetTrinketMultiplier(this,0x21);
|
|
iVar3 = 1;
|
|
if (trinketMultiplier == 2) {
|
|
iVar3 = 2;
|
|
}
|
|
else if (2 < trinketMultiplier) {
|
|
iVar3 = 3;
|
|
}
|
|
if (this->_redHearts <= iVar3) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(100,1,1);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x199,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x199), bVar2 == 0)) {
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0x49) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x48));
|
|
}
|
|
RemoveCostume(this,item);
|
|
if (this->_redHearts < 1) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x199,1,1);
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0x49) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x48));
|
|
}
|
|
AddCostume(this,item,0);
|
|
}
|
|
}
|
|
bVar2 = HasCollectible(this,0x8e,0);
|
|
if (((bVar2 != 0) &&
|
|
(pvVar5 = (g_manager->_itemConfig)._collectibles._begin,
|
|
0x238 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU))))
|
|
&& (item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x238)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
bVar2 = HasCollectible(this,0x197,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x197), bVar2 == 0)) {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x65c < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU))
|
|
) && (item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x65c)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0x45) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x44));
|
|
}
|
|
AddCostume(this,item,0);
|
|
update_purity_glow(this);
|
|
}
|
|
bVar2 = HasCollectible(this,0x19f,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x19f), bVar2 == 0)) {
|
|
bVar2 = HasFullHearts(this);
|
|
if (bVar2 == 0) {
|
|
crownAnim = "FloatNoGlow";
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x19f,1,1);
|
|
crownAnim = "FloatGlow";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_crownOfLightSprite)))->ANM2::Play(GHIDRA_CAST<byte *>(crownAnim),0);
|
|
}
|
|
bVar2 = HasCollectible(this,0x1ba,0);
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba), bVar2 == 0)) {
|
|
isCrownActive = FUN_007db360();
|
|
if (isCrownActive == '\0') {
|
|
crownAnim = "FloatNoGlow";
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1ba,1,1);
|
|
crownAnim = "FloatGlow";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_darkPrincesCrownSprite)))->ANM2::Play(GHIDRA_CAST<byte *>(crownAnim),0);
|
|
}
|
|
iVar3 = 0;
|
|
if ((this->_holyMantleStacks & 0xf0) != 0) {
|
|
do {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x4e4 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) &
|
|
0xfffffffcU))) &&
|
|
(item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x4e4)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
iVar3 = iVar3 + 1;
|
|
} while (iVar3 < GHIDRA_INT(GHIDRA_UINT((this->_holyMantleStacks >> 4))));
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (effectIter = (this->_temporaryeffects)._effects._begin;
|
|
effectIter != (this->_temporaryeffects)._effects._end; effectIter = effectIter + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*effectIter) == 0) && ((GHIDRA_CAST<int *>(*effectIter))[1] == 0x2e)) {
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x4e4 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) &
|
|
0xfffffffcU))) &&
|
|
(item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x4e4)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if ((((this->_variant == 0) && (bVar2 = HasCollectible(this,0x1f1,0), bVar2 != 0)) &&
|
|
(pvVar5 = (g_manager->_itemConfig)._collectibles._begin,
|
|
0x7c4 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU))))
|
|
&& (item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0x7c4)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
bVar2 = HasCollectible(this,0x24c,0);
|
|
if (bVar2 != 0) {
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (effectIter = (this->_temporaryeffects)._effects._begin;
|
|
effectIter != (this->_temporaryeffects)._effects._end; effectIter = effectIter + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*effectIter) == 0) && ((GHIDRA_CAST<int *>(*effectIter))[1] == 0x38)) goto LAB_007a8d7b;
|
|
}
|
|
}
|
|
pvVar5 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0xe1) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0xe0));
|
|
}
|
|
RemoveCostume(this,item);
|
|
if (((-1 < g_game->_lastBossRoomListIdx) &&
|
|
((g_game->_roomList[g_game->_lastBossRoomListIdx].Flags & 1) != 0)) &&
|
|
((pvVar5 = (g_manager->_itemConfig)._nullItems._begin,
|
|
0xe0 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) &&
|
|
(item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0xe0)), item != GHIDRA_CAST<ItemConfig_Item *>(0x0))))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
}
|
|
}
|
|
LAB_007a8d7b:
|
|
if ((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) {
|
|
uVar4 = 0;
|
|
pvVar5 = (this->_levelEffectItems)._begin;
|
|
game = g_game;
|
|
if (GHIDRA_INT((this->_levelEffectItems)._end) - GHIDRA_INT(pvVar5) >> 2 != 0) {
|
|
do {
|
|
levelEffectItemId = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar5) + uVar4 * 4));
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(levelEffectItemId)) goto LAB_007a8dea;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(levelEffectItemId) < 0) {
|
|
if ((GHIDRA_INT(levelEffectItemId) < 0) &&
|
|
(pvVar5 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~levelEffectItemId) <
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar5) >> 2)) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar5) + ~levelEffectItemId * 4)));
|
|
}
|
|
else {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_007a8dea:
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) >> 2 <=
|
|
GHIDRA_INT(levelEffectItemId)) goto LAB_007a8e36;
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + levelEffectItemId * 4));
|
|
}
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(RStack_18)) + 0x4))) = (ulonglong)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
RStack_18._shift3 = 0;
|
|
RStack_18._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&RStack_18,1,1);
|
|
game = g_game;
|
|
}
|
|
}
|
|
LAB_007a8e36:
|
|
uVar4 = uVar4 + 1;
|
|
pvVar5 = (this->_levelEffectItems)._begin;
|
|
} while (uVar4 < GHIDRA_UINT((GHIDRA_INT((this->_levelEffectItems)._end) - GHIDRA_INT(pvVar5) >> 2)));
|
|
}
|
|
}
|
|
bVar2 = HasTrinket(this,0x9a,0);
|
|
if ((bVar2 != 0) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x40)) == 1)) {
|
|
pvVar5 = (this->_trinketRNGs)._begin;
|
|
trinketSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar5) + 0x9a0));
|
|
uVar4 = *trinketSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *trinketSeed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x9a4)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x9a8)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0x9ac)) & 0x1f) ^ uVar4;
|
|
*trinketSeed = uVar4;
|
|
iVar3 = GetTrinketMultiplier(this,0x9a);
|
|
if (GHIDRA_INT((uVar4 & 1)) < iVar3) {
|
|
pvVar5 = (this->_trinketRNGs)._begin;
|
|
trinketSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar5) + 0xb70));
|
|
uVar4 = *trinketSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *trinketSeed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0xb74)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0xb78)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + 0xb7c)) & 0x1f) ^ uVar4;
|
|
*trinketSeed = uVar4;
|
|
iVar3 = *GHIDRA_CAST<int *>((&DAT_00b1f450 + (uVar4 % 10) * 4));
|
|
SetPocketActiveItem(this,iVar3,3,1);
|
|
AnimateCollectible(this,iVar3,GHIDRA_CAST<byte *>("UseItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
manager = g_manager;
|
|
local_38[0] = 0xfc;
|
|
seed_fart_sound_override(local_38);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_38[0],1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
this->_holyMantleState = 1 < this->_holyMantleState;
|
|
return;
|
|
}
|
|
|
|
// 007a8fd0
|
|
void Entity_Player::TriggerRoomClear()
|
|
{
|
|
void **ppvVar1;
|
|
int iVar2;
|
|
code *pcVar3;
|
|
int iVar4;
|
|
RNG rng;
|
|
byte bVar5;
|
|
int iVar6;
|
|
EntityPtr EVar7;
|
|
Entity *spawnedEntity;
|
|
uint uVar8;
|
|
int *piVar9;
|
|
ItemConfig_Item *itemConfig;
|
|
WeightedOutcomePicker WVar10;
|
|
int *effect;
|
|
qword *allocatedBytes;
|
|
uint *puVar11;
|
|
void *pvVar12;
|
|
uint uVar13;
|
|
Game *pGVar14;
|
|
float fVar15;
|
|
undefined4 uVar16;
|
|
TypeDescriptor *pTVar17;
|
|
Vector *position;
|
|
TypeDescriptor *pTVar18;
|
|
byte bVar19;
|
|
undefined4 uVar20;
|
|
undefined4 local_98;
|
|
undefined4 local_94;
|
|
undefined4 local_90;
|
|
undefined4 local_8c;
|
|
undefined4 local_88;
|
|
undefined4 local_84;
|
|
Vector local_80;
|
|
Entity_Player *player;
|
|
Vector local_74;
|
|
undefined4 local_6c;
|
|
uint *local_68;
|
|
undefined4 local_64;
|
|
undefined4 local_60;
|
|
TemporaryEffects *local_5c;
|
|
Game *local_58;
|
|
EntityList_EL local_54;
|
|
EntityPtr local_44;
|
|
undefined1 local_40 [8];
|
|
float fStack_38;
|
|
float fStack_34;
|
|
float local_30;
|
|
float fStack_2c;
|
|
float fStack_28;
|
|
float fStack_24;
|
|
float local_20;
|
|
float local_1c;
|
|
float local_18;
|
|
uint stackCookie;
|
|
void *prevExceptionList;
|
|
undefined1 *puStack_c;
|
|
undefined4 ehState;
|
|
Entity_Player *effectsOwner;
|
|
Entity_Familiar *familiar;
|
|
Manager *manager;
|
|
qword prevAllocatedBytes;
|
|
void *trinketRngs;
|
|
|
|
ehState = 0xffffffff;
|
|
puStack_c = &LAB_00affa55;
|
|
prevExceptionList = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((local_40 + 0x3c));
|
|
ExceptionList = &prevExceptionList;
|
|
player = this;
|
|
bVar5 = HasTrinket(this,0x8f,0);
|
|
if ((bVar5 == 0) && (bVar5 = HasCollectible(this,0x287,0), bVar5 == 0)) {
|
|
local_60 = GHIDRA_CAST<uint *>(0x0);
|
|
do {
|
|
puVar11 = local_60;
|
|
local_5c = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT((local_60 + 0x2b)) * 0x20));
|
|
uVar13 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&local_5c->_cacheFlags) + GHIDRA_INT(this)));
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar13)) goto LAB_007a907b;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar13) < 0) {
|
|
if ((GHIDRA_INT(uVar13) < 0) &&
|
|
(pvVar12 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar13) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar12) >> 2)) {
|
|
iVar6 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar12) + ~uVar13 * 4));
|
|
}
|
|
else {
|
|
iVar6 = 0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007a907b:
|
|
pvVar12 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar12) >> 2 <= GHIDRA_INT(uVar13))
|
|
goto LAB_007a9338;
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + uVar13 * 4));
|
|
}
|
|
if (iVar6 != 0) {
|
|
iVar6 = GetActiveMaxCharge(this,GHIDRA_INT(local_60));
|
|
if (iVar6 == 0) {
|
|
puVar11 = GHIDRA_CAST<uint *>(0x1);
|
|
local_68 = GHIDRA_CAST<uint *>(0x1);
|
|
if ((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) != 0x11) &&
|
|
(iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)), iVar6 != 0)) &&
|
|
(iVar6 = *GHIDRA_CAST<int *>((iVar6 + 0x10)), iVar6 != 0)) &&
|
|
(((iVar6 = *GHIDRA_CAST<int *>((iVar6 + 0x48)), iVar6 == 8 || (iVar6 == 0xb)) ||
|
|
((iVar6 == 0xc || ((iVar6 == 9 || (iVar6 == 10)))))))) {
|
|
puVar11 = GHIDRA_CAST<uint *>(0x2);
|
|
local_68 = GHIDRA_CAST<uint *>(0x2);
|
|
}
|
|
EVar7 = (EntityPtr)GetTrinketMultiplier(this,0x48);
|
|
local_44 = (EntityPtr)0x10;
|
|
if (GHIDRA_INT(EVar7) < 0x10) {
|
|
local_44 = EVar7;
|
|
}
|
|
if (0 < GHIDRA_INT(local_44)) {
|
|
do {
|
|
pvVar12 = (this->_trinketRNGs)._end;
|
|
if (GHIDRA_INT(pvVar12) - GHIDRA_INT((this->_trinketRNGs)._begin) >> 4 < 0x49) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Trinket ID out of bounds!\n"));
|
|
pvVar12 = (this->_trinketRNGs)._end;
|
|
}
|
|
trinketRngs = (this->_trinketRNGs)._begin;
|
|
uVar13 = (GHIDRA_INT(pvVar12) - GHIDRA_INT(trinketRngs) >> 4) - 1;
|
|
if (0x48 < uVar13) {
|
|
uVar13 = 0x48;
|
|
}
|
|
puVar11 = GHIDRA_CAST<uint *>((uVar13 * 0x10 + GHIDRA_INT(trinketRngs)));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)puVar11[1] & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 << ((byte)puVar11[2] & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 >> ((byte)puVar11[3] & 0x1f) ^ uVar13;
|
|
*puVar11 = uVar13;
|
|
if (uVar13 % 0x14 == 0) {
|
|
iVar6 = GetTrinketMultiplier(this,0x48);
|
|
local_68 = GHIDRA_CAST<uint *>((GHIDRA_INT(local_68) + iVar6));
|
|
}
|
|
local_44 = (EntityPtr)(GHIDRA_INT(local_44) + -1);
|
|
} while (0 < GHIDRA_INT(local_44));
|
|
puVar11 = local_68;
|
|
}
|
|
if (local_60 == GHIDRA_CAST<uint *>(0x3)) {
|
|
local_68 = GHIDRA_CAST<uint *>(0x0);
|
|
}
|
|
else if (((local_60 == GHIDRA_CAST<uint *>(0x2)) && (this->_activeDesc[2]._item == 0x244)) &&
|
|
(g_game->_challenge == 0x2c)) {
|
|
local_68 = GHIDRA_CAST<uint *>(0x0);
|
|
}
|
|
else {
|
|
local_68 = GHIDRA_CAST<uint *>(GetCollectibleMaxCharge)
|
|
(this,*GHIDRA_CAST<int *>((GHIDRA_INT(&local_5c->_cacheFlags) + GHIDRA_INT(this))),
|
|
this->_activeDesc[GHIDRA_INT(local_60)]._varData,GHIDRA_INT(local_60))
|
|
;
|
|
}
|
|
EVar7 = (EntityPtr)GetTrinketMultiplier(this,3);
|
|
local_44 = (EntityPtr)0x3;
|
|
if (GHIDRA_INT(EVar7) < 3) {
|
|
local_44 = EVar7;
|
|
}
|
|
if ((GHIDRA_INT(local_44) < 1) ||
|
|
(this->_activeDesc[GHIDRA_INT(local_60)]._charge + GHIDRA_INT(puVar11) <
|
|
GHIDRA_INT(local_68) - GHIDRA_INT(local_44))) {
|
|
AddActiveCharge(this,GHIDRA_INT(puVar11),GHIDRA_INT(local_60),0,0,0);
|
|
}
|
|
else {
|
|
iVar6 = AddActiveCharge(this,GHIDRA_INT(local_44) + GHIDRA_INT(puVar11),GHIDRA_INT(local_60),0,0,0);
|
|
manager = g_manager;
|
|
if (iVar6 != 0) {
|
|
local_44 = (EntityPtr)0xaa;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_44));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_44),1.0,2,0,1.0,0.0);
|
|
uVar13 = Random();
|
|
uVar20 = 0;
|
|
pTVar18 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar16 = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar13);
|
|
iVar6 = __RTDynamicCast(spawnedEntity,uVar16,pTVar17,pTVar18,uVar20);
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0x358)) = 0x3f800000;
|
|
puVar11 = local_60;
|
|
goto LAB_007a9338;
|
|
}
|
|
}
|
|
puVar11 = local_60;
|
|
}
|
|
else if (iVar6 == 1) {
|
|
FullCharge(this,GHIDRA_INT(puVar11),0,0);
|
|
}
|
|
}
|
|
}
|
|
LAB_007a9338:
|
|
local_60 = GHIDRA_CAST<uint *>((GHIDRA_INT(puVar11) + 1));
|
|
} while (local_60 < &DAT_00000004);
|
|
}
|
|
bVar5 = HasTrinket(this,0x2e,0);
|
|
if (bVar5 != 0) {
|
|
uVar13 = 10 - GHIDRA_INT((this->_luck * 0.5));
|
|
if (GHIDRA_INT(uVar13) < 1) {
|
|
uVar13 = 1;
|
|
}
|
|
if ((uVar13 == 0) || (uVar8 = Random(), uVar8 % uVar13 == 0)) {
|
|
bVar19 = 0;
|
|
bVar5 = 0;
|
|
iVar6 = GetTrinketMultiplier(this,0x2e);
|
|
AddHearts(this,iVar6,bVar5,bVar19);
|
|
manager = g_manager;
|
|
local_44 = (EntityPtr)0x9d;
|
|
if (this->_playerType == 0x16) {
|
|
local_44 = (EntityPtr)0x266;
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_44));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_44),1.0,2,0,1.0,0.0);
|
|
uVar13 = Random();
|
|
uVar20 = 0;
|
|
pTVar18 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar16 = 0;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar13)
|
|
;
|
|
iVar6 = __RTDynamicCast(spawnedEntity,uVar16,pTVar17,pTVar18,uVar20);
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0x358)) = 0x3f800000;
|
|
}
|
|
}
|
|
bVar5 = HasTrinket(this,0x46,0);
|
|
if (bVar5 != 0) {
|
|
AddBlueSpider(this,&this->_pos);
|
|
}
|
|
if (0 < this->_rottenHearts) {
|
|
iVar6 = 0;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_54,3,0x2b,-1,0,0);
|
|
EVar7 = (EntityPtr)0x0;
|
|
ehState = 0;
|
|
if ((EntityPtr)local_54._size != (EntityPtr)0x0) {
|
|
do {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54._data) + GHIDRA_INT(EVar7) * 4));
|
|
if (((iVar2 != 0) && (*GHIDRA_CAST<int *>((iVar2 + 0x28)) == 3)) &&
|
|
(*GHIDRA_CAST<Entity_Player **>((iVar2 + 0x410)) == this)) {
|
|
iVar6 = iVar6 + 1;
|
|
}
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 1);
|
|
} while (GHIDRA_UINT(EVar7) < GHIDRA_UINT(local_54._size));
|
|
}
|
|
iVar6 = this->_rottenHearts * 2 - iVar6;
|
|
if (0 < iVar6) {
|
|
AddBlueFlies(this,iVar6,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
ehState = 0xffffffff;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((WeightedOutcomePicker)local_54._data != (WeightedOutcomePicker)0x0) {
|
|
uVar13 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_54._data) + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar13;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar13));
|
|
free(GHIDRA_CAST<uint *>((GHIDRA_INT(local_54._data) + -4)));
|
|
}
|
|
ehState = 0xffffffff;
|
|
}
|
|
}
|
|
try_end_astral_projection(this);
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar9 = (this->_temporaryeffects)._effects._begin;
|
|
piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar9) == 0) && ((GHIDRA_CAST<int *>(*piVar9))[1] == 0x70)) {
|
|
if (piVar9[1] == 1) {
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if ((0x70 < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2) &&
|
|
(itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x1c0)),
|
|
itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x4))) = (ulonglong)GHIDRA_UINT(itemConfig->maxCooldown) << 0x20;
|
|
local_54._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) = itemConfig;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&local_54,1,1);
|
|
}
|
|
pvVar12 = this->_backupPlayer;
|
|
if ((pvVar12 != (void *)0x0) &&
|
|
(local_5c = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(pvVar12) + 0x1508)),
|
|
*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar12) + 0x1519)) == '\0')) {
|
|
piVar9 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar12) + 0x150c));
|
|
goto joined_r0x007a9607;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
LAB_007a9679:
|
|
bVar5 = HasCollectible(this,0x2b5,0);
|
|
if (bVar5 != 0) {
|
|
AddSwarmFlyOrbital(this,&this->_pos);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x47,1);
|
|
bVar5 = HasCollectible(this,699,0);
|
|
if (bVar5 != 0) {
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar9 = (this->_temporaryeffects)._effects._begin;
|
|
piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) {
|
|
iVar6 = *GHIDRA_CAST<int *>(*piVar9);
|
|
if ((((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 4)) && ((GHIDRA_CAST<int *>(*piVar9))[1] == 699)) {
|
|
iVar6 = piVar9[1];
|
|
if (iVar6 < 5) goto LAB_007a96f8;
|
|
goto LAB_007a9930;
|
|
}
|
|
}
|
|
}
|
|
iVar6 = 0;
|
|
LAB_007a96f8:
|
|
pvVar12 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((699 < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar12) >> 2) &&
|
|
(itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0xaec)),
|
|
itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x4))) = (ulonglong)GHIDRA_UINT(itemConfig->maxCooldown) << 0x20;
|
|
local_54._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) = itemConfig;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&local_54,0,1);
|
|
}
|
|
pvVar12 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar12) >> 2 < 700) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0xaec));
|
|
}
|
|
RemoveCostume(this,itemConfig);
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 0x61) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x180));
|
|
}
|
|
RemoveCostume(this,itemConfig);
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 0x62) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x184));
|
|
}
|
|
RemoveCostume(this,itemConfig);
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 99) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x188));
|
|
}
|
|
RemoveCostume(this,itemConfig);
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 100) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x18c));
|
|
}
|
|
RemoveCostume(this,itemConfig);
|
|
switch(iVar6) {
|
|
case 0:
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 0x61) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x180));
|
|
}
|
|
break;
|
|
case 1:
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 0x62) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x184));
|
|
}
|
|
break;
|
|
case 2:
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 99) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x188));
|
|
}
|
|
break;
|
|
case 3:
|
|
case 4:
|
|
pvVar12 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 < 100) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x18c));
|
|
}
|
|
break;
|
|
default:
|
|
goto switchD_007a9848_default;
|
|
}
|
|
AddCostume(this,itemConfig,0);
|
|
switchD_007a9848_default:
|
|
local_20 = 0.0;
|
|
local_30 = 0.0;
|
|
fStack_2c = 0.0;
|
|
fStack_28 = 0.0;
|
|
fStack_24 = 0.0;
|
|
local_1c = 0.0;
|
|
local_18 = 0.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_40)) + 0x0))) = 0.1;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) = 0.1;
|
|
fStack_38 = 0.1;
|
|
fStack_34 = 1.0;
|
|
this->SetColor(local_40,6,0xff,1,1);
|
|
}
|
|
LAB_007a9930:
|
|
bVar5 = HasTrinket(this,0xa3,0);
|
|
if (bVar5 != 0) {
|
|
local_5c = GHIDRA_CAST<TemporaryEffects *>(GetTrinketMultiplier(this,0xa3));
|
|
local_44 = (EntityPtr)0x0;
|
|
if (0 < GHIDRA_INT(local_5c)) {
|
|
do {
|
|
local_54._data = (void *)0x0;
|
|
local_54._capacity = 0;
|
|
local_54._size = 0;
|
|
ehState = 2;
|
|
local_74.x = 0.0;
|
|
local_74.y = 2.8026e-44;
|
|
std::vector<8byte>::_Emplace_reallocate(0,&local_74);
|
|
uVar13 = 0;
|
|
uVar8 = local_54._capacity - GHIDRA_INT(local_54._data) >> 3;
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54._data) + uVar13 * 8)) == 1) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(local_54._data) + uVar13 * 8 + 4));
|
|
*piVar9 = *piVar9 + 6;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
if (*piVar9 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_54._data) + uVar13 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007a9a17;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
local_6c = 1;
|
|
local_68 = GHIDRA_CAST<uint *>(&DAT_00000006);
|
|
if (local_54._capacity == local_54._size) {
|
|
std::vector<8byte>::_Emplace_reallocate(local_54._capacity,&local_6c);
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(local_54._capacity) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((local_54._capacity + 4)) = 6;
|
|
local_54._capacity = local_54._capacity + 8;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
LAB_007a9a17:
|
|
uVar13 = 0;
|
|
uVar8 = GHIDRA_INT(EVar7) - GHIDRA_INT(WVar10) >> 3;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8)) == 2) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + uVar13 * 8 + 4));
|
|
*piVar9 = *piVar9 + 6;
|
|
if (*piVar9 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007a9a7b;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
local_64 = 2;
|
|
local_60 = GHIDRA_CAST<uint *>(&DAT_00000006);
|
|
if (EVar7 == (EntityPtr)local_54._size) {
|
|
std::vector<8byte>::_Emplace_reallocate(EVar7,&local_64);
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(EVar7) = 2;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar7) + 4)) = 6;
|
|
local_54._capacity = GHIDRA_INT(EVar7) + 8;
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 8);
|
|
}
|
|
LAB_007a9a7b:
|
|
uVar13 = 0;
|
|
uVar8 = GHIDRA_INT(EVar7) - GHIDRA_INT(WVar10) >> 3;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8)) == 3) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + uVar13 * 8 + 4));
|
|
*piVar9 = *piVar9 + 1;
|
|
if (*piVar9 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007a9ae5;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
local_88 = 3;
|
|
local_84 = 1;
|
|
if (EVar7 == (EntityPtr)local_54._size) {
|
|
std::vector<8byte>::_Emplace_reallocate(EVar7,&local_88);
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(EVar7) = 3;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar7) + 4)) = 1;
|
|
local_54._capacity = GHIDRA_INT(EVar7) + 8;
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 8);
|
|
}
|
|
LAB_007a9ae5:
|
|
uVar13 = 0;
|
|
uVar8 = GHIDRA_INT(EVar7) - GHIDRA_INT(WVar10) >> 3;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8)) == 4) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + uVar13 * 8 + 4));
|
|
*piVar9 = *piVar9 + 1;
|
|
if (*piVar9 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007a9b52;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
local_90 = 4;
|
|
local_8c = 1;
|
|
if (EVar7 == (EntityPtr)local_54._size) {
|
|
std::vector<8byte>::_Emplace_reallocate(EVar7,&local_90);
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(EVar7) = 4;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar7) + 4)) = 1;
|
|
local_54._capacity = GHIDRA_INT(EVar7) + 8;
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 8);
|
|
}
|
|
LAB_007a9b52:
|
|
uVar13 = 0;
|
|
uVar8 = GHIDRA_INT(EVar7) - GHIDRA_INT(WVar10) >> 3;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8)) == 5) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + uVar13 * 8 + 4));
|
|
*piVar9 = *piVar9 + 1;
|
|
if (*piVar9 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007a9bc0;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
local_98 = 5;
|
|
local_94 = 1;
|
|
if (EVar7 == (EntityPtr)local_54._size) {
|
|
std::vector<8byte>::_Emplace_reallocate(EVar7,&local_98);
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(EVar7) = 5;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar7) + 4)) = 1;
|
|
local_54._capacity = GHIDRA_INT(EVar7) + 8;
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 8);
|
|
}
|
|
LAB_007a9bc0:
|
|
uVar13 = 0;
|
|
uVar8 = GHIDRA_INT(EVar7) - GHIDRA_INT(WVar10) >> 3;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8)) == 6) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + uVar13 * 8 + 4));
|
|
*piVar9 = *piVar9 + 1;
|
|
if (*piVar9 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + uVar13 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007a9c21;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
local_80.x = 8.40779e-45;
|
|
local_80.y = 1.4013e-45;
|
|
if (EVar7 == (EntityPtr)local_54._size) {
|
|
std::vector<8byte>::_Emplace_reallocate(EVar7,&local_80);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>(EVar7) = 6;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar7) + 4)) = 1;
|
|
local_54._capacity = GHIDRA_INT((GHIDRA_INT(EVar7) + 8));
|
|
}
|
|
LAB_007a9c21:
|
|
pvVar12 = (this->_trinketRNGs)._begin;
|
|
puVar11 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar12) + 0xa30));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa34)) & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa38)) & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa3c)) & 0x1f) ^ uVar13;
|
|
*puVar11 = uVar13;
|
|
rng._shift1 = 5;
|
|
rng._seed = uVar13;
|
|
rng._shift2 = 9;
|
|
rng._shift3 = 7;
|
|
uVar13 = (GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<WeightedOutcomePicker *>(&local_54._data))))->WeightedOutcomePicker::PickOutcome(rng);
|
|
Entity_Familiar::ThrowDip(uVar13,&this->_pos,GHIDRA_CAST<Entity *>(this));
|
|
ehState = 0xffffffff;
|
|
if ((WeightedOutcomePicker)local_54._data != (WeightedOutcomePicker)0x0) {
|
|
uVar13 = (local_54._size - GHIDRA_INT(local_54._data) >> 3) * 8;
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
if (0xfff < uVar13) {
|
|
WVar10 = *GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<char *>(local_54._data) + -4));
|
|
uVar13 = uVar13 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_54._data) + (-4 - GHIDRA_INT(WVar10))))) goto LAB_007aa32a;
|
|
}
|
|
operator_delete((void *)WVar10,uVar13);
|
|
local_54._data = (void *)0x0;
|
|
local_54._capacity = 0;
|
|
local_54._size = 0;
|
|
}
|
|
local_44 = (EntityPtr)(GHIDRA_INT(local_44) + 1);
|
|
} while (GHIDRA_INT(local_44) < GHIDRA_INT(local_5c));
|
|
}
|
|
}
|
|
bVar5 = HasTrinket(this,0xa7,0);
|
|
if (bVar5 != 0) {
|
|
local_60 = GHIDRA_CAST<uint *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0xa70));
|
|
iVar6 = GetTrinketMultiplier(this,0xa7);
|
|
local_5c = GHIDRA_CAST<TemporaryEffects *>((5 - iVar6));
|
|
uVar13 = *local_60;
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = *local_60;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)local_60[1] & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 ^ uVar13 << ((byte)local_60[2] & 0x1f);
|
|
uVar13 = uVar13 ^ uVar13 >> ((byte)local_60[3] & 0x1f);
|
|
*local_60 = uVar13;
|
|
if ((local_5c == GHIDRA_CAST<TemporaryEffects *>(0x0)) || (uVar13 % GHIDRA_UINT(local_5c) == 0)) {
|
|
pvVar12 = (this->_trinketRNGs)._begin;
|
|
puVar11 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar12) + 0xa70));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa74)) & 0x1f) ^ uVar13;
|
|
local_54._data = (void *)0x1;
|
|
local_54._capacity = 0xb;
|
|
uVar13 = uVar13 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa78)) & 0x1f) ^ uVar13;
|
|
local_5c = (TemporaryEffects *)
|
|
(uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa7c)) & 0x1f) ^ uVar13);
|
|
*puVar11 = GHIDRA_UINT(local_5c);
|
|
local_60 = GHIDRA_CAST<uint *>(&DAT_00000006);
|
|
if (local_5c == GHIDRA_CAST<TemporaryEffects *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar13 = GHIDRA_UINT(local_5c) >> 1 ^ GHIDRA_UINT(local_5c);
|
|
uVar13 = uVar13 << 0xb ^ uVar13;
|
|
local_68 = GHIDRA_CAST<uint *>((uVar13 >> 6 ^ uVar13));
|
|
local_58 = GHIDRA_CAST<Game *>(0x115);
|
|
if ((GHIDRA_UINT(local_68) & 3) != 0) {
|
|
local_58 = GHIDRA_CAST<Game *>(0xe3);
|
|
}
|
|
uVar13 = Random();
|
|
fVar15 = (float)((double)GHIDRA_INT(uVar13) + __uint_to_double_fixup[-(GHIDRA_INT(uVar13) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_5c = GHIDRA_CAST<TemporaryEffects *>((fVar15 + fVar15));
|
|
local_44 = (EntityPtr)sin((float)local_5c);
|
|
fVar15 = cos((float)local_5c);
|
|
local_74.x = fVar15 * 10.0 + (this->_pos).x;
|
|
local_74.y = (float)local_44 * 10.0 + (this->_pos).y;
|
|
if (local_68 == GHIDRA_CAST<uint *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar13 = GHIDRA_UINT(local_68) >> ((byte)local_54._data & 0x1f) ^ GHIDRA_UINT(local_68);
|
|
uVar13 = uVar13 << ((byte)local_54._capacity & 0x1f) ^ uVar13;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(local_58),0,&local_74,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,
|
|
uVar13 >> ((byte)local_60 & 0x1f) ^ uVar13);
|
|
if ((spawnedEntity == GHIDRA_CAST<Entity *>(0x0)) ||
|
|
(((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 || (spawnedEntity->_type != 1)) &&
|
|
(0x3dd < spawnedEntity->_type - 10U)))) {
|
|
spawnedEntity = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
fStack_28 = g_vectorZero.y;
|
|
local_20 = g_vectorZero.y;
|
|
fStack_2c = g_vectorZero.x;
|
|
fStack_24 = g_vectorZero.x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) = 0.0;
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
local_30 = 0.0;
|
|
local_1c = 0.0;
|
|
local_18 = 0.0;
|
|
(GHIDRA_CAST<Entity *>((spawnedEntity)))->Entity::AddCharmed(GHIDRA_CAST<EntityRef *>((local_40 + 4)),-1,0,0);
|
|
spawnedEntity->Update();
|
|
(GHIDRA_CAST<Entity *>((spawnedEntity)))->Entity::SetVisibleFlag(0);
|
|
fVar15 = spawnedEntity->_maxHitPoints + spawnedEntity->_maxHitPoints;
|
|
local_20 = 0.0;
|
|
local_1c = 0.0;
|
|
local_18 = 0.0;
|
|
spawnedEntity->_maxHitPoints = fVar15;
|
|
spawnedEntity->_health = fVar15;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_40)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) = 1.0;
|
|
fStack_38 = 1.0;
|
|
fStack_34 = 1.0;
|
|
local_30 = 0.0;
|
|
fStack_2c = 0.0;
|
|
fStack_28 = 0.0;
|
|
fStack_24 = 0.0;
|
|
uVar13 = Random();
|
|
Game::SpawnParticles
|
|
(g_game,&local_74,0x23,4,
|
|
(float)((double)GHIDRA_INT(uVar13) + __uint_to_double_fixup[-(GHIDRA_INT(uVar13) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0,GHIDRA_CAST<ColorMod *>(local_40),100000.0,0);
|
|
uVar13 = Random();
|
|
local_44 = (EntityPtr)
|
|
((float)((double)GHIDRA_INT(uVar13) + __uint_to_double_fixup[-(GHIDRA_INT(uVar13) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0);
|
|
uVar13 = Random();
|
|
iVar6 = (uVar13 & 1) + 2;
|
|
do {
|
|
uVar13 = Random();
|
|
uVar8 = Random();
|
|
fVar15 = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_58 = GHIDRA_CAST<Game *>((fVar15 + fVar15));
|
|
local_5c = GHIDRA_CAST<TemporaryEffects *>(sin((float)local_58));
|
|
local_80.x = cos((float)local_58);
|
|
local_80.x = local_80.x * (float)local_44;
|
|
local_80.y = (float)local_5c * 0.5 * (float)local_44;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,5,&local_74,&local_80,GHIDRA_CAST<Entity *>(0x0),1,uVar13);
|
|
uVar16 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&spawnedEntity->_flags) + 4));
|
|
iVar2 = *GHIDRA_CAST<int *>(spawnedEntity);
|
|
*GHIDRA_CAST<uint *>(&spawnedEntity->_flags) = GHIDRA_UINT(spawnedEntity->_flags) | 0x10000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&spawnedEntity->_flags) + 4)) = uVar16;
|
|
(**(code **)(iVar2 + 0xc))();
|
|
iVar6 = iVar6 + -1;
|
|
} while (iVar6 != 0);
|
|
this = player;
|
|
}
|
|
}
|
|
bVar5 = HasTrinket(this,0xaa,0);
|
|
if (bVar5 != 0) {
|
|
if ((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) >> 10 & 1) == 0) {
|
|
iVar6 = GetTrinketMultiplier(this,0xaa);
|
|
pGVar14 = GHIDRA_CAST<Game *>((4 - iVar6));
|
|
}
|
|
else {
|
|
iVar6 = GetTrinketMultiplier(this,0xaa);
|
|
pGVar14 = GHIDRA_CAST<Game *>(((5 - iVar6) * 2));
|
|
}
|
|
local_58 = GHIDRA_CAST<Game *>(0x1);
|
|
if (1 < GHIDRA_INT(pGVar14)) {
|
|
local_58 = pGVar14;
|
|
}
|
|
pvVar12 = (this->_trinketRNGs)._begin;
|
|
puVar11 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar12) + 0xaa0));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xaa4)) & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 ^ uVar13 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xaa8)) & 0x1f);
|
|
uVar13 = uVar13 ^ uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xaac)) & 0x1f);
|
|
*puVar11 = uVar13;
|
|
if ((local_58 == GHIDRA_CAST<Game *>(0x0)) || (uVar13 % GHIDRA_UINT(local_58) == 0)) {
|
|
EVar7 = (EntityPtr)0x0;
|
|
local_44 = (EntityPtr)0x0;
|
|
local_54._data = (void *)0x0;
|
|
local_54._capacity = 0;
|
|
local_54._size = 0;
|
|
ehState = 3;
|
|
pGVar14 = GHIDRA_CAST<Game *>(0x0);
|
|
do {
|
|
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanSpawnDoorOutline(g_game->_currentRoomIdx,GHIDRA_UINT(pGVar14));
|
|
if (bVar5 != 0) {
|
|
local_58 = pGVar14;
|
|
if (EVar7 == local_44) {
|
|
std::vector<4byte>::_Emplace_reallocate(EVar7,&local_58);
|
|
local_44 = (EntityPtr)local_54._size;
|
|
EVar7 = (EntityPtr)local_54._capacity;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<Game **>(EVar7) = pGVar14;
|
|
local_54._capacity = GHIDRA_INT(EVar7) + 4;
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 4);
|
|
}
|
|
}
|
|
this = player;
|
|
pGVar14 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar14->_stage) + 1));
|
|
} while (pGVar14 < GHIDRA_CAST<Game *>(&DAT_00000008));
|
|
if ((EntityPtr)local_54._data != EVar7) {
|
|
local_58 = g_game;
|
|
local_68 = GHIDRA_CAST<uint *>((GHIDRA_INT((player->_trinketRNGs)._begin) + 0xaa0));
|
|
uVar13 = GHIDRA_INT(EVar7) - GHIDRA_INT(local_54._data) >> 2;
|
|
local_60 = GHIDRA_CAST<uint *>(*local_68);
|
|
if (local_60 == GHIDRA_CAST<uint *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
local_60 = GHIDRA_CAST<uint *>(*local_68);
|
|
if (local_60 == GHIDRA_CAST<uint *>(0x0)) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar8 = GHIDRA_UINT(local_60) >> ((byte)local_68[1] & 0x1f) ^ GHIDRA_UINT(local_60);
|
|
uVar8 = uVar8 ^ uVar8 << ((byte)local_68[2] & 0x1f);
|
|
uVar8 = uVar8 ^ uVar8 >> ((byte)local_68[3] & 0x1f);
|
|
*local_68 = uVar8;
|
|
if (uVar13 == 0) {
|
|
uVar8 = 0;
|
|
}
|
|
else {
|
|
uVar8 = uVar8 % uVar13;
|
|
}
|
|
Level::MakeRedRoomDoor
|
|
(GHIDRA_CAST<Level *>(local_58),g_game->_currentRoomIdx,
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54._data) + uVar8 * 4)));
|
|
}
|
|
ehState = 0xffffffff;
|
|
if ((EntityPtr)local_54._data != (EntityPtr)0x0) {
|
|
uVar13 = (GHIDRA_INT(local_44) - GHIDRA_INT(local_54._data) >> 2) * 4;
|
|
EVar7 = (EntityPtr)local_54._data;
|
|
if (0xfff < uVar13) {
|
|
EVar7 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_54._data) + -4));
|
|
uVar13 = uVar13 + 0x23;
|
|
if (0x1f < (GHIDRA_INT(local_54._data) - GHIDRA_INT(EVar7)) - 4U) {
|
|
LAB_007aa32a:
|
|
ehState = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete((void *)EVar7,uVar13);
|
|
local_54._data = (void *)0x0;
|
|
local_54._capacity = 0;
|
|
local_54._size = 0;
|
|
}
|
|
}
|
|
}
|
|
if ((this->_variant == 1) && (this->_babySkin == 0x40)) {
|
|
uVar13 = (this->_dropRNG)._seed;
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = (this->_dropRNG)._seed;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)(this->_dropRNG)._shift1 & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 << ((byte)(this->_dropRNG)._shift2 & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 >> ((byte)(this->_dropRNG)._shift3 & 0x1f) ^ uVar13;
|
|
(this->_dropRNG)._seed = uVar13;
|
|
uVar13 = uVar13 % 10;
|
|
bVar5 = (byte)uVar13;
|
|
if (uVar13 == 0) {
|
|
position = &this->_pos;
|
|
bVar19 = bVar5;
|
|
iVar6 = Entity_Familiar::GetRandomWisp(&this->_dropRNG);
|
|
AddWisp(this,iVar6,position,bVar5,bVar19);
|
|
}
|
|
}
|
|
if ((((this->_playerType != 0x1d) && (this->_playerType != 0x26)) ||
|
|
((EVar7 = (EntityPtr)this->_backupPlayer, EVar7 == (EntityPtr)0x0 &&
|
|
(this->_twinPlayer == (EntityPtr)0x0)))) ||
|
|
((0 < this->_controlsCooldown || (this->_hasCurseMistEffect != 0)))) goto LAB_007aa526;
|
|
local_44 = this->_twinPlayer;
|
|
if (local_44 == (EntityPtr)0x0) {
|
|
local_44 = EVar7;
|
|
LAB_007aa43d:
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_54,3,-1,-1,1,0);
|
|
EVar7 = (EntityPtr)0x0;
|
|
ehState = 4;
|
|
if ((EntityPtr)local_54._size != (EntityPtr)0x0) {
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
do {
|
|
familiar = *GHIDRA_CAST<Entity_Familiar **>((GHIDRA_CAST<char *>(WVar10) + GHIDRA_INT(EVar7) * 4));
|
|
if (familiar->_player == this) {
|
|
(GHIDRA_CAST<Entity_Familiar *>((familiar)))->Entity_Familiar::TriggerRoomClear();
|
|
WVar10 = (WeightedOutcomePicker)local_54._data;
|
|
}
|
|
EVar7 = (EntityPtr)(GHIDRA_INT(EVar7) + 1);
|
|
} while (GHIDRA_UINT(EVar7) < GHIDRA_UINT(local_54._size));
|
|
}
|
|
ehState = 0xffffffff;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((WeightedOutcomePicker)local_54._data != (WeightedOutcomePicker)0x0) {
|
|
uVar13 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_54._data) + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar13;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar13));
|
|
free(GHIDRA_CAST<uint *>((GHIDRA_INT(local_54._data) + -4)));
|
|
}
|
|
}
|
|
ehState = 0xffffffff;
|
|
}
|
|
else if (local_44 == EVar7) goto LAB_007aa43d;
|
|
EVar7 = local_44;
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_60) + 2)),0x2c7,0,-1,0);
|
|
if ((EVar7 == (EntityPtr)this->_backupPlayer) && (this->_isCoopGhost == 0)) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar7) + 0x15c0)) = 0;
|
|
TriggerRoomClear(GHIDRA_CAST<Entity_Player *>(EVar7));
|
|
}
|
|
iVar6 = this->_activeDesc[2]._unk;
|
|
iVar2 = this->_activeDesc[2]._charge;
|
|
iVar4 = this->_activeDesc[2]._batteryCharge;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15c0)) = this->_activeDesc[2]._item;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15c4)) = iVar6;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15c8)) = iVar2;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15cc)) = iVar4;
|
|
iVar6 = this->_activeDesc[2]._timeRechargeCooldown;
|
|
iVar2 = this->_activeDesc[2]._partialCharge;
|
|
iVar4 = this->_activeDesc[2]._varData;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15d0)) = this->_activeDesc[2]._subCharge;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15d4)) = iVar6;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15d8)) = iVar2;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar7) + 0x15dc)) = iVar4;
|
|
LAB_007aa526:
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar9 = (this->_temporaryeffects)._effects._begin;
|
|
piVar9 != (this->_temporaryeffects)._effects._end; piVar9 = piVar9 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar9) == 2) && ((GHIDRA_CAST<int *>(*piVar9))[1] == 0xa2)) {
|
|
pvVar12 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((0x288 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar12) & 0xfffffffcU
|
|
))) &&
|
|
(itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x288)),
|
|
itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x4))) = (ulonglong)GHIDRA_UINT(itemConfig->maxCooldown) << 0x20;
|
|
local_54._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) = itemConfig;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(&local_54,1);
|
|
}
|
|
goto LAB_007aa725;
|
|
}
|
|
}
|
|
}
|
|
bVar5 = HasTrinket(this,0xa2,0);
|
|
if (bVar5 != 0) {
|
|
pvVar12 = (this->_trinketRNGs)._begin;
|
|
puVar11 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar12) + 0xa20));
|
|
iVar6 = GetTrinketMultiplier(this,0xa2);
|
|
uVar13 = *puVar11;
|
|
local_58 = GHIDRA_CAST<Game *>(0x1);
|
|
if (1 < 4 - iVar6) {
|
|
local_58 = GHIDRA_CAST<Game *>((4 - iVar6));
|
|
}
|
|
if (uVar13 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar13 = *puVar11;
|
|
if (uVar13 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar13 = uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa24)) & 0x1f) ^ uVar13;
|
|
uVar13 = uVar13 ^ uVar13 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa28)) & 0x1f);
|
|
uVar13 = uVar13 ^ uVar13 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar12) + 0xa2c)) & 0x1f);
|
|
*puVar11 = uVar13;
|
|
if ((((local_58 == GHIDRA_CAST<Game *>(0x0)) || (uVar13 % GHIDRA_UINT(local_58) == 0)) &&
|
|
(pvVar12 = (g_manager->_itemConfig)._trinkets._begin,
|
|
0x288 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar12) & 0xfffffffcU))))
|
|
&& (itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x288)),
|
|
itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
local_58 = GHIDRA_CAST<Game *>(itemConfig->maxCooldown);
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x4))) = ZEXT48(local_58) << 0x20;
|
|
local_54._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) = itemConfig;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
piVar9 = (this->_temporaryeffects)._effects._end;
|
|
for (effect = (this->_temporaryeffects)._effects._begin; effect != piVar9;
|
|
effect = effect + 4) {
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(*effect) == itemConfig) {
|
|
if (effect != piVar9) {
|
|
effect[1] = effect[1] + 2;
|
|
effect[2] = GHIDRA_INT(local_58->_roomList[0]._doors) + effect[2] + -0x30;
|
|
goto LAB_007aa715;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
piVar9 = (this->_temporaryeffects)._effects._end;
|
|
if (piVar9 == (this->_temporaryeffects)._effects._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(piVar9,&local_54);
|
|
}
|
|
else {
|
|
*piVar9 = GHIDRA_INT(itemConfig);
|
|
piVar9[1] = 0;
|
|
piVar9[2] = GHIDRA_INT(local_58);
|
|
piVar9[3] = 0;
|
|
ppvVar1 = &(this->_temporaryeffects)._effects._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x10);
|
|
}
|
|
itemConfig = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<ItemConfig_Item *>(local_54))) + 0x0)));
|
|
pvVar12 = (this->_temporaryeffects)._effects._begin;
|
|
*(undefined4 *)
|
|
(((GHIDRA_INT((this->_temporaryeffects)._effects._end) - GHIDRA_INT(pvVar12) & 0xfffffff0U) - 0xc) +
|
|
GHIDRA_INT(pvVar12)) = 2;
|
|
effectsOwner = (this->_temporaryeffects)._player;
|
|
if (effectsOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
AddCostume(effectsOwner,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<ItemConfig_Item *>(local_54))) + 0x0))),0);
|
|
}
|
|
LAB_007aa715:
|
|
(this->_temporaryeffects)._cacheFlags =
|
|
(this->_temporaryeffects)._cacheFlags | itemConfig->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
}
|
|
LAB_007aa725:
|
|
trigger_set_dispatch(&this->_proceduralItems,5,GHIDRA_CAST<Entity *>(0x0),&this->_pos,&g_vectorZero);
|
|
if (GHIDRA_INT((this->_pendingWisps)._end) - GHIDRA_INT((this->_pendingWisps)._begin) >> 2 != 0) {
|
|
uVar13 = 0;
|
|
do {
|
|
AddWisp(this,*GHIDRA_CAST<int *>((GHIDRA_INT((this->_pendingWisps)._begin) + uVar13 * 4)),&this->_pos,0,0);
|
|
uVar13 = uVar13 + 1;
|
|
pvVar12 = (this->_pendingWisps)._begin;
|
|
} while (uVar13 < GHIDRA_UINT((GHIDRA_INT((this->_pendingWisps)._end) - GHIDRA_INT(pvVar12) >> 2)));
|
|
(this->_pendingWisps)._end = pvVar12;
|
|
}
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
joined_r0x007a9607:
|
|
if (piVar9 == *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar12) + 0x1510))) goto LAB_007a9679;
|
|
if ((*GHIDRA_CAST<int *>(*piVar9) == 0) && ((GHIDRA_CAST<int *>(*piVar9))[1] == 0x70)) {
|
|
if ((piVar9[1] == 1) &&
|
|
((pvVar12 = (g_manager->_itemConfig)._nullItems._begin,
|
|
0x70 < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar12) >> 2 &&
|
|
(itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar12) + 0x1c0)),
|
|
itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x4))) = (ulonglong)GHIDRA_UINT(itemConfig->maxCooldown) << 0x20;
|
|
local_54._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54)) + 0x0))) = itemConfig;
|
|
(GHIDRA_CAST<TemporaryEffects *>((local_5c)))->TemporaryEffects::AddEffect(&local_54,1,1);
|
|
}
|
|
goto LAB_007a9679;
|
|
}
|
|
piVar9 = piVar9 + 4;
|
|
goto joined_r0x007a9607;
|
|
}
|
|
|
|
// 007aa7c0
|
|
byte Entity_Player::HasPlayerForm(int playerForm)
|
|
{
|
|
if ((((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) && (GHIDRA_UINT(playerForm) < 0x10))
|
|
&& (2 < this->_playerForms[playerForm])) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007aa800
|
|
byte Entity_Player::CanAddCollectible(int collectibleId)
|
|
{
|
|
ItemConfig_Item *item;
|
|
|
|
if (collectibleId != 0) {
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectibleId);
|
|
if (((item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (item->type == 3)) && (this->_parent != (EntityPtr)0x0)
|
|
) {
|
|
return 0;
|
|
}
|
|
}
|
|
return this->_itemHoldCooldown == 0;
|
|
}
|
|
|
|
// 007ab110
|
|
byte Entity_Player::IsExtraAnimationFinished()
|
|
{
|
|
if ((this->_isPlayingExtraAnimation == 0) && (this->_isPlayingItemAnimation == 0)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007ab130
|
|
void Entity_Player::AnimatePickup(ANM2 *param_2, byte param_3, byte *param_4)
|
|
{
|
|
byte bVar1;
|
|
Entity_Player *pEVar2;
|
|
uint uVar3;
|
|
byte *animName;
|
|
LayerState *shadowLayer;
|
|
char *pickupName;
|
|
byte *****pppppbVar4;
|
|
ANM2 *this_00;
|
|
bool isLess;
|
|
ANM2 spriteCopy;
|
|
undefined4 local_7c [11];
|
|
Entity_Player *player;
|
|
byte *savedAnimName;
|
|
ANM2 *savedSprite;
|
|
uint cleanupFlags;
|
|
char isOnlineCollectible;
|
|
byte *****spritePath [4];
|
|
uint spritePathSize;
|
|
uint spritePathCapacity;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
byte ****local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((spritePath + 0xe));
|
|
local_14 = GHIDRA_CAST<byte ****>(0xffffffff);
|
|
puStack_18 = &LAB_00affae0;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((spritePath + 0xb));
|
|
ExceptionList = &local_1c;
|
|
savedAnimName = param_4;
|
|
savedSprite = param_2;
|
|
cleanupFlags = 0;
|
|
player = this;
|
|
if ((g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) ||
|
|
(GHIDRA_UINT((GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(g_manager->_netplayManager) >> 2)) < 2)) {
|
|
LAB_007ab226:
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((spritePath + 0xe));
|
|
}
|
|
else {
|
|
pickupName = "Pickup";
|
|
do {
|
|
bVar1 = *param_4;
|
|
isLess = bVar1 < (byte)*pickupName;
|
|
if (bVar1 != *pickupName) {
|
|
LAB_007ab1d1:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007ab1d6;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = param_4[1];
|
|
isLess = bVar1 < (byte)pickupName[1];
|
|
if (bVar1 != pickupName[1]) goto LAB_007ab1d1;
|
|
param_4 = param_4 + 2;
|
|
pickupName = pickupName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_007ab1d6:
|
|
if (uVar3 != 0) goto LAB_007ab226;
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(spritePath))))->std::string::string(param_2);
|
|
pppppbVar4 = GHIDRA_CAST<byte *****>(spritePath);
|
|
if (0xf < spritePathCapacity) {
|
|
pppppbVar4 = spritePath[0];
|
|
}
|
|
cleanupFlags = 3;
|
|
uVar3 = std::string::find(GHIDRA_CAST<byte *>(pppppbVar4),spritePathSize,0,GHIDRA_CAST<byte *>("Collectible"),0xb);
|
|
if ((uVar3 != 0xffffffff) && (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
|
|
isOnlineCollectible = '\x01';
|
|
goto LAB_007ab230;
|
|
}
|
|
}
|
|
isOnlineCollectible = '\0';
|
|
LAB_007ab230:
|
|
if (((cleanupFlags & 1) != 0) && (0xf < spritePathCapacity)) {
|
|
uVar3 = spritePathCapacity + 1;
|
|
pppppbVar4 = spritePath[0];
|
|
if (0xfff < uVar3) {
|
|
pppppbVar4 = GHIDRA_CAST<byte *****>(spritePath[0][-1]);
|
|
uVar3 = spritePathCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(spritePath[0]) + (-4 - GHIDRA_INT(pppppbVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppbVar4,uVar3);
|
|
}
|
|
pEVar2 = player;
|
|
animName = GHIDRA_CAST<byte *>("Pickup_Online");
|
|
if (isOnlineCollectible == '\0') {
|
|
animName = savedAnimName;
|
|
}
|
|
PlayExtraAnimation(player,animName);
|
|
(GHIDRA_CAST<ANM2 *>((&spriteCopy)))->ANM2::ANM2(savedSprite);
|
|
Isaac::SwapANM2(&pEVar2->_heldSprite,&spriteCopy);
|
|
local_14 = GHIDRA_CAST<byte ****>(0x0);
|
|
(GHIDRA_CAST<ANM2 *>((this_00)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&spriteCopy._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&spriteCopy._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((spriteCopy._animDefaultName._buf)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&spriteCopy))))->std::string::_Tidy_deallocate();
|
|
(pEVar2->_heldSprite)._bitflags = savedSprite->_bitflags;
|
|
if (param_3 != 0) {
|
|
shadowLayer = (GHIDRA_CAST<ANM2 *>((&pEVar2->_heldSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>("shadow"));
|
|
if (shadowLayer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
if (&shadowLayer->_color != GHIDRA_CAST<ColorMod *>(local_7c)) {
|
|
(shadowLayer->_color)._colorize[0] = 0.0;
|
|
(shadowLayer->_color)._colorize[1] = 0.0;
|
|
(shadowLayer->_color)._colorize[2] = 0.0;
|
|
(shadowLayer->_color)._colorize[3] = 0.0;
|
|
(shadowLayer->_color)._offset[0] = 0.0;
|
|
(shadowLayer->_color)._offset[1] = 0.0;
|
|
(shadowLayer->_color)._tint[0] = 0.0;
|
|
(shadowLayer->_color)._tint[1] = 0.0;
|
|
(shadowLayer->_color)._tint[2] = 0.0;
|
|
(shadowLayer->_color)._tint[3] = 0.0;
|
|
(shadowLayer->_color)._offset[2] = 0.0;
|
|
}
|
|
}
|
|
}
|
|
(pEVar2->_heldSprite)._offset.x = 0.0;
|
|
(pEVar2->_heldSprite)._offset.y = -4.0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007ab550
|
|
void Entity_Player::AnimateTrinket(int trinketId, byte *animName, byte *spriteAnimName)
|
|
{
|
|
byte bVar1;
|
|
EntityConfig_Entity *pickupConfig;
|
|
byte *currentAnimChar;
|
|
uint compareResult;
|
|
byte unk;
|
|
byte *newAnimChar;
|
|
bool isLess;
|
|
undefined4 entityKey;
|
|
Entity_Player *player;
|
|
undefined1 lowerBoundResult [8];
|
|
void *lowerBoundNode;
|
|
byte *animData;
|
|
ANM2 *heldSprite;
|
|
Manager *manager;
|
|
int trinketConfig;
|
|
void *trinketsBegin;
|
|
|
|
trinketsBegin = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(trinketsBegin) >> 2 <=
|
|
GHIDRA_INT((trinketId & 0x7fffU))) {
|
|
return;
|
|
}
|
|
trinketConfig = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(trinketsBegin) + (trinketId & 0x7fffU) * 4));
|
|
if (trinketConfig == 0) {
|
|
return;
|
|
}
|
|
heldSprite = &this->_heldSprite;
|
|
player = this;
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Reset();
|
|
manager = g_manager;
|
|
entityKey = 0x506400;
|
|
_Find_lower_bound<>(lowerBoundResult,&entityKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(lowerBoundNode) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(lowerBoundNode) + 0x10)) < 0x506401)) &&
|
|
(lowerBoundNode != (manager->_entityConfig)._entities._head)) {
|
|
pickupConfig = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(lowerBoundNode) + 0x18));
|
|
}
|
|
else {
|
|
pickupConfig = (GHIDRA_CAST<EntityConfig *>((&manager->_entityConfig)))->EntityConfig::GetEntity(5,0,0);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Load(&pickupConfig->anm2Path,0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(heldSprite))))->Sprite::ReplaceSpritesheet(1,GHIDRA_CAST<std_string *>((trinketConfig + 0x38)));
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::LoadGraphics(unk);
|
|
animData = (this->_heldSprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
|
currentAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
currentAnimChar = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
newAnimChar = spriteAnimName;
|
|
do {
|
|
bVar1 = *currentAnimChar;
|
|
isLess = bVar1 < *newAnimChar;
|
|
if (bVar1 != *newAnimChar) {
|
|
LAB_007ab650:
|
|
compareResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007ab655;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentAnimChar[1];
|
|
isLess = bVar1 < newAnimChar[1];
|
|
if (bVar1 != newAnimChar[1]) goto LAB_007ab650;
|
|
currentAnimChar = currentAnimChar + 2;
|
|
newAnimChar = newAnimChar + 2;
|
|
} while (bVar1 != 0);
|
|
compareResult = 0;
|
|
LAB_007ab655:
|
|
if ((compareResult == 0) &&
|
|
((animData[0x34] == 0 || ((this->_heldSprite)._animState._isPlaying != 0))))
|
|
goto LAB_007ab67d;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetAnimation(spriteAnimName,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._animState)))->AnimationState::Rewind();
|
|
(this->_heldSprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_007ab67d:
|
|
(player->_heldSprite)._offset.x = 0.0;
|
|
(player->_heldSprite)._offset.y = -4.0;
|
|
PlayExtraAnimation(player,animName);
|
|
return;
|
|
}
|
|
|
|
// 007ab6b0
|
|
void Entity_Player::AnimateCard(int cardId, byte *animName)
|
|
{
|
|
byte bVar1;
|
|
byte *curAnimChar;
|
|
void *pvVar2;
|
|
EntityConfig_Entity *entityConfig;
|
|
byte *expectedName;
|
|
char *pcVar3;
|
|
uint uVar4;
|
|
ANM2 *heldSprite;
|
|
bool isLess;
|
|
byte *cardAnimName;
|
|
std_string cardAnm2Path;
|
|
std_string local_3c;
|
|
uint stackCookie;
|
|
void **ppvStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
byte *animData;
|
|
int cardConfig;
|
|
|
|
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00affb25;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_INT(&cardAnm2Path) + 0x44U;
|
|
ExceptionList = &local_1c;
|
|
heldSprite = &this->_heldSprite;
|
|
if (0x61 < cardId) {
|
|
pvVar2 = (g_manager->_itemConfig)._cards._begin;
|
|
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
|
|
if (((cardId < GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar2) >> 2) &&
|
|
(cardConfig = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + cardId * 4)),
|
|
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50), cardConfig != 0)) &&
|
|
(ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50), *GHIDRA_CAST<int *>((cardConfig + 0x6c)) != 0)) {
|
|
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<std::string *>((cardAnm2Path._buf)))->std::string::string(*(void **)(cardConfig + 0x6c));
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Load(&cardAnm2Path,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < cardAnm2Path._capacity) {
|
|
uVar4 = cardAnm2Path._capacity + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)cardAnm2Path._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(cardAnm2Path._buf)) + 0x0))) + -4);
|
|
uVar4 = cardAnm2Path._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(cardAnm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar4);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Play(GHIDRA_CAST<byte *>("Sparkle"),0);
|
|
cardAnimName = GHIDRA_CAST<byte *>((cardConfig + 0x38));
|
|
if (0xf < *GHIDRA_CAST<uint *>((cardConfig + 0x4c))) {
|
|
cardAnimName = *GHIDRA_CAST<byte **>(cardAnimName);
|
|
}
|
|
animData = (this->_heldSprite)._overlayAnimState._animData;
|
|
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
|
curAnimChar = animData;
|
|
expectedName = cardAnimName;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
do {
|
|
bVar1 = *curAnimChar;
|
|
isLess = bVar1 < *expectedName;
|
|
if (bVar1 != *expectedName) {
|
|
LAB_007ab7f4:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007ab7f9;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimChar[1];
|
|
isLess = bVar1 < expectedName[1];
|
|
if (bVar1 != expectedName[1]) goto LAB_007ab7f4;
|
|
curAnimChar = curAnimChar + 2;
|
|
expectedName = expectedName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar4 = 0;
|
|
LAB_007ab7f9:
|
|
if ((uVar4 == 0) &&
|
|
((animData[0x34] == 0 || ((this->_heldSprite)._overlayAnimState._isPlaying != 0))))
|
|
goto LAB_007abab4;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetOverlayAnimation(cardAnimName,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._overlayAnimState)))->AnimationState::Rewind();
|
|
(this->_heldSprite)._overlayAnimState._isPlaying = 1;
|
|
}
|
|
}
|
|
goto LAB_007abab4;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Reset();
|
|
local_3c._size = 0;
|
|
local_3c._capacity = 0xf;
|
|
local_3c._buf[0] = '\0';
|
|
local_3c._buf[1] = '\0';
|
|
local_3c._buf[2] = '\0';
|
|
local_3c._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
local_3c._size = 0x19;
|
|
local_3c._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0))),"gfx/ui/ui_cardspills.anm2",0x1a);
|
|
local_14 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Load(&local_3c,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < local_3c._capacity) {
|
|
uVar4 = local_3c._capacity + 1;
|
|
pcVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4));
|
|
uVar4 = local_3c._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar3,uVar4);
|
|
}
|
|
animData = (this->_heldSprite)._animState._animData;
|
|
heldSprite = &this->_heldSprite;
|
|
local_3c._size = 0;
|
|
local_3c._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) & 0xffffff00;
|
|
if (animData == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007ab949:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Sparkle"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._animState)))->AnimationState::Rewind();
|
|
(this->_heldSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
pcVar3 = "Sparkle";
|
|
do {
|
|
bVar1 = *curAnimChar;
|
|
isLess = bVar1 < (byte)*pcVar3;
|
|
if (bVar1 != *pcVar3) {
|
|
LAB_007ab936:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007ab93b;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimChar[1];
|
|
isLess = bVar1 < (byte)pcVar3[1];
|
|
if (bVar1 != pcVar3[1]) goto LAB_007ab936;
|
|
curAnimChar = curAnimChar + 2;
|
|
pcVar3 = pcVar3 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar4 = 0;
|
|
LAB_007ab93b:
|
|
if ((uVar4 != 0) || ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0))))
|
|
goto LAB_007ab949;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST<byte *>("CardFronts"),1);
|
|
if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)cardId);
|
|
}
|
|
uVar4 = 0;
|
|
if ((this->_heldSprite)._layerCount != 0) {
|
|
do {
|
|
pvVar2 = (GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._overlayAnimState)))->AnimationState::GetLayerFrame(uVar4);
|
|
if ((pvVar2 != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar2) + 0x2c)) != '\0')) goto LAB_007abab4;
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT((this->_heldSprite)._layerCount));
|
|
}
|
|
if ((((cardId < 0) ||
|
|
(pvVar2 = (g_manager->_itemConfig)._cards._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar2) >> 2 <= cardId)) ||
|
|
(cardConfig = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + cardId * 4)), cardConfig == 0)) ||
|
|
(entityConfig = EntityConfig::GetEntity
|
|
(&g_manager->_entityConfig,5,300,*GHIDRA_CAST<int *>((cardConfig + 0x54))),
|
|
entityConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0))) goto LAB_007abab4;
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Load(&entityConfig->anm2Path,1);
|
|
animData = (this->_heldSprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007aba73:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Sparkle"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._animState)))->AnimationState::Rewind();
|
|
(this->_heldSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
pcVar3 = "Sparkle";
|
|
do {
|
|
bVar1 = *curAnimChar;
|
|
isLess = bVar1 < (byte)*pcVar3;
|
|
if (bVar1 != *pcVar3) {
|
|
LAB_007aba60:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007aba65;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimChar[1];
|
|
isLess = bVar1 < (byte)pcVar3[1];
|
|
if (bVar1 != pcVar3[1]) goto LAB_007aba60;
|
|
curAnimChar = curAnimChar + 2;
|
|
pcVar3 = pcVar3 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar4 = 0;
|
|
LAB_007aba65:
|
|
if ((uVar4 != 0) || ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0))))
|
|
goto LAB_007aba73;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetOverlayAnimation(&DAT_00b6b338,1);
|
|
if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._overlayAnimState)))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
LAB_007abab4:
|
|
(this->_heldSprite)._offset.x = 0.0;
|
|
(this->_heldSprite)._offset.y = -12.0;
|
|
PlayExtraAnimation(this,animName);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007abb00
|
|
void Entity_Player::AnimatePill(int pillColor, byte *animName)
|
|
{
|
|
byte bVar1;
|
|
EntityConfig_Entity *pillConfig;
|
|
byte *curAnimChar;
|
|
uint animCompare;
|
|
char *sparkleChar;
|
|
bool isLess;
|
|
byte *animData;
|
|
ANM2 *heldSprite;
|
|
|
|
heldSprite = &this->_heldSprite;
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Reset();
|
|
pillConfig = (GHIDRA_CAST<EntityConfig *>((&g_manager->_entityConfig)))->EntityConfig::GetEntity(5,0x46,pillColor);
|
|
if (pillConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) goto LAB_007abbd4;
|
|
(GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::Load(&pillConfig->anm2Path,1);
|
|
animData = (this->_heldSprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007abb93:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Sparkle"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._animState)))->AnimationState::Rewind();
|
|
(this->_heldSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
sparkleChar = "Sparkle";
|
|
do {
|
|
bVar1 = *curAnimChar;
|
|
isLess = bVar1 < (byte)*sparkleChar;
|
|
if (bVar1 != *sparkleChar) {
|
|
LAB_007abb80:
|
|
animCompare = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007abb85;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimChar[1];
|
|
isLess = bVar1 < (byte)sparkleChar[1];
|
|
if (bVar1 != sparkleChar[1]) goto LAB_007abb80;
|
|
curAnimChar = curAnimChar + 2;
|
|
sparkleChar = sparkleChar + 2;
|
|
} while (bVar1 != 0);
|
|
animCompare = 0;
|
|
LAB_007abb85:
|
|
if ((animCompare != 0) ||
|
|
((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0))))
|
|
goto LAB_007abb93;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((heldSprite)))->ANM2::SetOverlayAnimation(&DAT_00b6b338,1);
|
|
if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_heldSprite)._overlayAnimState)))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
LAB_007abbd4:
|
|
(this->_heldSprite)._offset.x = 0.0;
|
|
(this->_heldSprite)._offset.y = -12.0;
|
|
PlayExtraAnimation(this,animName);
|
|
return;
|
|
}
|
|
|
|
// 007abc00
|
|
void Entity_Player::AnimateTrapdoor()
|
|
{
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Trapdoor"));
|
|
return;
|
|
}
|
|
|
|
// 007abc10
|
|
void Entity_Player::AnimateLightTravel()
|
|
{
|
|
Entity_Player *in_ECX;
|
|
|
|
PlayExtraAnimation(in_ECX,GHIDRA_CAST<byte *>("LightTravel"));
|
|
return;
|
|
}
|
|
|
|
// 007abc20
|
|
void Entity_Player::AnimatePitfallIn(byte isIgnoreEffect)
|
|
{
|
|
byte isHasEffect;
|
|
int pitfallState;
|
|
|
|
if ((isIgnoreEffect == 0) &&
|
|
(isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x271),
|
|
isHasEffect != 0)) {
|
|
return;
|
|
}
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("FallIn"));
|
|
this->_isControlsEnabled = 0;
|
|
pitfallState = 1;
|
|
this->_entityCollisionClass = 0;
|
|
this->_pitfallTimer = 0;
|
|
if (isIgnoreEffect != 0) {
|
|
pitfallState = 4;
|
|
}
|
|
this->_pitfallState = pitfallState;
|
|
return;
|
|
}
|
|
|
|
// 007abc90
|
|
void Entity_Player::AnimatePitfallOut()
|
|
{
|
|
this->_pitfallState = 3;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("JumpOut"));
|
|
return;
|
|
}
|
|
|
|
// 007abcb0
|
|
void Entity_Player::AnimateAppear()
|
|
{
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Appear"));
|
|
return;
|
|
}
|
|
|
|
// 007abcc0
|
|
void Entity_Player::AnimateTeleport(byte isUp)
|
|
{
|
|
byte bVar1;
|
|
char *animName;
|
|
undefined3 in_stack_00000005;
|
|
Manager *manager;
|
|
|
|
bVar1 = isUp;
|
|
animName = "TeleportUp";
|
|
if (isUp == 0) {
|
|
animName = "TeleportDown";
|
|
}
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>(animName));
|
|
manager = g_manager;
|
|
if (bVar1 != 0) {
|
|
_isUp = 0xd7;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&isUp));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(_isUp,1.0,2,0,1.0,0.0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007abd30
|
|
void Entity_Player::AnimateHappy()
|
|
{
|
|
int soundId;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
soundId = 0x10c;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Happy"));
|
|
return;
|
|
}
|
|
|
|
// 007abd90
|
|
void Entity_Player::AnimateSad()
|
|
{
|
|
int soundId;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
soundId = 0x10b;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
PlayExtraAnimation(this,&DAT_00b1cdf8);
|
|
return;
|
|
}
|
|
|
|
// 007abdf0
|
|
void Entity_Player::AddPrettyFly()
|
|
{
|
|
int *haloOfFliesCount;
|
|
|
|
haloOfFliesCount = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) + 0x28));
|
|
*haloOfFliesCount = *haloOfFliesCount + 1;
|
|
this->_cacheFlags = this->_cacheFlags | 0x200;
|
|
EvaluateItems(this);
|
|
AnimateHappy(this);
|
|
return;
|
|
}
|
|
|
|
// 007abe20
|
|
void Entity_Player::PlayExtraAnimation(byte *animName)
|
|
{
|
|
byte isAnimSet;
|
|
|
|
this->_isPlayingItemAnimation = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::Reset();
|
|
(this->_sprite)._playbackSpeed = 1.0;
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(animName,1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
this->_isPlayingItemAnimation = 0;
|
|
this->_isPlayingExtraAnimation = 1;
|
|
return;
|
|
}
|
|
|
|
// 007abf80
|
|
void Entity_Player::active_used_post(int slot, byte unk, int chargeBeforeUse)
|
|
{
|
|
int *piVar1;
|
|
int iVar2;
|
|
code *pcVar3;
|
|
RNG rng;
|
|
RNG rng_00;
|
|
RNG rng_01;
|
|
Game *pGVar4;
|
|
byte bVar5;
|
|
char isDeathmatchBanned;
|
|
uint uVar6;
|
|
ItemConfig_Item *collectibleConfig;
|
|
int iVar7;
|
|
int unused;
|
|
void *pvVar8;
|
|
uint uVar9;
|
|
WeightedOutcomePicker WVar10;
|
|
WeightedOutcomePicker freeBlock;
|
|
uint *rngSeed;
|
|
bool isExcludedItem;
|
|
float in_XMM0_Da;
|
|
short sStack0000000a;
|
|
WeightedOutcomePicker expansionPicker;
|
|
int *expansionPickerEnd;
|
|
int *expansionPickerCapacity;
|
|
WeightedOutcomePicker activePicker;
|
|
int *activePickerEnd;
|
|
int *activePickerCapacity;
|
|
int newOutcomeId;
|
|
int newOutcomeWeight;
|
|
int expansionOutcomeId;
|
|
Manager *local_1c;
|
|
int qualityWeight;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00affb8d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (this->_activeDesc[slot]._item == 0x1da) {
|
|
RemoveCollectible(this,0x1da,0,slot,1);
|
|
AddCollectible(this,0x160,-1,0,slot,0,0);
|
|
AnimateCollectible(this,0x160,GHIDRA_CAST<byte *>("UseItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
}
|
|
iVar7 = chargeBeforeUse;
|
|
if (slot == 0) {
|
|
TriggerBookOfVirtues(this,this->_activeDesc[0]._item,chargeBeforeUse);
|
|
trigger_book_of_belial_passive(this,this->_activeDesc[0]._item,iVar7);
|
|
}
|
|
bVar5 = HasTrinket(this,0x8a,0);
|
|
if (((bVar5 != 0) && (slot == 0)) &&
|
|
(bVar5 = ItemConfig::IsValidCollectible(this->_activeDesc[0]._item), bVar5 != 0)) {
|
|
bVar5 = HasCollectible(this,0x2d1,0);
|
|
pGVar4 = g_game;
|
|
if (bVar5 == 0) {
|
|
WVar10 = (WeightedOutcomePicker)0x0;
|
|
local_1c = g_manager;
|
|
activePicker = (WeightedOutcomePicker)0x0;
|
|
activePickerEnd = GHIDRA_CAST<int *>(0x0);
|
|
activePickerCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
chargeBeforeUse = 0;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2 != 0) {
|
|
do {
|
|
if ((((chargeBeforeUse != this->_activeDesc[0]._item) &&
|
|
(piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar8) + chargeBeforeUse * 4)), piVar1 != GHIDRA_CAST<int *>(0x0))) &&
|
|
((*piVar1 == 3 && (((piVar1[0x2f] & 1U) == 0 && (piVar1[0x12] != 0)))))) &&
|
|
(bVar5 = (GHIDRA_CAST<Item *>((piVar1)))->Item::IsAvailable(0xffffffff), bVar5 != 0)) {
|
|
iVar7 = piVar1[1];
|
|
uVar9 = GHIDRA_INT(activePickerEnd) - GHIDRA_INT(WVar10) >> 3;
|
|
qualityWeight = *GHIDRA_CAST<int *>((&DAT_00b6bc60 + piVar1[0x30] * 4));
|
|
uVar6 = 0;
|
|
if (uVar9 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar6 * 8)) == iVar7) {
|
|
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + 4 + uVar6 * 8));
|
|
*piVar1 = *piVar1 + qualityWeight;
|
|
if (*piVar1 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + 4 + uVar6 * 8)) = 0;
|
|
}
|
|
goto LAB_007ac194;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < uVar9);
|
|
}
|
|
if (0 < qualityWeight) {
|
|
newOutcomeId = iVar7;
|
|
newOutcomeWeight = qualityWeight;
|
|
if (activePickerEnd == activePickerCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(activePickerEnd,&newOutcomeId);
|
|
WVar10 = activePicker;
|
|
}
|
|
else {
|
|
*activePickerEnd = iVar7;
|
|
activePickerEnd[1] = qualityWeight;
|
|
activePickerEnd = activePickerEnd + 2;
|
|
}
|
|
}
|
|
}
|
|
LAB_007ac194:
|
|
chargeBeforeUse = chargeBeforeUse + 1;
|
|
pvVar8 = (local_1c->_itemConfig)._collectibles._begin;
|
|
} while (GHIDRA_UINT(chargeBeforeUse) <
|
|
GHIDRA_UINT((GHIDRA_INT((local_1c->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2)));
|
|
}
|
|
uVar6 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0x8a0)))))->RNG::Next();
|
|
in_XMM0_Da = 7.00649e-45;
|
|
rng._shift1 = 5;
|
|
rng._seed = uVar6;
|
|
rng._shift2 = 9;
|
|
rng._shift3 = 7;
|
|
uVar6 = (GHIDRA_CAST<WeightedOutcomePicker *>((&activePicker)))->WeightedOutcomePicker::PickOutcome(rng);
|
|
local_8 = 0xffffffff;
|
|
if (activePicker != (WeightedOutcomePicker)0x0) {
|
|
uVar9 = (GHIDRA_INT(activePickerCapacity) - GHIDRA_INT(activePicker) >> 3) * 8;
|
|
WVar10 = activePicker;
|
|
if (0xfff < uVar9) {
|
|
WVar10 = *GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<char *>(activePicker) + -4));
|
|
uVar9 = uVar9 + 0x23;
|
|
if (0x1f < (GHIDRA_INT(activePicker) - GHIDRA_INT(WVar10)) - 4U) goto LAB_007ac7ad;
|
|
}
|
|
operator_delete((void *)WVar10,uVar9);
|
|
activePicker = (WeightedOutcomePicker)0x0;
|
|
activePickerEnd = GHIDRA_CAST<int *>(0x0);
|
|
activePickerCapacity = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0x8a0)))))->RNG::Next();
|
|
uVar6 = ItemPool::CreateGlitchedCollectible(&pGVar4->_proceduralItemManager,uVar6,8);
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(uVar6);
|
|
if (collectibleConfig->type != 3) goto LAB_007ac2d2;
|
|
}
|
|
if (uVar6 != 0) {
|
|
iVar7 = GetTrinketMultiplier(this,0x8a);
|
|
RemoveCollectible(this,this->_activeDesc[0]._item,0,0,1);
|
|
AddCollectible(this,uVar6,0,0,0,0,0);
|
|
if (1 < iVar7) {
|
|
uVar6 = 0x14;
|
|
if (iVar7 == 2) {
|
|
uVar6 = 10;
|
|
}
|
|
uVar9 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0x8a0)))))->RNG::RandomInt(100);
|
|
if (uVar9 < uVar6) {
|
|
iVar7 = GetCollectibleMaxCharge
|
|
(this,this->_activeDesc[0]._item,this->_activeDesc[0]._varData,unused);
|
|
AddActiveCharge(this,iVar7,0,0,0,0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007ac2d2:
|
|
bVar5 = HasTrinket(this,0x7a,0);
|
|
if ((bVar5 != 0) && (slot == 0)) {
|
|
iVar7 = this->_activeDesc[0]._item;
|
|
bVar5 = ItemConfig::IsValidCollectible(iVar7);
|
|
if ((bVar5 != 0) &&
|
|
(((unk == 0 &&
|
|
(collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar7),
|
|
collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) && (collectibleConfig->type == 3)))) {
|
|
IsLocalPlayer(this);
|
|
SoundEffects::PlayWithFartOverride(0x385,in_XMM0_Da,2,0,1.0);
|
|
DropCollectible(this,this->_activeDesc[0]._item,GHIDRA_CAST<Entity_Pickup *>(0x0),0);
|
|
}
|
|
}
|
|
bVar5 = HasTrinket(this,0xb5,0);
|
|
if ((bVar5 != 0) && (slot == 0)) {
|
|
iVar7 = this->_activeDesc[0]._item;
|
|
bVar5 = ItemConfig::IsValidCollectible(iVar7);
|
|
if (bVar5 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar7);
|
|
iVar7 = GetActiveMaxCharge(this,0);
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (((iVar7 != 0) || (collectibleConfig->maxCharges < 1)) &&
|
|
((bVar5 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasTrinketEffect(0xb5), bVar5 != 0 &&
|
|
(*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)))) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddTrinketEffect(0xb5,1,1);
|
|
manager = g_manager;
|
|
expansionPicker = (WeightedOutcomePicker)0x0;
|
|
expansionPickerEnd = GHIDRA_CAST<int *>(0x0);
|
|
expansionPickerCapacity = GHIDRA_CAST<int *>(0x0);
|
|
WVar10 = (WeightedOutcomePicker)0x0;
|
|
activePicker = (WeightedOutcomePicker)0x0;
|
|
activePickerEnd = GHIDRA_CAST<int *>(0x0);
|
|
activePickerCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 2;
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
_unk = 0;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2 != 0) {
|
|
do {
|
|
if (((((_unk != this->_activeDesc[0]._item) &&
|
|
(piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar8) + _unk * 4)), piVar1 != GHIDRA_CAST<int *>(0x0))) && (*piVar1 == 3))
|
|
&& (((piVar1[0x2f] & 1U) == 0 && (piVar1[0x12] != 0)))) &&
|
|
((bVar5 = (GHIDRA_CAST<Item *>((piVar1)))->Item::IsAvailable(0xffffffff), bVar5 != 0 &&
|
|
((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 ||
|
|
(isDeathmatchBanned =
|
|
(**(code **)(*GHIDRA_CAST<int *>((g_game->_deathmatchManager)._type) + 0x30))(piVar1[1]),
|
|
isDeathmatchBanned == '\0')))))) {
|
|
iVar7 = piVar1[1];
|
|
if (iVar7 < 0x1ea) {
|
|
if ((iVar7 == 0x1e9) || (iVar7 == 0x1a6)) goto LAB_007ac5c0;
|
|
isExcludedItem = iVar7 == 0x1e8;
|
|
}
|
|
else {
|
|
isExcludedItem = iVar7 == 0x2bf;
|
|
}
|
|
if (!isExcludedItem) {
|
|
iVar2 = piVar1[0x1d];
|
|
if ((iVar2 == 1) || (iVar2 == 2)) {
|
|
uVar6 = 0;
|
|
uVar9 = GHIDRA_INT(expansionPickerEnd) - GHIDRA_INT(expansionPicker) >> 3;
|
|
if (uVar9 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(expansionPicker) + uVar6 * 8)) == iVar7) {
|
|
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(expansionPicker) + 4 + uVar6 * 8));
|
|
*piVar1 = *piVar1 + 1;
|
|
if (*piVar1 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(expansionPicker) + 4 + uVar6 * 8)) = 0;
|
|
}
|
|
goto LAB_007ac5c0;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < uVar9);
|
|
}
|
|
local_1c = GHIDRA_CAST<Manager *>(0x1);
|
|
expansionOutcomeId = iVar7;
|
|
if (expansionPickerEnd == expansionPickerCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(expansionPickerEnd,&expansionOutcomeId);
|
|
}
|
|
else {
|
|
*expansionPickerEnd = iVar7;
|
|
expansionPickerEnd[1] = 1;
|
|
expansionPickerEnd = expansionPickerEnd + 2;
|
|
}
|
|
}
|
|
else if (iVar2 == 3) {
|
|
uVar6 = 0;
|
|
uVar9 = GHIDRA_INT(activePickerEnd) - GHIDRA_INT(WVar10) >> 3;
|
|
if (uVar9 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(WVar10) + uVar6 * 8)) == iVar7) {
|
|
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(WVar10) + 4 + uVar6 * 8));
|
|
*piVar1 = *piVar1 + 1;
|
|
if (*piVar1 < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(WVar10) + 4 + uVar6 * 8)) = 0;
|
|
}
|
|
goto LAB_007ac5c0;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < uVar9);
|
|
}
|
|
newOutcomeWeight = 1;
|
|
newOutcomeId = iVar7;
|
|
if (activePickerEnd == activePickerCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(activePickerEnd,&newOutcomeId);
|
|
WVar10 = activePicker;
|
|
}
|
|
else {
|
|
*activePickerEnd = iVar7;
|
|
activePickerEnd[1] = 1;
|
|
activePickerEnd = activePickerEnd + 2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007ac5c0:
|
|
_unk = _unk + 1;
|
|
pvVar8 = (manager->_itemConfig)._collectibles._begin;
|
|
} while (_unk < GHIDRA_UINT((GHIDRA_INT((manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2)));
|
|
}
|
|
slot = 1;
|
|
iVar7 = GetTrinketMultiplier(this,0xb5);
|
|
if (iVar7 == 2) {
|
|
slot = 2;
|
|
}
|
|
else if (iVar7 == 3) {
|
|
slot = 2;
|
|
uVar6 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0xb50)))))->RNG::Next();
|
|
rng_00._shift1 = 5;
|
|
rng_00._seed = uVar6;
|
|
rng_00._shift2 = 9;
|
|
rng_00._shift3 = 7;
|
|
uVar6 = (GHIDRA_CAST<WeightedOutcomePicker *>((&activePicker)))->WeightedOutcomePicker::PickOutcome(rng_00);
|
|
if (uVar6 == 0) {
|
|
WVar10 = activePicker;
|
|
}
|
|
else {
|
|
iVar7 = this->_itemState;
|
|
this->_itemState = 0;
|
|
UseActiveItem(this,&sStack0000000a,uVar6,5,0,0);
|
|
WVar10 = activePicker;
|
|
if (this->_itemState == 0) {
|
|
this->_itemState = iVar7;
|
|
}
|
|
else {
|
|
this->_itemStateCooldown = 0;
|
|
}
|
|
}
|
|
}
|
|
do {
|
|
pvVar8 = (this->_trinketRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar8) + 0xb50));
|
|
uVar6 = *rngSeed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar6 = *rngSeed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar8) + 0xb54)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar8) + 0xb58)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar8) + 0xb5c)) & 0x1f) ^ uVar6;
|
|
*rngSeed = uVar6;
|
|
rng_01._shift1 = 5;
|
|
rng_01._seed = uVar6;
|
|
rng_01._shift2 = 9;
|
|
rng_01._shift3 = 7;
|
|
uVar6 = (GHIDRA_CAST<WeightedOutcomePicker *>((&expansionPicker)))->WeightedOutcomePicker::PickOutcome(rng_01);
|
|
if (uVar6 != 0) {
|
|
iVar7 = this->_itemState;
|
|
this->_itemState = 0;
|
|
UseActiveItem(this,&sStack0000000a,uVar6,5,0,0);
|
|
if (this->_itemState == 0) {
|
|
this->_itemState = iVar7;
|
|
}
|
|
else {
|
|
this->_itemStateCooldown = 0;
|
|
}
|
|
}
|
|
slot = slot + -1;
|
|
} while (slot != 0);
|
|
if (WVar10 != (WeightedOutcomePicker)0x0) {
|
|
uVar6 = GHIDRA_INT(activePickerCapacity) - GHIDRA_INT(WVar10) & 0xfffffff8;
|
|
freeBlock = WVar10;
|
|
if (0xfff < uVar6) {
|
|
freeBlock = *GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<char *>(WVar10) + -4));
|
|
uVar6 = uVar6 + 0x23;
|
|
if (0x1f < (GHIDRA_INT(WVar10) - GHIDRA_INT(freeBlock)) - 4U) goto LAB_007ac7ad;
|
|
}
|
|
operator_delete((void *)freeBlock,uVar6);
|
|
}
|
|
if (expansionPicker != (WeightedOutcomePicker)0x0) {
|
|
uVar6 = GHIDRA_INT(expansionPickerCapacity) - GHIDRA_INT(expansionPicker) & 0xfffffff8;
|
|
WVar10 = expansionPicker;
|
|
if (0xfff < uVar6) {
|
|
WVar10 = *GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<char *>(expansionPicker) + -4));
|
|
uVar6 = uVar6 + 0x23;
|
|
if (0x1f < (GHIDRA_INT(expansionPicker) - GHIDRA_INT(WVar10)) - 4U) {
|
|
LAB_007ac7ad:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete((void *)WVar10,uVar6);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007ac7e0
|
|
void Entity_Player::DischargeActiveItem(uint slot, byte unk)
|
|
{
|
|
PlayerManager *this_00;
|
|
code *pcVar1;
|
|
undefined4 uVar2;
|
|
int iVar3;
|
|
float fVar4;
|
|
byte bVar5;
|
|
uint uVar6;
|
|
ItemConfig_Item *itemConfig;
|
|
int varData;
|
|
Entity *effect;
|
|
int *playerSlot;
|
|
undefined4 extraout_EAX;
|
|
ColorMod *color;
|
|
undefined4 *puVar8;
|
|
char isCacheDirty;
|
|
Entity_Player *pEVar9;
|
|
int iVar10;
|
|
float *historyItem;
|
|
void *pvVar11;
|
|
Vector *position;
|
|
uint *rngSeed;
|
|
undefined4 uVar12;
|
|
TypeDescriptor *pTVar13;
|
|
TypeDescriptor *pTVar14;
|
|
undefined4 uVar15;
|
|
float local_88;
|
|
float fStack_84;
|
|
Entity_Player *pEStack_80;
|
|
Entity_Player *pEStack_7c;
|
|
uint activeSlot;
|
|
int local_74;
|
|
int descOffset;
|
|
float *local_6c;
|
|
Entity_Player *local_68;
|
|
EntityPtr local_64;
|
|
EntityPtr local_60;
|
|
Game *local_5c;
|
|
Entity_Player *local_58;
|
|
char isItemMoved;
|
|
Color local_50;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
float local_14;
|
|
undefined4 *dstDescHead;
|
|
char *dstDescTail;
|
|
float *historyEnd;
|
|
Manager *manager;
|
|
EntityPtr otherPlayer;
|
|
int partialCharge;
|
|
int rechargeCooldown;
|
|
char *srcDescTail;
|
|
int subCharge;
|
|
int varData;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((&local_50)[1]._offset);
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00affbc7;
|
|
local_1c = ExceptionList;
|
|
uVar6 = __security_cookie ^ GHIDRA_UINT(((&local_50)[1]._colorize + 1));
|
|
local_68 = GHIDRA_CAST<Entity_Player *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_68)) + 0x1))),unk));
|
|
activeSlot = slot;
|
|
if (3 < slot) {
|
|
return;
|
|
}
|
|
descOffset = slot * 0x20 + 0x1580;
|
|
if (this->_activeDesc[slot]._item == 0) {
|
|
return;
|
|
}
|
|
local_6c = GHIDRA_CAST<float *>((slot * 0x20));
|
|
local_64 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>((local_6c + 0x563)) + GHIDRA_INT(this)));
|
|
ExceptionList = &local_1c;
|
|
local_58 = this;
|
|
local_24 = uVar6;
|
|
local_74 = GetActiveMaxCharge(this,slot);
|
|
local_5c = GHIDRA_CAST<Game *>(GetActiveMaxCharge(this,slot));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((local_6c + 0x562)) + GHIDRA_INT(this))) < local_74) {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((local_6c + 0x562)) + GHIDRA_INT(this))) - local_74;
|
|
itemConfig = ItemConfig::GetCollectible
|
|
(&g_manager->_itemConfig,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + descOffset)));
|
|
if ((itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (varData = FUN_007308d0(uVar6), varData != 2)) {
|
|
varData = FUN_007308d0(uVar6);
|
|
if (varData == 1) {
|
|
iVar10 = -1;
|
|
}
|
|
varData = GetEffectiveSoulCharge(this);
|
|
if ((varData < 1) ||
|
|
(((this->_playerType == 0x12 && (bVar5 = HasCollectible(this,0x26b,0), bVar5 != 0)) &&
|
|
(uVar6 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0x26b0)))))->RNG::RandomInt(2),
|
|
uVar6 == 0)))) {
|
|
varData = GetEffectiveBloodCharge(this);
|
|
if (0 < varData) {
|
|
AddBloodCharge(this,iVar10);
|
|
}
|
|
}
|
|
else {
|
|
AddSoulCharge(this,iVar10);
|
|
}
|
|
}
|
|
}
|
|
bVar5 = HasCollectible(this,0x74,0);
|
|
if ((bVar5 != 0) && (local_60 = (EntityPtr)(GHIDRA_INT(local_64) + 1), GHIDRA_INT(local_60) < GHIDRA_INT(local_5c))) {
|
|
local_5c = GHIDRA_CAST<Game *>(g_manager);
|
|
itemConfig = ItemConfig::GetCollectible
|
|
(&g_manager->_itemConfig,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + descOffset)));
|
|
iVar10 = GetActiveMaxCharge(this,activeSlot);
|
|
if (itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
if (iVar10 == 1) {
|
|
local_64 = local_60;
|
|
if (GHIDRA_INT(local_60) < local_74 / 2) {
|
|
local_64 = (EntityPtr)(local_74 / 2);
|
|
}
|
|
}
|
|
else if (iVar10 == 0) {
|
|
local_64 = local_60;
|
|
local_60 = (EntityPtr)0xab;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_60));
|
|
(GHIDRA_CAST<SoundEffects *>(((SoundEffects *)
|
|
&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_5c->_glowingHourglassStates[0]._gameState)) + 0x3934))))))->SoundEffects::Play(GHIDRA_INT(local_60),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
uVar6 = Random();
|
|
uVar15 = 0;
|
|
pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar12 = 0;
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar6);
|
|
iVar10 = __RTDynamicCast(effect,uVar12,pTVar13,pTVar14,uVar15);
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar10 + 0x358)) = 0x3f800000;
|
|
}
|
|
uVar6 = activeSlot;
|
|
local_74 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((local_6c + 0x562)) + GHIDRA_INT(this)));
|
|
SetActiveCharge(this,GHIDRA_INT(local_64),activeSlot);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1826))) = 0;
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + descOffset));
|
|
if (iVar10 != 0x2bf) {
|
|
if ((iVar10 == 0x2c7) && (uVar6 == 2)) {
|
|
otherPlayer = this->_twinPlayer;
|
|
if (otherPlayer != (EntityPtr)0x0) {
|
|
iVar10 = this->_activeDesc[2]._unk;
|
|
varData = this->_activeDesc[2]._charge;
|
|
iVar3 = this->_activeDesc[2]._batteryCharge;
|
|
subCharge = this->_activeDesc[2]._subCharge;
|
|
rechargeCooldown = this->_activeDesc[2]._timeRechargeCooldown;
|
|
partialCharge = this->_activeDesc[2]._partialCharge;
|
|
varData = this->_activeDesc[2]._varData;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15c0)) = this->_activeDesc[2]._item;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15c4)) = iVar10;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15c8)) = varData;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15cc)) = iVar3;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15d0)) = subCharge;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15d4)) = rechargeCooldown;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15d8)) = partialCharge;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x15dc)) = varData;
|
|
active_used_post(this,2,(byte)local_68,local_74);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
pvVar11 = this->_backupPlayer;
|
|
if (pvVar11 != (void *)0x0) {
|
|
iVar10 = this->_activeDesc[2]._unk;
|
|
varData = this->_activeDesc[2]._charge;
|
|
iVar3 = this->_activeDesc[2]._batteryCharge;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15c0)) = this->_activeDesc[2]._item;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15c4)) = iVar10;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15c8)) = varData;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15cc)) = iVar3;
|
|
iVar10 = this->_activeDesc[2]._timeRechargeCooldown;
|
|
varData = this->_activeDesc[2]._partialCharge;
|
|
iVar3 = this->_activeDesc[2]._varData;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15d0)) = this->_activeDesc[2]._subCharge;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15d4)) = iVar10;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15d8)) = varData;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x15dc)) = iVar3;
|
|
active_used_post(this,2,(byte)local_68,local_74);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
goto LAB_007ad261;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((local_6c + 0x567)) + GHIDRA_INT(this))) == 0) {
|
|
iVar10 = 0;
|
|
local_5c = g_game;
|
|
playerSlot = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x80))));
|
|
LAB_007aca80:
|
|
if (*playerSlot != 0) goto code_r0x007aca85;
|
|
local_68 = operator_new(0x2f00);
|
|
local_14 = 0.0;
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uVar12 = 0;
|
|
}
|
|
else {
|
|
constructor(local_68);
|
|
uVar12 = extraout_EAX;
|
|
}
|
|
local_14 = -NAN;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>((&local_5c->_seedEffects + -1)) + iVar10 * 4)) = uVar12;
|
|
if (-1 < iVar10) {
|
|
otherPlayer = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>((&g_game->_seedEffects + -1)) + iVar10 * 4));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((local_6c + 0x567)) + GHIDRA_INT(this))) = iVar10 + 1;
|
|
local_64 = otherPlayer;
|
|
(**(code **)(*GHIDRA_CAST<int *>(otherPlayer) + 4))(this->_type,this->_variant,0,this->_initSeed);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(otherPlayer) + 0x33c)))->x = (this->_pos).x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x340)) = (this->_pos).y;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(otherPlayer) + 0x360)))->x = (this->_velocity).x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x364)) = (this->_velocity).y;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(otherPlayer) + 0x1508)))))->TemporaryEffects::AddNullEffect(100,1,1);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1340)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1344)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1348)) = 0;
|
|
this->_boneHeartsMask = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1d88)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1da4)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x134c)) = 6;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1350)) = -1;
|
|
UpdateBlackHeartMask(GHIDRA_CAST<Entity_Player *>(otherPlayer));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x154c)) = this->_edenSpeed;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1550)) = this->_edenFireDelay;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1554)) = this->_edenDamage;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1558)) = this->_edenTearRange;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x155c)) = this->_edenShotSpeed;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1560)) = this->_edenLuck;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(otherPlayer) + 0x16b4)) = this->_totalDamageTaken;
|
|
SyncConsumables(this,GHIDRA_CAST<Entity_Player *>(otherPlayer),0xffffffff);
|
|
pvVar11 = (this->_collectibleRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar11) + 0x2bf0));
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(otherPlayer) + 0x1df8)) = 1;
|
|
historyItem = (local_58->_history)._historyItems._begin;
|
|
pEVar9 = local_58;
|
|
if (historyItem != (local_58->_history)._historyItems._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((historyItem + 1)) == '\0') {
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_INT((pEVar9->_collectibleCounts)._begin) + GHIDRA_INT(historyItem[2]) * 4))) {
|
|
itemConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(historyItem[2]));
|
|
pEVar9 = local_58;
|
|
if (itemConfig->type != 3) {
|
|
bVar5 = CanRerollCollectible(local_58,GHIDRA_INT(historyItem[2]),0);
|
|
if ((bVar5 != 0) && (0 < GHIDRA_INT(*historyItem))) {
|
|
local_50._colorize[0] = *historyItem;
|
|
local_50._colorize[1] = historyItem[1];
|
|
local_50._colorize[3] = historyItem[3];
|
|
local_68 = GHIDRA_CAST<Entity_Player *>(historyItem[6]);
|
|
fVar4 = historyItem[4];
|
|
pEStack_7c = GHIDRA_CAST<Entity_Player *>(historyItem[5]);
|
|
local_50._colorize[2] = 0.0;
|
|
local_60 = (EntityPtr)0x0;
|
|
local_50._offset[0] = fVar4;
|
|
local_50._offset[1] = (float)pEStack_7c;
|
|
local_50._offset[2] = (float)local_68;
|
|
do {
|
|
if (local_50._colorize[2] != 0.0) goto LAB_007ace88;
|
|
uVar6 = *rngSeed;
|
|
local_5c = GHIDRA_CAST<Game *>(&g_game->_itemPool);
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar6 = *rngSeed;
|
|
if (uVar6 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x2bf4)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x2bf8)) & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x2bfc)) & 0x1f) ^ uVar6;
|
|
*rngSeed = uVar6;
|
|
local_50._colorize[2] =
|
|
(float)ItemPool::GetCollectible
|
|
(GHIDRA_CAST<ItemPool *>(local_5c),GHIDRA_INT(historyItem[6]),uVar6,6,0,0);
|
|
local_60 = (EntityPtr)(GHIDRA_INT(local_60) + 1);
|
|
} while (GHIDRA_INT(local_60) < 10);
|
|
if (local_50._colorize[2] == 0.0) {
|
|
local_50._colorize[2] = 3.50325e-44;
|
|
}
|
|
LAB_007ace88:
|
|
AddCollectible(GHIDRA_CAST<Entity_Player *>(local_64),GHIDRA_INT(local_50._colorize[2]),0,0,0,0,0);
|
|
historyEnd = *(void **)(GHIDRA_CAST<char *>(local_64) + 0x1df0);
|
|
if (historyEnd == *(void **)(GHIDRA_CAST<char *>(local_64) + 0x1df4)) {
|
|
std::vector<28byte>::_Emplace_reallocate(historyEnd,local_50._colorize);
|
|
}
|
|
else {
|
|
*historyEnd = local_50._colorize[0];
|
|
historyEnd[1] = local_50._colorize[1];
|
|
historyEnd[2] = local_50._colorize[2];
|
|
historyEnd[3] = local_50._colorize[3];
|
|
historyEnd[4] = fVar4;
|
|
historyEnd[5] = (float)pEStack_7c;
|
|
historyEnd[6] = (float)local_68;
|
|
*(void **)(GHIDRA_CAST<char *>(local_64) + 0x1df0) =
|
|
(void *)(GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(local_64) + 0x1df0)) + 0x1c);
|
|
}
|
|
}
|
|
pEVar9 = local_58;
|
|
}
|
|
}
|
|
}
|
|
historyItem = historyItem + 7;
|
|
} while (historyItem != (pEVar9->_history)._historyItems._end);
|
|
}
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_64) + 0x1df8)) = 0;
|
|
this = local_58;
|
|
goto LAB_007acefb;
|
|
}
|
|
goto LAB_007acacf;
|
|
}
|
|
LAB_007acefb:
|
|
local_68 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>((local_6c + 0x567)) + GHIDRA_INT(this)));
|
|
if (0 < GHIDRA_INT(local_68)) {
|
|
pEVar9 = GHIDRA_CAST<Entity_Player *>((g_game->_seedEffects)._stageSeeds[GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_68[-1])) + 0x2ee2))))]);
|
|
local_58 = pEVar9;
|
|
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar9->_isControlsEnabled = 0;
|
|
local_64 = *GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_darkEsau))) + 0x0))));
|
|
if (local_64 != (EntityPtr)0x0) {
|
|
local_5c = GHIDRA_CAST<Game *>(&this->_darkEsau);
|
|
std::multiset<unsigned_int>::erase(&local_5c);
|
|
this->_darkEsau = (EntityPtr)0x0;
|
|
}
|
|
local_6c = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetNullEffect(0x6d);
|
|
if (local_6c == GHIDRA_CAST<float *>(0x0)) {
|
|
pvVar11 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar11) & 0xfffffffcU)) <
|
|
0x1b5) {
|
|
local_88 = 0.0;
|
|
}
|
|
else {
|
|
local_88 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar11) + 0x1b4));
|
|
}
|
|
pEStack_80 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(local_88) + 0x78));
|
|
fStack_84 = 0.0;
|
|
pEStack_7c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
local_88 = *local_6c;
|
|
fStack_84 = local_6c[1];
|
|
pEStack_80 = GHIDRA_CAST<Entity_Player *>(local_6c[2]);
|
|
pEStack_7c = GHIDRA_CAST<Entity_Player *>(local_6c[3]);
|
|
}
|
|
this_00 = &g_game->_playerManager;
|
|
pEVar9->_totalDamageTaken = this->_totalDamageTaken;
|
|
local_50._colorize[3] = local_88;
|
|
local_50._offset[0] = fStack_84;
|
|
local_50._offset[1] = (float)pEStack_80;
|
|
local_50._offset[2] = (float)pEStack_7c;
|
|
(GHIDRA_CAST<PlayerManager *>((this_00)))->PlayerManager::replace_player(this,pEVar9);
|
|
manager = g_manager;
|
|
local_60 = (EntityPtr)0x418;
|
|
(g_game->_seedEffects)._stageSeeds[GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_68[-1])) + 0x2ee2))))] = GHIDRA_INT(this);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_60));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_60),1.0,2,0,1.0,0.0);
|
|
pEVar9 = local_58;
|
|
if (local_58->_playerType != this->_playerType) {
|
|
ChangePlayerType(local_58,this->_playerType,1);
|
|
}
|
|
if (local_64 != (EntityPtr)0x0) {
|
|
if (pEVar9->_darkEsau != (EntityPtr)0x0) {
|
|
local_5c = GHIDRA_CAST<Game *>(&pEVar9->_darkEsau);
|
|
std::multiset<unsigned_int>::erase(&local_5c);
|
|
}
|
|
pEVar9->_darkEsau = local_64;
|
|
std::multiset<unsigned_int>::insert(&pEVar9->_darkEsau);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar9->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x6d,-1);
|
|
if (local_6c != GHIDRA_CAST<float *>(0x0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar9->_temporaryeffects)))->TemporaryEffects::AddEffect(local_50._colorize + 3,1,1);
|
|
}
|
|
pvVar11 = (this->_history)._historyItems._begin;
|
|
isCacheDirty = '\0';
|
|
isItemMoved = '\0';
|
|
if (pvVar11 != (this->_history)._historyItems._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar11) + 4)) == '\0') {
|
|
local_68 = (Entity_Player *)
|
|
ItemConfig::GetCollectible
|
|
(&g_manager->_itemConfig,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 8)));
|
|
if (((local_68 == GHIDRA_CAST<Entity_Player *>(0x0)) || (*GHIDRA_CAST<int *>(local_68) == 3)) ||
|
|
((*GHIDRA_CAST<uint *>(&(local_68->_sprite)._overlayRenderFirst) & 0x8000) == 0)) {
|
|
isCacheDirty = isItemMoved;
|
|
goto LAB_007ad16e;
|
|
}
|
|
*(undefined4 *)
|
|
(GHIDRA_INT((local_58->_collectibleCounts)._begin) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 8)) * 4) =
|
|
*(undefined4 *)
|
|
(GHIDRA_INT((this->_collectibleCounts)._begin) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 8)) * 4);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((this->_collectibleCounts)._begin) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 8)) * 4))
|
|
= 0;
|
|
(GHIDRA_CAST<History *>((&local_58->_history)))->History::AddHistoryItem(pvVar11);
|
|
puVar8 = GHIDRA_CAST<undefined4 *>(std)::vector<HistoryItem>::erase(&pEStack_7c,pvVar11);
|
|
pvVar11 = (void *)*puVar8;
|
|
local_58->_cacheFlags =
|
|
local_58->_cacheFlags | *GHIDRA_CAST<uint *>(((local_68->_sprite)._filename._buf + 0xc));
|
|
isCacheDirty = '\x01';
|
|
isItemMoved = '\x01';
|
|
}
|
|
else {
|
|
LAB_007ad16e:
|
|
pvVar11 = (void *)(GHIDRA_INT(pvVar11) + 0x1c);
|
|
}
|
|
} while (pvVar11 != (this->_history)._historyItems._end);
|
|
if (isCacheDirty != '\0') {
|
|
(local_58->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
pEVar9 = local_58;
|
|
uVar6 = Random();
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
|
|
effect->Update();
|
|
uVar6 = *GHIDRA_CAST<uint *>((GHIDRA_INT((&(pEVar9->_sprite)._filename + -3)) + descOffset));
|
|
if ((uVar6 != *GHIDRA_CAST<uint *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + descOffset))) && (uVar6 != 0))
|
|
{
|
|
RemoveCollectible(pEVar9,uVar6,1,0,1);
|
|
}
|
|
puVar8 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + descOffset));
|
|
uVar12 = puVar8[1];
|
|
uVar15 = puVar8[2];
|
|
uVar2 = puVar8[3];
|
|
dstDescHead = GHIDRA_CAST<undefined4 *>((GHIDRA_INT((&(pEVar9->_sprite)._filename + -3)) + descOffset));
|
|
*dstDescHead = *puVar8;
|
|
dstDescHead[1] = uVar12;
|
|
dstDescHead[2] = uVar15;
|
|
dstDescHead[3] = uVar2;
|
|
srcDescTail = (this->_sprite)._filename._buf + descOffset + -0x38;
|
|
uVar12 = *GHIDRA_CAST<undefined4 *>((srcDescTail + 4));
|
|
uVar15 = *GHIDRA_CAST<undefined4 *>((srcDescTail + 8));
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((srcDescTail + 0xc));
|
|
dstDescTail = (pEVar9->_sprite)._filename._buf + descOffset + -0x38;
|
|
*GHIDRA_CAST<undefined4 *>(dstDescTail) = *GHIDRA_CAST<undefined4 *>(srcDescTail);
|
|
*GHIDRA_CAST<undefined4 *>((dstDescTail + 4)) = uVar12;
|
|
*GHIDRA_CAST<undefined4 *>((dstDescTail + 8)) = uVar15;
|
|
*GHIDRA_CAST<undefined4 *>((dstDescTail + 0xc)) = uVar2;
|
|
AnimateCollectible(pEVar9,0x2bf,GHIDRA_CAST<byte *>("UseItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
SyncConsumables(this,pEVar9,0xffffffff);
|
|
pEVar9->_isControlsEnabled = 1;
|
|
pEVar9->_controlsCooldown = 1;
|
|
bVar5 = HasCollectible(this,0x248,0);
|
|
if ((bVar5 != 0) || (bVar5 = HasCollectible(pEVar9,0x248,0), bVar5 != 0)) {
|
|
AddWisp(pEVar9,0x2bf,&this->_pos,0,0);
|
|
}
|
|
TriggerNewRoom_TemporaryEffects(pEVar9);
|
|
}
|
|
}
|
|
LAB_007ad261:
|
|
uVar6 = activeSlot;
|
|
active_used_post(this,activeSlot,unk,local_74);
|
|
if (uVar6 == 3) {
|
|
SetPocketActiveItem(this,0,3,0);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
code_r0x007aca85:
|
|
iVar10 = iVar10 + 1;
|
|
playerSlot = playerSlot + 1;
|
|
if (3 < iVar10) goto LAB_007acacf;
|
|
goto LAB_007aca80;
|
|
LAB_007acacf:
|
|
manager = g_manager;
|
|
local_60 = (EntityPtr)0x35;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_60));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_60),1.0,2,0,1.0,0.0);
|
|
uVar6 = Random();
|
|
position = &this->_pos;
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x61,position,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
|
|
effect->Update();
|
|
local_5c = GHIDRA_CAST<Game *>((local_58->_posOffset).y);
|
|
(GHIDRA_CAST<Color *>((&local_50)))->Color::Color();
|
|
uVar6 = Random();
|
|
Game::SpawnParticles
|
|
(g_game,position,0x23,8,
|
|
(float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0,color,(float)local_5c,0);
|
|
uVar6 = Random();
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,position,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2,uVar6);
|
|
effect->Update();
|
|
this = local_58;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&local_58->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x83,1,1);
|
|
EvaluateItems(this);
|
|
AnimateCollectible(this,0x2bf,GHIDRA_CAST<byte *>("UseItem"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
if (unk == 0) {
|
|
RemoveCollectible(this,*GHIDRA_CAST<uint *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + descOffset)),0,
|
|
activeSlot,1);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
goto LAB_007acefb;
|
|
}
|
|
|
|
// 007ad3a0
|
|
void Entity_Player::TryRemoveTrinketCostume(int trinketId)
|
|
{
|
|
ItemConfig_Item *Item;
|
|
byte isHasTrinketEffect;
|
|
void *trinkets;
|
|
|
|
trinkets = (g_manager->_itemConfig)._trinkets._begin;
|
|
if ((GHIDRA_INT((trinketId & 0x7fffU)) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(trinkets) >> 2) &&
|
|
(Item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(trinkets) + (trinketId & 0x7fffU) * 4)),
|
|
Item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
if ((Item->addCostumeOnPickup == 0) &&
|
|
(isHasTrinketEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasTrinketEffect(trinketId),
|
|
isHasTrinketEffect != 0)) {
|
|
return;
|
|
}
|
|
RemoveCostume(this,Item);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ad400
|
|
void Entity_Player::TryRemoveNullCostume(int param_1)
|
|
{
|
|
Entity_Player *in_ECX;
|
|
void *nullItems;
|
|
|
|
if ((param_1 < 0) ||
|
|
(nullItems = (g_manager->_itemConfig)._nullItems._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) >> 2 <= param_1)) {
|
|
RemoveCostume(in_ECX,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
return;
|
|
}
|
|
RemoveCostume(in_ECX,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(nullItems) + param_1 * 4)));
|
|
return;
|
|
}
|
|
|
|
// 007ad440
|
|
uint Entity_Player::GetMaxPocketItems()
|
|
{
|
|
byte isHasItem;
|
|
uint result;
|
|
uint count;
|
|
|
|
count = 1;
|
|
isHasItem = HasCollectible(this,0xfb,0);
|
|
if (isHasItem == 0) {
|
|
isHasItem = HasCollectible(this,0xfc,0);
|
|
if (isHasItem == 0) {
|
|
isHasItem = HasCollectible(this,0x1c6,0);
|
|
if (isHasItem == 0) goto LAB_007ad488;
|
|
}
|
|
}
|
|
count = 2;
|
|
LAB_007ad488:
|
|
if ((this->_pocketSlots[1] == 2) && (0 < this->_pocketSlots[0])) {
|
|
count = count + 1;
|
|
}
|
|
if ((this->_pocketSlots[3] == 2) && (0 < this->_pocketSlots[2])) {
|
|
count = count + 1;
|
|
}
|
|
if ((this->_pocketSlots[5] == 2) && (0 < this->_pocketSlots[4])) {
|
|
count = count + 1;
|
|
}
|
|
if ((this->_pocketSlots[7] != 2) || (result = count + 1, this->_pocketSlots[6] < 1)) {
|
|
result = count;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// 007ad4e0
|
|
void Entity_Player::stop_costume_item_anims()
|
|
{
|
|
PlayerCostumeMap *costumeMapEntry;
|
|
int batchesLeft;
|
|
|
|
if (this->_isCoopGhost == 0) {
|
|
costumeMapEntry = this->_playerCostumeMap + 1;
|
|
batchesLeft = 3;
|
|
do {
|
|
if (-1 < costumeMapEntry[-1]._index) {
|
|
*(undefined1 *)
|
|
(costumeMapEntry[-1]._index * 0x130 + 0x11c + GHIDRA_INT((this->_costumeSpriteDescs)._begin)) = 0;
|
|
}
|
|
if (-1 < costumeMapEntry->_index) {
|
|
*(undefined1 *)
|
|
(costumeMapEntry->_index * 0x130 + 0x11c + GHIDRA_INT((this->_costumeSpriteDescs)._begin)) = 0;
|
|
}
|
|
if (-1 < costumeMapEntry[1]._index) {
|
|
*(undefined1 *)
|
|
(costumeMapEntry[1]._index * 0x130 + 0x11c + GHIDRA_INT((this->_costumeSpriteDescs)._begin)) = 0;
|
|
}
|
|
if (-1 < costumeMapEntry[2]._index) {
|
|
*(undefined1 *)
|
|
(costumeMapEntry[2]._index * 0x130 + 0x11c + GHIDRA_INT((this->_costumeSpriteDescs)._begin)) = 0;
|
|
}
|
|
if (-1 < costumeMapEntry[3]._index) {
|
|
*(undefined1 *)
|
|
(costumeMapEntry[3]._index * 0x130 + 0x11c + GHIDRA_INT((this->_costumeSpriteDescs)._begin)) = 0;
|
|
}
|
|
costumeMapEntry = costumeMapEntry + 5;
|
|
batchesLeft = batchesLeft + -1;
|
|
} while (batchesLeft != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ad5a0
|
|
void Entity_Player::ClearCollectibleAnim(int collectible)
|
|
{
|
|
ItemConfig_Item *item;
|
|
PlayerCostumeMap *costumeEntry;
|
|
int remaining;
|
|
void *costumeDescs;
|
|
int costumeIndex;
|
|
|
|
if (this->_isCoopGhost == 0) {
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectible);
|
|
costumeEntry = this->_playerCostumeMap;
|
|
remaining = 0xf;
|
|
do {
|
|
costumeIndex = costumeEntry->_index;
|
|
if ((-1 < costumeIndex) &&
|
|
(costumeDescs = (this->_costumeSpriteDescs)._begin,
|
|
*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(costumeDescs) + costumeIndex * 0x130 + 0x114)) == item)) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(costumeDescs) + costumeIndex * 0x130 + 0x11c)) = 0;
|
|
}
|
|
costumeEntry = costumeEntry + 1;
|
|
remaining = remaining + -1;
|
|
} while (remaining != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ad680
|
|
byte Entity_Player::IsCollectibleAnimFinished(int collectible, std_string *animName)
|
|
{
|
|
byte isAnimFinished;
|
|
ItemConfig_Item *item;
|
|
std_string *animName_00;
|
|
PlayerCostumeMap *costumeMapEntry;
|
|
ANM2 *costumeSprite;
|
|
uint costumeLayer;
|
|
void *animData;
|
|
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectible);
|
|
costumeLayer = 0;
|
|
isAnimFinished = 1;
|
|
costumeMapEntry = this->_playerCostumeMap;
|
|
do {
|
|
if (((-1 < costumeMapEntry->_index) &&
|
|
(costumeSprite =
|
|
GHIDRA_CAST<ANM2 *>((costumeMapEntry->_index * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin))),
|
|
costumeSprite[1]._filename._buf[8] != '\0')) &&
|
|
(*GHIDRA_CAST<ItemConfig_Item **>(costumeSprite[1]._filename._buf) == item)) {
|
|
animName_00 = animName;
|
|
if (0xf < animName->_capacity) {
|
|
animName_00 = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
isAnimFinished = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST<byte *>(animName_00));
|
|
if ((isAnimFinished != 0) &&
|
|
((animData = (costumeSprite->_animState)._animData, animData == (void *)0x0 ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(animData) + 0x34)) == '\0')))) {
|
|
return 1;
|
|
}
|
|
isAnimFinished = 0;
|
|
}
|
|
costumeLayer = costumeLayer + 1;
|
|
costumeMapEntry = costumeMapEntry + 1;
|
|
if (0xe < costumeLayer) {
|
|
return isAnimFinished;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 007ad860
|
|
void Entity_Player::TriggerTrinketAdded(uint trinketID, byte firstTimePickingUp)
|
|
{
|
|
byte isMomsBox;
|
|
uint uVar1;
|
|
int iVar2;
|
|
uint goldenFlag;
|
|
int *bibleUpgrade;
|
|
Game *game;
|
|
void *trinketsBegin;
|
|
|
|
game = g_game;
|
|
if (this->_variant != 0) {
|
|
return;
|
|
}
|
|
goldenFlag = trinketID & 0x8000;
|
|
uVar1 = trinketID & 0x7fff;
|
|
switch(uVar1) {
|
|
case 7:
|
|
bibleUpgrade = &(g_game->_itemPool)._pools[6]._bibleUpgrade;
|
|
*bibleUpgrade = *bibleUpgrade + 5;
|
|
bibleUpgrade = &(game->_itemPool)._pools[1]._bibleUpgrade;
|
|
*bibleUpgrade = *bibleUpgrade + 5;
|
|
break;
|
|
case 0x30:
|
|
IncrementPlayerFormCounter(this,0xf,1);
|
|
break;
|
|
case 0x47:
|
|
IncrementPlayerFormCounter(this,4,1);
|
|
break;
|
|
case 0x6d:
|
|
iVar2 = GetTrinketMultiplier(this,0x6d);
|
|
if ((1 < iVar2) && (this->_ductTapeMode == 0)) {
|
|
this->_ductTapeMode = 1;
|
|
}
|
|
break;
|
|
case 0x79:
|
|
FUN_007db0a0();
|
|
if ((goldenFlag != 0) || (isMomsBox = HasCollectible(this,0x1b7,0), isMomsBox != 0)) {
|
|
FUN_007db0a0();
|
|
}
|
|
break;
|
|
case 0x84:
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
add_random_drug_item_effect();
|
|
}
|
|
break;
|
|
case 0x92:
|
|
Level::update_treasure_room_doors_for_trinket();
|
|
break;
|
|
case 0x99:
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
AddRandomMomItemEffect();
|
|
}
|
|
break;
|
|
case 0x9c:
|
|
update_greeds_gullet(this);
|
|
if (firstTimePickingUp == 0) goto LAB_007ad9f7;
|
|
AddHearts(this,GHIDRA_UINT((goldenFlag != 0)) * 2 + 2,0,0);
|
|
goto LAB_007ad9e6;
|
|
case 0xa6:
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
ModelingClay_roll(this,GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_trinketRNGs)._begin) + 0xa60)));
|
|
}
|
|
break;
|
|
case 0xa9:
|
|
IncrementPlayerFormCounter(this,0,(goldenFlag != 0) + 1);
|
|
break;
|
|
case 0xb0:
|
|
spawn_lil_clot_familiars(this);
|
|
break;
|
|
case 0xb7:
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
twins_duplicate_familiars(this,1);
|
|
}
|
|
}
|
|
if (firstTimePickingUp != 0) {
|
|
LAB_007ad9e6:
|
|
if (trinketID == 0x9f) {
|
|
AddKeys(this,1);
|
|
}
|
|
}
|
|
LAB_007ad9f7:
|
|
trinketsBegin = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (((GHIDRA_INT(uVar1) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(trinketsBegin) >> 2) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(trinketsBegin) + uVar1 * 4)), iVar2 != 0)) &&
|
|
(uVar1 = *GHIDRA_CAST<uint *>((iVar2 + 0x54)), uVar1 != 0)) {
|
|
this->_cacheFlags = this->_cacheFlags | uVar1;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007adb30
|
|
void Entity_Player::TriggerTrinketRemoved(uint trinketID)
|
|
{
|
|
byte isHeld;
|
|
ItemConfig_Item *item;
|
|
int iVar1;
|
|
uint uVar2;
|
|
uint i;
|
|
ItemConfig_Item *effectItem;
|
|
undefined4 local_14;
|
|
int effectCooldown;
|
|
undefined4 local_c;
|
|
int *bibleUpgrade;
|
|
Game *game;
|
|
int playerForm;
|
|
void *trinkets;
|
|
|
|
game = g_game;
|
|
if (this->_variant != 0) {
|
|
return;
|
|
}
|
|
uVar2 = trinketID & 0x7fff;
|
|
switch(uVar2) {
|
|
case 7:
|
|
bibleUpgrade = &(g_game->_itemPool)._pools[6]._bibleUpgrade;
|
|
*bibleUpgrade = *bibleUpgrade + -5;
|
|
bibleUpgrade = &(game->_itemPool)._pools[1]._bibleUpgrade;
|
|
*bibleUpgrade = *bibleUpgrade + -5;
|
|
break;
|
|
case 0x30:
|
|
iVar1 = -1;
|
|
playerForm = 0xf;
|
|
goto LAB_007adda7;
|
|
case 0x47:
|
|
iVar1 = -1;
|
|
playerForm = 4;
|
|
goto LAB_007adda7;
|
|
case 0x79:
|
|
isHeld = HasTrinket(this,0x79,0);
|
|
if (isHeld == 0) {
|
|
remove_wooden_cross_mantles(this);
|
|
isHeld = HasCollectible(this,0x1b7,0);
|
|
if (isHeld != 0) {
|
|
remove_wooden_cross_mantles(this);
|
|
}
|
|
}
|
|
break;
|
|
case 0x84:
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) &&
|
|
(isHeld = HasTrinket(this,trinketID,0), isHeld == 0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2edc)))) != 0))
|
|
{
|
|
TemporaryEffects::RemoveCollectibleEffect
|
|
(&this->_temporaryeffects,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2edc)))),1);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2edc)))) = 0;
|
|
}
|
|
break;
|
|
case 0x92:
|
|
Level::update_treasure_room_doors_for_trinket();
|
|
break;
|
|
case 0x99:
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) &&
|
|
(isHeld = HasTrinket(this,trinketID,0), isHeld == 0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee0)))) != 0))
|
|
{
|
|
TemporaryEffects::RemoveCollectibleEffect
|
|
(&this->_temporaryeffects,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee0)))),1);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee0)))) = 0;
|
|
}
|
|
break;
|
|
case 0x9c:
|
|
update_greeds_gullet(this);
|
|
break;
|
|
case 0xa6:
|
|
isHeld = HasTrinket(this,trinketID,0);
|
|
if (isHeld == 0) {
|
|
iVar1 = this->_modelingClayEffect;
|
|
this->_modelingClayEffect = 0;
|
|
if (iVar1 != 0) {
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar1);
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
this->_cacheFlags = this->_cacheFlags | item->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
TryRemoveCollectibleCostume(this,iVar1,0);
|
|
}
|
|
}
|
|
break;
|
|
case 0xa9:
|
|
iVar1 = -1 - GHIDRA_UINT(((trinketID & 0x8000) != 0));
|
|
playerForm = 0;
|
|
LAB_007adda7:
|
|
IncrementPlayerFormCounter(this,playerForm,iVar1);
|
|
break;
|
|
case 0xb7:
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) &&
|
|
(isHeld = HasTrinket(this,trinketID,0), isHeld == 0)) {
|
|
i = 0;
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee4))));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee8)))) - iVar1 >> 2 != 0) {
|
|
do {
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(*GHIDRA_CAST<int *>((iVar1 + i * 4)));
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
effectCooldown = item->maxCooldown;
|
|
local_14 = 0;
|
|
local_c = 0;
|
|
effectItem = item;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(&effectItem,1);
|
|
}
|
|
i = i + 1;
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee4))));
|
|
} while (i < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee8)))) - iVar1 >> 2)));
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee8)))) = iVar1;
|
|
}
|
|
}
|
|
trinkets = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (((GHIDRA_INT(uVar2) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(trinkets) >> 2) &&
|
|
(iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(trinkets) + uVar2 * 4)), iVar1 != 0)) &&
|
|
(uVar2 = *GHIDRA_CAST<uint *>((iVar1 + 0x54)), uVar2 != 0)) {
|
|
this->_cacheFlags = this->_cacheFlags | uVar2;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ae4b0
|
|
void Entity_Player::RestoreGameState(GameStatePlayer *saveState)
|
|
{
|
|
undefined4 friendBallHealth;
|
|
undefined4 uVar2;
|
|
undefined4 uVar3;
|
|
GameStatePlayer GVar4;
|
|
GameStatePlayer GVar5;
|
|
EntityConfig_Player *pEVar6;
|
|
char cVar7;
|
|
uint uVar8;
|
|
undefined4 *puVar9;
|
|
GameStatePlayer *pGVar10;
|
|
Entity_Player *mainPlayer;
|
|
void *pvVar11;
|
|
GameStatePlayer GVar12;
|
|
void *extraout_ECX;
|
|
uint uVar13;
|
|
int iVar14;
|
|
GameStatePlayer *playerFormDst;
|
|
int *piVar15;
|
|
Entity_Player *player;
|
|
undefined4 *movingBoxEntry;
|
|
GameStatePlayer *playerFormSrc;
|
|
short *psVar16;
|
|
int *piVar17;
|
|
Entity_Player *self;
|
|
int *trinketDst;
|
|
undefined1 local_60 [4];
|
|
GameStatePlayer local_5c;
|
|
GameStatePlayer *local_58;
|
|
GameStatePlayer local_54;
|
|
Entity_Player *selfSaved;
|
|
undefined4 *local_4c;
|
|
GameStatePlayer local_48;
|
|
EntityConfig_Player *local_44;
|
|
GameStatePlayer local_40;
|
|
void *local_3c [3];
|
|
void *local_30;
|
|
GameStatePlayer *local_2c;
|
|
GameStatePlayer *local_28;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
void *local_14;
|
|
undefined8 friendBallHealth;
|
|
Game *game;
|
|
Manager *manager;
|
|
void *smeltedCounts;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((local_3c + 0xe));
|
|
local_14 = (void *)0xffffffff;
|
|
puStack_18 = &LAB_00affbfd;
|
|
local_1c = ExceptionList;
|
|
uVar8 = __security_cookie ^ GHIDRA_UINT((local_3c + 0xb));
|
|
local_58 = saveState;
|
|
if (this->_replacedPlayer != (void *)0x0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
selfSaved = this;
|
|
local_24 = uVar8;
|
|
SetControllerIndex(this,GHIDRA_INT(saveState[0x149]),1);
|
|
GVar12 = (GameStatePlayer)this->_playerType;
|
|
if ((GHIDRA_INT((g_manager->_entityConfig)._players._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148 <= GHIDRA_INT(GVar12)) {
|
|
this->_playerType = 0;
|
|
GVar12 = (GameStatePlayer)0x0;
|
|
}
|
|
if (g_game->_isRestoringGlowingHourglassState != 0) {
|
|
if (GVar12 != *saveState) {
|
|
RemoveSkinCostume(this);
|
|
stop_costume_item_anims(this);
|
|
this->_playerType = GHIDRA_INT(*saveState);
|
|
update_player_skin(this);
|
|
this->ResetColor(uVar8);
|
|
}
|
|
if (((g_game->_isRestoringGlowingHourglassState != 0) && (this->_isCoopGhost != 0)) &&
|
|
(*GHIDRA_CAST<char *>((saveState + 0x164)) == '\0')) {
|
|
RevivePlayerGhost(this);
|
|
}
|
|
}
|
|
if ((this->_playerType < 0) ||
|
|
(pvVar11 = (void *)this->_playerType,
|
|
(GHIDRA_INT((g_manager->_entityConfig)._players._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148 <= GHIDRA_INT(pvVar11))) {
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
}
|
|
else {
|
|
local_44 = (EntityConfig_Player *)
|
|
(GHIDRA_INT(pvVar11) * 0x148 + GHIDRA_INT((g_manager->_entityConfig)._players._begin));
|
|
if (local_44 != GHIDRA_CAST<EntityConfig_Player *>(0x0)) goto LAB_007ae611;
|
|
}
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Could not load config for player type %d\n"));
|
|
pvVar11 = extraout_ECX;
|
|
LAB_007ae611:
|
|
local_44 = (EntityConfig_Player *)
|
|
(GHIDRA_CAST<EntityConfig_Player *>((local_44)))->EntityConfig_Player::GetDisplayName(GHIDRA_CAST<std_string *>(local_3c),pvVar11);
|
|
if (GHIDRA_CAST<EntityConfig_Player *>(&this->_name) != local_44) {
|
|
(GHIDRA_CAST<std::string *>(((this->_name)._buf)))->std::string::_Tidy_deallocate();
|
|
friendBallHealth = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&local_44->_id) + 4));
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&local_44->_id) + 8));
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&local_44->_id) + 0xc));
|
|
*GHIDRA_CAST<int *>((this->_name)._buf) = local_44->_id;
|
|
*GHIDRA_CAST<undefined4 *>(((this->_name)._buf + 4)) = friendBallHealth;
|
|
*GHIDRA_CAST<undefined4 *>(((this->_name)._buf + 8)) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>(((this->_name)._buf + 0xc)) = uVar3;
|
|
*GHIDRA_CAST<undefined8 *>(&(this->_name)._size) = *GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(local_44) + 0x10));
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_44) + 0x10)) = 0;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_44) + 0x14)) = 0xf;
|
|
*GHIDRA_CAST<char *>(&local_44->_id) = '\0';
|
|
}
|
|
if (0xf < local_28) {
|
|
uVar8 = GHIDRA_INT(local_28) + 1;
|
|
pvVar11 = local_3c[0];
|
|
if (0xfff < uVar8) {
|
|
pvVar11 = *(void **)(GHIDRA_INT(local_3c[0]) + -4);
|
|
uVar8 = GHIDRA_INT(local_28) + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_3c[0]) + (-4 - GHIDRA_INT(pvVar11))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar11,uVar8);
|
|
}
|
|
pGVar10 = local_58;
|
|
local_2c = GHIDRA_CAST<GameStatePlayer *>(0x0);
|
|
local_28 = GHIDRA_CAST<GameStatePlayer *>(0xf);
|
|
local_3c[0] = (void *)(GHIDRA_UINT(local_3c[0]) & 0xffffff00);
|
|
uVar13 = GHIDRA_INT(saveState[0x5b]) - GHIDRA_INT(saveState[0x5a]) >> 2;
|
|
uVar8 = GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2;
|
|
if (uVar13 < uVar8) {
|
|
uVar8 = uVar13;
|
|
}
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
if (uVar8 != 0) {
|
|
do {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((this->_collectibleCounts)._begin) + GHIDRA_INT(local_44) * 4)) =
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(saveState[0x5a]) + GHIDRA_INT(local_44) * 4));
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 1));
|
|
} while (local_44 < uVar8);
|
|
}
|
|
piVar15 = this->_trinketsID;
|
|
*piVar15 = GHIDRA_INT(saveState[99]);
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
*GHIDRA_CAST<GameStatePlayer *>((this->_trinketsID + 1)) = saveState[100];
|
|
do {
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._trinkets._begin) >> 2 <= GHIDRA_INT((*piVar15 & 0x7fffU))) {
|
|
if (local_44 == GHIDRA_CAST<EntityConfig_Player *>(0x0)) {
|
|
trinketDst = piVar15;
|
|
piVar17 = piVar15;
|
|
for (iVar14 = 1; piVar17 = piVar17 + 1, iVar14 != 0; iVar14 = iVar14 + -1) {
|
|
*trinketDst = *piVar17;
|
|
trinketDst = trinketDst + 1;
|
|
}
|
|
this = selfSaved;
|
|
}
|
|
this->_trinketsID[1] = 0;
|
|
}
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 1));
|
|
piVar15 = piVar15 + 1;
|
|
} while (local_44 < 2);
|
|
local_40 = (GameStatePlayer)&this->_voidedCollectibles;
|
|
(this->_voidedCollectibles)._end = (GHIDRA_CAST<std_vector *>(local_40))->_begin;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_58[0x5e]) - GHIDRA_INT(local_58[0x5d]) >> 2));
|
|
if (GHIDRA_UINT((GHIDRA_INT((this->_voidedCollectibles)._capacity) - GHIDRA_INT((GHIDRA_CAST<std_vector *>(local_40))->_begin) >> 2
|
|
)) < local_44) {
|
|
if (0x3fffffff < local_44) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
std::vector<unsigned_int>::_Reallocate(local_44);
|
|
}
|
|
GVar12 = local_40;
|
|
local_40 = pGVar10[0x5d];
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
if (GHIDRA_INT(pGVar10[0x5e]) - GHIDRA_INT(local_40) >> 2 != 0) {
|
|
do {
|
|
local_40 = (GameStatePlayer)(GHIDRA_INT(local_40) + GHIDRA_INT(local_44) * 4);
|
|
if (*GHIDRA_CAST<int *>(local_40) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2) {
|
|
piVar15 = *(void **)(GHIDRA_CAST<char *>(GVar12) + 4);
|
|
if (piVar15 == *(void **)(GHIDRA_CAST<char *>(GVar12) + 8)) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(piVar15,local_40);
|
|
}
|
|
else {
|
|
*piVar15 = *GHIDRA_CAST<int *>(local_40);
|
|
*(void **)(GHIDRA_CAST<char *>(GVar12) + 4) = (void *)(GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(GVar12) + 4)) + 4);
|
|
}
|
|
}
|
|
local_40 = pGVar10[0x5d];
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 1));
|
|
} while (local_44 < GHIDRA_UINT((GHIDRA_INT(pGVar10[0x5e]) - GHIDRA_INT(local_40) >> 2)));
|
|
this = selfSaved;
|
|
}
|
|
pvVar11 = (this->_voidedPassives)._begin;
|
|
local_40 = (GameStatePlayer)&this->_voidedPassives;
|
|
(this->_voidedPassives)._end = pvVar11;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(pGVar10[0x61]) - GHIDRA_INT(pGVar10[0x60]) >> 3));
|
|
if (GHIDRA_UINT((GHIDRA_INT((this->_voidedPassives)._capacity) - GHIDRA_INT(pvVar11) >> 3)) < local_44) {
|
|
if (0x1fffffff < local_44) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
std::vector<8byte>::_Reallocate_exactly(local_44);
|
|
}
|
|
GVar12 = local_40;
|
|
local_54 = pGVar10[0x60];
|
|
local_48 = (GameStatePlayer)0x0;
|
|
if (GHIDRA_INT(pGVar10[0x61]) - GHIDRA_INT(local_54) >> 3 != 0) {
|
|
do {
|
|
pGVar10 = local_58;
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_INT(local_54) + GHIDRA_INT(local_48) * 8));
|
|
if (*piVar15 <
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2) {
|
|
piVar17 = *(void **)(GHIDRA_CAST<char *>(GVar12) + 4);
|
|
if (piVar17 == *(void **)(GHIDRA_CAST<char *>(GVar12) + 8)) {
|
|
std::vector<8byte>::_Emplace_reallocate(piVar17,piVar15);
|
|
}
|
|
else {
|
|
iVar14 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54) + 4 + GHIDRA_INT(local_48) * 8));
|
|
*piVar17 = *piVar15;
|
|
piVar17[1] = iVar14;
|
|
*(void **)(GHIDRA_CAST<char *>(GVar12) + 4) = (void *)(GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(GVar12) + 4)) + 8);
|
|
}
|
|
}
|
|
local_54 = pGVar10[0x60];
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(local_48) + 1);
|
|
} while (GHIDRA_UINT(local_48) < GHIDRA_UINT((GHIDRA_INT(pGVar10[0x61]) - GHIDRA_INT(local_54) >> 3)));
|
|
this = selfSaved;
|
|
}
|
|
local_40 = (GameStatePlayer)&this->_movingBoxContents;
|
|
std::vector<EntitySaveState>::resize((GHIDRA_INT(pGVar10[0x79]) - GHIDRA_INT(pGVar10[0x78])) / 0x78);
|
|
local_54 = pGVar10[0x78];
|
|
local_48 = (GameStatePlayer)0x0;
|
|
iVar14 = GHIDRA_INT(pGVar10[0x79]) - GHIDRA_INT(local_54) >> 0x1f;
|
|
if ((GHIDRA_INT(pGVar10[0x79]) - GHIDRA_INT(local_54)) / 0x78 + iVar14 != iVar14) {
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
do {
|
|
movingBoxEntry = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>(local_40) + GHIDRA_INT(local_44)));
|
|
*movingBoxEntry = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[1] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 4U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[2] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 8U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[3] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0xcU + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[4] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x10U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[5] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x14U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[6] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x18U + GHIDRA_INT(local_54)));
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(movingBoxEntry) + 0x22)) =
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(local_44) + 0x22U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[9] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x24U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[7] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x1cU + GHIDRA_INT(local_54)));
|
|
*GHIDRA_CAST<undefined2 *>((movingBoxEntry + 8)) = *GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(local_44) + 0x20U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[10] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x28U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0xb] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x2cU + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0xc] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x30U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0xd] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x34U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0xe] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x38U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0xf] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x3cU + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0x10] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x40U + GHIDRA_INT(local_54)));
|
|
iVar14 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_44) + 0x3cU + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0x12] = iVar14;
|
|
movingBoxEntry[0x13] = iVar14 >> 0x1f;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(movingBoxEntry) + 0x23)) =
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(local_44) + 0x23U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0x14] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x50U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0x15] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x54U + GHIDRA_INT(local_54)));
|
|
*GHIDRA_CAST<undefined1 *>((movingBoxEntry + 0x18)) =
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(local_44) + 0x60U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0x16] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x58U + GHIDRA_INT(local_54)));
|
|
movingBoxEntry[0x17] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_44) + 0x5cU + GHIDRA_INT(local_54)));
|
|
local_4c = movingBoxEntry;
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(FUN_004d7250(GHIDRA_INT(local_54) + 100 + GHIDRA_INT(local_44)));
|
|
pGVar10 = local_58;
|
|
friendBallHealth = puVar9[1];
|
|
puVar9[1] = movingBoxEntry[0x1a];
|
|
movingBoxEntry[0x1a] = friendBallHealth;
|
|
friendBallHealth = *puVar9;
|
|
*puVar9 = movingBoxEntry[0x19];
|
|
movingBoxEntry[0x19] = friendBallHealth;
|
|
local_14 = (void *)0x0;
|
|
if (((local_5c != (GameStatePlayer)0x0) &&
|
|
(cVar7 = (**(code **)(*GHIDRA_CAST<int *>(local_5c) + 0xc))(), cVar7 != '\0')) &&
|
|
(g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateExtraDataReleaseFn)(local_60);
|
|
}
|
|
pEVar6 = local_44;
|
|
local_14 = (void *)0xffffffff;
|
|
(GHIDRA_CAST<SharedPtr *>((local_4c + 0x1b)))->SharedPtr::assign((void *)(GHIDRA_INT(local_54) + 0x6c + GHIDRA_INT(local_44)));
|
|
local_54 = pGVar10[0x78];
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(pEVar6) + 0x78));
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(local_48) + 1);
|
|
} while (GHIDRA_UINT(local_48) < GHIDRA_UINT(((GHIDRA_INT(pGVar10[0x79]) - GHIDRA_INT(local_54)) / 0x78)));
|
|
this = selfSaved;
|
|
}
|
|
self = selfSaved;
|
|
playerFormDst = GHIDRA_CAST<GameStatePlayer *>(this->_playerForms);
|
|
iVar14 = 0x10;
|
|
playerFormSrc = pGVar10 + 0x49;
|
|
do {
|
|
GVar12 = *playerFormSrc;
|
|
playerFormSrc = playerFormSrc + 1;
|
|
*playerFormDst = GVar12;
|
|
playerFormDst = playerFormDst + 1;
|
|
iVar14 = iVar14 + -1;
|
|
} while (iVar14 != 0);
|
|
selfSaved->_playerFormsRewarded = GHIDRA_INT(pGVar10[0x59]);
|
|
ClearCostumes(selfSaved);
|
|
local_48 = (GameStatePlayer)0x0;
|
|
if (pGVar10[0x74] != (GameStatePlayer)0x0) {
|
|
do {
|
|
local_4c = *GHIDRA_CAST<undefined4 **>((GHIDRA_INT(pGVar10[0x75]) + 4 + GHIDRA_INT(local_48) * 8));
|
|
if ((local_4c <
|
|
(undefined4 *)
|
|
(GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2)) &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(pGVar10[0x75]) + GHIDRA_INT(local_48) * 8)) < 5)) {
|
|
/* WARNING: Could not recover jumptable at 0x007aeb80. Too many branches */
|
|
/* WARNING: Treating indirect jump as call */
|
|
(*(code *)(&PTR_DAT_007afc04)[*GHIDRA_CAST<int *>((GHIDRA_INT(pGVar10[0x75]) + GHIDRA_INT(local_48) * 8))])();
|
|
return;
|
|
}
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(local_48) + 1);
|
|
self = selfSaved;
|
|
pGVar10 = local_58;
|
|
} while (GHIDRA_UINT(local_48) < GHIDRA_UINT(local_58[0x74]));
|
|
}
|
|
uVar13 = GHIDRA_INT(pGVar10[0x72]) - GHIDRA_INT(pGVar10[0x71]) >> 2;
|
|
uVar8 = GHIDRA_INT((self->_pillEffectUses)._end) - GHIDRA_INT((self->_pillEffectUses)._begin) >> 2;
|
|
if (uVar13 < uVar8) {
|
|
uVar8 = uVar13;
|
|
}
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
if (uVar8 != 0) {
|
|
do {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((self->_pillEffectUses)._begin) + GHIDRA_INT(local_44) * 4)) =
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pGVar10[0x71]) + GHIDRA_INT(local_44) * 4));
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 1));
|
|
} while (local_44 < uVar8);
|
|
}
|
|
uVar13 = GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2;
|
|
uVar8 = GHIDRA_INT(pGVar10[0x66]) - GHIDRA_INT(pGVar10[0x65]) >> 2;
|
|
if (uVar13 < uVar8) {
|
|
uVar8 = uVar13;
|
|
}
|
|
if (uVar8 != 0) {
|
|
uVar13 = 0;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT((self->_collectibleRNGs)._begin) + GHIDRA_INT(local_44)));
|
|
iVar14 = uVar13 * 4;
|
|
uVar13 = uVar13 + 1;
|
|
*puVar9 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pGVar10[0x65]) + iVar14));
|
|
*GHIDRA_CAST<undefined8 *>((puVar9 + 1)) = 0x900000005;
|
|
puVar9[3] = 7;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 0x10));
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
uVar13 = GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._trinkets._begin) >> 2;
|
|
uVar8 = GHIDRA_INT(pGVar10[0x69]) - GHIDRA_INT(pGVar10[0x68]) >> 2;
|
|
if (uVar13 < uVar8) {
|
|
uVar8 = uVar13;
|
|
}
|
|
if (uVar8 != 0) {
|
|
uVar13 = 0;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT((self->_trinketRNGs)._begin) + GHIDRA_INT(local_44)));
|
|
iVar14 = uVar13 * 4;
|
|
uVar13 = uVar13 + 1;
|
|
*puVar9 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pGVar10[0x68]) + iVar14));
|
|
*GHIDRA_CAST<undefined8 *>((puVar9 + 1)) = 0x900000005;
|
|
puVar9[3] = 7;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 0x10));
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
uVar13 = GHIDRA_INT((g_manager->_itemConfig)._pillEffects._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._pillEffects._begin) >> 2;
|
|
uVar8 = GHIDRA_INT(pGVar10[0x6c]) - GHIDRA_INT(pGVar10[0x6b]) >> 2;
|
|
if (uVar13 < uVar8) {
|
|
uVar8 = uVar13;
|
|
}
|
|
if (uVar8 != 0) {
|
|
uVar13 = 0;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT((self->_pillRNGs)._begin) + GHIDRA_INT(local_44)));
|
|
iVar14 = uVar13 * 4;
|
|
uVar13 = uVar13 + 1;
|
|
*puVar9 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pGVar10[0x6b]) + iVar14));
|
|
*GHIDRA_CAST<undefined8 *>((puVar9 + 1)) = 0x900000005;
|
|
puVar9[3] = 7;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 0x10));
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
GVar12 = (GameStatePlayer)
|
|
(GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT((g_manager->_itemConfig)._cards._begin)
|
|
>> 2);
|
|
local_40 = (GameStatePlayer)(GHIDRA_INT(pGVar10[0x6f]) - GHIDRA_INT(pGVar10[0x6e]) >> 2);
|
|
if (GHIDRA_UINT(GVar12) < GHIDRA_UINT(local_40)) {
|
|
local_40 = GVar12;
|
|
}
|
|
GVar12 = (GameStatePlayer)0x0;
|
|
if (local_40 != (GameStatePlayer)0x0) {
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
do {
|
|
puVar9 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT((self->_cardRNGs)._begin) + GHIDRA_INT(local_44)));
|
|
iVar14 = GHIDRA_INT(GVar12) * 4;
|
|
GVar12 = (GameStatePlayer)(GHIDRA_INT(GVar12) + 1);
|
|
*puVar9 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pGVar10[0x6e]) + iVar14));
|
|
*GHIDRA_CAST<undefined8 *>((puVar9 + 1)) = 0x900000005;
|
|
puVar9[3] = 7;
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>((GHIDRA_INT(local_44) + 0x10));
|
|
} while (GHIDRA_UINT(GVar12) < GHIDRA_UINT(local_40));
|
|
}
|
|
self->_goldenHearts = 0;
|
|
self->_eternalHearts = 0;
|
|
self->_boneHearts = 0;
|
|
self->_blackHearts = 0;
|
|
self->_soulHearts = 0;
|
|
self->_maxHearts = 0;
|
|
self->_redHearts = 0;
|
|
self->_brokenHearts = 0;
|
|
self->_rottenHearts = 0;
|
|
AddMaxHearts(self,GHIDRA_INT(pGVar10[2]),1);
|
|
self->_blackHearts = GHIDRA_INT(pGVar10[4]);
|
|
AddSoulHearts(self,GHIDRA_INT(pGVar10[3]),0);
|
|
self->_eternalHearts = GHIDRA_INT(pGVar10[5]);
|
|
self->_boneHearts = GHIDRA_INT(pGVar10[0xdd]);
|
|
self->_boneHeartsMask = GHIDRA_INT(pGVar10[0xde]);
|
|
AddHearts(self,GHIDRA_INT(pGVar10[1]),1,0);
|
|
if ((*GHIDRA_CAST<char *>((pGVar10 + 0xe6)) != '\0') && (self->_subPlayer != 0)) {
|
|
FUN_007ae430(pGVar10 + 0xe7);
|
|
}
|
|
local_54 = (GameStatePlayer)0x0;
|
|
local_30 = (void *)0x0;
|
|
local_48 = (GameStatePlayer)0x0;
|
|
local_2c = GHIDRA_CAST<GameStatePlayer *>(0x0);
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
local_28 = GHIDRA_CAST<GameStatePlayer *>(0x0);
|
|
local_14 = (void *)0x1;
|
|
local_40 = (GameStatePlayer)&g_game->_playerManager;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT(((GHIDRA_CAST<PlayerManager *>(local_40))->_playerList)._begin) >> 2 != 0) {
|
|
uVar8 = 0;
|
|
do {
|
|
pvVar11 = *(void **)(GHIDRA_CAST<char *>(local_40) + 4);
|
|
if (GHIDRA_INT(pvVar11) - *GHIDRA_CAST<int *>(local_40) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar11 = *(void **)(GHIDRA_CAST<char *>(local_40) + 4);
|
|
}
|
|
pGVar10 = *GHIDRA_CAST<GameStatePlayer **>(local_40);
|
|
if (uVar8 < GHIDRA_UINT((GHIDRA_INT(pvVar11) - GHIDRA_INT(pGVar10) >> 2))) {
|
|
pGVar10 = pGVar10 + uVar8;
|
|
}
|
|
local_54 = *pGVar10;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54) + 0x2c)) == 1) {
|
|
mainPlayer = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(local_54) + 0x3bc));
|
|
if ((mainPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) || (mainPlayer->_type != 1)) {
|
|
local_40 = (GameStatePlayer)g_game;
|
|
piVar15 = (g_game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT(piVar15) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
piVar15 = ((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(local_40) + 0x1baa8)))->_playerList)._begin;
|
|
}
|
|
mainPlayer = GHIDRA_CAST<Entity_Player *>(*piVar15);
|
|
}
|
|
if (mainPlayer == self) {
|
|
if (local_48 == (GameStatePlayer)local_44) {
|
|
local_40 = local_54;
|
|
std::vector<unsigned_int>::_Emplace_reallocate(local_48,&local_40);
|
|
local_44 = GHIDRA_CAST<EntityConfig_Player *>(local_28);
|
|
local_48 = (GameStatePlayer)local_2c;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<GameStatePlayer *>(local_48) = local_54;
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(local_48) + 4);
|
|
local_2c = GHIDRA_CAST<GameStatePlayer *>(local_48);
|
|
}
|
|
}
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
local_40 = (GameStatePlayer)&g_game->_playerManager;
|
|
} while (uVar8 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT(((GHIDRA_CAST<PlayerManager *>(local_40))->_playerList)._begin) >> 2)));
|
|
pGVar10 = local_58;
|
|
}
|
|
local_40 = pGVar10[0xe3];
|
|
local_4c = (void *)0x0;
|
|
iVar14 = GHIDRA_INT(pGVar10[0xe4]) - GHIDRA_INT(local_40) >> 0x1f;
|
|
local_54 = (GameStatePlayer)local_30;
|
|
if ((GHIDRA_INT(pGVar10[0xe4]) - GHIDRA_INT(local_40)) / 0x1c + iVar14 != iVar14) {
|
|
iVar14 = GHIDRA_INT(local_48) - GHIDRA_INT(local_30);
|
|
local_48 = (GameStatePlayer)0x0;
|
|
do {
|
|
psVar16 = GHIDRA_CAST<short *>((GHIDRA_INT(GHIDRA_CAST<int *>(local_48)) + GHIDRA_INT(local_40)));
|
|
if (local_4c < (void *)(iVar14 >> 2)) {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54) + GHIDRA_INT(local_4c) * 4)) + 0x1aec)) == GHIDRA_INT(*psVar16)) {
|
|
FUN_007ae430(psVar16);
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::SpawnCoPlayerBaby(GHIDRA_INT(*psVar16));
|
|
FUN_007ae430(GHIDRA_INT(GHIDRA_CAST<int *>(local_48)) + GHIDRA_INT(local_40));
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(player,(byte)player);
|
|
pGVar10 = local_58;
|
|
}
|
|
local_40 = pGVar10[0xe3];
|
|
local_4c = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(local_4c) + 1));
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(local_48) + 0x1c);
|
|
} while (local_4c < (void *)((GHIDRA_INT(pGVar10[0xe4]) - GHIDRA_INT(local_40)) / 0x1c));
|
|
self = selfSaved;
|
|
}
|
|
if (&self->_history != GHIDRA_CAST<History *>((pGVar10 + 0xef))) {
|
|
std::vector<HistoryItem>::assign(pGVar10[0xef],pGVar10[0xf0],local_5c);
|
|
}
|
|
game = g_game;
|
|
GVar12 = pGVar10[0xf3];
|
|
GVar4 = pGVar10[0xf4];
|
|
GVar5 = pGVar10[0xf5];
|
|
self->_inventory[0] = GHIDRA_INT(pGVar10[0xf2]);
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 1)) = GVar12;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 2)) = GVar4;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 3)) = GVar5;
|
|
GVar12 = pGVar10[0xf7];
|
|
GVar4 = pGVar10[0xf8];
|
|
GVar5 = pGVar10[0xf9];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 4)) = pGVar10[0xf6];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 5)) = GVar12;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 6)) = GVar4;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 7)) = GVar5;
|
|
GVar12 = pGVar10[0xfb];
|
|
GVar4 = pGVar10[0xfc];
|
|
GVar5 = pGVar10[0xfd];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 8)) = pGVar10[0xfa];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 9)) = GVar12;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 10)) = GVar4;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 0xb)) = GVar5;
|
|
GVar12 = pGVar10[0xff];
|
|
GVar4 = pGVar10[0x100];
|
|
GVar5 = pGVar10[0x101];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 0xc)) = pGVar10[0xfe];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 0xd)) = GVar12;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 0xe)) = GVar4;
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_inventory + 0xf)) = GVar5;
|
|
HUD::mark_all_slots_dirty(&game->_hud,0,0);
|
|
uVar8 = 0;
|
|
if (GHIDRA_INT((self->_smeltedTrinkets)._end) - GHIDRA_INT((self->_smeltedTrinkets)._begin) >> 2 != 0) {
|
|
do {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((self->_smeltedTrinkets)._begin) + uVar8 * 4)) = 0;
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT((GHIDRA_INT((self->_smeltedTrinkets)._end) -
|
|
GHIDRA_INT((self->_smeltedTrinkets)._begin) >> 2)));
|
|
}
|
|
pvVar11 = (self->_history)._historyItems._begin;
|
|
if (pvVar11 != (self->_history)._historyItems._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar11) + 4)) != '\0') {
|
|
uVar8 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar11) + 8)) & 0x7fff;
|
|
smeltedCounts = (self->_smeltedTrinkets)._begin;
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar11) + 8)) >> 0xf & 1) == 0) {
|
|
psVar16 = GHIDRA_CAST<short *>((GHIDRA_INT(smeltedCounts) + uVar8 * 4));
|
|
*psVar16 = *psVar16 + 1;
|
|
}
|
|
else {
|
|
psVar16 = GHIDRA_CAST<short *>((GHIDRA_INT(smeltedCounts) + uVar8 * 4 + 2));
|
|
*psVar16 = *psVar16 + 1;
|
|
}
|
|
}
|
|
pvVar11 = (void *)(GHIDRA_INT(pvVar11) + 0x1c);
|
|
} while (pvVar11 != (self->_history)._historyItems._end);
|
|
pGVar10 = local_58;
|
|
}
|
|
self->_jarHearts = GHIDRA_INT(pGVar10[6]);
|
|
self->_jarFlies = GHIDRA_INT(pGVar10[7]);
|
|
self->_numCoins = GHIDRA_INT(pGVar10[8]);
|
|
self->_numKeys = GHIDRA_INT(pGVar10[9]);
|
|
self->_numBombs = GHIDRA_INT(pGVar10[10]);
|
|
self->_hasGoldenKey = *GHIDRA_CAST<byte *>((pGVar10 + 0xb));
|
|
self->_hasGoldenBomb = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar10[0xb])) + 0x1)));
|
|
self->_monkeyPawCounter = GHIDRA_UINT(*GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar10[0xb])) + 0x2)))));
|
|
self->_totalDamageTaken = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((pGVar10 + 0xc)));
|
|
self->_holyMantleState = -((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar10[0xc])) + 0x2))) != '\0') & 2;
|
|
self->_tonsilCounter = *GHIDRA_CAST<short *>((pGVar10 + 0xd));
|
|
self->_tonsilCount = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar10[0xd])) + 0x2))));
|
|
self->_numLeprosy = *GHIDRA_CAST<short *>((pGVar10 + 0xe));
|
|
self->_speedModifier = GHIDRA_INT(pGVar10[0x12]);
|
|
self->_fireDelayModifier = GHIDRA_INT(pGVar10[0x13]);
|
|
self->_damageModifier = GHIDRA_INT(pGVar10[0x14]);
|
|
self->_tearRangeModifier = GHIDRA_INT(pGVar10[0x15]);
|
|
self->_shotSpeedModifier = GHIDRA_INT(pGVar10[0x16]);
|
|
self->_luckModifier = GHIDRA_INT(pGVar10[0x17]);
|
|
self->_donateLuck = GHIDRA_INT(pGVar10[0x18]);
|
|
self->_potatoPeelerCounter = GHIDRA_INT(pGVar10[0x19]);
|
|
self->_potatoPeelerBandageCounter = GHIDRA_INT(pGVar10[0x1a]);
|
|
self->_brittleBonesUpgrades = *GHIDRA_CAST<short *>((pGVar10 + 0xee));
|
|
self->_redStewBonusDuration = GHIDRA_INT(pGVar10[0x10f]);
|
|
self->_brokenHearts = GHIDRA_INT(pGVar10[0x110]);
|
|
self->_rottenHearts = GHIDRA_INT(pGVar10[0x111]);
|
|
self->_effectiveSoulCharge = GHIDRA_INT(pGVar10[0x112]);
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1dcc)))) = pGVar10[0x113];
|
|
self->_urnSouls = GHIDRA_INT(pGVar10[0x114]);
|
|
self->_numGigaBombs = GHIDRA_INT(pGVar10[0x115]);
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1db0)))) = *GHIDRA_CAST<undefined8 *>((pGVar10 + 0x116));
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1db8)))) = pGVar10[0x118];
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1dbc)))) = *GHIDRA_CAST<undefined8 *>((pGVar10 + 0x119));
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1dc4)))) = pGVar10[0x11b];
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1dc8)))) = pGVar10[0x11c];
|
|
self->_rockBottomDamage = (float)pGVar10[0x11f];
|
|
self->_rockBottomMaxFireDelay = (float)pGVar10[0x11e];
|
|
self->_rockBottomLuck = (float)pGVar10[0x122];
|
|
self->_rockBottomTearRange = (float)pGVar10[0x120];
|
|
self->_rockBottomMoveSpeed = (float)pGVar10[0x11d];
|
|
self->_rockBottomShotSpeed = (float)pGVar10[0x121];
|
|
self->_reverseEmpressMaxHearts = GHIDRA_INT(pGVar10[0x123]);
|
|
self->_reverseSunBoneHearts = GHIDRA_INT(pGVar10[0x124]);
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1ed8)))) = pGVar10[0x125];
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1ec8)))) = pGVar10[0x126];
|
|
self->_forgottenBodyRoomIdx = GHIDRA_INT(pGVar10[0x127]);
|
|
(self->_forgottenBodyPos).x = (float)pGVar10[0x128];
|
|
(self->_forgottenBodyPos).y = (float)pGVar10[0x129];
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1f14)))) = pGVar10[0x12a];
|
|
self->_maggyHealthDrainCooldown = GHIDRA_INT(pGVar10[299]);
|
|
if (&self->_echoChamberItems != GHIDRA_CAST<std_deque *>((pGVar10 + 300))) {
|
|
local_40 = (GameStatePlayer)(GHIDRA_UINT(local_40) & 0xffffff00);
|
|
std::deque<Vector>::operator_assign(pGVar10 + 300,local_40);
|
|
}
|
|
uVar8 = 8;
|
|
if (GHIDRA_UINT((GHIDRA_INT(pGVar10[0x132]) - GHIDRA_INT(pGVar10[0x131]))) < 8) {
|
|
uVar8 = GHIDRA_INT(pGVar10[0x132]) - GHIDRA_INT(pGVar10[0x131]);
|
|
}
|
|
uVar13 = 0;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
self->_bagOfCraftingContent[uVar13] = *GHIDRA_CAST<byte *>((uVar13 + GHIDRA_INT(pGVar10[0x131])));
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
GVar12 = pGVar10[0x134];
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1f50)))) = pGVar10[0x135];
|
|
self->_bagOfCraftingOutput = GVar12;
|
|
uVar8 = 6;
|
|
if (GHIDRA_UINT((GHIDRA_INT(pGVar10[0x138]) - GHIDRA_INT(pGVar10[0x137]))) < 6) {
|
|
uVar8 = GHIDRA_INT(pGVar10[0x138]) - GHIDRA_INT(pGVar10[0x137]);
|
|
}
|
|
uVar13 = 0;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
self->_poopSpellQueue[uVar13] = *GHIDRA_CAST<byte *>((uVar13 + GHIDRA_INT(pGVar10[0x137])));
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
uVar8 = 0x14;
|
|
if (GHIDRA_UINT((GHIDRA_INT(pGVar10[0x13b]) - GHIDRA_INT(pGVar10[0x13a]))) < 0x14) {
|
|
uVar8 = GHIDRA_INT(pGVar10[0x13b]) - GHIDRA_INT(pGVar10[0x13a]);
|
|
}
|
|
uVar13 = 0;
|
|
if (uVar8 != 0) {
|
|
do {
|
|
self->_poopSpellQueue[uVar13 + 6] = *GHIDRA_CAST<byte *>((uVar13 + GHIDRA_INT(pGVar10[0x13a])));
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < uVar8);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1f72))) = *GHIDRA_CAST<undefined1 *>((pGVar10 + 0x13d));
|
|
self->_poopMana = GHIDRA_INT(pGVar10[0x136]);
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((self)) + 0x1f74)))) = pGVar10[0x13e];
|
|
self->_effectiveBloodCharge = GHIDRA_INT(pGVar10[0x13f]);
|
|
if (&self->_itemCards != GHIDRA_CAST<std_vector *>((pGVar10 + 0x140))) {
|
|
local_5c = pGVar10[0x140];
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(pGVar10[0x141]) - GHIDRA_INT(local_5c));
|
|
local_40 = (GameStatePlayer)(GHIDRA_INT(local_48) >> 2);
|
|
local_4c = (self->_itemCards)._begin;
|
|
if (GHIDRA_UINT((GHIDRA_INT((self->_itemCards)._capacity) - GHIDRA_INT(local_4c) >> 2)) < GHIDRA_UINT(local_40)) {
|
|
std::vector<int>::reserve_clear(local_40);
|
|
local_4c = (self->_itemCards)._begin;
|
|
}
|
|
memmove(local_4c,(void *)local_5c,(size_t)local_48);
|
|
(self->_itemCards)._end = (void *)(GHIDRA_INT(GHIDRA_CAST<int *>(local_48)) + GHIDRA_INT(local_4c));
|
|
}
|
|
self->_modelingClayEffect = GHIDRA_INT(pGVar10[0x143]);
|
|
self->_keepersSackBonus = GHIDRA_INT(pGVar10[0x144]);
|
|
self->_isLevelStartPending = *GHIDRA_CAST<byte *>((pGVar10 + 0x14d));
|
|
self->_hasCurseMistEffect = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar10[0x14d])) + 0x1)));
|
|
GVar12 = pGVar10[0x14f];
|
|
GVar4 = pGVar10[0x150];
|
|
GVar5 = pGVar10[0x151];
|
|
(self->_consumablesBackup).coins = GHIDRA_INT(pGVar10[0x14e]);
|
|
(self->_consumablesBackup).keys = GHIDRA_INT(GVar12);
|
|
(self->_consumablesBackup).bombs = GHIDRA_INT(GVar4);
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(self->_consumablesBackup).goldkey) = GVar5;
|
|
GVar12 = pGVar10[0x153];
|
|
GVar4 = pGVar10[0x154];
|
|
GVar5 = pGVar10[0x155];
|
|
(self->_consumablesBackup).soulcharges = GHIDRA_INT(pGVar10[0x152]);
|
|
(self->_consumablesBackup).gigabombs = GHIDRA_INT(GVar12);
|
|
(self->_consumablesBackup).poopmana = GHIDRA_INT(GVar4);
|
|
(self->_consumablesBackup).bloodcharges = GHIDRA_INT(GVar5);
|
|
if (&self->_curseMistFamiliars != GHIDRA_CAST<std_vector *>((pGVar10 + 0x156))) {
|
|
std::vector<52byte>::assign(pGVar10[0x156],pGVar10[0x157],local_5c);
|
|
}
|
|
self->_curseMistRedHearts = GHIDRA_INT(pGVar10[0x159]);
|
|
GVar12 = pGVar10[0x15b];
|
|
self->_curseMistPocketSlots[0] = GHIDRA_INT(pGVar10[0x15a]);
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 1)) = GVar12;
|
|
GVar12 = pGVar10[0x15d];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 2)) = pGVar10[0x15c];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 3)) = GVar12;
|
|
GVar12 = pGVar10[0x15f];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 4)) = pGVar10[0x15e];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 5)) = GVar12;
|
|
GVar12 = pGVar10[0x161];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 6)) = pGVar10[0x160];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistPocketSlots + 7)) = GVar12;
|
|
self->_curseMistTrinkets[0] = GHIDRA_INT(pGVar10[0x162]);
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_curseMistTrinkets + 1)) = pGVar10[0x163];
|
|
self->_isCoopGhost = *GHIDRA_CAST<byte *>((pGVar10 + 0x164));
|
|
GVar12 = pGVar10[0x166];
|
|
self->_ghostPocketSlots[0] = GHIDRA_INT(pGVar10[0x165]);
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 1)) = GVar12;
|
|
GVar12 = pGVar10[0x168];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 2)) = pGVar10[0x167];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 3)) = GVar12;
|
|
GVar12 = pGVar10[0x16a];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 4)) = pGVar10[0x169];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 5)) = GVar12;
|
|
GVar12 = pGVar10[0x16c];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 6)) = pGVar10[0x16b];
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostPocketSlots + 7)) = GVar12;
|
|
self->_ghostTrinkets[0] = GHIDRA_INT(pGVar10[0x16d]);
|
|
*GHIDRA_CAST<GameStatePlayer *>((self->_ghostTrinkets + 1)) = pGVar10[0x16e];
|
|
self->_wildCardItemType = *GHIDRA_CAST<byte *>((pGVar10 + 0x16f));
|
|
self->_wildCardItem = GHIDRA_INT(pGVar10[0x170]);
|
|
self->_wildCardVarData = GHIDRA_INT(pGVar10[0x171]);
|
|
self->_samsonBerserkCharge = GHIDRA_INT(pGVar10[0x172]);
|
|
self->_ibsCharge = (float)pGVar10[0x173];
|
|
std_map_copy_assign(&(self->_proceduralItems)._itemIds,pGVar10 + 0x175);
|
|
(GHIDRA_CAST<GlitchedItemSet *>((&self->_proceduralItems)))->GlitchedItemSet::recalculate();
|
|
manager = g_manager;
|
|
selfSaved->_edenSpeed = (float)pGVar10[0x1b];
|
|
selfSaved->_edenFireDelay = (float)pGVar10[0x1c];
|
|
selfSaved->_edenDamage = (float)pGVar10[0x1d];
|
|
selfSaved->_edenTearRange = (float)pGVar10[0x1e];
|
|
selfSaved->_edenShotSpeed = (float)pGVar10[0x1f];
|
|
selfSaved->_edenLuck = (float)pGVar10[0x20];
|
|
selfSaved->_vampireCharmKills = GHIDRA_INT(pGVar10[0x21]);
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((selfSaved)) + 0x160c)))) = pGVar10[0x22];
|
|
pvVar11 = (manager->_itemConfig)._collectibles._end;
|
|
if (GHIDRA_INT(pGVar10[0x23]) < GHIDRA_INT(pvVar11) - GHIDRA_INT((manager->_itemConfig)._collectibles._begin) >> 2) {
|
|
selfSaved->_activeDesc[0]._item = GHIDRA_INT(pGVar10[0x23]);
|
|
selfSaved->_activeDesc[0]._unk = GHIDRA_INT(pGVar10[0x24]);
|
|
selfSaved->_activeDesc[0]._charge = GHIDRA_INT(pGVar10[0x25]);
|
|
selfSaved->_activeDesc[0]._batteryCharge = GHIDRA_INT(pGVar10[0x26]);
|
|
selfSaved->_activeDesc[0]._partialCharge = GHIDRA_INT(pGVar10[0x27]);
|
|
selfSaved->_activeDesc[0]._varData = GHIDRA_INT(pGVar10[0x28]);
|
|
pvVar11 = (manager->_itemConfig)._collectibles._end;
|
|
}
|
|
if (GHIDRA_INT(pGVar10[0x29]) < GHIDRA_INT(pvVar11) - GHIDRA_INT((manager->_itemConfig)._collectibles._begin) >> 2) {
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_activeDesc + 1)) = pGVar10[0x29];
|
|
selfSaved->_activeDesc[1]._unk = GHIDRA_INT(pGVar10[0x2a]);
|
|
selfSaved->_activeDesc[1]._charge = GHIDRA_INT(pGVar10[0x2b]);
|
|
selfSaved->_activeDesc[1]._batteryCharge = GHIDRA_INT(pGVar10[0x2c]);
|
|
selfSaved->_activeDesc[1]._partialCharge = GHIDRA_INT(pGVar10[0x2d]);
|
|
selfSaved->_activeDesc[1]._varData = GHIDRA_INT(pGVar10[0x2e]);
|
|
pvVar11 = (manager->_itemConfig)._collectibles._end;
|
|
}
|
|
if (GHIDRA_INT(pGVar10[0x2f]) < GHIDRA_INT(pvVar11) - GHIDRA_INT((manager->_itemConfig)._collectibles._begin) >> 2) {
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_activeDesc + 2)) = pGVar10[0x2f];
|
|
selfSaved->_activeDesc[2]._unk = GHIDRA_INT(pGVar10[0x30]);
|
|
selfSaved->_activeDesc[2]._charge = GHIDRA_INT(pGVar10[0x31]);
|
|
selfSaved->_activeDesc[2]._batteryCharge = GHIDRA_INT(pGVar10[0x32]);
|
|
selfSaved->_activeDesc[2]._partialCharge = GHIDRA_INT(pGVar10[0x33]);
|
|
selfSaved->_activeDesc[2]._varData = GHIDRA_INT(pGVar10[0x34]);
|
|
pvVar11 = (manager->_itemConfig)._collectibles._end;
|
|
}
|
|
if (GHIDRA_INT(pGVar10[0x35]) < GHIDRA_INT(pvVar11) - GHIDRA_INT((manager->_itemConfig)._collectibles._begin) >> 2) {
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_activeDesc + 3)) = pGVar10[0x35];
|
|
selfSaved->_activeDesc[3]._unk = GHIDRA_INT(pGVar10[0x36]);
|
|
selfSaved->_activeDesc[3]._charge = GHIDRA_INT(pGVar10[0x37]);
|
|
selfSaved->_activeDesc[3]._batteryCharge = GHIDRA_INT(pGVar10[0x38]);
|
|
selfSaved->_activeDesc[3]._partialCharge = GHIDRA_INT(pGVar10[0x39]);
|
|
selfSaved->_activeDesc[3]._varData = GHIDRA_INT(pGVar10[0x3a]);
|
|
}
|
|
iVar14 = selfSaved->_variant;
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((selfSaved)) + 0x1738)))) = pGVar10[0x11];
|
|
(selfSaved->_playerSpriteScale).x = (float)pGVar10[0x3b];
|
|
(selfSaved->_playerSpriteScale).y = (float)pGVar10[0x3c];
|
|
if ((iVar14 == 0) && (selfSaved->_isCoopGhost == 0)) {
|
|
(selfSaved->_headScale).x = (float)pGVar10[0x3d];
|
|
(selfSaved->_headScale).y = (float)pGVar10[0x3e];
|
|
(selfSaved->_bodyScale).x = (float)pGVar10[0x3f];
|
|
(selfSaved->_bodyScale).y = (float)pGVar10[0x40];
|
|
}
|
|
local_40 = (GameStatePlayer)selfSaved->_pocketSlots;
|
|
GVar12 = pGVar10[0x42];
|
|
*GHIDRA_CAST<GameStatePlayer *>(local_40) = pGVar10[0x41];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 1)) = GVar12;
|
|
GVar12 = pGVar10[0x44];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 2)) = pGVar10[0x43];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 3)) = GVar12;
|
|
GVar12 = pGVar10[0x46];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 4)) = pGVar10[0x45];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 5)) = GVar12;
|
|
GVar12 = pGVar10[0x48];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 6)) = pGVar10[0x47];
|
|
*GHIDRA_CAST<GameStatePlayer *>((selfSaved->_pocketSlots + 7)) = GVar12;
|
|
local_48 = (GameStatePlayer)0x0;
|
|
do {
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_40) + 4)) == 1) && (*GHIDRA_CAST<int *>(local_40) != 0)) &&
|
|
(GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT((g_manager->_itemConfig)._cards._begin) >> 2
|
|
<= *GHIDRA_CAST<int *>(local_40))) {
|
|
if (GHIDRA_UINT(local_48) < 3) {
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_INT(local_40) + 8));
|
|
GVar12 = local_40;
|
|
for (uVar8 = (3 - GHIDRA_INT(local_48)) * 2 & 0x3ffffffe; uVar8 != 0; uVar8 = uVar8 - 1) {
|
|
*GHIDRA_CAST<int *>(GVar12) = *piVar15;
|
|
piVar15 = piVar15 + 1;
|
|
GVar12 = (GameStatePlayer)(GHIDRA_INT(GVar12) + 4);
|
|
}
|
|
}
|
|
selfSaved->_pocketSlots[6] = 0;
|
|
}
|
|
local_48 = (GameStatePlayer)(GHIDRA_INT(local_48) + 1);
|
|
local_40 = (GameStatePlayer)(GHIDRA_INT(local_40) + 8);
|
|
} while (GHIDRA_UINT(local_48) < 4);
|
|
selfSaved->_rUaWizardTimer = GHIDRA_INT(local_58[0x82]);
|
|
selfSaved->_bloodLustCounter = *GHIDRA_CAST<short *>((local_58 + 0x83));
|
|
selfSaved->_deadCatLives = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_58[0x83])) + 0x2))));
|
|
GVar12 = local_58[0x85];
|
|
GVar4 = local_58[0x86];
|
|
GVar5 = local_58[0x87];
|
|
(selfSaved->_friendBallEnemy)._type = GHIDRA_INT(local_58[0x84]);
|
|
(selfSaved->_friendBallEnemy)._variant = GHIDRA_INT(GVar12);
|
|
(selfSaved->_friendBallEnemy)._subtype = GHIDRA_INT(GVar4);
|
|
(selfSaved->_friendBallEnemy)._championId = GHIDRA_INT(GVar5);
|
|
friendBallHealth = *GHIDRA_CAST<undefined8 *>((local_58 + 0x88));
|
|
(selfSaved->_friendBallEnemy)._health = (float)GHIDRA_INT(friendBallHealth);
|
|
(selfSaved->_friendBallEnemy)._maxHealth = (float)GHIDRA_INT(((ulonglong)friendBallHealth >> 0x20));
|
|
*GHIDRA_CAST<GameStatePlayer *>(&(selfSaved->_friendBallEnemy)._playerControlled) = local_58[0x8a];
|
|
selfSaved->_purityState = GHIDRA_INT(local_58[0xd2]);
|
|
selfSaved->_immaculateConceptionState = GHIDRA_INT(local_58[0xd3]);
|
|
selfSaved->_cambionConceptionState = GHIDRA_INT(local_58[0xd4]);
|
|
selfSaved->_conceptionFamiliarFlags = GHIDRA_INT(local_58[0xd5]);
|
|
selfSaved->_d8DamageModifier = (float)local_58[0xd6];
|
|
selfSaved->_d8SpeedModifier = (float)local_58[0xd7];
|
|
selfSaved->_d8RangeModifier = (float)local_58[0xd8];
|
|
selfSaved->_d8FireDelayModifier = (float)local_58[0xd9];
|
|
selfSaved->_goldenHearts = GHIDRA_INT(local_58[0xda]);
|
|
selfSaved->_planCKillCountdown = GHIDRA_INT(local_58[0xf]);
|
|
selfSaved->_imExcitedSpeedupCountdown = GHIDRA_INT(local_58[0x10]);
|
|
selfSaved->_holyMantleStacks = *GHIDRA_CAST<byte *>((local_58 + 0x174));
|
|
selfSaved->_ductTapeMode = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT((byte)local_58[0x174]))) + 0x1)));
|
|
selfSaved->_dead = 0;
|
|
try_trigger_astral_projection(selfSaved);
|
|
if (local_54 != (GameStatePlayer)0x0) {
|
|
uVar8 = GHIDRA_INT(local_44) - GHIDRA_INT(local_54) & 0xfffffffc;
|
|
GVar12 = local_54;
|
|
if (0xfff < uVar8) {
|
|
GVar12 = *GHIDRA_CAST<GameStatePlayer *>((GHIDRA_CAST<char *>(local_54) + -4));
|
|
uVar8 = uVar8 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_54) + (-4 - GHIDRA_INT(GVar12))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete((void *)GVar12,uVar8);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007afc20
|
|
byte Entity_Player::try_trigger_astral_projection()
|
|
{
|
|
ANM2 other;
|
|
ANM2 *pAVar1;
|
|
byte isNoHearts;
|
|
void *astralEffect;
|
|
int iVar3;
|
|
uint seed;
|
|
EntityPtr astralBody;
|
|
LayerState *ghostLayer;
|
|
Entity *linkEffect;
|
|
Entity_Player *tempEffects;
|
|
ANM2 aAStackY_8c70 [128];
|
|
undefined1 in_stack_fffffea4 [240];
|
|
float fVar4;
|
|
float fVar5;
|
|
float fVar6;
|
|
Vector *position;
|
|
Vector *pVVar7;
|
|
Entity_Player *pEVar8;
|
|
undefined4 uVar9;
|
|
EntityRef emptyRef;
|
|
EntityPtr *astralBodyRef;
|
|
bool isNoHearts;
|
|
TemporaryEffects *tempEffects;
|
|
|
|
if (((this->_redHearts < 1) && (this->_soulHearts < 1)) && (this->_boneHearts < 1)) {
|
|
isNoHearts = true;
|
|
}
|
|
else {
|
|
isNoHearts = false;
|
|
}
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (isNoHearts)) && (0 < this->_blackHearts)) {
|
|
isNoHearts = false;
|
|
}
|
|
if (((this->_dead != 0) || (!isNoHearts)) || (this->_isCoopGhost != 0)) {
|
|
return 0;
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
if (((this->_temporaryeffects)._disabled == 0) &&
|
|
(astralEffect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(0x2a5),
|
|
astralEffect != (void *)0x0)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(astralEffect) + 4));
|
|
if (iVar3 == 1) {
|
|
return 0;
|
|
}
|
|
}
|
|
else {
|
|
iVar3 = 0;
|
|
}
|
|
isNoHearts = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c0);
|
|
if (isNoHearts != 0) {
|
|
return 0;
|
|
}
|
|
if (iVar3 != 2) {
|
|
isNoHearts = HasCollectible(this,0x2a2,0);
|
|
if (((isNoHearts != 0) && (iVar3 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetNullEffectNum(0x66), iVar3 == 0))
|
|
&& (iVar3 = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetNullEffectNum(0x65), iVar3 == 0)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddNullEffect(0x65,1,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddNullEffect(0x66,1,1);
|
|
this->_soulHearts = 0;
|
|
this->_blackHearts = 0;
|
|
this->_eternalHearts = 0;
|
|
this->_boneHeartsMask = 0;
|
|
this->_boneHearts = 0;
|
|
this->_rottenHearts = 0;
|
|
if (this->_maxHearts < 1) {
|
|
iVar3 = GetHealthType(this);
|
|
if (iVar3 == 4) {
|
|
this->_redHearts = 0;
|
|
AddBoneHearts(tempEffects,1);
|
|
}
|
|
else {
|
|
iVar3 = GetHealthType(tempEffects);
|
|
if (iVar3 == 3) {
|
|
this->_redHearts = 2;
|
|
this->_maxHearts = 2;
|
|
}
|
|
else if (this->_playerType == 0x12) {
|
|
this->_maxHearts = 2;
|
|
this->_redHearts = 1;
|
|
}
|
|
else {
|
|
this->_redHearts = 0;
|
|
this->_soulHearts = 1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
this->_redHearts = 1;
|
|
iVar3 = GetHealthType(this);
|
|
if (iVar3 == 3) {
|
|
this->_redHearts = 2;
|
|
}
|
|
}
|
|
astralBodyRef = &this->_astralProjectionBody;
|
|
this->_damageCooldown = 0x1e;
|
|
if (this->_astralProjectionBody == (EntityPtr)0x0) {
|
|
seed = Random();
|
|
iVar3 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uVar9)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uVar9)) + 0x1))) = 0;
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(uVar9)) + 0x2))) = 0;
|
|
pVVar7 = &g_vectorZero;
|
|
position = &this->_pos;
|
|
fVar6 = 8.40779e-45;
|
|
fVar5 = 1.4013e-42;
|
|
fVar4 = 1.1295154e-38;
|
|
pEVar8 = this;
|
|
astralBody = (EntityPtr)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,6,position,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,seed,0);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(register0x00000010) + -0x15c)))))->ANM2::ANM2(&this->_sprite);
|
|
other._championColor._colorize[3] = fVar4;
|
|
other._filename._buf[0] = in_stack_fffffea4[0];
|
|
other._filename._buf[1] = in_stack_fffffea4[1];
|
|
other._filename._buf[2] = in_stack_fffffea4[2];
|
|
other._filename._buf[3] = in_stack_fffffea4[3];
|
|
other._filename._buf[4] = in_stack_fffffea4[4];
|
|
other._filename._buf[5] = in_stack_fffffea4[5];
|
|
other._filename._buf[6] = in_stack_fffffea4[6];
|
|
other._filename._buf[7] = in_stack_fffffea4[7];
|
|
other._filename._buf[8] = in_stack_fffffea4[8];
|
|
other._filename._buf[9] = in_stack_fffffea4[9];
|
|
other._filename._buf[10] = in_stack_fffffea4[10];
|
|
other._filename._buf[0xb] = in_stack_fffffea4[0xb];
|
|
other._filename._buf[0xc] = in_stack_fffffea4[0xc];
|
|
other._filename._buf[0xd] = in_stack_fffffea4[0xd];
|
|
other._filename._buf[0xe] = in_stack_fffffea4[0xe];
|
|
other._filename._buf[0xf] = in_stack_fffffea4[0xf];
|
|
other._filename._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x10)));
|
|
other._filename._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x14)));
|
|
other._animDefaultName._buf[0] = in_stack_fffffea4[0x18];
|
|
other._animDefaultName._buf[1] = in_stack_fffffea4[0x19];
|
|
other._animDefaultName._buf[2] = in_stack_fffffea4[0x1a];
|
|
other._animDefaultName._buf[3] = in_stack_fffffea4[0x1b];
|
|
other._animDefaultName._buf[4] = in_stack_fffffea4[0x1c];
|
|
other._animDefaultName._buf[5] = in_stack_fffffea4[0x1d];
|
|
other._animDefaultName._buf[6] = in_stack_fffffea4[0x1e];
|
|
other._animDefaultName._buf[7] = in_stack_fffffea4[0x1f];
|
|
other._animDefaultName._buf[8] = in_stack_fffffea4[0x20];
|
|
other._animDefaultName._buf[9] = in_stack_fffffea4[0x21];
|
|
other._animDefaultName._buf[10] = in_stack_fffffea4[0x22];
|
|
other._animDefaultName._buf[0xb] = in_stack_fffffea4[0x23];
|
|
other._animDefaultName._buf[0xc] = in_stack_fffffea4[0x24];
|
|
other._animDefaultName._buf[0xd] = in_stack_fffffea4[0x25];
|
|
other._animDefaultName._buf[0xe] = in_stack_fffffea4[0x26];
|
|
other._animDefaultName._buf[0xf] = in_stack_fffffea4[0x27];
|
|
other._animDefaultName._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x28)));
|
|
other._animDefaultName._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x2c)));
|
|
other._animState._animation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x30)));
|
|
other._animState._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x34)));
|
|
other._animState._layerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x38)));
|
|
other._animState._nullLayerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x3c)));
|
|
other._animState._animFrame = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0x40)));
|
|
other._animState._isPlaying = in_stack_fffffea4[0x44];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other._animState)) + 0x15))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x45)));
|
|
other._animState._currentlyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x48)));
|
|
other._animState._previouslyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x4c)));
|
|
other._overlayAnimState._animation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x50)));
|
|
other._overlayAnimState._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x54)));
|
|
other._overlayAnimState._layerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x58)));
|
|
other._overlayAnimState._nullLayerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x5c)));
|
|
other._overlayAnimState._animFrame = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0x60)));
|
|
other._overlayAnimState._isPlaying = in_stack_fffffea4[100];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other._overlayAnimState)) + 0x15))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x65)));
|
|
other._overlayAnimState._currentlyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x68)));
|
|
other._overlayAnimState._previouslyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x6c)));
|
|
other._overlayRenderFirst = in_stack_fffffea4[0x70];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other)) + 0x71))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x71)));
|
|
other._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x74)));
|
|
other._animCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x78)));
|
|
other._layerState = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x7c)));
|
|
other._layerCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x80)));
|
|
other._nullLayerNames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x84)));
|
|
other._numNullLayers = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x88)));
|
|
other._eventNames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffea4)) + 0x8c)));
|
|
other._numEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffea4)) + 0x90)));
|
|
other._offset.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0x94)));
|
|
other._offset.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0x98)));
|
|
other._scale.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0x9c)));
|
|
other._scale.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xa0)));
|
|
other._rotation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xa4)));
|
|
other._color._tint[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xa8)));
|
|
other._color._tint[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xac)));
|
|
other._color._tint[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xb0)));
|
|
other._color._tint[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xb4)));
|
|
other._color._colorize[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xb8)));
|
|
other._color._colorize[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xbc)));
|
|
other._color._colorize[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xc0)));
|
|
other._color._colorize[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xc4)));
|
|
other._color._offset[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xc8)));
|
|
other._color._offset[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xcc)));
|
|
other._color._offset[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xd0)));
|
|
other._championColor._tint[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xd4)));
|
|
other._championColor._tint[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xd8)));
|
|
other._championColor._tint[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xdc)));
|
|
other._championColor._tint[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xe0)));
|
|
other._championColor._colorize[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xe4)));
|
|
other._championColor._colorize[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xe8)));
|
|
other._championColor._colorize[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffea4)) + 0xec)));
|
|
other._championColor._offset[0] = fVar5;
|
|
other._championColor._offset[1] = fVar6;
|
|
other._championColor._offset[2] = (float)position;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(other)) + 0x100))) = pVVar7;
|
|
other._playbackSpeed = (float)pEVar8;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other)) + 0x108))) = (char)uVar9;
|
|
other._loaded = SUB41(uVar9,1);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(other)) + 0x10a))) = SUB42(uVar9,2);
|
|
other._shadowLayerIndex = seed;
|
|
other._bitflags = iVar3;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(astralBody) + 0x48)))))->ANM2::operator_assign(other);
|
|
ghostLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(astralBody) + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ghost"));
|
|
if (ghostLayer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
ghostLayer->_visible = 0;
|
|
}
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(astralBody) + 0x98)))))->AnimationState::SetAnimationData((void *)0x0);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(astralBody) + 0x48)))))->ANM2::Play(GHIDRA_CAST<byte *>("Death"),0);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(astralBody) + 0x168)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(astralBody) + 0x168)) | 0x200000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(astralBody) + 0x16c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(astralBody) + 0x16c));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(astralBody) + 0x450)) = 10;
|
|
(**(code **)(*GHIDRA_CAST<int *>(astralBody) + 0xc))();
|
|
if (*astralBodyRef != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
*astralBodyRef = astralBody;
|
|
std::multiset<unsigned_int>::insert();
|
|
if (*astralBodyRef == (EntityPtr)0x0) {
|
|
return 0;
|
|
}
|
|
}
|
|
seed = Random();
|
|
linkEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x72,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed,0);
|
|
astralBody = *astralBodyRef;
|
|
if (linkEffect->_child != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
linkEffect->_child = astralBody;
|
|
if (astralBody != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::insert();
|
|
}
|
|
if (linkEffect->_target != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
linkEffect->_target = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert();
|
|
iVar3 = *GHIDRA_CAST<int *>(linkEffect);
|
|
pAVar1 = &linkEffect[1]._sprite;
|
|
(pAVar1->_animDefaultName)._buf[8] = '\0';
|
|
(pAVar1->_animDefaultName)._buf[9] = '\0';
|
|
(pAVar1->_animDefaultName)._buf[10] = -0x60;
|
|
(pAVar1->_animDefaultName)._buf[0xb] = 'B';
|
|
(linkEffect->_targetPosition).x = 10.0;
|
|
(linkEffect->_targetPosition).y = 0.0;
|
|
(**(code **)(iVar3 + 0xc))();
|
|
return 0;
|
|
}
|
|
if (((this->_lastDamageSource)._type == 6) || ((this->_lastDamageFlags & 0x400) != 0)) {
|
|
Player_stats_add(&g_game->_onlinePlayerStats,4,this,1.0);
|
|
}
|
|
emptyRef._type = 0;
|
|
emptyRef._variant = 0;
|
|
emptyRef._spawnerType = 0;
|
|
emptyRef._spawnerVariant = 0;
|
|
emptyRef._position.x = g_vectorZero.x;
|
|
emptyRef._position.y = g_vectorZero.y;
|
|
emptyRef._velocity.x = g_vectorZero.x;
|
|
emptyRef._velocity.y = g_vectorZero.y;
|
|
emptyRef._flags = 0;
|
|
emptyRef._entity = (void *)0x0;
|
|
(GHIDRA_CAST<EntityRef *>((&this->_lastDamageSource)))->EntityRef::operator_(&emptyRef);
|
|
}
|
|
(GHIDRA_CAST<EntityRef *>((&emptyRef)))->EntityRef::EntityRef();
|
|
this->Kill();
|
|
return 1;
|
|
}
|
|
|
|
// 007b0070
|
|
void Entity_Player::spawn_dark_esau(void *gameStatePlayer)
|
|
{
|
|
void **ppvVar1;
|
|
char cVar2;
|
|
byte bVar3;
|
|
uint uVar4;
|
|
Menu_Stats *spawnedFamiliar;
|
|
Entity *spawnedEntity;
|
|
Entity_NPC *restoredEnemy;
|
|
uint uVar5;
|
|
Vector *candidatePos;
|
|
EntityPtr familiarRecord;
|
|
int *effectIt;
|
|
int iVar7;
|
|
Manager *manager;
|
|
void *itemListBegin;
|
|
float fVar8;
|
|
float fVar9;
|
|
undefined4 uVar10;
|
|
TypeDescriptor *pTVar11;
|
|
TypeDescriptor *pTVar12;
|
|
undefined4 uVar13;
|
|
float *local_6c;
|
|
Vector local_64;
|
|
float local_5c;
|
|
EntityPtr local_58;
|
|
EntityPtr local_54;
|
|
Vector local_50;
|
|
float fStack_48;
|
|
undefined4 uStack_44;
|
|
Vector spawnPos;
|
|
EntityRef charmSource;
|
|
float *effectsEnd;
|
|
EntityPtr familiarRecord;
|
|
void *itemListEnd;
|
|
Room *room;
|
|
std_vector *tempEffects;
|
|
float velocityX;
|
|
float velocityY;
|
|
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x37c));
|
|
if (iVar7 != (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 900)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x380))) /
|
|
0x34) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("m_FamiliarCount does not match m_Familiars.size()"));
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x37c));
|
|
}
|
|
local_64.x = 0.0;
|
|
if (iVar7 != 0) {
|
|
local_6c = GHIDRA_CAST<float *>(0x0);
|
|
do {
|
|
local_54 = (EntityPtr)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x380)) + GHIDRA_INT(local_6c));
|
|
familiarRecord = *GHIDRA_CAST<EntityPtr *>(local_54);
|
|
local_58 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_54) + 8));
|
|
room = g_game->_room;
|
|
uVar4 = Random();
|
|
local_5c = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_5c = local_5c + local_5c;
|
|
fVar8 = cos(local_5c);
|
|
local_50.x = fVar8 * 20.0 + (this->_pos).x;
|
|
fVar8 = sin(local_5c);
|
|
local_50.y = fVar8 * 20.0 + (this->_pos).y;
|
|
Room::GetClampedPositionImpl(room,&spawnPos,&local_50,20.0,20.0,20.0,20.0);
|
|
familiarRecord = local_54;
|
|
spawnedFamiliar =
|
|
(Menu_Stats *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,GHIDRA_UINT(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_54) + 4))),&spawnPos,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(local_58),GHIDRA_UINT(familiarRecord),0);
|
|
(GHIDRA_CAST<Menu_Stats *>((spawnedFamiliar)))->Menu_Stats::Render(familiarRecord);
|
|
local_64.x = (float)(GHIDRA_INT(local_64.x) + 1);
|
|
local_6c = GHIDRA_CAST<float *>((GHIDRA_INT(local_6c) + 0x34));
|
|
} while (GHIDRA_UINT(local_64.x) < GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x37c))));
|
|
}
|
|
if (this->_replacedPlayer == (void *)0x0) {
|
|
if (this->_playerType == 0x11) {
|
|
spawn_forgotten_body(this);
|
|
}
|
|
local_5c = 0.0;
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x22c))) {
|
|
local_6c = GHIDRA_CAST<float *>((GHIDRA_INT(gameStatePlayer) + 0x244));
|
|
do {
|
|
room = g_game->_room;
|
|
local_58 = (EntityPtr)((room->_bottomRightPos).x - (room->_topLeftPos).x);
|
|
local_54 = (EntityPtr)((room->_bottomRightPos).y - (room->_topLeftPos).y);
|
|
uVar4 = Random();
|
|
familiarRecord = local_54;
|
|
if ((float)local_54 <= (float)local_58) {
|
|
familiarRecord = local_58;
|
|
}
|
|
local_50.y = (float)local_54 * 0.5 + (room->_topLeftPos).y;
|
|
local_50.x = (float)local_58 * 0.5 + (room->_topLeftPos).x;
|
|
Room::FindFreePickupSpawnPosition
|
|
(room,&spawnPos,&local_50,
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * (float)familiarRecord,0,0,0);
|
|
uVar4 = Random();
|
|
uVar13 = 0;
|
|
pTVar12 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor;
|
|
pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar10 = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(local_6c[-5]),GHIDRA_UINT(local_6c[-4]),&spawnPos,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_6c[-3]),uVar4);
|
|
restoredEnemy = GHIDRA_CAST<Entity_NPC *>(__RTDynamicCast(spawnedEntity,uVar10,pTVar11,pTVar12,uVar13));
|
|
if (restoredEnemy != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
restoredEnemy->_health = local_6c[-1];
|
|
restoredEnemy->_maxHitPoints = *local_6c;
|
|
(GHIDRA_CAST<Entity_NPC *>((restoredEnemy)))->Entity_NPC::Morph(GHIDRA_INT(local_6c[-5]),GHIDRA_INT(local_6c[-4]),GHIDRA_INT(local_6c[-3]),
|
|
GHIDRA_INT(local_6c[-2]));
|
|
if (*GHIDRA_CAST<char *>((local_6c + 1)) != '\0') {
|
|
restoredEnemy->_controllerID = this->_controllerIndex;
|
|
}
|
|
local_64.x = (float)g_game->_room;
|
|
cVar2 = restoredEnemy->CanShutDoors();
|
|
if ((cVar2 != '\0') && (restoredEnemy->_type != 0x362)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_64.x) + 0x12c0)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_64.x) + 0x12c0)) + -1;
|
|
cVar2 = restoredEnemy->IsBoss();
|
|
if (cVar2 != '\0') {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_64.x) + 0x12c8)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_64.x) + 0x12c8)) + -1;
|
|
}
|
|
}
|
|
restoredEnemy->_canShutDoors = 0;
|
|
charmSource._type = this->_type;
|
|
charmSource._position.x = (this->_pos).x;
|
|
charmSource._position.y = (this->_pos).y;
|
|
charmSource._variant = this->_variant;
|
|
charmSource._spawnerType = this->_spawnerType;
|
|
charmSource._spawnerVariant = this->_spawnerVariant;
|
|
charmSource._velocity.x = (this->_velocity).x;
|
|
charmSource._velocity.y = (this->_velocity).y;
|
|
local_64.x = (float)GHIDRA_UINT(((this->_flags & 0x100) != 0));
|
|
if ((this->_flags & 0x20000000) == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
uVar4 = 2;
|
|
}
|
|
if ((this->_flags & 0x40000000000000) == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = 4;
|
|
}
|
|
charmSource._flags = uVar5 | uVar4 | GHIDRA_UINT(local_64.x);
|
|
charmSource._entity = this;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(restoredEnemy))))->Entity::AddCharmed(&charmSource,-1,0,0);
|
|
restoredEnemy->Update();
|
|
}
|
|
local_5c = (float)(GHIDRA_INT(local_5c) + 1);
|
|
local_6c = local_6c + 7;
|
|
} while (GHIDRA_INT(local_5c) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x22c)));
|
|
}
|
|
if (&this->_levelEffectItems != GHIDRA_CAST<std_vector *>((GHIDRA_INT(gameStatePlayer) + 0x424))) {
|
|
local_54 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x424));
|
|
local_64.x = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x428)) - GHIDRA_INT(local_54));
|
|
local_5c = (float)(GHIDRA_INT(local_64.x) >> 2);
|
|
local_6c = (this->_levelEffectItems)._begin;
|
|
if (GHIDRA_UINT((GHIDRA_INT((this->_levelEffectItems)._capacity) - GHIDRA_INT(local_6c) >> 2)) < GHIDRA_UINT(local_5c)) {
|
|
std::vector<int>::reserve_clear(local_5c);
|
|
local_6c = (this->_levelEffectItems)._begin;
|
|
}
|
|
memmove(local_6c,(void *)local_54,(size_t)local_64.x);
|
|
(this->_levelEffectItems)._end = (void *)(GHIDRA_INT(local_64.x) + GHIDRA_INT(local_6c));
|
|
}
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x430));
|
|
this->_bleedOutHealth = iVar7;
|
|
if (0 < iVar7) {
|
|
local_54 = (EntityPtr)this->_type;
|
|
uVar4 = GHIDRA_UINT(this->_flags);
|
|
uVar5 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
fVar8 = (this->_pos).x;
|
|
fVar9 = (this->_pos).y;
|
|
velocityX = (this->_velocity).x;
|
|
velocityY = (this->_velocity).y;
|
|
local_58 = (EntityPtr)this->_variant;
|
|
local_64.x = (float)this->_spawnerType;
|
|
iVar7 = this->_spawnerVariant;
|
|
*GHIDRA_CAST<uint *>(&this->_flags) = uVar4;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4)) = uVar5 | 4;
|
|
local_5c = (float)GHIDRA_UINT(((uVar4 & 0x100) != 0));
|
|
if ((uVar4 & 0x20000000) == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
uVar4 = 2;
|
|
}
|
|
if ((uVar5 & 0x400000) == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = 4;
|
|
}
|
|
(this->_entityRef2)._position.x = fVar8;
|
|
(this->_entityRef2)._type = GHIDRA_INT(local_54);
|
|
(this->_entityRef2)._variant = GHIDRA_INT(local_58);
|
|
(this->_entityRef2)._spawnerType = GHIDRA_INT(local_64.x);
|
|
(this->_entityRef2)._spawnerVariant = iVar7;
|
|
(this->_entityRef2)._position.y = fVar9;
|
|
(this->_entityRef2)._velocity.x = velocityX;
|
|
(this->_entityRef2)._velocity.y = velocityY;
|
|
(this->_entityRef2)._flags = uVar5 | uVar4 | GHIDRA_UINT(local_5c);
|
|
(this->_entityRef2)._entity = this;
|
|
}
|
|
this->_greedsGulletHearts = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x434));
|
|
tempEffects = &(this->_temporaryeffects)._effects;
|
|
this->_greedsGulletOverflow = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x438));
|
|
(this->_queuedItem)._item = *(void **)(GHIDRA_CAST<char *>(gameStatePlayer) + 0x408);
|
|
(this->_queuedItem)._charge = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x40c));
|
|
(this->_queuedItem)._flags = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x410));
|
|
if (tempEffects != GHIDRA_CAST<std_vector *>((GHIDRA_INT(gameStatePlayer) + 0x414))) {
|
|
local_54 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x414));
|
|
local_64.x = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x418)) - GHIDRA_INT(local_54));
|
|
local_5c = (float)(GHIDRA_INT(local_64.x) >> 4);
|
|
local_6c = tempEffects->_begin;
|
|
if (GHIDRA_UINT((GHIDRA_INT((this->_temporaryeffects)._effects._capacity) - GHIDRA_INT(local_6c) >> 4)) <
|
|
GHIDRA_UINT(local_5c)) {
|
|
vector16_clear_and_reserve(tempEffects,GHIDRA_UINT(local_5c));
|
|
local_6c = (this->_temporaryeffects)._effects._begin;
|
|
}
|
|
memmove(local_6c,(void *)local_54,(size_t)local_64.x);
|
|
(this->_temporaryeffects)._effects._end = (void *)(GHIDRA_INT(local_64.x) + GHIDRA_INT(local_6c));
|
|
}
|
|
this->_strengthMaxHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x420));
|
|
if ((this->_temporaryeffects)._effects._begin == (this->_temporaryeffects)._effects._end) {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x518));
|
|
local_64.x = 0.0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x51c)) - iVar7 >> 4 != 0) {
|
|
local_6c = GHIDRA_CAST<float *>(0x0);
|
|
manager = g_manager;
|
|
do {
|
|
uVar4 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_6c) + 4 + iVar7));
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x518))));
|
|
if (iVar7 == 0) {
|
|
if (GHIDRA_INT(uVar4) < 0) goto LAB_007b07a0;
|
|
itemListBegin = (manager->_itemConfig)._nullItems._begin;
|
|
itemListEnd = (manager->_itemConfig)._nullItems._end;
|
|
LAB_007b0792:
|
|
if (GHIDRA_INT(uVar4) < GHIDRA_INT(itemListEnd) - GHIDRA_INT(itemListBegin) >> 2) {
|
|
local_50.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(itemListBegin) + uVar4 * 4));
|
|
}
|
|
else {
|
|
LAB_007b07a0:
|
|
local_50.x = 0.0;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar7 == 2) {
|
|
itemListBegin = (manager->_itemConfig)._trinkets._begin;
|
|
uVar4 = uVar4 & 0x7fff;
|
|
itemListEnd = (manager->_itemConfig)._trinkets._end;
|
|
goto LAB_007b0792;
|
|
}
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar4)) goto LAB_007b0760;
|
|
goto LAB_007b07a0;
|
|
}
|
|
if (-1 < GHIDRA_INT(uVar4)) {
|
|
LAB_007b0760:
|
|
itemListBegin = (manager->_itemConfig)._collectibles._begin;
|
|
itemListEnd = (manager->_itemConfig)._collectibles._end;
|
|
goto LAB_007b0792;
|
|
}
|
|
if ((-1 < GHIDRA_INT(uVar4)) ||
|
|
(itemListBegin = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(itemListBegin) >> 2
|
|
<= GHIDRA_INT(~uVar4))) goto LAB_007b07a0;
|
|
local_50.x = **GHIDRA_CAST<float **>((GHIDRA_CAST<char *>(itemListBegin) + ~uVar4 * 4));
|
|
}
|
|
uStack_44 = 0;
|
|
local_50.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_6c) + 8 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x518))));
|
|
fStack_48 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_6c) + 0xc + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x518))));
|
|
effectsEnd = (this->_temporaryeffects)._effects._end;
|
|
if (effectsEnd == (this->_temporaryeffects)._effects._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(effectsEnd,&local_50);
|
|
manager = g_manager;
|
|
}
|
|
else {
|
|
*effectsEnd = local_50.x;
|
|
effectsEnd[1] = local_50.y;
|
|
effectsEnd[2] = fStack_48;
|
|
effectsEnd[3] = 0.0;
|
|
ppvVar1 = &(this->_temporaryeffects)._effects._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x10);
|
|
}
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x518));
|
|
local_6c = GHIDRA_CAST<float *>((GHIDRA_INT(local_6c) + 0x10));
|
|
local_64.x = (float)(GHIDRA_INT(local_64.x) + 1);
|
|
} while (GHIDRA_UINT(local_64.x) < GHIDRA_UINT((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x51c)) - iVar7 >> 4)));
|
|
}
|
|
}
|
|
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(gameStatePlayer) + 0x530))) {
|
|
if (this->_darkEsau != (EntityPtr)0x0) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_darkEsau) + 0x28))();
|
|
}
|
|
room = g_game->_room;
|
|
local_58 = (EntityPtr)((room->_bottomRightPos).x - (room->_topLeftPos).x);
|
|
local_54 = (EntityPtr)((room->_bottomRightPos).y - (room->_topLeftPos).y);
|
|
uVar4 = Random();
|
|
familiarRecord = local_54;
|
|
if ((float)local_54 <= (float)local_58) {
|
|
familiarRecord = local_58;
|
|
}
|
|
local_50.y = (float)local_54 * 0.5 + (room->_topLeftPos).y;
|
|
local_50.x = (float)local_58 * 0.5 + (room->_topLeftPos).x;
|
|
Room::FindFreePickupSpawnPosition
|
|
(room,&local_64,&local_50,
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * (float)familiarRecord,1,0,0);
|
|
local_5c = 0.0;
|
|
do {
|
|
fVar9 = (this->_pos).x - local_64.x;
|
|
fVar8 = (this->_pos).y - local_64.y;
|
|
if (6400.0 <= fVar8 * fVar8 + fVar9 * fVar9) break;
|
|
room = g_game->_room;
|
|
candidatePos = (GHIDRA_CAST<Room *>((room)))->Room::GetRandomPosition(&spawnPos,20.0);
|
|
candidatePos = Room::FindFreePickupSpawnPosition(room,&local_50,candidatePos,0.0,1,0,0);
|
|
local_64.x = candidatePos->x;
|
|
local_64.y = candidatePos->y;
|
|
local_5c = (float)(GHIDRA_INT(local_5c) + 1);
|
|
} while (GHIDRA_INT(local_5c) < 0x14);
|
|
uVar4 = Random();
|
|
familiarRecord = (EntityPtr)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(0x362,0,&local_64,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
if (this->_darkEsau != (EntityPtr)0x0) {
|
|
local_54 = (EntityPtr)&this->_darkEsau;
|
|
std::multiset<unsigned_int>::erase(&local_54);
|
|
}
|
|
this->_darkEsau = familiarRecord;
|
|
if (familiarRecord != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::insert(&this->_darkEsau);
|
|
}
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(familiarRecord) + 0x168)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(familiarRecord) + 0x168)) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(familiarRecord) + 0x16c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(familiarRecord) + 0x16c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(familiarRecord) + 0xc))();
|
|
}
|
|
if (this->_isCoopGhost != 0) {
|
|
reset_body_sprite(this);
|
|
this->_isPlayingItemAnimation = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::Reset();
|
|
(this->_sprite)._playbackSpeed = 1.0;
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("GhostAppear"),1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
this->_isPlayingExtraAnimation = 1;
|
|
this->_isPlayingItemAnimation = 0;
|
|
this->_entityGridCollisionClass = 3;
|
|
this->_isCoopGhost = 1;
|
|
this->_isInvicible = 1;
|
|
this->_visible = 1;
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (effectIt = (this->_temporaryeffects)._effects._begin;
|
|
effectIt != (this->_temporaryeffects)._effects._end; effectIt = effectIt + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*effectIt) == 0) && ((GHIDRA_CAST<int *>(*effectIt))[1] == 0x78)) {
|
|
if ((this->_parent != (EntityPtr)0x0) && (GHIDRA_CAST<int *>(this->_subPlayer) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_subPlayer) + 0x44))();
|
|
if (GHIDRA_CAST<undefined4 *>(this->_subPlayer) != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(this->_subPlayer))(1);
|
|
}
|
|
this->_subPlayer = 0;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
UpdateCanShoot(this);
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
EvaluateItems(this);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::RemoveCompassEffect();
|
|
this->_postLevelInitFinished = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007b2200
|
|
void Entity_Player::DonateLuck(int luck)
|
|
{
|
|
this->_donateLuck = this->_donateLuck + luck;
|
|
this->_cacheFlags = this->_cacheFlags | 0x400;
|
|
EvaluateItems(this);
|
|
return;
|
|
}
|
|
|
|
// 007b2230
|
|
void Entity_Player::UseCard(int cardType, uint useFlag)
|
|
{
|
|
code *pcVar1;
|
|
RNG rng;
|
|
bool isAnyMarked;
|
|
Game *game;
|
|
byte bVar4;
|
|
char cVar5;
|
|
Room *pRVar6;
|
|
uint uVar7;
|
|
Entity_Player *player;
|
|
PersistentGameData *persistentData;
|
|
GlowingHourglassState *hourglassState;
|
|
Entity_NPC *npc;
|
|
Ambush *ambush;
|
|
Minimap *minimap;
|
|
RoomDescriptor *roomDesc;
|
|
Seeds *seeds;
|
|
char *markBelow;
|
|
Vector *vecResult2;
|
|
float *pfVar16;
|
|
int iVar17;
|
|
ItemOverlay *itemOverlay;
|
|
EntityList *entityList;
|
|
Room *pRVar20;
|
|
EntityPtr EVar21;
|
|
Level *pLVar22;
|
|
Level *level;
|
|
Entity_Effect *effect;
|
|
EntityRef *sourceRef;
|
|
ItemPool_Item *pool;
|
|
undefined4 *puVar27;
|
|
undefined1 *puVar28;
|
|
EntityPtr *entryPtr;
|
|
HUD *hud;
|
|
uint uVar30;
|
|
Entity *tmpEntity;
|
|
PlayerManager *playerManager;
|
|
EntityPtr EVar33;
|
|
Vector *vecResult;
|
|
TemporaryEffects *playerEffects;
|
|
undefined4 uVar36;
|
|
int *piVar37;
|
|
ItemConfig *itemConfig;
|
|
ItemConfig_Item *configItem;
|
|
ItemPool *itemPool;
|
|
int iVar41;
|
|
char *markCell;
|
|
char *markAbove;
|
|
RNG *rngSource;
|
|
void *pvVar45;
|
|
undefined4 *copyDst;
|
|
undefined1 *puVar47;
|
|
float in_XMM0_Da;
|
|
TypeDescriptor *pTVar48;
|
|
TypeDescriptor *pTVar49;
|
|
uint shiftidx;
|
|
undefined4 uVar50;
|
|
float fVar51;
|
|
undefined4 uVar52;
|
|
EntityRef suicideKingRef;
|
|
Vector VStack_488;
|
|
undefined1 evilCharmEffect [8];
|
|
undefined4 evilCharmCooldown;
|
|
undefined1 bookOfShadowsEffect [8];
|
|
undefined4 bookOfShadowsCooldown;
|
|
undefined1 darkArtsEffect [8];
|
|
int darkArtsCooldown;
|
|
undefined1 unicornEffect [8];
|
|
int unicornCooldown;
|
|
Vector VStack_440;
|
|
EntityList_EL hermitPickups;
|
|
EntityList_EL shardCollectibles;
|
|
EntityList_EL creditPickups;
|
|
ItemConfig_Item *whoreClothEffect;
|
|
undefined4 uStack_404;
|
|
int whoreClothCooldown;
|
|
undefined4 uStack_3fc;
|
|
ItemConfig_Item *whoreEffect;
|
|
undefined4 uStack_3f4;
|
|
int whoreCooldown;
|
|
undefined4 uStack_3ec;
|
|
ItemConfig_Item *belialEffect;
|
|
undefined4 uStack_3e4;
|
|
int belialCooldown;
|
|
undefined4 uStack_3dc;
|
|
ItemConfig_Item *telepathyEffect;
|
|
undefined4 uStack_3d4;
|
|
int telepathyCooldown;
|
|
undefined4 uStack_3cc;
|
|
EntityList_EL towerEffects;
|
|
Vector spawnPos;
|
|
EntityList_EL jeraPickups;
|
|
Vector spawnPos2;
|
|
Vector VStack_398;
|
|
undefined1 tmpEffect [8];
|
|
undefined4 berserkCooldown;
|
|
Vector pickupPos;
|
|
undefined4 announcerDelay;
|
|
Vector VStack_374;
|
|
int cardConfig;
|
|
Vector VStack_368;
|
|
Vector VStack_360;
|
|
Vector VStack_358;
|
|
WeightedOutcomePicker outcomePicker [3];
|
|
Vector VStack_344;
|
|
int targetsBegin;
|
|
int targetsEnd;
|
|
Vector VStack_330;
|
|
undefined1 auStack_328 [12];
|
|
Vector VStack_31c;
|
|
Vector VStack_314;
|
|
undefined4 uStack_30c;
|
|
Vector VStack_308;
|
|
Vector VStack_300;
|
|
undefined4 uStack_2f8;
|
|
EntityPtr EStack_2f4;
|
|
Vector VStack_2f0;
|
|
undefined4 uStack_2e8;
|
|
EntityPtr EStack_2e4;
|
|
byte isPlayAnim;
|
|
byte isPlayAnnouncer;
|
|
Vector VStack_2dc;
|
|
Vector VStack_2d4;
|
|
Vector VStack_2cc;
|
|
Vector VStack_2c4;
|
|
Vector VStack_2bc;
|
|
Vector VStack_2b4;
|
|
undefined4 local_2ac;
|
|
undefined4 local_2a8;
|
|
undefined2 uStack_2a2;
|
|
Vector VStack_2a0;
|
|
undefined4 local_298;
|
|
int card;
|
|
EntityRef soulLazarusRef;
|
|
RNG shardRng;
|
|
EntityRef EStack_254;
|
|
RNG RStack_22c;
|
|
RNG towerRng;
|
|
RNG RStack_20c;
|
|
RNG tmpRng;
|
|
int *speedStat;
|
|
int *fireDelayStat;
|
|
int *damageStat;
|
|
int *rangeStat;
|
|
int *shotSpeedStat;
|
|
int *luckStat;
|
|
char gridMarks [448];
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 uStack_8;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00affd56;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((gridMarks + 0x1d0));
|
|
card = cardType;
|
|
if (cardType < 0) {
|
|
return;
|
|
}
|
|
pvVar45 = (g_manager->_itemConfig)._cards._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar45) >> 2 <= cardType) {
|
|
return;
|
|
}
|
|
cardConfig = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar45) + cardType * 4));
|
|
if (cardConfig == 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
VStack_2d4.y = (float)this;
|
|
Player_stats_add(5,this);
|
|
announcerDelay = 2;
|
|
VStack_2a0.y = (float)(g_manager->_optionsConfig)._announcerVoiceMode;
|
|
if ((EntityPtr)VStack_2a0.y == (EntityPtr)0x0) {
|
|
announcerDelay = 900;
|
|
}
|
|
if (g_game->_challenge == 0x20) {
|
|
rngSource = GHIDRA_CAST<RNG *>((cardType * 0x10 + GHIDRA_INT((this->_cardRNGs)._begin)));
|
|
(GHIDRA_CAST<RNG *>((rngSource)))->RNG::Next();
|
|
cardType = GHIDRA_UINT(rngSource->_seed) % 0x61 + 1;
|
|
card = cardType;
|
|
}
|
|
VStack_2dc.y = (float)(useFlag >> 7 & 0xffffff01);
|
|
local_2ac = useFlag >> 5 & 0xffffff01;
|
|
bVar4 = HasCollectible(this,0x1c3,0);
|
|
if ((bVar4 == 0) || ((*GHIDRA_CAST<int *>((cardConfig + 0x58)) != 0 && (*GHIDRA_CAST<int *>((cardConfig + 0x58)) != 5)))) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) = 0;
|
|
bVar4 = ~(byte)(useFlag >> 1) & 1;
|
|
LAB_007b23cf:
|
|
local_2a8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2a8)) + 0x1))),bVar4);
|
|
}
|
|
else {
|
|
isPlayAnnouncer = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) = 1;
|
|
VStack_2bc.y = (float)(CONCAT31((uint3)(useFlag >> 9),~(byte)(useFlag >> 1)) & 0xffffff01);
|
|
local_2a8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2a8)) + 0x1))),SUB41(VStack_2bc.y,0));
|
|
if ((useFlag & 4) != 0) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) = 1;
|
|
local_2a8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2a8)) + 0x1))),SUB41(VStack_2bc.y,0));
|
|
if ((char)local_2ac == '\0') {
|
|
UseCard(this,cardType,0x20);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) = isPlayAnnouncer;
|
|
bVar4 = SUB41(VStack_2bc.y,0);
|
|
goto LAB_007b23cf;
|
|
}
|
|
}
|
|
}
|
|
isPlayAnim = ~(byte)useFlag & 1;
|
|
pRVar6 = GHIDRA_CAST<Room *>(GetCardRNG(cardType));
|
|
local_298 = pRVar6;
|
|
uVar7 = Random();
|
|
if (((((((uVar7 & 1) == 0) && ((EntityPtr)VStack_2a0.y == (EntityPtr)0x0)) ||
|
|
((EntityPtr)VStack_2a0.y == (EntityPtr)0x2)) && ((useFlag & 0x100) == 0)) &&
|
|
((5 < g_game->_stage - 1U || (bVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x30), bVar4 == 0)))) &&
|
|
(g_game->_stage != 0xd)) {
|
|
isPlayAnnouncer = '\x01';
|
|
}
|
|
else {
|
|
isPlayAnnouncer = '\0';
|
|
}
|
|
game = g_game;
|
|
switch(card) {
|
|
case 1:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
g_game->_leaveDoor = -1;
|
|
Game::StartRoomTransition(game,game->_startingRoomIdx,-1,3,this,0);
|
|
goto LAB_007b8998;
|
|
case 2:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
piVar37 = GHIDRA_CAST<int *>(BitSet128)::operator_and(&g_tearFlagHoming);
|
|
if ((*piVar37 != 0 || piVar37[1] != 0) || (piVar37[2] != 0 || piVar37[3] != 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x185);
|
|
}
|
|
telepathyEffect = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0xc0);
|
|
uStack_3d4 = 0;
|
|
telepathyCooldown = telepathyEffect->maxCooldown;
|
|
uStack_3cc = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&telepathyEffect,(byte)local_2a8,1);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
belialEffect = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x22);
|
|
uStack_3e4 = 0;
|
|
belialCooldown = belialEffect->maxCooldown;
|
|
uStack_3dc = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&belialEffect,(byte)local_2a8,1);
|
|
}
|
|
break;
|
|
case 3:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
VStack_2dc.y = (float)g_game->_room;
|
|
VStack_2d4.y = (float)this;
|
|
VStack_2cc.y = (float)this;
|
|
if (((GHIDRA_CAST<Level *>(VStack_2dc.y))->_roomList[0x19].DecorationSeed != 0) &&
|
|
((GHIDRA_CAST<Level *>(VStack_2dc.y))->_roomList[0x26].GreedSubType != 6)) {
|
|
VStack_2b4.y = (float)(GHIDRA_UINT(VStack_2b4.y) & 0xffffff00);
|
|
VStack_2bc.y = 1.4013e-45;
|
|
VStack_2a0.y = 0.0;
|
|
if (1 < GHIDRA_UINT((GHIDRA_CAST<Level *>(VStack_2dc.y))->_roomList[0x19].DecorationSeed)) {
|
|
do {
|
|
pRVar6 = *GHIDRA_CAST<Room **>((*GHIDRA_CAST<int *>(&(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(VStack_2dc.y) + 0x14)))[0x19]).
|
|
PoopCount + GHIDRA_INT(VStack_2bc.y) * 4));
|
|
cVar5 = this->IsValidTarget(pRVar6);
|
|
if ((cVar5 != '\0') &&
|
|
(((bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar4 != 0 ||
|
|
((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) &&
|
|
(pRVar6->_gridEntities[1] == (void *)0x1)) ||
|
|
((GHIDRA_INT(pRVar6->_gridEntities[1]) - 10U < 0x3de &&
|
|
(pRVar6->_gridEntities[1] != (void *)0x21)))) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(VStack_2b4.y)) + 0x0))) == '\0'))))
|
|
&& ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pRVar6->_gridEntities) + 0x14f)) == 0 &&
|
|
(VStack_2a0.y <= (float)*GHIDRA_CAST<EntityPtr *>((pRVar6->_gridEntities + 0xd7)))))))) {
|
|
VStack_2d4.y = VStack_2cc.y;
|
|
VStack_2cc.y = (float)pRVar6;
|
|
VStack_2a0.y = (float)*GHIDRA_CAST<EntityPtr *>((pRVar6->_gridEntities + 0xd7));
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
VStack_2b4.y = (float)(GHIDRA_UINT(VStack_2b4.y) & 0xff);
|
|
if (bVar4 != 0) {
|
|
VStack_2b4.y = 1.4013e-45;
|
|
}
|
|
}
|
|
VStack_2bc.y = (float)(GHIDRA_INT(VStack_2bc.y) + 1);
|
|
} while (GHIDRA_UINT(VStack_2bc.y) <
|
|
GHIDRA_UINT((GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(VStack_2dc.y) + 0x14)))[0x19].DecorationSeed));
|
|
}
|
|
}
|
|
fVar51 = VStack_2cc.y;
|
|
if ((GHIDRA_CAST<Room *>(VStack_2d4.y) == GHIDRA_CAST<Room *>(0x0)) || (GHIDRA_CAST<Entity_Player *>(VStack_2d4.y) == this)) {
|
|
VStack_2d4.y = VStack_2cc.y;
|
|
}
|
|
if (GHIDRA_CAST<Room *>(VStack_2cc.y) != GHIDRA_CAST<Room *>(0x0)) {
|
|
uVar7 = Random();
|
|
VStack_2a0.x = (GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(fVar51) + 0x24) + 0xc6)))->x;
|
|
VStack_2a0.y = *GHIDRA_CAST<float *>(((void **)(GHIDRA_INT(fVar51) + 0x24) + 199));
|
|
uVar52 = 0;
|
|
pTVar49 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar48 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar36 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x1d,&VStack_2a0,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(__RTDynamicCast(tmpEntity,uVar36,pTVar48,pTVar49,uVar52));
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetTarget(GHIDRA_CAST<Entity *>(VStack_2cc.y));
|
|
tmpEntity->Update();
|
|
}
|
|
fVar51 = VStack_2d4.y;
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) && (GHIDRA_CAST<Room *>(VStack_2d4.y) != GHIDRA_CAST<Room *>(0x0))) {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(Entity_Effect)::CreateTimer(0,0);
|
|
pvVar45 = ((void **)(GHIDRA_INT(fVar51) + 0x24))[199];
|
|
(tmpEntity->_pos).x = (GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(fVar51) + 0x24) + 0xc6)))->x;
|
|
(tmpEntity->_pos).y = (float)pvVar45;
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetTarget(GHIDRA_CAST<Entity *>(fVar51));
|
|
}
|
|
break;
|
|
case 4:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x7a);
|
|
if (bVar4 == 0) {
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(3,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
whoreEffect = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x7a);
|
|
uStack_3f4 = 0;
|
|
whoreCooldown = whoreEffect->maxCooldown;
|
|
uStack_3ec = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&whoreEffect,(byte)local_2a8,1);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
whoreClothEffect = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x7a);
|
|
uStack_404 = 0;
|
|
whoreClothCooldown = whoreClothEffect->maxCooldown;
|
|
uStack_3fc = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&whoreClothEffect,(byte)local_2a8,1);
|
|
}
|
|
break;
|
|
case 5:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar41 = (GHIDRA_CAST<Level *>((5)))->Level::QueryRoomTypeIndex(0,pRVar6,0);
|
|
game = g_game;
|
|
if (-1 < iVar41) {
|
|
g_game->_leaveDoor = -1;
|
|
Game::StartRoomTransition(game,iVar41,-1,3,this,-1);
|
|
isPlayAnim = 0;
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
roomDesc = (GHIDRA_CAST<Level *>((pLVar22)))->Level::GetRoomByIdx(iVar41,-1);
|
|
if (roomDesc->VisitedCount == 0) {
|
|
AddSoulHearts(this,2,0);
|
|
}
|
|
}
|
|
break;
|
|
case 6:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
VStack_2a0.y = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) + 2);
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos2,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),3,uVar7);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
pRVar6 = local_298;
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
break;
|
|
case 7:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
VStack_2a0.y = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) + 2);
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,uVar7);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
pRVar6 = local_298;
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
break;
|
|
case 8:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x4d);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
unicornCooldown = unicornCooldown * 2;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(unicornEffect,(byte)local_2a8,1);
|
|
break;
|
|
case 9:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
VStack_2a0.y = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) + 1);
|
|
do {
|
|
bVar4 = HasTrinket(this,0x16,0);
|
|
if (bVar4 == 0) {
|
|
LAB_007b2f5b:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
pRVar6 = local_298;
|
|
}
|
|
else {
|
|
rngSource = GHIDRA_CAST<RNG *>(FUN_005cbd00(0x16));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((rngSource)))->RNG::RandomInt(5);
|
|
if (uVar7 == 0) goto LAB_007b2f5b;
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&spawnPos2,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x28,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_298))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_358,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x1e,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_298))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
pRVar6 = local_298;
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
break;
|
|
case 10:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
Config::GetCollectibles();
|
|
iVar41 = (GHIDRA_CAST<Level *>((2)))->Level::QueryRoomTypeIndex(0,pRVar6,0);
|
|
if (-1 < iVar41) {
|
|
Config::GetCollectibles();
|
|
FUN_00428ae0(0xffffffff);
|
|
Game::StartRoomTransition(g_game,iVar41,-1,3,this,-1);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
FUN_00420ae0();
|
|
FUN_00753c40(2);
|
|
}
|
|
goto LAB_007b8998;
|
|
}
|
|
break;
|
|
case 0xb:
|
|
play_sound_with_fart_seed(0x109,2,0,0x3f800000);
|
|
VStack_2b4.y = 1.4013e-45;
|
|
iVar41 = FUN_0067f030();
|
|
if (iVar41 == 0) {
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
bVar4 = (GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::Unlocked(0x25f);
|
|
if (bVar4 == 0) goto LAB_007b319e;
|
|
VStack_2b4.y = 2.24208e-44;
|
|
}
|
|
else if (iVar41 < 0x1a) {
|
|
LAB_007b319e:
|
|
VStack_2b4.y = 4.2039e-45;
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0);
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2b4.y);
|
|
goto LAB_007b31f0;
|
|
case 0xc:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0xc,(byte)local_2a8,1);
|
|
iVar41 = GetHeartLimit(this,0);
|
|
iVar17 = GetEffectiveMaxHearts(this);
|
|
if (iVar17 < iVar41) {
|
|
this->_strengthMaxHearts = this->_strengthMaxHearts + 1;
|
|
AddMaxHearts(this,2,0);
|
|
}
|
|
AddHearts(this,2,0,0);
|
|
break;
|
|
case 0xd:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
iVar41 = 1;
|
|
uVar7 = local_2a8;
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x14);
|
|
bVar4 = (byte)uVar7;
|
|
goto LAB_007b327d;
|
|
case 0xe:
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>(()))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0xc,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
SoundEffects::PlayWithFartOverride(0x21,2,0,0x3f800000);
|
|
UseActiveItem(this,&uStack_2a2,0x23,1,-1,0);
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::IncreaseEventCounter(7,1);
|
|
break;
|
|
case 0xf:
|
|
play_sound_with_fart_seed(0x109,2,0,0x3f800000);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0);
|
|
pRVar6 = GHIDRA_CAST<Room *>(0x2);
|
|
goto LAB_007b31f0;
|
|
case 0x10:
|
|
SoundEffects::PlayWithFartOverride(0x22,2,0,0x3f800000);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x22,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
itemConfig = Isaac::GetItemConfig();
|
|
iVar41 = 1;
|
|
uVar7 = local_2a8;
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x22);
|
|
bVar4 = (byte)uVar7;
|
|
goto LAB_007b327d;
|
|
case 0x11:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
iVar41 = 1;
|
|
uVar7 = local_2a8;
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x41);
|
|
bVar4 = (byte)uVar7;
|
|
LAB_007b327d:
|
|
pvVar45 = (void *)(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(pvVar45,bVar4,iVar41);
|
|
break;
|
|
case 0x12:
|
|
Config::GetCollectibles();
|
|
VStack_2b4.y = (float)(GHIDRA_CAST<Level *>((0x18)))->Level::QueryRoomTypeIndex(0,pRVar6,0);
|
|
if (GHIDRA_INT(VStack_2b4.y) < 0) {
|
|
LAB_007b3428:
|
|
Config::GetCollectibles();
|
|
VStack_2b4.y = (float)(GHIDRA_CAST<Level *>((4)))->Level::QueryRoomTypeIndex(0,pRVar6,0);
|
|
if (GHIDRA_INT(VStack_2b4.y) < 0) break;
|
|
}
|
|
else {
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
roomDesc = (GHIDRA_CAST<Level *>((pLVar22)))->Level::GetRoomByIdx(GHIDRA_INT(VStack_2b4.y),-1);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 8)) != 0x18) goto LAB_007b3428;
|
|
}
|
|
Config::GetCollectibles();
|
|
FUN_00428ae0(0xffffffff);
|
|
Game::StartRoomTransition(g_game,GHIDRA_INT(VStack_2b4.y),-1,3,this,-1);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
FUN_00420ae0();
|
|
FUN_00753c40(1);
|
|
}
|
|
goto LAB_007b8998;
|
|
case 0x13:
|
|
Config::GetCollectibles();
|
|
uVar52 = 0;
|
|
uVar36 = 7;
|
|
goto LAB_007b34ad;
|
|
case 0x14:
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) == 0) {
|
|
fVar51 = 1.0;
|
|
}
|
|
else {
|
|
fVar51 = 2.0;
|
|
}
|
|
VStack_2c4.y = fVar51 * 100.0;
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
VStack_2dc.y = (float)(GHIDRA_CAST<Room *>(()))->Room::GetEntities();
|
|
EVar33 = (EntityPtr)0x0;
|
|
VStack_2bc.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
entryPtr = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index(EVar33);
|
|
VStack_2a0.y = *GHIDRA_CAST<float *>(entryPtr);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2a0.y))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar4 != 0) {
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(VStack_2a0.y) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&EStack_254)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(*pcVar1)(VStack_2c4.y,0,0,&EStack_254,0x1e);
|
|
EVar33 = (EntityPtr)VStack_2bc.y;
|
|
}
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(EVar33) + 1);
|
|
VStack_2bc.y = (float)EVar33;
|
|
EVar21 = (EntityPtr)(GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
} while (GHIDRA_UINT(EVar33) < GHIDRA_UINT(EVar21));
|
|
}
|
|
uVar7 = 0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
iVar41 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
|
|
player = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::GetPlayer(uVar7);
|
|
if (player->_dead == 0) {
|
|
SetFullHearts(player);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
uVar30 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
} while (uVar7 < uVar30);
|
|
}
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::ShowMap();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((pRVar6)))->Room::StopRain();
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::RemoveCurses(1);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(5,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
break;
|
|
case 0x15:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(3);
|
|
if (uVar7 == 0) {
|
|
VStack_2d4.y = (float)&DAT_00000005;
|
|
}
|
|
else {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(0x32);
|
|
if (uVar7 == 0) {
|
|
VStack_2d4.y = (float)&DAT_0000000d;
|
|
}
|
|
else {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(0x32);
|
|
if (uVar7 == 0) {
|
|
persistentData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
|
|
bVar4 = (GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::Unlocked(0x266);
|
|
if (bVar4 != 0) {
|
|
VStack_2d4.y = 2.52234e-44;
|
|
goto LAB_007b36ff;
|
|
}
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(0x32);
|
|
if (uVar7 == 0) {
|
|
VStack_2d4.y = (float)&DAT_00000007;
|
|
}
|
|
else {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(0x32);
|
|
VStack_2d4.y = (float)&DAT_00000004;
|
|
if (uVar7 == 0) {
|
|
VStack_2d4.y = (float)&DAT_00000009;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007b36ff:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_344,&this->_pos,40.0,0,0,0);
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2d4.y);
|
|
goto LAB_007b31f0;
|
|
case 0x16:
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::ShowMap();
|
|
break;
|
|
case 0x17:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar41 = this->_numBombs;
|
|
if (iVar41 == 0) {
|
|
iVar41 = 2;
|
|
}
|
|
AddBombs(this,iVar41 + (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) * 2);
|
|
break;
|
|
case 0x18:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar41 = this->_numCoins;
|
|
if (iVar41 == 0) {
|
|
iVar41 = 2;
|
|
}
|
|
AddCoins(this,iVar41 + (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) * 2);
|
|
break;
|
|
case 0x19:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar41 = this->_numKeys;
|
|
if (iVar41 == 0) {
|
|
iVar41 = 2;
|
|
}
|
|
AddKeys(this,iVar41 + (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) * 2);
|
|
break;
|
|
case 0x1a:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (this->_playerType == 0x24) {
|
|
iVar41 = this->_effectiveBloodCharge;
|
|
if (iVar41 == 0) {
|
|
iVar41 = 2;
|
|
}
|
|
AddBloodCharge(iVar41 + (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) * 2);
|
|
}
|
|
else {
|
|
iVar41 = this->_redHearts;
|
|
iVar17 = iVar41;
|
|
if (iVar41 == 0) {
|
|
iVar17 = 2;
|
|
}
|
|
VStack_2a0.y = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) * 2);
|
|
puVar28 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(VStack_2a0.y) + iVar17));
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
iVar17 = iVar41;
|
|
if (iVar41 == 0) {
|
|
iVar17 = 0x10;
|
|
}
|
|
uVar7 = iVar17 + (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) * 0x10;
|
|
puVar28 = GHIDRA_CAST<undefined1 *>((uVar7 >> 3));
|
|
this->_redHearts = (uVar7 & 7) + iVar41;
|
|
}
|
|
AddHearts(this,GHIDRA_INT(puVar28),0,0);
|
|
}
|
|
break;
|
|
case 0x1b:
|
|
case 0x1c:
|
|
case 0x1d:
|
|
case 0x1e:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
EVar33 = (EntityPtr)g_game->_room;
|
|
VStack_2a0.y = (float)EVar33;
|
|
FUN_00424510();
|
|
uStack_8 = 0;
|
|
if (*(void **)(GHIDRA_CAST<char *>(EVar33) + 0x1264) != (void *)0x0) {
|
|
pvVar45 = (void *)0x0;
|
|
do {
|
|
pLVar22 = *(Level **)
|
|
(GHIDRA_INT((GHIDRA_CAST<PlayerCostumeMap *>((GHIDRA_INT(EVar33) + 0x125c)))->_index) + GHIDRA_INT(pvVar45) * 4);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pLVar22->_roomList[1])) + 0xa7))) == '\0') {
|
|
puVar28 = pLVar22->_roomList[0].OverrideData;
|
|
if (puVar28 == &DAT_00000005) {
|
|
bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pLVar22))))->Entity_Pickup::CanReroll();
|
|
if (((bVar4 != 0) && (pLVar22->_roomList[7].AllowedDoors == 0)) &&
|
|
(pLVar22->_roomList[0].AllowedDoors != 100)) {
|
|
vecResult = &VStack_2dc;
|
|
VStack_2dc.y = (float)pLVar22;
|
|
goto LAB_007b2675;
|
|
}
|
|
}
|
|
else if (((((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (puVar28 != GHIDRA_CAST<undefined1 *>(0x1)))
|
|
&& ((puVar28 + -10 < GHIDRA_CAST<undefined1 *>(0x3de) &&
|
|
((puVar28 != GHIDRA_CAST<undefined1 *>(0x1) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pLVar22))))->Entity::IsActiveEnemy(0), bVar4 != 0)))))) &&
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pLVar22->_roomList[1])) + 0xa7))) == '\0')) &&
|
|
(cVar5 = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(pLVar22))))->Entity_NPC::CanReroll(), cVar5 != '\0')) {
|
|
VStack_2c4.y = (float)pLVar22;
|
|
vecResult = &VStack_2c4;
|
|
LAB_007b2675:
|
|
emplace_back<>(&vecResult->y);
|
|
}
|
|
}
|
|
pvVar45 = (void *)(GHIDRA_INT(pvVar45) + 1);
|
|
EVar33 = (EntityPtr)VStack_2a0.y;
|
|
} while (pvVar45 < *(void **)(GHIDRA_CAST<char *>(VStack_2a0.y) + 0x1264));
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
VStack_2bc.y = 0.0;
|
|
VStack_2f0.y = *GHIDRA_CAST<float *>((&DAT_00b6bbd8 + card * 4));
|
|
if (targetsEnd - targetsBegin >> 2 != 0) {
|
|
do {
|
|
fVar51 = VStack_2bc.y;
|
|
iVar41 = *GHIDRA_CAST<int *>((targetsBegin + GHIDRA_INT(VStack_2bc.y) * 4));
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((iVar41 + 0x28)) == 1)) ||
|
|
(*GHIDRA_CAST<int *>((iVar41 + 0x28)) - 10U < 0x3de)) {
|
|
uVar7 = Random();
|
|
iVar41 = *GHIDRA_CAST<int *>((targetsBegin + GHIDRA_INT(fVar51) * 4));
|
|
VStack_2cc.x = *GHIDRA_CAST<float *>((iVar41 + 0x33c));
|
|
VStack_2cc.y = *GHIDRA_CAST<float *>((iVar41 + 0x340));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&VStack_2cc,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
piVar37 = *GHIDRA_CAST<int **>((targetsBegin + GHIDRA_INT(fVar51) * 4));
|
|
VStack_2a0.y = 0.0;
|
|
if (piVar37[10] == 5) {
|
|
VStack_2a0.y = *GHIDRA_CAST<float *>((piVar37 + 0x14a));
|
|
}
|
|
(**(code **)(*piVar37 + 0x28))();
|
|
iVar41 = *GHIDRA_CAST<int *>((targetsBegin + GHIDRA_INT(fVar51) * 4));
|
|
VStack_2b4.x = *GHIDRA_CAST<float *>((iVar41 + 0x33c));
|
|
VStack_2b4.y = *GHIDRA_CAST<float *>((iVar41 + 0x340));
|
|
pRVar6 = g_game->_room;
|
|
VStack_2d4.x = *GHIDRA_CAST<float *>((iVar41 + 0x33c));
|
|
VStack_2d4.y = *GHIDRA_CAST<float *>((iVar41 + 0x340));
|
|
iVar41 = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridIndex(&VStack_2d4);
|
|
uVar7 = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridCollision(iVar41);
|
|
if (uVar7 != 0) {
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,&VStack_358,&VStack_2b4,0.0,0,0,0);
|
|
VStack_2b4.x = vecResult->x;
|
|
VStack_2b4.y = vecResult->y;
|
|
}
|
|
fVar51 = VStack_2bc.y;
|
|
RStack_20c._seed = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((targetsBegin + GHIDRA_INT(VStack_2bc.y) * 4)) + 0x3ec));
|
|
RStack_20c._shift1 = 1;
|
|
RStack_20c._shift2 = 5;
|
|
RStack_20c._shift3 = 0x10;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x0))) = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&RStack_20c)))->RNG::Next();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(VStack_2f0.y),&VStack_2b4,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0
|
|
,uVar7);
|
|
uStack_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_8))) + 0x1))) << 8;
|
|
VStack_2bc.y = (float)(GHIDRA_INT(fVar51) + 1);
|
|
tmpEntity[1]._sprite._championColor._tint[0] = VStack_2a0.y;
|
|
} while (GHIDRA_UINT(VStack_2bc.y) < GHIDRA_UINT((targetsEnd - targetsBegin >> 2)));
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
FID_conflict__Tidy(&targetsBegin);
|
|
break;
|
|
case 0x1f:
|
|
g_game->_leaveDoor = -1;
|
|
iVar41 = (GHIDRA_CAST<Level *>((0xe)))->Level::QueryRoomTypeIndex(0,pRVar6,0);
|
|
Game::StartRoomTransition(g_game,iVar41,-1,3,this,0);
|
|
goto LAB_007b8998;
|
|
case 0x20:
|
|
use_card_hagalaz(0);
|
|
break;
|
|
case 0x21:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,&jeraPickups,5,-1,-1,0,0);
|
|
uStack_8 = 3;
|
|
EVar33 = (EntityPtr)0x0;
|
|
VStack_2bc.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(EVar33);
|
|
bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(*puVar27))))->Entity_Pickup::CanJeraDuplicate();
|
|
if (bVar4 != 0) {
|
|
entryPtr = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index(EVar33);
|
|
EVar33 = *entryPtr;
|
|
VStack_2a0.y = (float)EVar33;
|
|
VStack_2dc.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::InitSeed();
|
|
uVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::SubType();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2a0.y))))->Entity::Position(&VStack_330);
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_31c,vecResult,40.0,0,0,0);
|
|
uVar30 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2a0.y))))->Entity::Variant();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar30,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(VStack_2d4.y),uVar7,
|
|
GHIDRA_UINT(VStack_2dc.y));
|
|
EVar33 = (EntityPtr)VStack_2bc.y;
|
|
}
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(EVar33) + 1);
|
|
VStack_2bc.y = (float)EVar33;
|
|
EVar21 = (EntityPtr)(GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
} while (GHIDRA_UINT(EVar33) < GHIDRA_UINT(EVar21));
|
|
}
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x15,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&jeraPickups)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case 0x22:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_2f8) + 2)),0x54,1,-1,0);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x16,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
break;
|
|
case 0x23:
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::RemoveCurses(0xffffffff);
|
|
AddSoulHearts(this,2,0);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x17,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
if (cVar5 != '\0') {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x278);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
evilCharmCooldown = 600;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(evilCharmEffect,1,1);
|
|
}
|
|
break;
|
|
case 0x24:
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::ShowMap();
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::ApplyBlueMapEffect();
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x18,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
break;
|
|
case 0x25:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_2f8) + 2)),0x69,1,-1,0);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x19,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
break;
|
|
case 0x26:
|
|
iVar41 = 3;
|
|
do {
|
|
uVar7 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xe7,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0x19,uVar7);
|
|
FUN_005b18f0(1);
|
|
iVar41 = iVar41 + -1;
|
|
} while (iVar41 != 0);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x1a,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
break;
|
|
case 0x27:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x3a);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
bookOfShadowsCooldown = 600;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(bookOfShadowsEffect,(byte)local_2a8,1);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x1b,4,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
break;
|
|
case 0x28:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(4);
|
|
if (uVar7 == 0) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(VStack_2dc.y)) + 0x0))) == '\0') {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_330,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,300,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0x28,uVar7);
|
|
pRVar6 = local_298;
|
|
}
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(9);
|
|
VStack_2b4.y = *GHIDRA_CAST<float *>((&DAT_00b6bc20 + uVar7 * 4));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
piVar37 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
cVar5 = (**(code **)(*piVar37 + 0x24))(VStack_2b4.y);
|
|
if (cVar5 != '\0') {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(9);
|
|
pRVar20 = *GHIDRA_CAST<Room **>((&DAT_00b6bc20 + uVar7 * 4));
|
|
VStack_2b4.y = (float)pRVar20;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
piVar37 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
cVar5 = (**(code **)(*piVar37 + 0x24))(pRVar20);
|
|
} while (cVar5 != '\0');
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
}
|
|
UseCard(this,GHIDRA_INT(VStack_2b4.y),0);
|
|
break;
|
|
case 0x29:
|
|
if ((((this->_queuedItem)._item != (void *)0x0) &&
|
|
(cVar5 = (GHIDRA_CAST<Item *>(()))->Item::IsCollectible(), cVar5 != '\0')) &&
|
|
(bVar4 = (GHIDRA_CAST<Item *>(((this->_queuedItem)._item)))->Item::HasTags(0x8000), bVar4 == 0)) {
|
|
speedStat = &this->_speedModifier;
|
|
(this->_queuedItem)._item = (void *)0x0;
|
|
fireDelayStat = &this->_fireDelayModifier;
|
|
(this->_queuedItem)._charge = 0;
|
|
damageStat = &this->_damageModifier;
|
|
rangeStat = &this->_tearRangeModifier;
|
|
shotSpeedStat = &this->_shotSpeedModifier;
|
|
luckStat = &this->_luckModifier;
|
|
uVar36 = FUN_005cbd00(0x29);
|
|
FUN_005cbfe0(uVar36);
|
|
*speedStat = *speedStat + 1;
|
|
*fireDelayStat = *fireDelayStat + 1;
|
|
uVar7 = Random();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)))))->Vector::__add(&VStack_31c,vecResult);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
VStack_2b4.y = (float)(GHIDRA_CAST<Room *>(()))->Room::GetEntities();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) = 0;
|
|
FUN_00424510();
|
|
uStack_8 = 4;
|
|
pRVar6 = GHIDRA_CAST<Room *>(0x0);
|
|
VStack_2cc.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
std::vector<int>::operator_index(pRVar6);
|
|
local_298 = GHIDRA_CAST<Room *>(FUN_00435e30());
|
|
if (((local_298 != GHIDRA_CAST<Room *>(0x0)) &&
|
|
(cVar5 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_298))))->Entity_Pickup::IsShopItem(), cVar5 == '\0')) &&
|
|
((cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::IsDead(), cVar5 == '\0' &&
|
|
(bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_298))))->Entity_Pickup::CanReroll(), bVar4 != 0)))) {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::Variant();
|
|
if (((iVar41 == 100) && (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::SubType(), iVar41 != 0)) &&
|
|
(iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_298))))->Entity_Pickup::Timeout(), iVar41 < 1)) {
|
|
speedStat = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1520))));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) = 1;
|
|
fireDelayStat = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1524))));
|
|
damageStat = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1528))));
|
|
rangeStat = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x152c))));
|
|
shotSpeedStat = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1530))));
|
|
luckStat = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1534))));
|
|
uVar36 = FUN_005cbd00(0x29);
|
|
FUN_005cbfe0(uVar36);
|
|
*speedStat = *speedStat + 1;
|
|
*fireDelayStat = *fireDelayStat + 1;
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::Position(&VStack_330);
|
|
vecResult2 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&VStack_360,vecResult2);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
FUN_0060d1f0(4);
|
|
Entity_Pickup::RemoveOtherOptions();
|
|
iVar41 = FUN_005b1960();
|
|
if (iVar41 != -1) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayerManager();
|
|
uVar7 = (GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetNumAlivePlayers();
|
|
if (iVar41 + 1U < uVar7) {
|
|
std::vector<unsigned_int>::push_back(&local_298);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::Variant();
|
|
if ((iVar41 != 100) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_298))))->Entity_Pickup::CanReroll(), bVar4 != 0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(local_298) + 0x28))();
|
|
tmpEntity = GHIDRA_CAST<Entity *>(0x0);
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::Position(&VStack_368);
|
|
AddBlueFlies(this,1,vecResult,tmpEntity);
|
|
}
|
|
}
|
|
}
|
|
puVar47 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(VStack_2cc.y) + 1));
|
|
VStack_2cc.y = (float)puVar47;
|
|
puVar28 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2cc.y);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
} while (puVar47 < puVar28);
|
|
}
|
|
EVar33 = (EntityPtr)0x0;
|
|
VStack_2bc.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
if (iVar41 != 0) {
|
|
VStack_2a0.y = (float)((void **)(GHIDRA_INT(VStack_2d4.y) + 0x24) + 0xee);
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(FUN_0042c810(EVar33));
|
|
tmpEntity = GHIDRA_CAST<Entity *>(*puVar27);
|
|
iVar41 = FUN_005b1960();
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::Position(&VStack_2dc);
|
|
tmpEntity->Remove();
|
|
itemPool = GHIDRA_CAST<ItemPool *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemPool();
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(VStack_2a0.y))))->RNG::Next();
|
|
uVar7 = ItemPool::GetCollectible(itemPool,2,uVar7,0,0,0);
|
|
uVar30 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(VStack_2a0.y))))->RNG::Next();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&VStack_2dc,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar30);
|
|
FUN_006e2ff0(iVar41 + 1);
|
|
tmpEntity->Update();
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(VStack_2bc.y) + 1);
|
|
VStack_2bc.y = (float)EVar33;
|
|
EVar21 = (EntityPtr)(GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
} while (GHIDRA_UINT(EVar33) < GHIDRA_UINT(EVar21));
|
|
}
|
|
FUN_007dc610();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1574)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1574)) | 0x41f;
|
|
EvaluateItems();
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_2f8) + 2)),0x23,1,-1,0);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
iVar41 = (GHIDRA_CAST<GridEntity *>(()))->GridEntity::GetVariant();
|
|
if (iVar41 != 0xb) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
iVar41 = (GHIDRA_CAST<GridEntity *>(()))->GridEntity::GetVariant();
|
|
if (iVar41 != 0x11) goto LAB_007b4865;
|
|
}
|
|
ambush = GHIDRA_CAST<Ambush *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetAmbush();
|
|
(GHIDRA_CAST<Ambush *>((ambush)))->Ambush::StartChallenge();
|
|
}
|
|
LAB_007b4865:
|
|
uStack_8 = 0xffffffff;
|
|
FID_conflict__Tidy(auStack_328);
|
|
break;
|
|
case 0x2a:
|
|
VStack_2dc.y = (float)&this->_lastVelocity;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(VStack_2dc.y))))->Vector::Normalized(&VStack_2f0);
|
|
bVar4 = (GHIDRA_CAST<Vector *>((&VStack_2f0)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<Vector *>((&VStack_2f0)))->Vector::operator_assign(&this->_movementVector);
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Vector *>((&VStack_2f0)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar4 != 0) {
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
(GHIDRA_CAST<Vector *>((&VStack_2f0)))->Vector::operator_assign(vecResult);
|
|
}
|
|
uVar7 = Random();
|
|
VStack_2a0.y = 10.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&VStack_2f0)))->Vector::__mul(&VStack_398,&VStack_2a0.y);
|
|
VStack_2bc.y = 0.5;
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(VStack_2dc.y))))->Vector::__mul(&VStack_368,&VStack_2bc.y);
|
|
VStack_2c4.y = 2.0;
|
|
vecResult2 = (GHIDRA_CAST<Vector *>((vecResult2)))->Vector::__mul(&VStack_360,&VStack_2c4.y);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&VStack_31c,vecResult2);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,9,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(VStack_2d4.y) + 0x24) + 0xc6)),vecResult,
|
|
GHIDRA_CAST<Entity *>(VStack_2d4.y),0,uVar7);
|
|
goto LAB_007b8998;
|
|
case 0x2b:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,&creditPickups,5,-1,-1,0,0);
|
|
uStack_8 = 2;
|
|
uVar7 = 0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(uVar7);
|
|
VStack_2a0.y = (float)__RTDynamicCast(*puVar27,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::
|
|
RTTI_Type_Descriptor,0);
|
|
if (((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) &&
|
|
(iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(VStack_2a0.y))))->Entity_Pickup::Price(), iVar41 != 0)) {
|
|
(GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(VStack_2a0.y))))->Entity_Pickup::update_price_sprite(0);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
uVar30 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
} while (uVar7 < uVar30);
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&creditPickups)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case 0x2c:
|
|
VStack_2a0.y = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomFloat();
|
|
if (0.05 <= VStack_2a0.y) {
|
|
(GHIDRA_CAST<Game *>(()))->Game::ShowRule();
|
|
}
|
|
else {
|
|
FUN_0065d070();
|
|
}
|
|
break;
|
|
case 0x2d:
|
|
play_sound_with_fart_seed(0x25,2,0,0x3f800000);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
Room::SetCardAgainstHumanity();
|
|
break;
|
|
case 0x2e:
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x24);
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((&suicideKingRef)))->EntityRef::EntityRef();
|
|
(*pcVar1)(sourceRef);
|
|
*GHIDRA_CAST<undefined4 *>(&this->_lastDamageFlags) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_lastDamageFlags) + 4)) = 0;
|
|
(this->_lastDamageSource)._type = 0;
|
|
(this->_lastDamageSource)._variant = 0;
|
|
VStack_2a0.y = 0.0;
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_298))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_344,GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xc6)),40.0,
|
|
0,0,0);
|
|
uVar30 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_298))))->RNG::RandomInt(0xc);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,*GHIDRA_CAST<uint *>((&DAT_00b6bbf0 + uVar30 * 4)),vecResult,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(VStack_2d4.y),0,uVar7);
|
|
fVar51 = VStack_2a0.y;
|
|
FUN_005b19f0(VStack_2a0.y);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(fVar51) + 1);
|
|
} while (GHIDRA_INT(VStack_2a0.y) < 10);
|
|
goto LAB_007b8998;
|
|
case 0x2f:
|
|
UseActiveItem(this,&uStack_2a2,0xaf,1,-1,0);
|
|
break;
|
|
case 0x30:
|
|
iVar41 = this->_activeDesc[0]._item;
|
|
if (iVar41 != 0) {
|
|
if (iVar41 != 0x11e) {
|
|
if ((((iVar41 == 0x1a6) &&
|
|
(hourglassState = (GHIDRA_CAST<Game *>((g_game)))->Game::GetGlowingHourglassState(),
|
|
hourglassState != GHIDRA_CAST<GlowingHourglassState *>(0x0))) && (-1 < this->_glowingHourglassIndex)) &&
|
|
(hourglassState = (GHIDRA_CAST<Game *>((g_game)))->Game::GetGlowingHourglassState(),
|
|
hourglassState != GHIDRA_CAST<GlowingHourglassState *>(0x0))) {
|
|
VStack_2a0.y = (float)(hourglassState->_eventCounters +
|
|
this->_glowingHourglassIndex * 0x177 + -0x182d);
|
|
VStack_2b4.y = 0.0;
|
|
pfVar16 = GHIDRA_CAST<float *>((GHIDRA_INT(VStack_2a0.y) + 0x104));
|
|
LAB_007b3be0:
|
|
cVar5 = FUN_00753630();
|
|
if ((cVar5 == '\0') || (*pfVar16 != 6.72623e-44)) goto LAB_007b3bf0;
|
|
if (GHIDRA_UINT(VStack_2b4.y) < GHIDRA_CAST<Room *>(0x3)) {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(VStack_2b4.y) * 8 + 0x10c + GHIDRA_INT(VStack_2a0.y)));
|
|
copyDst = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(VStack_2b4.y) * 8 + 0x104 + GHIDRA_INT(VStack_2a0.y)));
|
|
for (uVar7 = (3 - GHIDRA_INT(VStack_2b4.y)) * 2 & 0x3ffffffe; uVar7 != 0; uVar7 = uVar7 - 1) {
|
|
*copyDst = *puVar27;
|
|
puVar27 = puVar27 + 1;
|
|
copyDst = copyDst + 1;
|
|
}
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
FUN_00753620();
|
|
}
|
|
LAB_007b3c4c:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_2f8) + 2)),
|
|
(GHIDRA_CAST<ActiveItemDesc *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1580)))))->_item,4,0,0);
|
|
TriggerBookOfVirtues((GHIDRA_CAST<ActiveItemDesc *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1580)))))->_item,0);
|
|
goto LAB_007b8998;
|
|
}
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
bVar4 = (GHIDRA_CAST<Level *>((pLVar22)))->Level::IsNextStageAvailable();
|
|
if (bVar4 == 0) {
|
|
uVar7 = Random();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_31c,&this->_pos,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(0x11,2,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
}
|
|
else {
|
|
Config::GetCollectibles();
|
|
FUN_00428ae0(0xffffffff);
|
|
Game::StartRoomTransition(g_game,-2,-1,3,this,-1);
|
|
}
|
|
RemoveCollectible(this,this->_activeDesc[0]._item,0,0,1);
|
|
}
|
|
break;
|
|
case 0x31:
|
|
UseActiveItem(this,&uStack_2a2,0x69,1,-1,0);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_2f8) + 2)),0xa6,1,-1,0);
|
|
break;
|
|
case 0x32:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<Room *>(()))->Room::GetEntities();
|
|
pRVar6 = GHIDRA_CAST<Room *>(0x0);
|
|
VStack_2c4.x = 0.0;
|
|
VStack_2c4.y = 0.0;
|
|
VStack_2b4.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(pRVar6);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar27))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar4 != 0) {
|
|
if (VStack_2c4.x == 0.0) {
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::vector<int>::operator_index(pRVar6);
|
|
VStack_2c4.x = *pfVar16;
|
|
}
|
|
else {
|
|
if (GHIDRA_CAST<Entity *>(VStack_2c4.y) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
VStack_2dc.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2c4.y))))->Entity::Position(&VStack_31c);
|
|
VStack_2bc.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2c4.x))))->Entity::Position(&VStack_360);
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(pRVar6);
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar27))))->Entity::Position(&VStack_368);
|
|
vecResult2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2c4.x))))->Entity::Position(&VStack_398);
|
|
VStack_2dc.y = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(VStack_2dc.y))))->Vector::DistanceSquared(GHIDRA_CAST<Vector *>(VStack_2bc.y));
|
|
VStack_2bc.y = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::DistanceSquared(vecResult2);
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2b4.y);
|
|
if (VStack_2bc.y <= VStack_2dc.y) goto LAB_007b3d9f;
|
|
}
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::vector<int>::operator_index(pRVar6);
|
|
VStack_2c4.y = *pfVar16;
|
|
}
|
|
}
|
|
LAB_007b3d9f:
|
|
pRVar6 = GHIDRA_CAST<Room *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pRVar6)) + 0x1))));
|
|
VStack_2b4.y = (float)pRVar6;
|
|
puVar28 = GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
} while (pRVar6 < puVar28);
|
|
}
|
|
VStack_2a0.y = 0.0;
|
|
do {
|
|
EVar33 = *GHIDRA_CAST<EntityPtr *>((&VStack_2c4.x + GHIDRA_INT(VStack_2a0.y)));
|
|
VStack_2bc.y = (float)EVar33;
|
|
if (EVar33 != (EntityPtr)0x0) {
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::Position(&VStack_31c);
|
|
vecResult2 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&VStack_368,vecResult2);
|
|
uVar52 = 0;
|
|
pTVar49 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar48 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar36 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x5b,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast(tmpEntity,uVar36,pTVar48,pTVar49,uVar52));
|
|
fVar51 = VStack_2bc.y;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(VStack_2bc.y));
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x96);
|
|
effect->Update();
|
|
npc = (Entity_NPC *)
|
|
__RTDynamicCast(fVar51,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar51))))->Entity::Position(&VStack_330);
|
|
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::hold_set(0x96,vecResult);
|
|
}
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
} while (GHIDRA_INT(VStack_2a0.y) < 2);
|
|
break;
|
|
case 0x33:
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x2e);
|
|
if (bVar4 == 0) {
|
|
bVar4 = (byte)local_2a8;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x2e,bVar4,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x139,bVar4,1);
|
|
}
|
|
break;
|
|
case 0x34:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0x1e);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x29);
|
|
cVar5 = vector_contains_int(configItem);
|
|
if (cVar5 == '\0') {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x29);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(tmpEffect,(byte)local_2a8,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x12e,0,1);
|
|
}
|
|
break;
|
|
case 0x35:
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>(()))->Level)::GetCurrentRoom();
|
|
Room::FindFreePickupSpawnPosition(pRVar20,&pickupPos,&this->_pos,0.0,0,0,0);
|
|
VStack_2a0.y = (float)&this->_cardRNGs;
|
|
VStack_2b4.y = 0.0;
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetItemPool();
|
|
rngSource = GHIDRA_CAST<RNG *>(FUN_005cbd00(0x35));
|
|
uVar30 = (GHIDRA_CAST<RNG *>((rngSource)))->RNG::Next();
|
|
uVar30 = ItemPool::GetCard(uVar30,1,0,0);
|
|
vecResult = Vector::FromAngle(&VStack_374,(float)GHIDRA_INT(VStack_2b4.y) * -90.0);
|
|
VStack_2dc.y = 2.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&VStack_300,&VStack_2dc.y);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,300,&pickupPos,vecResult,GHIDRA_CAST<Entity *>(VStack_2d4.y),uVar30,uVar7);
|
|
VStack_2b4.y = (float)(GHIDRA_INT(VStack_2b4.y) + 1);
|
|
pRVar6 = local_298;
|
|
} while (GHIDRA_INT(VStack_2b4.y) < 3);
|
|
break;
|
|
case 0x36:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x2a);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(tmpEffect,1,1);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddCollectibleEffect(0xe8,1,1);
|
|
break;
|
|
case 0x37:
|
|
VStack_2b4.y = (float)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(8);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
if (cVar5 != '\0') {
|
|
pRVar20 = GHIDRA_CAST<Room *>(VStack_2b4.y);
|
|
do {
|
|
if ((pRVar20 != GHIDRA_CAST<Room *>(0x0)) && (pRVar20 != GHIDRA_CAST<Room *>(&DAT_00000006))) break;
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG)::RandomInt(8);
|
|
VStack_2b4.y = (float)pRVar20;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
} while (cVar5 != '\0');
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
switch(VStack_2b4.y) {
|
|
case 0.0:
|
|
VStack_2dc.y = (float)Config::GetCollectibles();
|
|
uVar7 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(VStack_2dc.y))))->Level::GetCurrentRoomIndex();
|
|
if (-1 < GHIDRA_INT(uVar7)) {
|
|
if (uVar7 < 0xa9) {
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_INT(uVar7) / 0xd));
|
|
VStack_2bc.y = (float)(GHIDRA_INT(uVar7) % 0xd);
|
|
local_298 = GHIDRA_CAST<Room *>((GHIDRA_INT(VStack_2bc.y) + -3));
|
|
VStack_2c4.y = (float)(GHIDRA_INT(VStack_2bc.y) + 3);
|
|
VStack_2b4.y = (float)pRVar6;
|
|
if (GHIDRA_INT(local_298) <= GHIDRA_INT((GHIDRA_INT(VStack_2bc.y) + 3))) {
|
|
VStack_2cc.y = -NAN;
|
|
do {
|
|
fVar51 = VStack_2cc.y;
|
|
if ((GHIDRA_CAST<undefined1 *>((GHIDRA_INT(VStack_2cc.y) + GHIDRA_INT(VStack_2bc.y))) < GHIDRA_CAST<undefined1 *>(0xd)) &&
|
|
(GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pRVar6[-1])) + 0x7895)))) <= GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pRVar6)) + 0x3)))))) {
|
|
uVar7 = 0xfffffffd;
|
|
VStack_2a0.y = 9.80909e-45;
|
|
iVar41 = GHIDRA_INT(local_298->_gridEntities) + GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pRVar6[-1])) + 0x7895)))) * 0xd + -0x24
|
|
;
|
|
do {
|
|
if (GHIDRA_INT(pRVar6->_gridEntities) + (uVar7 - 0x24) < 0xd) {
|
|
if (GHIDRA_INT((((GHIDRA_UINT(fVar51) ^ GHIDRA_INT(fVar51) >> 0x1f) - (GHIDRA_INT(fVar51) >> 0x1f)) +
|
|
((uVar7 ^ GHIDRA_INT(uVar7) >> 0x1f) - (GHIDRA_INT(uVar7) >> 0x1f)))) < 4) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(VStack_2dc.y))))->Level::GetRoomByIdx(iVar41,-1);
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2b4.y);
|
|
fVar51 = VStack_2cc.y;
|
|
if (roomDesc->Data != (void *)0x0) {
|
|
roomDesc->DisplayFlags = roomDesc->DisplayFlags | 5;
|
|
}
|
|
}
|
|
else {
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2b4.y);
|
|
fVar51 = VStack_2cc.y;
|
|
}
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
iVar41 = iVar41 + 0xd;
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
}
|
|
local_298 = GHIDRA_CAST<Room *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_298)) + 0x1))));
|
|
VStack_2cc.y = (float)(GHIDRA_INT(fVar51) + 1);
|
|
} while (GHIDRA_INT(local_298) <= GHIDRA_INT(VStack_2c4.y));
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
}
|
|
}
|
|
minimap = GHIDRA_CAST<Minimap *>(FUN_00738380());
|
|
(GHIDRA_CAST<Minimap *>((minimap)))->Minimap::Refresh();
|
|
break;
|
|
case 1.4013e-45:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetItemPool();
|
|
(GHIDRA_CAST<ItemPool *>(()))->ItemPool::ResetRoomBlacklist();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,&shardCollectibles,5,100,-1,0,0);
|
|
uStack_8 = 5;
|
|
uVar30 = 0xb;
|
|
local_298 = GHIDRA_CAST<Room *>(0x0);
|
|
uVar7 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<RNG *>((&shardRng)))->RNG::game_constructor(uVar7,uVar30);
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),6);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&shardRng)))->RNG::RandomInt(2);
|
|
VStack_2a0.y = (float)((-GHIDRA_UINT((uVar7 != 0)) & 0xffffffdc) + 0x24);
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
uVar7 = 0;
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(uVar7);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(*puVar27);
|
|
cVar5 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::IsDead();
|
|
if ((cVar5 == '\0') && (iVar41 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SubType(), iVar41 != 0)) {
|
|
pRVar6 = GHIDRA_CAST<Room *>(__RTDynamicCast(tmpEntity,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::
|
|
RTTI_Type_Descriptor,0));
|
|
bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pRVar6))))->Entity_Pickup::CanReroll();
|
|
if (((bVar4 != 0) &&
|
|
((iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pRVar6))))->Entity_Pickup::OptionsPickupIndex(), iVar41 == 0
|
|
|| (iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pRVar6))))->Entity_Pickup::Timeout(), iVar41 < 0)))) &&
|
|
((uVar30 = (GHIDRA_CAST<RNG *>((&shardRng)))->RNG::Next(), local_298 == GHIDRA_CAST<Room *>(0x0) || (uVar30 != 0)))) {
|
|
local_298 = pRVar6;
|
|
}
|
|
}
|
|
pRVar6 = local_298;
|
|
uVar7 = uVar7 + 1;
|
|
uVar30 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
} while (uVar7 < uVar30);
|
|
if (pRVar6 != GHIDRA_CAST<Room *>(0x0)) {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::Variant();
|
|
iVar17 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_298))))->Entity::Type();
|
|
Entity_Pickup::Morph(GHIDRA_CAST<Entity_Pickup *>(local_298),iVar17,iVar41,GHIDRA_INT(VStack_2a0.y),1,0,0);
|
|
FUN_005b1950(0);
|
|
}
|
|
}
|
|
guard_check_icall();
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&shardCollectibles)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case 2.8026e-45:
|
|
uVar7 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xe7,GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xc6)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0x19,uVar7);
|
|
FUN_005b18f0(1);
|
|
break;
|
|
case 4.2039e-45:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x3a);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
RStack_22c._shift2 = 0x5a;
|
|
TemporaryEffects::AddEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1508)))),&RStack_22c,(byte)local_2a8,1);
|
|
break;
|
|
case 5.60519e-45:
|
|
use_card_hagalaz(pRVar6);
|
|
break;
|
|
case 7.00649e-45:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_30c) + 2)),0x1dc,1,-1,0);
|
|
break;
|
|
case 8.40779e-45:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&VStack_314.y) + 2)),0x54,1,-1,0);
|
|
break;
|
|
case 9.80909e-45:
|
|
AddSoulHearts(this,1,0);
|
|
}
|
|
break;
|
|
case 0x38:
|
|
iVar41 = 0;
|
|
VStack_2bc.x = (float)this;
|
|
uVar7 = 0;
|
|
VStack_2bc.y = (float)this->_subPlayer;
|
|
EVar33 = (EntityPtr)0x0;
|
|
VStack_314.y = 0.0;
|
|
EStack_2f4 = (EntityPtr)0x0;
|
|
VStack_2b4.y = 0.0;
|
|
uStack_2f8 = 0;
|
|
VStack_2cc.y = 0.0;
|
|
uStack_30c = 0;
|
|
local_2a8 = 0;
|
|
VStack_2a0.y = 0.0;
|
|
do {
|
|
player = GHIDRA_CAST<Entity_Player *>((&VStack_2bc.x)[GHIDRA_INT(VStack_2a0.y)]);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uStack_2f8 = uStack_2f8 + player->_eternalHearts;
|
|
VStack_2cc.y = (float)(GHIDRA_INT(VStack_2cc.y) + player->_goldenHearts);
|
|
VStack_2f0.y = (float)player->_rottenHearts;
|
|
local_2ac = player->_redHearts;
|
|
player->_eternalHearts = 0;
|
|
player->_goldenHearts = 0;
|
|
uStack_2e8 = (float)FUN_00759260();
|
|
EStack_2e4 = (EntityPtr)player->_soulHearts;
|
|
VStack_2c4.y = (float)player->_boneHearts;
|
|
if ((player->_redHearts < 1) || (player->_maxHearts < 1)) {
|
|
if (player->_boneHearts < 1) {
|
|
if (0 < GHIDRA_INT(EStack_2e4)) {
|
|
AddSoulHearts(player,1 - GHIDRA_INT(EStack_2e4),0);
|
|
}
|
|
}
|
|
else {
|
|
AddHearts(player,-player->_redHearts,0,0);
|
|
AddSoulHearts(player,-player->_soulHearts,0);
|
|
player->_boneHearts = 1;
|
|
update_bone_hearts(player);
|
|
}
|
|
}
|
|
else {
|
|
iVar17 = GetHealthType(player);
|
|
iVar41 = player->_redHearts;
|
|
if (iVar17 == 3) {
|
|
if (2 < iVar41) {
|
|
iVar17 = 2;
|
|
goto LAB_007b4f9f;
|
|
}
|
|
}
|
|
else if (1 < iVar41) {
|
|
iVar17 = 1;
|
|
LAB_007b4f9f:
|
|
AddHearts(player,iVar17 - iVar41,0,0);
|
|
}
|
|
AddSoulHearts(player,-player->_soulHearts,0);
|
|
player->_boneHearts = 0;
|
|
update_bone_hearts(player);
|
|
}
|
|
VStack_2f0.y = (float)(GHIDRA_INT(VStack_2f0.y) - player->_rottenHearts);
|
|
local_2ac = (local_2ac + GHIDRA_INT(VStack_2f0.y) * -2) - player->_redHearts;
|
|
iVar41 = FUN_00759260();
|
|
uStack_2e8 = (float)(GHIDRA_INT(uStack_2e8) - iVar41);
|
|
EStack_2e4 = (EntityPtr)((GHIDRA_INT(EStack_2e4) + GHIDRA_INT(uStack_2e8) * -2) - player->_soulHearts);
|
|
if ((0 < GHIDRA_INT(local_2ac)) && (iVar41 = GetHealthType(player), iVar41 == 3)) {
|
|
iVar41 = local_2ac + 1;
|
|
local_2ac = 0;
|
|
local_2a8 = local_2a8 + iVar41 / 2;
|
|
}
|
|
EVar33 = EStack_2e4;
|
|
if (GHIDRA_INT(EStack_2e4) < 0) {
|
|
iVar41 = (1 - GHIDRA_INT(EStack_2e4)) / 2;
|
|
uStack_2e8 = (float)(GHIDRA_INT(uStack_2e8) - iVar41);
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(EStack_2e4) + iVar41 * 2);
|
|
}
|
|
fVar51 = (float)(GHIDRA_INT(VStack_2c4.y) - player->_boneHearts);
|
|
uVar7 = uVar7 + local_2ac;
|
|
VStack_2c4.y = fVar51;
|
|
VStack_314.y = (float)(GHIDRA_INT((GHIDRA_INT(VStack_2f0.y) + 0x24)) + GHIDRA_INT(VStack_314.y) + -0x24);
|
|
VStack_2b4.y = (float)(GHIDRA_INT(VStack_2b4.y) + GHIDRA_INT(uStack_2e8));
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(EStack_2f4) + GHIDRA_INT(EVar33));
|
|
uStack_30c = uStack_30c + GHIDRA_INT(fVar51);
|
|
iVar41 = local_2a8;
|
|
EStack_2f4 = EVar33;
|
|
}
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
} while (GHIDRA_UINT(VStack_2a0.y) < 2);
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1da8))) {
|
|
EStack_2f4 = (EntityPtr)(GHIDRA_INT(EVar33) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1da8)));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1da8)) = 0;
|
|
}
|
|
uVar30 = uVar7;
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1dac))) {
|
|
uVar30 = uVar7 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1dac));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1dac)) = 0;
|
|
}
|
|
local_2a8 = iVar41 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1368));
|
|
VStack_2bc.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1dd4));
|
|
VStack_2dc.y = (float)GHIDRA_UINT((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1361)) != '\0'));
|
|
EStack_2e4 = (EntityPtr)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1364)) - GHIDRA_INT(VStack_2bc.y));
|
|
uStack_2e8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x135c));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1368)) = 0;
|
|
VStack_2a0.y = (float)GHIDRA_UINT((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1360)) != '\0'));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1364)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1dd4)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1361)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x135c)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1360)) = 0;
|
|
local_2ac = uVar7;
|
|
FUN_005b19d0();
|
|
shiftidx = 0x2c;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_298))))->RNG::Next();
|
|
(GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::game_constructor(uVar7,shiftidx);
|
|
uStack_8 = 7;
|
|
VStack_2f0.y = (float)((void **)(GHIDRA_INT(this) + 0x24) + 0xc6);
|
|
if (0 < GHIDRA_INT(uVar30)) {
|
|
do {
|
|
iVar41 = nullsub_7dd380();
|
|
if (GHIDRA_INT(uVar30) < iVar41) {
|
|
iVar41 = nullsub_7dd380();
|
|
if (GHIDRA_INT(uVar30) < iVar41) {
|
|
VStack_2c4.y = 2.8026e-45;
|
|
}
|
|
else {
|
|
VStack_2c4.y = 1.4013e-45;
|
|
}
|
|
}
|
|
else {
|
|
VStack_2c4.y = 7.00649e-45;
|
|
}
|
|
iVar41 = nullsub_7dd380();
|
|
local_2ac = uVar30 - iVar41;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_300,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)),40.0,
|
|
0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(VStack_2c4.y),uVar7);
|
|
uVar30 = local_2ac;
|
|
} while (0 < GHIDRA_INT(local_2ac));
|
|
}
|
|
VStack_2c4.y = (float)((void **)(GHIDRA_INT(this) + 0x24) + 0xc6);
|
|
fVar51 = VStack_314.y;
|
|
EVar33 = EStack_2f4;
|
|
if (0 < GHIDRA_INT(VStack_314.y)) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_300,GHIDRA_CAST<Vector *>(VStack_2c4.y),40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0xc,uVar7);
|
|
VStack_314.y = (float)(GHIDRA_INT(VStack_314.y) + -1);
|
|
fVar51 = 0.0;
|
|
EVar33 = EStack_2f4;
|
|
} while (VStack_314.y != 0.0);
|
|
}
|
|
while( true ) {
|
|
VStack_314.y = fVar51;
|
|
EStack_2f4 = EVar33;
|
|
if (GHIDRA_INT(EVar33) < 1) break;
|
|
iVar41 = nullsub_7dd380();
|
|
if (GHIDRA_INT(EVar33) < iVar41) {
|
|
VStack_2c4.y = (float)&DAT_00000008;
|
|
}
|
|
else {
|
|
VStack_2c4.y = 4.2039e-45;
|
|
}
|
|
iVar41 = nullsub_7dd380();
|
|
EStack_2f4 = (EntityPtr)(GHIDRA_INT(EVar33) - iVar41);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_300,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)),40.0,0,
|
|
0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(VStack_2c4.y),uVar7);
|
|
fVar51 = VStack_314.y;
|
|
EVar33 = EStack_2f4;
|
|
}
|
|
VStack_2c4.y = 0.0;
|
|
iVar41 = nullsub_7dd380();
|
|
if (0 < iVar41) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_300,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)),40.0,
|
|
0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),6,uVar7);
|
|
fVar51 = (float)(GHIDRA_INT(VStack_2c4.y) + 1);
|
|
VStack_2c4.y = fVar51;
|
|
iVar41 = nullsub_7dd380();
|
|
} while (GHIDRA_INT(fVar51) < iVar41);
|
|
}
|
|
if (0 < uStack_30c) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_300,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)),40.0,
|
|
0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0xb,uVar7);
|
|
uStack_30c = uStack_30c + -1;
|
|
} while (uStack_30c != 0);
|
|
}
|
|
if (0 < uStack_2f8) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_374,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)),40.0,
|
|
0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),4,uVar7);
|
|
uStack_2f8 = uStack_2f8 + -1;
|
|
} while (uStack_2f8 != 0);
|
|
}
|
|
local_298 = GHIDRA_CAST<Room *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6));
|
|
if (0 < GHIDRA_INT(VStack_2cc.y)) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_330,GHIDRA_CAST<Vector *>(((void **)(GHIDRA_INT(this) + 0x24) + 0xc6)),40.0,
|
|
0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),7,uVar7);
|
|
VStack_2cc.y = (float)(GHIDRA_INT(VStack_2cc.y) + -1);
|
|
} while (VStack_2cc.y != 0.0);
|
|
VStack_2f0.y = (float)((void **)(GHIDRA_INT(this) + 0x24) + 0xc6);
|
|
VStack_2cc.y = 0.0;
|
|
}
|
|
VStack_2b4.y = (float)local_298;
|
|
if (0 < GHIDRA_INT(local_2a8)) {
|
|
do {
|
|
if (local_2a8 < 100) {
|
|
if (0x18 < local_2a8) {
|
|
uVar7 = 0x4a;
|
|
local_2a8 = local_2a8 - 0x19;
|
|
goto LAB_007b5662;
|
|
}
|
|
VStack_2c4.y = 2.8026e-44;
|
|
if (local_2a8 < 10) {
|
|
if (local_2a8 < 5) {
|
|
if (local_2a8 < 2) {
|
|
uVar7 = 1;
|
|
local_2a8 = local_2a8 - 1;
|
|
}
|
|
else {
|
|
uVar7 = 4;
|
|
local_2a8 = local_2a8 - 2;
|
|
}
|
|
}
|
|
else {
|
|
uVar7 = 2;
|
|
local_2a8 = local_2a8 - 5;
|
|
}
|
|
}
|
|
else {
|
|
uVar7 = 3;
|
|
local_2a8 = local_2a8 - 10;
|
|
}
|
|
local_298 = GHIDRA_CAST<Room *>((GHIDRA_CAST<RNG *>((&tmpRng)))->RNG)::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
fVar51 = 40.0;
|
|
}
|
|
else {
|
|
uVar7 = 0x12;
|
|
local_2a8 = local_2a8 - 100;
|
|
LAB_007b5662:
|
|
VStack_2c4.y = 1.4013e-43;
|
|
local_298 = GHIDRA_CAST<Room *>((GHIDRA_CAST<RNG *>((&tmpRng)))->RNG)::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
fVar51 = 10.0;
|
|
}
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_31c,GHIDRA_CAST<Vector *>(VStack_2f0.y),fVar51,0,0,0);
|
|
fVar51 = VStack_2c4.y;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(VStack_2c4.y),vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),uVar7
|
|
,GHIDRA_UINT(local_298));
|
|
VStack_2c4.y = (float)tmpEntity;
|
|
if (fVar51 == 1.4013e-43) {
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2c4.y))))->Entity::Position(&VStack_360);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
} while (0 < GHIDRA_INT(local_2a8));
|
|
local_298 = GHIDRA_CAST<Room *>(VStack_2f0.y);
|
|
}
|
|
VStack_2cc.y = VStack_2b4.y;
|
|
if (0 < GHIDRA_INT(EStack_2e4)) {
|
|
do {
|
|
if (GHIDRA_UINT(EStack_2e4) < 99) {
|
|
if (9 < GHIDRA_UINT(EStack_2e4)) {
|
|
uVar7 = 0x13;
|
|
EStack_2e4 = (EntityPtr)(GHIDRA_INT(EStack_2e4) + -10);
|
|
goto LAB_007b57d2;
|
|
}
|
|
VStack_2c4.y = 5.60519e-44;
|
|
if (GHIDRA_UINT(EStack_2e4) < 2) {
|
|
uVar7 = 1;
|
|
EStack_2e4 = (EntityPtr)(GHIDRA_INT(EStack_2e4) + -1);
|
|
}
|
|
else {
|
|
uVar7 = 2;
|
|
EStack_2e4 = (EntityPtr)(GHIDRA_INT(EStack_2e4) + -2);
|
|
}
|
|
VStack_2b4.y = (float)(GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
fVar51 = 40.0;
|
|
}
|
|
else {
|
|
uVar7 = 0xbe;
|
|
EStack_2e4 = (EntityPtr)(GHIDRA_INT(EStack_2e4) + -99);
|
|
LAB_007b57d2:
|
|
VStack_2c4.y = 1.4013e-43;
|
|
VStack_2b4.y = (float)(GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
fVar51 = 10.0;
|
|
}
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_368,GHIDRA_CAST<Vector *>(local_298),fVar51,0,0,0);
|
|
fVar51 = VStack_2c4.y;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(VStack_2c4.y),vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),uVar7
|
|
,GHIDRA_UINT(VStack_2b4.y));
|
|
VStack_2c4.y = (float)tmpEntity;
|
|
if (fVar51 == 1.4013e-43) {
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2c4.y))))->Entity::Position(&VStack_398);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
} while (0 < GHIDRA_INT(EStack_2e4));
|
|
VStack_2b4.y = (float)local_298;
|
|
}
|
|
for (; VStack_2dc.y != 0.0; VStack_2dc.y = (float)(GHIDRA_INT(VStack_2dc.y) - 1)) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_344,GHIDRA_CAST<Vector *>(VStack_2b4.y),40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x28,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),4,uVar7);
|
|
}
|
|
VStack_2dc.y = 0.0;
|
|
fVar51 = uStack_2e8;
|
|
EVar33 = (EntityPtr)VStack_2bc.y;
|
|
if (0 < GHIDRA_INT(VStack_2bc.y)) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&spawnPos,GHIDRA_CAST<Vector *>(VStack_2cc.y),40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x28,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),7,uVar7);
|
|
VStack_2bc.y = (float)(GHIDRA_INT(VStack_2bc.y) + -1);
|
|
fVar51 = uStack_2e8;
|
|
EVar33 = (EntityPtr)0x0;
|
|
} while ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0);
|
|
}
|
|
while (VStack_2bc.y = (float)EVar33, 0 < GHIDRA_INT(fVar51)) {
|
|
if (GHIDRA_UINT(fVar51) < 99) {
|
|
VStack_2c4.y = 4.2039e-44;
|
|
if (GHIDRA_UINT(fVar51) < 2) {
|
|
VStack_2dc.y = 1.4013e-45;
|
|
fVar51 = (float)(GHIDRA_INT(fVar51) - 1);
|
|
}
|
|
else {
|
|
VStack_2dc.y = 4.2039e-45;
|
|
fVar51 = (float)(GHIDRA_INT(fVar51) - 2);
|
|
}
|
|
uStack_2e8 = fVar51;
|
|
VStack_2bc.y = (float)(GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
pRVar6 = GHIDRA_CAST<Room *>(0x42200000);
|
|
}
|
|
else {
|
|
VStack_2bc.y = (float)(GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
VStack_2f0.y = 10.0;
|
|
fVar51 = (float)(GHIDRA_INT(fVar51) - 99);
|
|
VStack_2c4.y = 1.4013e-43;
|
|
VStack_2dc.y = (float)&DAT_00000011;
|
|
uStack_2e8 = fVar51;
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2f0.y);
|
|
}
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar20,&spawnPos2,GHIDRA_CAST<Vector *>(VStack_2cc.y),(float)pRVar6,0,0,0);
|
|
VStack_2bc.y = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(VStack_2c4.y),vecResult,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(VStack_2dc.y),GHIDRA_UINT(VStack_2bc.y));
|
|
EVar33 = (EntityPtr)VStack_2bc.y;
|
|
if (VStack_2c4.y == 1.4013e-43) {
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2bc.y))))->Entity::Position(&VStack_358);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
fVar51 = uStack_2e8;
|
|
EVar33 = (EntityPtr)VStack_2bc.y;
|
|
}
|
|
}
|
|
for (; VStack_2a0.y != 0.0; VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) - 1)) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_2bc,GHIDRA_CAST<Vector *>(VStack_2cc.y),40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x1e,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),2,uVar7);
|
|
}
|
|
iVar41 = 2;
|
|
VStack_2a0.y = 0.0;
|
|
do {
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::FindFreePickupSpawnPosition(pRVar6,&pickupPos,GHIDRA_CAST<Vector *>(VStack_2cc.y),0.0,0,0,0);
|
|
DropTrinket(this,&pickupPos,0);
|
|
iVar41 = iVar41 + -1;
|
|
} while (iVar41 != 0);
|
|
uVar30 = GetMaxPocketItems(this);
|
|
uVar7 = 0;
|
|
if (uVar30 != 0) {
|
|
do {
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition
|
|
(pRVar6,&VStack_300,GHIDRA_CAST<Vector *>(VStack_2cc.y),0.0,0,0,0);
|
|
DropPocketItem(this,uVar7,vecResult);
|
|
uVar7 = uVar7 + 1;
|
|
uVar30 = GetMaxPocketItems(this);
|
|
} while (uVar7 < uVar30);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
Config::GetCollectibles();
|
|
EVar33 = (EntityPtr)FUN_0042c7f0();
|
|
FUN_00424510();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x0))) = 8;
|
|
if (0 < GHIDRA_INT(EVar33)) {
|
|
joined_r0x007b5c54:
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(EVar33) + -1);
|
|
VStack_2a0.y = (float)EVar33;
|
|
if (-1 < GHIDRA_INT(EVar33)) {
|
|
Config::GetCollectibles();
|
|
iVar41 = FUN_005cbe00(EVar33);
|
|
if (*GHIDRA_CAST<char *>((iVar41 + 4)) == '\0') {
|
|
Config::GetCollectibles();
|
|
iVar41 = FUN_005cbe00(EVar33);
|
|
VStack_2b4.y = *GHIDRA_CAST<float *>((iVar41 + 8));
|
|
bVar4 = CanRerollCollectible(this,GHIDRA_INT(VStack_2b4.y),0);
|
|
if (bVar4 != 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(VStack_2b4.y));
|
|
if (configItem->type != 3) {
|
|
VStack_2bc.y = (float)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(((GHIDRA_CAST<Room *>(this))->_fxLayers))) + 0xb0)));
|
|
iVar41 = 0;
|
|
piVar37 = GHIDRA_CAST<int *>(FUN_0042c810(VStack_2b4.y));
|
|
EVar33 = (EntityPtr)VStack_2a0.y;
|
|
if (0 < *piVar37) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
EVar33 = (EntityPtr)VStack_2a0.y;
|
|
if (2 < uVar7) break;
|
|
std::vector<unsigned_int>::push_back(&VStack_2b4.y);
|
|
iVar41 = iVar41 + 1;
|
|
piVar37 = GHIDRA_CAST<int *>(FUN_0042c810(VStack_2b4.y));
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
EVar33 = (EntityPtr)VStack_2a0.y;
|
|
} while (iVar41 < *piVar37);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
goto joined_r0x007b5c54;
|
|
}
|
|
uVar7 = 0;
|
|
iVar41 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
piVar37 = GHIDRA_CAST<int *>(FUN_0042c810(uVar7));
|
|
DropCollectible(this,*piVar37,GHIDRA_CAST<Entity_Pickup *>(0x0),1);
|
|
uVar7 = uVar7 + 1;
|
|
uVar30 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
} while (uVar7 < uVar30);
|
|
}
|
|
}
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),7);
|
|
FID_conflict__Tidy(auStack_328);
|
|
}
|
|
FUN_005b19d0();
|
|
ConsumableCountChanged(this,-1);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetHUD();
|
|
FUN_009a6110(1);
|
|
uStack_8 = 0xffffffff;
|
|
guard_check_icall();
|
|
break;
|
|
case 0x39:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x3c,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x3c,(byte)local_2a8,1);
|
|
break;
|
|
case 0x3a:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x3d,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x3d,(byte)local_2a8,1);
|
|
break;
|
|
case 0x3b:
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x3e);
|
|
if (bVar4 == 0) {
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x2a,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
iVar41 = this->_reverseEmpressMaxHearts;
|
|
this->_reverseEmpressMaxHearts = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x3e,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x3e,(byte)local_2a8,1);
|
|
this->_reverseEmpressMaxHearts = iVar41;
|
|
VStack_2a0.y = (float)(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_2a2))) + 0x1))) - iVar41) + 2);
|
|
if (0 < GHIDRA_INT(VStack_2a0.y)) {
|
|
do {
|
|
iVar41 = GetHeartLimit(this,0);
|
|
iVar17 = GetEffectiveMaxHearts(this);
|
|
if (iVar17 < iVar41) {
|
|
this->_reverseEmpressMaxHearts = this->_reverseEmpressMaxHearts + 1;
|
|
AddMaxHearts(this,2,0);
|
|
}
|
|
AddHearts(this,2,0,0);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
} while ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0);
|
|
VStack_2a0.y = 0.0;
|
|
}
|
|
break;
|
|
case 0x3c:
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
rngSource = GHIDRA_CAST<RNG *>(FUN_005cbd00(0x3c));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((rngSource)))->RNG::Next();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::TryInitializeExtraBossRoom(uVar7);
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
roomDesc = (GHIDRA_CAST<Level *>((pLVar22)))->Level::GetRoomByIdx(-0x11,-1);
|
|
if (roomDesc->Data == (void *)0x0) {
|
|
rngSource = GHIDRA_CAST<RNG *>(FUN_005cbd00(0x3c));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((rngSource)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::MoveToRandomRoom(0,uVar7,this);
|
|
}
|
|
else {
|
|
Config::GetCollectibles();
|
|
FUN_00428ae0(0xffffffff);
|
|
Game::StartRoomTransition(g_game,-0x11,-1,3,this,0);
|
|
}
|
|
goto LAB_007b8998;
|
|
case 0x3d:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
VStack_2a0.y = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) + 2);
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0xb,uVar7);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
pRVar6 = local_298;
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
break;
|
|
case 0x3e:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
VStack_2a0.y = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) + 1);
|
|
VStack_2dc.y = (float)&this->_pos;
|
|
do {
|
|
EVar33 = (EntityPtr)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
VStack_2bc.y = (float)EVar33;
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar7 = (GHIDRA_CAST<Room *>((pRVar20)))->Room::GetSeededCollectible(GHIDRA_UINT(EVar33),0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
fVar51 = VStack_2bc.y;
|
|
if (cVar5 != '\0') {
|
|
do {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
piVar37 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
cVar5 = (**(code **)(*piVar37 + 0x30))(uVar7);
|
|
if (cVar5 == '\0') break;
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar7 = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetSeededCollectible(GHIDRA_UINT(fVar51),0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
} while (cVar5 != '\0');
|
|
pRVar6 = local_298;
|
|
}
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::FindFreePickupSpawnPosition(pRVar20,&VStack_2cc,GHIDRA_CAST<Vector *>(VStack_2dc.y),40.0,0,0,0);
|
|
uVar30 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&VStack_2cc,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar30);
|
|
uVar7 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&VStack_2cc,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x3c);
|
|
uVar36 = (GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x40000000,0x3ecccccd,0x3ecccccd,0x3f800000,0,0,0);
|
|
(*pcVar1)(uVar36,0xffffffff,0xff,0,1);
|
|
SoundEffects::PlayWithFartOverride(0x13c,2,0,0x3f800000);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1340)) < 1) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(VStack_2d4.y) + 0x1d88)) < 1) {
|
|
AddSoulHearts(GHIDRA_CAST<Entity_Player *>(VStack_2d4.y),-4,0);
|
|
}
|
|
else {
|
|
AddBoneHearts(GHIDRA_CAST<Entity_Player *>(VStack_2d4.y),-1);
|
|
}
|
|
}
|
|
else {
|
|
AddMaxHearts(GHIDRA_CAST<Entity_Player *>(VStack_2d4.y),-2,0);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 10) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x1f)) {
|
|
AddBrokenHearts(this,1);
|
|
}
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<FXLayers *>((GHIDRA_INT(this) + 0x1618))))) + 0x90)))) = 0x400;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<FXLayers *>((GHIDRA_INT(this) + 0x1618))))) + 0x94)))) = 0;
|
|
pRVar6 = local_298;
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
break;
|
|
case 0x3f:
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x3f);
|
|
if (bVar4 == 0) {
|
|
play_sound_with_fart_seed(0x1e7,2,0,0x3f800000);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(4);
|
|
VStack_2f0.y = (float)&this->_pos;
|
|
VStack_2bc.y = 4.2039e-45;
|
|
do {
|
|
vecResult = MusicManager::RandomVector(&VStack_308);
|
|
random_float();
|
|
pLVar22 = GHIDRA_CAST<Level *>((in_XMM0_Da * 5.0));
|
|
VStack_2dc.y = (float)pLVar22;
|
|
(GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&VStack_2cc,&VStack_2dc.y);
|
|
uVar7 = Random();
|
|
vecResult = MusicManager::RandomVector(&VStack_300);
|
|
random_float();
|
|
VStack_2c4.y = (float)pLVar22 * 20.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&VStack_374,&VStack_2c4.y);
|
|
fVar51 = VStack_2f0.y;
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(VStack_2f0.y))))->Vector::__add(&VStack_330,vecResult);
|
|
uVar52 = 0;
|
|
pTVar49 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar48 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar36 = 0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,vecResult,&VStack_2cc,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
effect = GHIDRA_CAST<Entity_Effect *>(__RTDynamicCast(tmpEntity,uVar36,pTVar48,pTVar49,uVar52));
|
|
VStack_2a0.y = 1.0;
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::Position(&VStack_31c);
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__sub(&VStack_360,GHIDRA_CAST<Vector *>(fVar51));
|
|
vecResult2 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
VStack_2b4.y = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::Dot(vecResult2);
|
|
puVar28 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
if (VStack_2b4.y < 0.0) {
|
|
puVar28 = &DAT_bf800000;
|
|
VStack_2a0.y = (float)&DAT_bf800000;
|
|
}
|
|
random_float();
|
|
fVar51 = ((float)puVar28 * 10.0 + 2.0) * VStack_2a0.y;
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_rotation(fVar51);
|
|
iVar41 = Isaac::Random(0xf);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(iVar41 + 0xf);
|
|
uVar50 = 0;
|
|
uVar52 = 0;
|
|
uVar36 = 0;
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(effect) + 0x3c);
|
|
random_float(0,0,0);
|
|
in_XMM0_Da = 1.0;
|
|
uVar36 = (GHIDRA_CAST<Color *>((fVar51 * 0.5 + 0.2)))->Color::Color(uVar36,uVar52,uVar50);
|
|
(*pcVar1)(uVar36,0xffffffff,0xff,0,1);
|
|
effect->Update();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
VStack_2bc.y = (float)(GHIDRA_INT(VStack_2bc.y) + -1);
|
|
} while ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(VStack_2d4.y) + 0x3c);
|
|
uVar36 = (GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0,0,0,0,0x3f4ccccd,0x3f4ccccd,0x3f4ccccd);
|
|
(*pcVar1)(uVar36,2,0xff,1,1);
|
|
pRVar6 = local_298;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1508)))))))->TemporaryEffects::RemoveNullEffect(0x3f,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1508)))))))->TemporaryEffects::AddNullEffect(0x3f,1,1);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(10);
|
|
if (uVar7 == 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar4 = 0;
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x44);
|
|
AddCostume(this,configItem,bVar4);
|
|
}
|
|
goto LAB_007b8998;
|
|
case 0x40:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) + 1) * 3);
|
|
EVar33 = (EntityPtr)(uVar7 + 2);
|
|
VStack_2a0.y = (float)EVar33;
|
|
if (EVar33 != (EntityPtr)0x0) {
|
|
VStack_2bc.y = (float)&this->_pos;
|
|
do {
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::FindFreePickupSpawnPosition(pRVar20,&VStack_358,GHIDRA_CAST<Vector *>(VStack_2bc.y),40.0,0,0,0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x3c,&VStack_358,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(EVar33) + -1);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
} while (EVar33 != (EntityPtr)0x0);
|
|
}
|
|
break;
|
|
case 0x41:
|
|
local_2ac = 0;
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,&hermitPickups,5,-1,-1,0,0);
|
|
uStack_8 = 9;
|
|
EVar33 = (EntityPtr)0x0;
|
|
VStack_2bc.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 == 0) {
|
|
LAB_007b6afb:
|
|
uVar30 = 0x21;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
(GHIDRA_CAST<RNG *>((&RStack_22c)))->RNG::game_constructor(uVar7,uVar30);
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),0xb);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&RStack_22c)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
vecResult = Room::GetCenterPos(&VStack_308);
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_300,vecResult,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
|
guard_check_icall();
|
|
}
|
|
else {
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(EVar33);
|
|
pRVar6 = GHIDRA_CAST<Room *>(*puVar27);
|
|
VStack_2b4.y = (float)pRVar6;
|
|
cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::Exists();
|
|
if (((((cVar5 == '\0') || (cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::IsDead(), cVar5 != '\0')) ||
|
|
(cVar5 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pRVar6))))->Entity_Pickup::IsShopItem(), cVar5 != '\0')) ||
|
|
((cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::Visible(), cVar5 == '\0' ||
|
|
(iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pRVar6))))->Entity_Pickup::Timeout(), 0 < iVar41)))) ||
|
|
(bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pRVar6))))->Entity_Pickup::CanReroll(), bVar4 == 0))
|
|
goto switchD_007b66d7_caseD_b;
|
|
uVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::Variant();
|
|
if (uVar7 < 0x47) {
|
|
if (uVar7 == 0x46) {
|
|
LAB_007b6844:
|
|
local_2a8 = 5;
|
|
}
|
|
else {
|
|
switch(uVar7) {
|
|
case 10:
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if ((iVar41 == 4) || (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 7)) {
|
|
LAB_007b6706:
|
|
local_2a8 = 10;
|
|
}
|
|
else {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if (((iVar41 == 6) || (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 0xb))
|
|
|| (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 5)) {
|
|
local_2a8 = 6;
|
|
}
|
|
else {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if (iVar41 == 3) goto LAB_007b6844;
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if ((iVar41 == 8) || (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 0xc))
|
|
{
|
|
local_2a8 = 2;
|
|
}
|
|
else {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
local_2a8 = GHIDRA_UINT((iVar41 != 2)) * 2 + 1;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
goto switchD_007b66d7_caseD_b;
|
|
case 0x1e:
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if (((iVar41 == 3) || (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 2)) ||
|
|
(iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 4)) goto LAB_007b6706;
|
|
goto LAB_007b6844;
|
|
case 0x28:
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if ((iVar41 == 2) || (iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType(), iVar41 == 4))
|
|
goto LAB_007b6706;
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
if (iVar41 != 7) goto LAB_007b6844;
|
|
local_2a8 = 10;
|
|
break;
|
|
case 0x45:
|
|
local_2a8 = 7;
|
|
}
|
|
}
|
|
LAB_007b684f:
|
|
uVar30 = 0x10;
|
|
uVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::InitSeed();
|
|
(GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::game_constructor(uVar7,uVar30);
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),10);
|
|
if (9 < local_2a8) {
|
|
VStack_2a0.y = (float)((local_2a8 - 5) / 5);
|
|
local_2a8 = local_2a8 + GHIDRA_INT(VStack_2a0.y) * -5;
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
uVar30 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
vecResult = RandomVector(&VStack_308,uVar30);
|
|
VStack_2dc.y = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
vecResult = GHIDRA_CAST<Vector *>(Vector)::operator_mul(vecResult);
|
|
VStack_2c4.y = 5.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&VStack_374,&VStack_2c4.y);
|
|
vecResult2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2b4.y))))->Entity::Position(&VStack_330);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,vecResult2,vecResult,GHIDRA_CAST<Entity *>(0x0),2,uVar7);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) - 1);
|
|
} while (VStack_2a0.y != 0.0);
|
|
VStack_2a0.y = 0.0;
|
|
}
|
|
if (0 < GHIDRA_INT(local_2a8)) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
uVar30 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
vecResult = RandomVector(&VStack_31c,uVar30);
|
|
VStack_2f0.y = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
vecResult = GHIDRA_CAST<Vector *>(Vector)::operator_mul(vecResult);
|
|
VStack_2cc.y = 5.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&VStack_368,&VStack_2cc.y);
|
|
vecResult2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2b4.y))))->Entity::Position(&VStack_398);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,vecResult2,vecResult,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
|
local_2a8 = local_2a8 - 1;
|
|
} while (local_2a8 != 0);
|
|
}
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2b4.y))))->Entity::Position(&VStack_344);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x3c);
|
|
uVar36 = (GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x40400000,0x4019999a,0x3f800000,0x3f800000,0,0,0);
|
|
(*pcVar1)(uVar36,0xffffffff,0xff,0,1);
|
|
fVar51 = VStack_2b4.y;
|
|
cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2b4.y))))->Entity::IsType(5,100,0xffffffff);
|
|
if (cVar5 == '\0') {
|
|
(**(code **)(*GHIDRA_CAST<int *>(fVar51) + 0x28))();
|
|
}
|
|
else {
|
|
FUN_0060d1f0(4);
|
|
}
|
|
Entity_Pickup::RemoveOtherOptions();
|
|
uVar7 = local_2ac + 1;
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),9);
|
|
local_2ac = uVar7;
|
|
guard_check_icall();
|
|
}
|
|
else {
|
|
if (uVar7 < 0x12d) {
|
|
if ((uVar7 == 300) || (uVar7 == 0x5a)) goto LAB_007b6844;
|
|
if (uVar7 == 100) {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pRVar6))))->Entity::SubType();
|
|
local_2a8 = -GHIDRA_UINT((iVar41 != 0)) & 0xf;
|
|
if (local_2a8 != 0) goto LAB_007b684f;
|
|
}
|
|
}
|
|
else if (uVar7 == 0x15e) goto LAB_007b6844;
|
|
switchD_007b66d7_caseD_b:
|
|
uVar7 = local_2ac;
|
|
VStack_2bc.y = (float)EVar33;
|
|
}
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(VStack_2bc.y) + 1);
|
|
VStack_2bc.y = (float)EVar33;
|
|
EVar21 = (EntityPtr)(GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
} while (GHIDRA_UINT(EVar33) < GHIDRA_UINT(EVar21));
|
|
if (uVar7 == 0) {
|
|
pRVar6 = local_298;
|
|
goto LAB_007b6afb;
|
|
}
|
|
(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_298))))->RNG::Next();
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&hermitPickups)))->EntityList_Query::~EntityList_Query();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
break;
|
|
case 0x42:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Darken(0x3f800000,0x3c);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0x32);
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(6);
|
|
VStack_2bc.y = (float)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
fVar51 = VStack_2a0.y;
|
|
if ((EntityPtr)VStack_2a0.y == (EntityPtr)0x0) {
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_2e8) + 2)),0x11c,0x11,-1,0);
|
|
}
|
|
else {
|
|
if (((((EntityPtr)VStack_2a0.y == (EntityPtr)0x1) ||
|
|
((EntityPtr)VStack_2a0.y == (EntityPtr)0x5)) ||
|
|
((EntityPtr)VStack_2a0.y == (EntityPtr)0x2)) &&
|
|
((UseActiveItem(this,GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(EStack_2e4)) + 0x2)))),0xa6,1,-1,0),
|
|
(EntityPtr)fVar51 == (EntityPtr)0x2 || ((EntityPtr)fVar51 == (EntityPtr)0x5)))) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::RerollLevelPickups(VStack_2bc.y);
|
|
}
|
|
if (((EntityPtr)fVar51 == (EntityPtr)0x3) || ((EntityPtr)fVar51 == (EntityPtr)0x5)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::RerollLevelCollectibles();
|
|
UseActiveItem(this,GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(EStack_2f4)) + 0x2)))),0x69,1,-1,0);
|
|
}
|
|
if ((EntityPtr)fVar51 == (EntityPtr)0x4) {
|
|
seeds = GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetSeeds();
|
|
Config::GetCollectibles();
|
|
uVar36 = _get_index_plus_one_if_kind_4_5();
|
|
(GHIDRA_CAST<Seeds *>((seeds)))->Seeds::ForgetStageSeed(uVar36);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::StartStageTransition(1,0,0);
|
|
}
|
|
else if ((EntityPtr)fVar51 == (EntityPtr)0x5) {
|
|
uVar7 = 0;
|
|
iVar41 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar7);
|
|
iVar41 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2a0.y))))->Entity::Variant();
|
|
if (iVar41 == 0) {
|
|
UseActiveItem(GHIDRA_CAST<Entity_Player *>(VStack_2a0.y),GHIDRA_CAST<short *>((GHIDRA_INT(&VStack_314.y) + 2)),0x11c,
|
|
0x11,-1,0);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
uVar30 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
} while (uVar7 < uVar30);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0x43:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddNullEffect(0x40,1,1);
|
|
break;
|
|
case 0x44:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x41,1,1);
|
|
break;
|
|
case 0x45:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_2ac) + 2)),0x221,3,-1,0);
|
|
break;
|
|
case 0x46:
|
|
if ((char)local_2ac != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar41 = 5;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_2a2)) + 0x1))) != 0) {
|
|
iVar41 = 10;
|
|
}
|
|
do {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x45,1,1);
|
|
iVar41 = iVar41 + -1;
|
|
} while (iVar41 != 0);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
goto LAB_007b8998;
|
|
case 0x47:
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x43);
|
|
if (bVar4 == 0) {
|
|
play_sound_with_fart_seed(0x10a,2,0,0x3f800000);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(10,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x43,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x43,1,1);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_2a8) + 2)),0x21,3,-1,0);
|
|
break;
|
|
case 0x48:
|
|
uVar30 = 0x2d;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
(GHIDRA_CAST<RNG *>((&towerRng)))->RNG::game_constructor(uVar7,uVar30);
|
|
uStack_8 = 0xc;
|
|
memset(gridMarks,0,0x1c0);
|
|
local_298 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar7 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
local_2a8 = uVar7;
|
|
local_2ac = (GHIDRA_CAST<Room *>((local_298)))->Room::GetGridHeight();
|
|
VStack_2cc.y = (float)(local_2ac * uVar7);
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,&towerEffects,1000,0xa1,-1,0,0);
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),0xd);
|
|
if (0 < GHIDRA_INT(VStack_2cc.y)) {
|
|
uVar7 = 0;
|
|
pRVar6 = local_298;
|
|
do {
|
|
fVar51 = 0.0;
|
|
vecResult = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridPosition(&VStack_308,uVar7);
|
|
bVar4 = (GHIDRA_CAST<Room *>((pRVar6)))->Room::IsPositionInRoom(vecResult,fVar51);
|
|
if (bVar4 != 0) {
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridEntity(uVar7);
|
|
uVar30 = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridCollision(uVar7);
|
|
if (uVar30 == 0) {
|
|
if ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) {
|
|
(GHIDRA_CAST<GridEntity *>(()))->GridEntity::GetType();
|
|
cVar5 = is_grid_type_floor_special();
|
|
if (cVar5 != '\0') goto LAB_007b6f0b;
|
|
}
|
|
VStack_2b4.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(VStack_2b4.y);
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar27))))->Entity::Position(&VStack_300);
|
|
uVar30 = (GHIDRA_CAST<Room *>((local_298)))->Room::GetGridIndex(vecResult);
|
|
if (uVar30 == uVar7) {
|
|
pRVar6 = local_298;
|
|
goto LAB_007b6f0b;
|
|
}
|
|
VStack_2b4.y = (float)(GHIDRA_INT(VStack_2b4.y) + 1);
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
} while (GHIDRA_UINT(VStack_2b4.y) < pRVar6);
|
|
pRVar6 = local_298;
|
|
}
|
|
gridMarks[uVar7] = '\x05';
|
|
}
|
|
}
|
|
LAB_007b6f0b:
|
|
uVar7 = uVar7 + 1;
|
|
} while (GHIDRA_INT(uVar7) < GHIDRA_INT(VStack_2cc.y));
|
|
uVar7 = local_2a8;
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
EStack_2f4 = (EntityPtr)(uVar7 - 1);
|
|
VStack_2a0.y = 1.4013e-45;
|
|
if (1 < GHIDRA_INT(EStack_2f4)) {
|
|
iVar41 = uVar7 - 1;
|
|
VStack_2c4.y = (float)(local_2ac - 1);
|
|
do {
|
|
if (1 < GHIDRA_INT((local_2ac - 1))) {
|
|
markAbove = gridMarks + GHIDRA_INT(VStack_2a0.y);
|
|
markBelow = gridMarks + GHIDRA_INT((GHIDRA_INT(VStack_2a0.y) + uVar7 * 2));
|
|
VStack_2dc.y = (float)(-1 - uVar7);
|
|
markCell = markAbove + uVar7;
|
|
VStack_2bc.y = (float)(1 - uVar7);
|
|
iVar41 = local_2ac - 2;
|
|
do {
|
|
if ((((*markCell != '\0') && (uVar7 = local_2a8, markBelow[GHIDRA_INT(VStack_2bc.y)] != '\0')) &&
|
|
(markBelow[GHIDRA_INT(((GHIDRA_CAST<Level *>(VStack_2dc.y))->_roomList + -1)) + 0xa4] != '\0')) &&
|
|
((*markBelow != '\0' && (*markAbove != '\0')))) {
|
|
*markCell = '2';
|
|
}
|
|
markBelow = markBelow + uVar7;
|
|
markAbove = markAbove + uVar7;
|
|
markCell = markCell + uVar7;
|
|
iVar41 = iVar41 + -1;
|
|
} while (iVar41 != 0);
|
|
iVar41 = uVar7 - 1;
|
|
}
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
} while (GHIDRA_INT(VStack_2a0.y) < iVar41);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
VStack_2b4.y = 0.0;
|
|
do {
|
|
FUN_00424510();
|
|
fVar51 = VStack_2cc.y;
|
|
iVar41 = 0;
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),0xe);
|
|
isAnyMarked = false;
|
|
if (GHIDRA_INT(VStack_2cc.y) < 1) {
|
|
LAB_007b73c1:
|
|
std::vector<Vector>::_Tidy();
|
|
break;
|
|
}
|
|
do {
|
|
if (gridMarks[iVar41] != '\0') {
|
|
WeightedOutcomePicker::AddOutcomeWeight(outcomePicker,iVar41,GHIDRA_INT(gridMarks[iVar41]),0);
|
|
isAnyMarked = true;
|
|
}
|
|
iVar41 = iVar41 + 1;
|
|
} while (iVar41 < GHIDRA_INT(fVar51));
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
if (!isAnyMarked) goto LAB_007b73c1;
|
|
rng._shift1 = towerRng._shift1;
|
|
rng._seed = towerRng._seed;
|
|
rng._shift2 = towerRng._shift2;
|
|
rng._shift3 = towerRng._shift3;
|
|
uVar7 = (GHIDRA_CAST<WeightedOutcomePicker *>((outcomePicker)))->WeightedOutcomePicker::PickOutcome(rng);
|
|
vecResult = (GHIDRA_CAST<Room *>((local_298)))->Room::GetGridPosition(&VStack_308,uVar7);
|
|
fVar51 = (GHIDRA_CAST<RNG *>((&towerRng)))->RNG::RandomFloat();
|
|
VStack_2a0.y = fVar51 * 36.0 - 18.0;
|
|
fVar51 = (GHIDRA_CAST<RNG *>((&towerRng)))->RNG::RandomFloat();
|
|
VStack_2bc.y = fVar51 * 36.0 - 18.0;
|
|
vecResult2 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
(GHIDRA_CAST<Vector *>((vecResult)))->Vector::__add(&VStack_314,vecResult2);
|
|
VStack_2bc.y = 0.0;
|
|
iVar41 = GHIDRA_INT(uVar7) % GHIDRA_INT(local_2a8);
|
|
VStack_2c4.y = (float)(GHIDRA_INT(uVar7) / GHIDRA_INT(local_2a8));
|
|
VStack_2a0.y = (float)(iVar41 + -2);
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::max<int>();
|
|
pLVar22 = GHIDRA_CAST<Level *>(*puVar27);
|
|
EStack_2e4 = (EntityPtr)(iVar41 + 2);
|
|
VStack_2bc.y = (float)EStack_2f4;
|
|
VStack_2dc.y = (float)pLVar22;
|
|
VStack_2a0.y = (float)EStack_2e4;
|
|
piVar37 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
if (GHIDRA_INT(pLVar22) <= *piVar37) {
|
|
uStack_2e8 = (float)(GHIDRA_INT(VStack_2c4.y) - 2);
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_INT(VStack_2c4.y) + 2));
|
|
VStack_2f0.y = (float)pRVar6;
|
|
do {
|
|
VStack_2bc.y = 0.0;
|
|
VStack_2a0.y = uStack_2e8;
|
|
pfVar16 = GHIDRA_CAST<float *>(std)::max<int>();
|
|
fVar51 = *pfVar16;
|
|
VStack_2bc.y = (float)(local_2ac - 1);
|
|
VStack_2c4.y = fVar51;
|
|
VStack_2a0.y = (float)pRVar6;
|
|
piVar37 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
if (GHIDRA_INT(fVar51) <= *piVar37) {
|
|
uVar7 = GHIDRA_INT((GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(VStack_2dc.y) + 0x14)))->_doors) +
|
|
GHIDRA_INT(fVar51) * local_2a8 + -0x30;
|
|
do {
|
|
if (gridMarks[uVar7] != '\0') {
|
|
(GHIDRA_CAST<Room *>((local_298)))->Room::GetGridPosition(&VStack_358,uVar7);
|
|
VStack_2a0.y = (GHIDRA_CAST<Vector *>((&VStack_358)))->Vector::DistanceSquared(&VStack_314);
|
|
if (5625.0 < VStack_2a0.y) {
|
|
gridMarks[uVar7] = '\x01';
|
|
}
|
|
else {
|
|
if (0x1bf < uVar7) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_00aef86f();
|
|
}
|
|
gridMarks[uVar7] = '\0';
|
|
uVar30 = (GHIDRA_CAST<RNG *>((&towerRng)))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridPosition(&VStack_374,uVar7);
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xb1,vecResult,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(VStack_2d4.y),1,uVar30);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(GHIDRA_INT(VStack_2b4.y));
|
|
effect->Update();
|
|
fVar51 = VStack_2c4.y;
|
|
}
|
|
}
|
|
uVar7 = uVar7 + local_2a8;
|
|
VStack_2a0.y = VStack_2f0.y;
|
|
fVar51 = (float)(GHIDRA_INT(fVar51) + 1);
|
|
VStack_2bc.y = (float)(local_2ac - 1);
|
|
VStack_2c4.y = fVar51;
|
|
piVar37 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
} while (GHIDRA_INT(fVar51) <= *piVar37);
|
|
pRVar6 = GHIDRA_CAST<Room *>(VStack_2f0.y);
|
|
}
|
|
VStack_2a0.y = (float)EStack_2e4;
|
|
pLVar22 = GHIDRA_CAST<Level *>((GHIDRA_INT(GHIDRA_CAST<int *>(VStack_2dc.y)) + 1));
|
|
VStack_2bc.y = (float)EStack_2f4;
|
|
VStack_2dc.y = (float)pLVar22;
|
|
piVar37 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
} while (GHIDRA_INT(pLVar22) <= *piVar37);
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&towerRng)))->RNG::Next();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xb1,&VStack_314,&g_vectorZero,GHIDRA_CAST<Entity *>(VStack_2d4.y),0,
|
|
uVar7);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(GHIDRA_INT(VStack_2b4.y));
|
|
effect->Update();
|
|
std::vector<Vector>::_Tidy();
|
|
VStack_2b4.y = (float)(GHIDRA_INT((GHIDRA_INT(VStack_2b4.y) + 4)) + 1);
|
|
} while (GHIDRA_INT(VStack_2b4.y) < 0x23);
|
|
(GHIDRA_CAST<EntityList_Query *>((&towerEffects)))->EntityList_Query::~EntityList_Query();
|
|
uStack_8 = 0xffffffff;
|
|
guard_check_icall();
|
|
break;
|
|
case 0x49:
|
|
Config::GetCollectibles();
|
|
VStack_2bc.y = (float)FUN_0042c7f0();
|
|
if (0 < GHIDRA_INT(VStack_2bc.y)) {
|
|
iVar41 = 0;
|
|
do {
|
|
Config::GetCollectibles();
|
|
piVar37 = GHIDRA_CAST<int *>(FUN_005cbe00(iVar41));
|
|
if (((char)piVar37[1] == '\0') && (0 < *piVar37)) {
|
|
Config::GetCollectibles();
|
|
iVar17 = FUN_005cbe00(iVar41);
|
|
VStack_2a0.y = *GHIDRA_CAST<float *>((iVar17 + 8));
|
|
bVar4 = CanRerollCollectible(this,GHIDRA_INT(VStack_2a0.y),0);
|
|
if (bVar4 != 0) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(VStack_2a0.y));
|
|
if ((configItem->type != 3) && (piVar37 = GHIDRA_CAST<int *>(FUN_0042c810(VStack_2a0.y)), 0 < *piVar37))
|
|
{
|
|
RemoveCollectibleByHistoryIndex(this,iVar41,1);
|
|
AnimateCollectible(this,GHIDRA_INT(VStack_2a0.y),GHIDRA_CAST<byte *>("Pickup"),
|
|
GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x46,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x46,1,1);
|
|
goto LAB_007b8998;
|
|
}
|
|
}
|
|
}
|
|
iVar41 = iVar41 + 1;
|
|
} while (iVar41 < GHIDRA_INT(VStack_2bc.y));
|
|
}
|
|
break;
|
|
case 0x4a:
|
|
Config::GetCollectibles();
|
|
uVar52 = 1;
|
|
uVar36 = 0x1d;
|
|
LAB_007b34ad:
|
|
iVar41 = (GHIDRA_CAST<Level *>((uVar36)))->Level::QueryRoomTypeIndex(0,pRVar6,uVar52);
|
|
if (-1 < iVar41) {
|
|
Config::GetCollectibles();
|
|
FUN_00428ae0(0xffffffff);
|
|
Game::StartRoomTransition(g_game,iVar41,-1,3,this,-1);
|
|
goto LAB_007b8998;
|
|
}
|
|
break;
|
|
case 0x4b:
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x42);
|
|
if (bVar4 == 0) {
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(0x2b,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x42,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x42,1,1);
|
|
if ((0 < this->_maxHearts) && (iVar41 = GetHealthType(this), iVar41 == 0)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
if (cVar5 == '\0') {
|
|
iVar41 = this->_maxHearts;
|
|
this->_maxHearts = 0;
|
|
iVar41 = iVar41 / 2;
|
|
this->_boneHearts = this->_boneHearts + iVar41;
|
|
this->_boneHeartsMask =
|
|
this->_boneHeartsMask << ((byte)iVar41 & 0x1f) | (1 << ((byte)iVar41 & 0x1f)) - 1U;
|
|
UpdateHeartDependentEffects(this);
|
|
this->_reverseSunBoneHearts = iVar41;
|
|
break;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
if (cVar5 != '\0') {
|
|
this->_boneHearts = this->_boneHearts + this->_redHearts;
|
|
this->_maxHearts = 0;
|
|
this->_redHearts = 0;
|
|
}
|
|
break;
|
|
case 0x4c:
|
|
play_sound_with_fart_seed(0x109,2,0,0x3f800000);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0);
|
|
pRVar6 = GHIDRA_CAST<Room *>(0xa);
|
|
LAB_007b31f0:
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(6,GHIDRA_UINT(pRVar6),vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::AddEntityFlags(4);
|
|
break;
|
|
case 0x4d:
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>(()))->Level)::GetCurrentRoom();
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridIndex(&this->_pos);
|
|
if (-1 < GHIDRA_INT(VStack_2a0.y)) {
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar7 = Random();
|
|
(GHIDRA_CAST<Room *>((pRVar6)))->Room::SpawnGridEntity(GHIDRA_INT(VStack_2a0.y),0x12,0,uVar7,0);
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<Room *>((pRVar6)))->Room::GetGridEntity(GHIDRA_UINT(VStack_2a0.y));
|
|
if ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) {
|
|
iVar41 = (GHIDRA_CAST<GridEntity *>(()))->GridEntity::GetType();
|
|
if (iVar41 == 0x12) {
|
|
iVar41 = (GHIDRA_CAST<GridEntity *>(()))->GridEntity::GetVariant();
|
|
if (iVar41 == 0) {
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
(GHIDRA_CAST<Level *>((pLVar22)))->Level::SetStateFlag(0xd,1);
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(VStack_2a0.y))))->GridEntity::Position(&VStack_308);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
tmpEntity->Update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0x4e:
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_298) + 2)),0x244,1,-1,0);
|
|
break;
|
|
case 0x4f:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(0x14);
|
|
VStack_2bc.y = (float)(uVar7 + 1);
|
|
VStack_2a0.y = 0.0;
|
|
if ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,uVar7);
|
|
FUN_005b19f0(VStack_2a0.y);
|
|
tmpEntity->Update();
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
pRVar6 = local_298;
|
|
} while (GHIDRA_UINT(VStack_2a0.y) < GHIDRA_UINT(VStack_2bc.y));
|
|
}
|
|
break;
|
|
case 0x50:
|
|
if (-1 < (char)(byte)useFlag) {
|
|
bVar4 = this->_wildCardItemType;
|
|
if (bVar4 == 1) {
|
|
UseCard(this,this->_wildCardItem,0x180);
|
|
}
|
|
else if (bVar4 == 0) {
|
|
UsePill(this->_wildCardItem,this->_wildCardVarData,0x180);
|
|
if (this->_cacheFlags != 0) {
|
|
InvalidateCoPlayerItems(this);
|
|
EvaluateItems();
|
|
}
|
|
}
|
|
else if (bVar4 == 2) {
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_298) + 2)),this->_wildCardItem,0x484,-1,
|
|
this->_wildCardVarData);
|
|
TriggerBookOfVirtues(this->_wildCardItem,0);
|
|
goto LAB_007b8998;
|
|
}
|
|
}
|
|
break;
|
|
case 0x51:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(&RStack_20c),5,100,-1,0,0);
|
|
uStack_8 = 0xf;
|
|
EVar33 = (EntityPtr)0x0;
|
|
VStack_2a0.y = 0.0;
|
|
iVar41 = (GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
pRVar6 = local_298;
|
|
if (iVar41 != 0) {
|
|
do {
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index(EVar33);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(*puVar27);
|
|
cVar5 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::IsDead();
|
|
if (cVar5 == '\0') {
|
|
iVar41 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SubType();
|
|
if (iVar41 != 0) {
|
|
EVar33 = (EntityPtr)FUN_00435e30();
|
|
VStack_2bc.y = (float)EVar33;
|
|
if (((EVar33 != (EntityPtr)0x0) &&
|
|
((iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(EVar33))))->Entity_Pickup::OptionsPickupIndex(), iVar41 == 0
|
|
|| (iVar41 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(EVar33))))->Entity_Pickup::Timeout(), iVar41 < 0)))) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(EVar33))))->Entity_Pickup::CanReroll(), bVar4 != 0)) {
|
|
pRVar20 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
iVar41 = (GHIDRA_CAST<Room *>((pRVar20)))->Room::GetSeededCollectible(uVar7,0);
|
|
FUN_006daca0(iVar41);
|
|
uVar7 = Random();
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2bc.y))))->Entity::Position(&VStack_308);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
tmpEntity->Update();
|
|
}
|
|
}
|
|
}
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
EVar21 = (EntityPtr)(GHIDRA_CAST<EntityList *>(()))->EntityList::Size();
|
|
EVar33 = (EntityPtr)VStack_2a0.y;
|
|
} while (GHIDRA_UINT(VStack_2a0.y) < GHIDRA_UINT(EVar21));
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&RStack_20c)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case 0x52:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x72,1,1);
|
|
break;
|
|
case 0x53:
|
|
SoundEffects::PlayWithFartOverride(0xcc,2,0,0x3f800000);
|
|
VStack_2b4.y = 0.0;
|
|
do {
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
level = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
iVar41 = (GHIDRA_CAST<Level *>((level)))->Level::GetCurrentRoomIndex();
|
|
bVar4 = (GHIDRA_CAST<Level *>((pLVar22)))->Level::CanSpawnDoorOutline(iVar41,GHIDRA_UINT(VStack_2b4.y));
|
|
if (bVar4 != 0) {
|
|
Config::GetCollectibles();
|
|
pLVar22 = GHIDRA_CAST<Level *>(Config)::GetCollectibles();
|
|
uVar36 = (GHIDRA_CAST<Level *>((pLVar22)))->Level::GetCurrentRoomIndex();
|
|
(GHIDRA_CAST<Level *>((uVar36)))->Level::MakeRedRoomDoor(VStack_2b4.y);
|
|
}
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
fVar51 = VStack_2b4.y;
|
|
VStack_2a0.y = (float)(GHIDRA_CAST<Room *>((pRVar6)))->Room::GetDoor(GHIDRA_INT(VStack_2b4.y));
|
|
if ((((EntityPtr)VStack_2a0.y != (EntityPtr)0x0) &&
|
|
(cVar5 = FUN_0056ff60(0x10), cVar5 == '\0')) &&
|
|
(bVar4 = (GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(VStack_2a0.y))))->GridEntity_Door::TryUnlock(this,1), bVar4 == 0)) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(VStack_2a0.y))))->GridEntity_Door::Open();
|
|
(GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(VStack_2a0.y))))->GridEntity_Door::TryBlowOpen(0,GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
VStack_2b4.y = (float)(GHIDRA_INT(fVar51) + 1);
|
|
} while (GHIDRA_INT(VStack_2b4.y) < 8);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddCollectibleEffect(0xaf,1,1);
|
|
break;
|
|
case 0x54:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2c1);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
darkArtsCooldown = 0x5a - darkArtsCooldown;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(darkArtsEffect,1,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x80,1,1);
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
(GHIDRA_CAST<Room *>((pRVar6)))->Room::SetPauseTimer(0x5a);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&VStack_2d4.y) + 2)),0x2c1,9,-1,0);
|
|
break;
|
|
case 0x55:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x73,1,1);
|
|
play_sound_with_fart_seed(0x25,2,0,0x3f800000);
|
|
play_sound_with_fart_seed(0x95,2,0,0x3fc00000);
|
|
uVar7 = Random();
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xc3,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,uVar7);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x24);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
effect->Update();
|
|
break;
|
|
case 0x56:
|
|
VStack_2a0.y = 2.10195e-44;
|
|
do {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
FUN_0043eed0(&VStack_2b4);
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
random_float();
|
|
VStack_2dc.y = -80.0 - in_XMM0_Da * 120.0;
|
|
vecResult = MusicManager::RandomVector(&VStack_308);
|
|
VStack_2bc.y = 1000.0;
|
|
vecResult = (GHIDRA_CAST<Vector *>((vecResult)))->Vector::__mul(&VStack_300,&VStack_2bc.y);
|
|
vecResult = (GHIDRA_CAST<Vector *>((&VStack_2b4)))->Vector::__add(&VStack_374,vecResult);
|
|
vecResult = (GHIDRA_CAST<Room *>((pRVar6)))->Room::GetClampedPosition(&VStack_330,vecResult,VStack_2dc.y);
|
|
(GHIDRA_CAST<Vector *>((&VStack_2b4)))->Vector::operator_assign(vecResult);
|
|
uVar7 = Random();
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xc5,&VStack_2b4,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
VStack_2dc.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(effect) + 0x40));
|
|
bVar4 = HasCollectible(this,0xf7,0);
|
|
if (bVar4 == 0) {
|
|
in_XMM0_Da = 1.0;
|
|
}
|
|
else {
|
|
in_XMM0_Da = 2.0;
|
|
}
|
|
(*(code *)VStack_2dc.y)(in_XMM0_Da);
|
|
iVar41 = Isaac::Random(0x96);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(iVar41 + 300);
|
|
iVar41 = Isaac::Random(0x5a);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_state(iVar41);
|
|
effect->Update();
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
} while ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0);
|
|
break;
|
|
case 0x57:
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x2c0);
|
|
(GHIDRA_CAST<TemporaryEffect *>((configItem)))->TemporaryEffect::TemporaryEffect();
|
|
berserkCooldown = 300;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(tmpEffect,1,1);
|
|
play_sound_with_fart_seed(0x250,2,0,0x3f800000);
|
|
play_sound_with_fart_seed(0x28a,2,0,0x3f800000);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
(GHIDRA_CAST<Level *>(()))->Level::UpdateBackwardsPathStages();
|
|
break;
|
|
case 0x58:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
iVar41 = 0xf0;
|
|
if (cVar5 != '\0') {
|
|
iVar41 = 0x5a;
|
|
}
|
|
this->_megaBlastDuration = iVar41;
|
|
itemConfig = Isaac::GetItemConfig();
|
|
bVar4 = 0;
|
|
configItem = (GHIDRA_CAST<Config *>((itemConfig)))->Config::GetNullItem(0x1f);
|
|
AddCostume(this,configItem,bVar4);
|
|
break;
|
|
case 0x59:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x71,-1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x71,1,1);
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x24);
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((&soulLazarusRef)))->EntityRef::EntityRef();
|
|
(*pcVar1)(sourceRef);
|
|
*GHIDRA_CAST<undefined4 *>(&this->_lastDamageFlags) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_lastDamageFlags) + 4)) = 0;
|
|
(this->_lastDamageSource)._type = 0;
|
|
(this->_lastDamageSource)._variant = 0;
|
|
goto LAB_007b8998;
|
|
case 0x5a:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddCollectibleEffect(0x192,1,1);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&VStack_2d4.y) + 2)),0x69,1,-1,0);
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_298) + 2)),0xa6,1,-1,0);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(FUN_004360d0());
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x192,-1);
|
|
break;
|
|
case 0x5b:
|
|
spawn_ghost_corpse();
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x70,-1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x70,1,2);
|
|
iVar41 = GetPlayerType(this);
|
|
if (iVar41 != 10) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x139,1,1);
|
|
(GHIDRA_CAST<std::string *>(("Shimmer")))->std::string::string_from_cstr();
|
|
uStack_8 = 0x10;
|
|
PlayCollectibleAnim(this,0x139,1,&EStack_254._position,0xffffffff,0);
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<std::string *>(()))->std::string::_Tidy_deallocate();
|
|
}
|
|
break;
|
|
case 0x5c:
|
|
FUN_00424510();
|
|
uStack_8 = 0x11;
|
|
itemPool = GHIDRA_CAST<ItemPool *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemPool();
|
|
pool = (GHIDRA_CAST<ItemPool *>((itemPool)))->ItemPool::GetPool(0x1c);
|
|
VStack_2b4.y = (float)&pool->_poolList;
|
|
VStack_2cc.y = 0.0;
|
|
iVar41 = FUN_00414410();
|
|
if (iVar41 != 0) {
|
|
do {
|
|
iVar41 = FUN_004143f0(VStack_2cc.y);
|
|
if (*GHIDRA_CAST<char *>((iVar41 + 0x14)) != '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
piVar37 = GHIDRA_CAST<int *>((GHIDRA_CAST<EntityList *>(()))->EntityList)::Size();
|
|
pcVar1 = *(code **)(*piVar37 + 0x30);
|
|
puVar27 = GHIDRA_CAST<undefined4 *>(FUN_004143f0(VStack_2cc.y));
|
|
cVar5 = (*pcVar1)(*puVar27);
|
|
if (cVar5 != '\0') goto LAB_007b81fb;
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
itemConfig = Isaac::GetItemConfig();
|
|
piVar37 = GHIDRA_CAST<int *>(FUN_004143f0(VStack_2cc.y));
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(*piVar37);
|
|
if ((configItem != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (configItem->type == 4)) {
|
|
bVar4 = (GHIDRA_CAST<Item *>((configItem)))->Item::HasTags(0x8000000);
|
|
if ((bVar4 == 0) || (bVar4 = HasCollectible(this,configItem->id,0), bVar4 == 0)) {
|
|
std::vector<unsigned_int>::push_back(&configItem->id);
|
|
}
|
|
}
|
|
}
|
|
LAB_007b81fb:
|
|
puVar47 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(VStack_2cc.y) + 1));
|
|
VStack_2cc.y = (float)puVar47;
|
|
puVar28 = GHIDRA_CAST<undefined1 *>(FUN_00414410());
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
} while (puVar47 < puVar28);
|
|
pRVar6 = local_298;
|
|
}
|
|
cVar5 = FUN_004bc660();
|
|
if (cVar5 == '\0') {
|
|
uVar7 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(uVar7);
|
|
entryPtr = GHIDRA_CAST<EntityPtr *>(FUN_0042c810(uVar7));
|
|
EVar33 = *entryPtr;
|
|
VStack_2a0.y = (float)EVar33;
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(GHIDRA_INT(EVar33));
|
|
if ((useFlag & 0x800) == 0) {
|
|
hud = GHIDRA_CAST<HUD *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetHUD();
|
|
(GHIDRA_CAST<HUD *>((hud)))->HUD::ShowItemText(this,configItem);
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x80,2,0,0x3f800000);
|
|
AnimateCollectible(this,GHIDRA_INT(VStack_2a0.y),GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
|
|
SetQueuedItem(configItem,0xffffffff,0,0,0xffffffff);
|
|
isPlayAnim = 0;
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
FID_conflict__Tidy(outcomePicker);
|
|
break;
|
|
case 0x5d:
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(0x19);
|
|
VStack_2bc.y = (float)(uVar7 + 1);
|
|
VStack_2a0.y = 0.0;
|
|
if ((EntityPtr)VStack_2bc.y != (EntityPtr)0x0) {
|
|
do {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::Next();
|
|
pRVar6 = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
vecResult = Room::FindFreePickupSpawnPosition(pRVar6,&VStack_308,&this->_pos,40.0,0,0,0);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
FUN_005b19f0(VStack_2a0.y);
|
|
tmpEntity->Update();
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
pRVar6 = local_298;
|
|
} while (GHIDRA_UINT(VStack_2a0.y) < GHIDRA_UINT(VStack_2bc.y));
|
|
}
|
|
break;
|
|
case 0x5e:
|
|
VStack_2a0.y = 0.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
FUN_00429550();
|
|
VStack_2bc.y = (float)&this->_pos;
|
|
do {
|
|
uVar7 = Random();
|
|
uVar30 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(pRVar6))))->RNG::RandomInt(5);
|
|
vecResult = MusicManager::RandomVector(&VStack_308);
|
|
vecResult = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(VStack_2bc.y))))->Vector::__add(&VStack_300,vecResult);
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0x2b,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(VStack_2d4.y),uVar30 + 1,
|
|
uVar7);
|
|
tmpEntity->Update();
|
|
EVar33 = (EntityPtr)(GHIDRA_INT(VStack_2a0.y) + 1);
|
|
VStack_2a0.y = (float)EVar33;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar5 = FUN_00429550();
|
|
iVar41 = 0xf;
|
|
if (cVar5 != '\0') {
|
|
iVar41 = 10;
|
|
}
|
|
pRVar6 = local_298;
|
|
} while (GHIDRA_INT(EVar33) < iVar41);
|
|
break;
|
|
case 0x5f:
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>(()))->Game)::GetPlayerManager();
|
|
EVar33 = (EntityPtr)(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::SpawnCoPlayer2(0x10);
|
|
VStack_2a0.y = (float)EVar33;
|
|
SetControllerIndex(GHIDRA_CAST<Entity_Player *>(EVar33),this->_controllerIndex,0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&VStack_300,vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::SetPosition(vecResult);
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(GetEffects(GHIDRA_CAST<Entity_Player *>(EVar33)));
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddNullEffect(0x78,1,1);
|
|
init_forgotten_twin(GHIDRA_CAST<Entity_Player *>(EVar33));
|
|
InitPostLevelInitStats(GHIDRA_CAST<Entity_Player *>(EVar33));
|
|
AddBoneHearts(GHIDRA_CAST<Entity_Player *>(EVar33),1);
|
|
AddHearts(GHIDRA_CAST<Entity_Player *>(EVar33),2,1,0);
|
|
uVar7 = Random();
|
|
vecResult = &VStack_440;
|
|
goto LAB_007b850e;
|
|
case 0x60:
|
|
VStack_2a0.y = 8.40779e-45;
|
|
do {
|
|
rngSource = GHIDRA_CAST<RNG *>(FUN_005cbd00(0x2ad));
|
|
Isaac::GetItemConfig();
|
|
Config::GetCollectibles();
|
|
iVar41 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
uVar7 = (GHIDRA_CAST<RNG *>((rngSource)))->RNG::RandomInt(iVar41 - 1);
|
|
VStack_2bc.y = (float)(uVar7 + 1);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(uVar7 + 1);
|
|
if (((configItem == GHIDRA_CAST<ItemConfig_Item *>(0x0)) ||
|
|
(cVar5 = ItemConfig::IsValidCollectible(VStack_2bc.y), cVar5 == '\0')) ||
|
|
(configItem->type != 3)) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x248);
|
|
}
|
|
if ((configItem[1].type == 0) || (*GHIDRA_CAST<short *>((configItem[1].type + 400)) < 1)) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(0x248);
|
|
}
|
|
AddWisp(this,configItem->id,&this->_pos,1,0);
|
|
VStack_2a0.y = (float)(GHIDRA_INT(VStack_2a0.y) + -1);
|
|
} while ((EntityPtr)VStack_2a0.y != (EntityPtr)0x0);
|
|
SoundEffects::PlayWithFartOverride2(0x1d7,&this->_pos,2,0,0x3f800000);
|
|
break;
|
|
case 0x61:
|
|
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>(()))->Game)::GetPlayerManager();
|
|
EVar33 = (EntityPtr)(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::SpawnCoPlayer2(0x14);
|
|
VStack_2a0.y = (float)EVar33;
|
|
SetControllerIndex(GHIDRA_CAST<Entity_Player *>(EVar33),this->_controllerIndex,0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
vecResult = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(()))->Vector)::Vector();
|
|
vecResult = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&VStack_308,vecResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar33))))->Entity::SetPosition(vecResult);
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>(GetEffects(GHIDRA_CAST<Entity_Player *>(EVar33)));
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddNullEffect(0x79,1,1);
|
|
init_forgotten_twin(GHIDRA_CAST<Entity_Player *>(EVar33));
|
|
InitPostLevelInitStats(GHIDRA_CAST<Entity_Player *>(EVar33));
|
|
VStack_2c4.y = (float)FUN_005cbd00(0x2bf);
|
|
VStack_2cc.y = (float)(GHIDRA_INT(EVar33) + 0x1dec);
|
|
FUN_005b16f0(1);
|
|
VStack_2dc.y = (float)Config::GetCollectibles();
|
|
std::iterator_copy(&local_298);
|
|
uVar36 = FUN_00456190(&VStack_2f0.y);
|
|
cVar5 = FUN_0042c710(uVar36);
|
|
while (cVar5 != '\0') {
|
|
iVar41 = EntityPtr::Ref();
|
|
if (*GHIDRA_CAST<char *>((iVar41 + 4)) == '\0') {
|
|
iVar41 = EntityPtr::Ref();
|
|
piVar37 = GHIDRA_CAST<int *>(FUN_0042c810(*GHIDRA_CAST<undefined4 *>((iVar41 + 8))));
|
|
if (0 < *piVar37) {
|
|
itemConfig = Isaac::GetItemConfig();
|
|
iVar41 = EntityPtr::Ref();
|
|
configItem = (GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(*GHIDRA_CAST<int *>((iVar41 + 8)));
|
|
if (configItem->type != 3) {
|
|
bVar4 = 0;
|
|
iVar41 = EntityPtr::Ref();
|
|
bVar4 = CanRerollCollectible(this,*GHIDRA_CAST<int *>((iVar41 + 8)),bVar4);
|
|
if (bVar4 != 0) {
|
|
piVar37 = GHIDRA_CAST<int *>(EntityPtr)::Ref();
|
|
EStack_254._spawnerVariant = *piVar37;
|
|
EStack_254._position.x = (float)piVar37[1];
|
|
EStack_254._velocity.x = (float)piVar37[3];
|
|
EStack_254._velocity.y = (float)piVar37[4];
|
|
EStack_254._flags = piVar37[5];
|
|
EStack_254._entity = (void *)piVar37[6];
|
|
uStack_8 = 0x12;
|
|
EStack_254._position.y = 0.0;
|
|
VStack_2bc.y = 0.0;
|
|
do {
|
|
if (EStack_254._position.y != 0.0) goto LAB_007b8881;
|
|
itemPool = GHIDRA_CAST<ItemPool *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemPool();
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(VStack_2c4.y))))->RNG::Next();
|
|
iVar41 = EntityPtr::Ref();
|
|
EStack_254._position.y =
|
|
(float)ItemPool::GetCollectible(itemPool,*GHIDRA_CAST<int *>((iVar41 + 0x18)),uVar7,7,0,0);
|
|
if (EStack_254._position.y == 8.67404e-43) {
|
|
EStack_254._position.y = 0.0;
|
|
}
|
|
VStack_2bc.y = (float)(GHIDRA_INT(VStack_2bc.y) + 1);
|
|
} while (GHIDRA_INT(VStack_2bc.y) < 10);
|
|
if (EStack_254._position.y != 0.0) {
|
|
LAB_007b8881:
|
|
AddCollectible(GHIDRA_CAST<Entity_Player *>(VStack_2a0.y),GHIDRA_INT(EStack_254._position.y),0,1,0,0,0);
|
|
itemConfig = Isaac::GetItemConfig();
|
|
iVar41 = EntityPtr::Ref();
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::GetCollectible(*GHIDRA_CAST<int *>((iVar41 + 8)));
|
|
Config::GetCollectibles();
|
|
FUN_007221a0(&EStack_254._spawnerVariant);
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
guard_check_icall();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
FUN_005cba20();
|
|
uVar36 = FUN_00456190(&VStack_2f0.y);
|
|
cVar5 = FUN_0042c710(uVar36);
|
|
}
|
|
FUN_005b16f0(0);
|
|
uVar7 = Random();
|
|
vecResult = &VStack_488;
|
|
LAB_007b850e:
|
|
tmpEntity = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Room *>(this)))) + 0x1d9c))));
|
|
vecResult = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_2a0.y))))->Entity::Position(vecResult);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,vecResult,&g_vectorZero,tmpEntity,0,uVar7);
|
|
tmpEntity->Update();
|
|
this = GHIDRA_CAST<Entity_Player *>(VStack_2d4.y);
|
|
break;
|
|
default:
|
|
Isaac::GetItemConfig();
|
|
Config::GetCards();
|
|
iVar41 = (GHIDRA_CAST<std::vector *>(()))->std::vector::size();
|
|
if (iVar41 <= card) {
|
|
/* WARNING: Subroutine does not return */
|
|
KAGE_LogMessage(1,"Warning: Card % don\'t exist\n",card);
|
|
}
|
|
}
|
|
if (isPlayAnim != 0) {
|
|
AnimateCard(this,card,"UseItem");
|
|
}
|
|
LAB_007b8998:
|
|
if ((isPlayAnnouncer != '\0') && (*GHIDRA_CAST<int *>((cardConfig + 0x5c)) != 0)) {
|
|
PlayDelayedSFX(this,*GHIDRA_CAST<int *>((cardConfig + 0x5c)),*GHIDRA_CAST<undefined4 *>((cardConfig + 0x60)),announcerDelay);
|
|
}
|
|
FUN_00863cc0(card,this,useFlag);
|
|
ExceptionList = local_10;
|
|
return;
|
|
LAB_007b3bf0:
|
|
pfVar16 = pfVar16 + 2;
|
|
VStack_2b4.y = (float)(GHIDRA_INT(VStack_2b4.y) + 1);
|
|
if (GHIDRA_CAST<undefined1 *>(0x3) < GHIDRA_UINT(VStack_2b4.y)) goto LAB_007b3c4c;
|
|
goto LAB_007b3be0;
|
|
}
|
|
|
|
// 007b8cb0
|
|
void Entity_Player::update_footprints()
|
|
{
|
|
float fVar1;
|
|
int iVar2;
|
|
byte bVar3;
|
|
Vector *tmpVec;
|
|
uint rngResult;
|
|
uint rngResult2;
|
|
Entity *spawned;
|
|
int *splat;
|
|
ColorMod *color;
|
|
KColor *color_00;
|
|
int unusedArg;
|
|
int effectTimeout;
|
|
float oldOffsetBlue;
|
|
double dVar5;
|
|
undefined4 uVar6;
|
|
TypeDescriptor *pTVar7;
|
|
void *pvVar8;
|
|
undefined1 auStack_13a [2];
|
|
undefined1 quad [112];
|
|
undefined4 shaderColor;
|
|
undefined4 uStack_bc;
|
|
undefined4 uStack_b8;
|
|
undefined4 uStack_b4;
|
|
undefined4 local_b0;
|
|
float floorRed;
|
|
float floorGreen;
|
|
float floorBlue;
|
|
KColor tmpKColor;
|
|
int savedBlendMode0;
|
|
int savedBlendMode1;
|
|
Vector VStack_7c;
|
|
Vector local_74;
|
|
Vector local_6c;
|
|
Entity_Player *local_64;
|
|
Vector local_60;
|
|
Vector local_58;
|
|
float local_50;
|
|
Vector local_4c;
|
|
undefined1 *local_44;
|
|
Color tmpColor;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
float local_8;
|
|
Manager *manager;
|
|
float oldOffsetBlue;
|
|
float oldOffsetGreen;
|
|
float oldOffsetRed;
|
|
code *sampleColorFn;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00affd9d;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((&tmpColor)[1]._colorize);
|
|
ExceptionList = &local_10;
|
|
if (((this->_variant == 0) && (this->_isCoopGhost == 0)) &&
|
|
(local_64 = this, bVar3 = IsHologram(this), bVar3 == 0)) {
|
|
if ((this->_footprintColor2)._tint[3] == 0.0) {
|
|
local_58.y = ((this->_pos).y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5;
|
|
local_60.y = g_displayPixelRatio * g_screenPointScale;
|
|
local_44 = (undefined1 *)
|
|
((((this->_pos).x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_60.y +
|
|
0.5);
|
|
dVar5 = floor((double)(float)local_44);
|
|
VStack_7c.y = (float)dVar5 / local_60.y;
|
|
local_44 = GHIDRA_CAST<undefined1 *>((local_58.y * local_60.y + 0.5));
|
|
dVar5 = floor((double)(float)local_44);
|
|
local_44 = GHIDRA_CAST<undefined1 *>(((float)dVar5 / local_60.y));
|
|
pvVar8 = g_game->_room;
|
|
local_60.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x11fc));
|
|
local_58.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x1200));
|
|
(GHIDRA_CAST<shared_ptr *>((&local_4c)))->shared_ptr::assign((void *)(GHIDRA_INT(pvVar8) + 0x1bc8));
|
|
local_8 = 0.0;
|
|
sampleColorFn = *(code **)(*GHIDRA_CAST<int *>(local_4c.x) + 0x2c);
|
|
__ftoui3();
|
|
__ftoui3();
|
|
(*sampleColorFn)(&tmpKColor);
|
|
local_8 = -NAN;
|
|
FUN_0041c710();
|
|
this = local_64;
|
|
local_60.y = (float)&local_64->_footprintColor2;
|
|
(local_64->_footprintColor2)._tint[3] = 1.0;
|
|
(GHIDRA_CAST<ColorMod *>(local_60.y))->_tint[0] = 0.0;
|
|
(local_64->_footprintColor2)._tint[1] = 0.0;
|
|
(local_64->_footprintColor2)._tint[2] = 0.0;
|
|
(local_64->_footprintColor2)._tint[3] = 0.7;
|
|
(local_64->_footprintColor2)._offset[0] = tmpKColor._red * 0.9;
|
|
(local_64->_footprintColor2)._offset[2] = tmpKColor._blue * 0.9;
|
|
(local_64->_footprintColor2)._offset[1] = tmpKColor._green * 0.9;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&local_64->_footprintColor1))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(local_60.y));
|
|
}
|
|
else {
|
|
local_60.y = (float)&this->_footprintColor2;
|
|
}
|
|
bVar3 = is_footstep_triggered(this,-1);
|
|
if (bVar3 != 0) {
|
|
local_6c.x = (this->_velocity).y;
|
|
local_6c.y = -(this->_velocity).x;
|
|
tmpVec = (GHIDRA_CAST<Vector *>((&local_6c)))->Vector::Normalized(&local_74);
|
|
local_58.y = tmpVec->x + tmpVec->x;
|
|
VStack_7c.y = tmpVec->y + tmpVec->y;
|
|
bVar3 = is_footstep_triggered(this,0);
|
|
local_44 = &DAT_bf800000;
|
|
if (bVar3 == 0) {
|
|
local_60.y = (float)&this->_footprintColor1;
|
|
}
|
|
else {
|
|
local_58.y = local_58.y * -1.0;
|
|
VStack_7c.y = VStack_7c.y * -1.0;
|
|
}
|
|
local_6c.x = local_58.y + (this->_pos).x;
|
|
local_6c.y = VStack_7c.y + (this->_pos).y;
|
|
local_58.y = g_displayPixelRatio * g_screenPointScale;
|
|
VStack_7c.y = (local_6c.y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5;
|
|
local_50 = ((local_6c.x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_58.y + 0.5;
|
|
dVar5 = floor((double)local_50);
|
|
local_4c.y = (float)dVar5 / local_58.y;
|
|
local_50 = VStack_7c.y * local_58.y + 0.5;
|
|
dVar5 = floor((double)local_50);
|
|
local_50 = (float)dVar5 / local_58.y;
|
|
bVar3 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
manager = g_manager;
|
|
if (bVar3 != 0) {
|
|
local_58.y = 6.72623e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_58.y));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_58.y),0.5,1,0,1.0,0.0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(5);
|
|
rngResult = Random();
|
|
local_58.x = (local_64->_velocity).x * 0.7;
|
|
local_58.y = (local_64->_velocity).y * 0.7;
|
|
tmpVec = MusicManager::RandomVector(&local_74);
|
|
rngResult2 = Random();
|
|
oldOffsetBlue = (float)((double)GHIDRA_INT(rngResult2) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult2) >> 0x1f)]
|
|
) * 2.3283064e-10 * 20.0;
|
|
VStack_7c.x = local_6c.x + oldOffsetBlue * tmpVec->x;
|
|
VStack_7c.y = local_6c.y + oldOffsetBlue * tmpVec->y;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&VStack_7c,&local_58,GHIDRA_CAST<Entity *>(0x0),0,rngResult);
|
|
rngResult = Random();
|
|
if ((rngResult & 1) == 0) {
|
|
local_44 = GHIDRA_CAST<undefined1 *>(0x3f800000);
|
|
}
|
|
rngResult = Random();
|
|
*GHIDRA_CAST<float *>((spawned[1]._sprite._animDefaultName._buf + 4)) =
|
|
(float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0 * (float)local_44;
|
|
rngResult = Random();
|
|
iVar2 = *GHIDRA_CAST<int *>(spawned);
|
|
effectTimeout = rngResult % 0xf + 0xf;
|
|
*GHIDRA_CAST<int *>((spawned[1]._sprite._filename._buf + 4)) = effectTimeout;
|
|
*GHIDRA_CAST<int *>((spawned[1]._sprite._filename._buf + 8)) = effectTimeout;
|
|
(**(code **)(iVar2 + 0xc))();
|
|
this = local_64;
|
|
}
|
|
oldOffsetBlue = (this->_velocity).y;
|
|
fVar1 = (this->_velocity).x;
|
|
if (0.16000001 < fVar1 * fVar1 + oldOffsetBlue * oldOffsetBlue) {
|
|
rngResult = Random();
|
|
pTVar7 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar6 = 0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,7,&local_6c,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,rngResult);
|
|
splat = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,uVar6,pTVar7));
|
|
oldOffsetBlue = g_vectorOne.y * 0.1;
|
|
splat[0x39] = GHIDRA_INT((g_vectorOne.x * 0.1));
|
|
splat[0x3a] = GHIDRA_INT(oldOffsetBlue);
|
|
(**(code **)(*splat + 0x3c))(local_60.y,0xffffffff,0xff);
|
|
(**(code **)(*splat + 0xc))();
|
|
}
|
|
pvVar8 = g_game->_room;
|
|
local_58.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x11fc));
|
|
local_44 = *GHIDRA_CAST<undefined1 **>((GHIDRA_CAST<char *>(pvVar8) + 0x1200));
|
|
(GHIDRA_CAST<shared_ptr *>((&VStack_7c)))->shared_ptr::assign((void *)(GHIDRA_INT(pvVar8) + 0x1bc8));
|
|
local_8 = 1.4013e-45;
|
|
(**(code **)(*GHIDRA_CAST<int *>(VStack_7c.x) + 0x2c))(&floorRed);
|
|
local_8 = -NAN;
|
|
FUN_0041c710();
|
|
oldOffsetBlue = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60.y) + 0x20));
|
|
fVar1 = (GHIDRA_CAST<float *>((GHIDRA_INT(local_60.y) + 0x20)))[2];
|
|
oldOffsetGreen = (GHIDRA_CAST<float *>((GHIDRA_INT(local_60.y) + 0x20)))[1];
|
|
oldOffsetRed = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60.y) + 0x20));
|
|
(GHIDRA_CAST<float *>(local_60.y))[3] = (0.7 - (GHIDRA_CAST<float *>(local_60.y))[3]) * 0.3 + (GHIDRA_CAST<float *>(local_60.y))[3];
|
|
oldOffsetBlue = (GHIDRA_CAST<float *>((GHIDRA_INT(local_60.y) + 0x20)))[2];
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60.y) + 0x20)) = (floorRed * 0.9 - oldOffsetBlue) * 0.5 + oldOffsetRed;
|
|
(GHIDRA_CAST<float *>((GHIDRA_INT(local_60.y) + 0x20)))[2] = (floorBlue * 0.9 - fVar1) * 0.5 + oldOffsetBlue;
|
|
(GHIDRA_CAST<float *>((GHIDRA_INT(local_60.y) + 0x20)))[1] =
|
|
(floorGreen * 0.9 - oldOffsetGreen) * 0.5 + (GHIDRA_CAST<float *>((GHIDRA_INT(local_60.y) + 0x20)))[1];
|
|
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x7240))) {
|
|
oldOffsetBlue = (this->_velocity).y;
|
|
fVar1 = (this->_velocity).x;
|
|
if (1.0 < fVar1 * fVar1 + oldOffsetBlue * oldOffsetBlue) {
|
|
local_60.y = oldOffsetBlue + local_6c.y;
|
|
local_60.x = local_6c.x + fVar1;
|
|
rngResult = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,99,&local_60,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,rngResult);
|
|
iVar2 = *GHIDRA_CAST<int *>(spawned);
|
|
(spawned->_velocity).x = (this->_velocity).x;
|
|
(spawned->_velocity).y = (this->_velocity).y;
|
|
(**(code **)(iVar2 + 0xc))();
|
|
rngResult = Random();
|
|
for (local_44 = GHIDRA_CAST<undefined1 *>((rngResult % 5 + 3)); local_44 != GHIDRA_CAST<undefined1 *>(0x0);
|
|
local_44 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(local_44) + -1))) {
|
|
rngResult = Random();
|
|
rngResult2 = Random();
|
|
local_50 = (float)((double)GHIDRA_INT(rngResult2) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult2) >> 0x1f)]) * 2.3283064e-10;
|
|
local_64 = GHIDRA_CAST<Entity_Player *>((local_50 * (this->_velocity).y));
|
|
local_50 = local_50 * (this->_velocity).x;
|
|
rngResult2 = Random();
|
|
local_4c.y = (float)((double)GHIDRA_INT(rngResult2) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult2) >> 0x1f)]) * 2.3283064e-10
|
|
* 3.14;
|
|
local_4c.y = local_4c.y + local_4c.y;
|
|
local_58.y = sin(local_4c.y);
|
|
oldOffsetBlue = cos(local_4c.y);
|
|
local_74.x = oldOffsetBlue + local_50;
|
|
local_74.y = local_58.y + (float)local_64;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,99,&local_60,&local_74,GHIDRA_CAST<Entity *>(this),1,rngResult);
|
|
spawned->Update();
|
|
}
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1be8)) != '\0') &&
|
|
(oldOffsetBlue = (this->_velocity).y, fVar1 = (this->_velocity).x,
|
|
0.16000001 < fVar1 * fVar1 + oldOffsetBlue * oldOffsetBlue)) {
|
|
FUN_00683680();
|
|
g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd;
|
|
(GHIDRA_CAST<shared_ptr *>((&local_74)))->shared_ptr::assign((void *)(GHIDRA_INT(g_game->_room) + 0x1bd8));
|
|
local_8 = 2.8026e-45;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget((void *)local_74.x,0);
|
|
local_8 = -NAN;
|
|
FUN_0041c710();
|
|
iVar2 = g_graphicsManager_blendMode[4];
|
|
savedBlendMode0 = g_graphicsManager_blendMode[0];
|
|
savedBlendMode1 = g_graphicsManager_blendMode[1];
|
|
VStack_7c.x = (float)g_graphicsManager_blendMode[2];
|
|
VStack_7c.y = (float)g_graphicsManager_blendMode[3];
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 0;
|
|
local_44 = GHIDRA_CAST<undefined1 *>(((g_screenHeight - 182.0) * 0.5));
|
|
local_50 = (g_screenWidth - 338.0) * 0.5;
|
|
local_60.y = g_displayPixelRatio * g_screenPointScale;
|
|
local_4c.y = (local_50 - 52.0) * local_60.y + 0.5;
|
|
dVar5 = floor((double)local_4c.y);
|
|
local_58.y = (float)dVar5 / local_60.y;
|
|
local_4c.y = ((float)local_44 - 52.0) * local_60.y + 0.5;
|
|
dVar5 = floor((double)local_4c.y);
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(((float)dVar5 / local_60.y));
|
|
local_4c.y = ((local_6c.x - 60.0) * 0.65 + local_50) * local_60.y + 0.5;
|
|
dVar5 = floor((double)local_4c.y);
|
|
local_50 = (float)dVar5 / local_60.y;
|
|
local_4c.y = ((local_6c.y - 140.0) * 0.65 + (float)local_44) * local_60.y + 0.5;
|
|
dVar5 = floor((double)local_4c.y);
|
|
local_4c.y = (float)dVar5;
|
|
oldOffsetBlue = local_4c.y / local_60.y;
|
|
(GHIDRA_CAST<KColor *>((&tmpKColor)))->KColor::SetFromARGB(0xffffffff);
|
|
tmpVec = &local_74;
|
|
local_74.x = 20.0;
|
|
local_74.y = 20.0;
|
|
local_4c.x = (local_50 - local_58.y) - 10.0;
|
|
local_4c.y = (oldOffsetBlue - (float)local_64) - 10.0;
|
|
render_quad_set_rect(quad,&local_4c,tmpVec,color_00);
|
|
FUN_00682260();
|
|
pvVar8 = (void *)0x7b9800;
|
|
(GHIDRA_CAST<Color *>((&tmpColor)))->Color::Color();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_13a + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c79844);
|
|
apply_sprite_shader_params(color,1,tmpVec,pvVar8);
|
|
local_b0 = 0;
|
|
shaderColor = 0x3f800000;
|
|
uStack_bc = 0x3f800000;
|
|
uStack_b8 = 0x3f800000;
|
|
uStack_b4 = 0x3e75c28f;
|
|
(**(code **)(*DAT_00c79844 + 0x1c))();
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
g_graphicsManager_blendMode[0] = savedBlendMode0;
|
|
g_graphicsManager_blendMode[1] = savedBlendMode1;
|
|
g_graphicsManager_blendMode[2] = GHIDRA_INT(VStack_7c.x);
|
|
g_graphicsManager_blendMode[3] = GHIDRA_INT(VStack_7c.y);
|
|
g_graphicsManager_blendMode[4] = iVar2;
|
|
shader_cache_find(unusedArg);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007b98c0
|
|
void Entity_Player::SetFootprintColor(KColor color, byte unk)
|
|
{
|
|
byte isFootstep;
|
|
|
|
isFootstep = is_footstep_triggered(this,-1);
|
|
if (((isFootstep != 0) || (unk != 0)) && (this->_canFly == 0)) {
|
|
isFootstep = is_footstep_triggered(this,0);
|
|
if (isFootstep != 0) {
|
|
(this->_footprintColor2)._offset[0] = color._red;
|
|
(this->_footprintColor2)._offset[1] = color._green;
|
|
(this->_footprintColor2)._offset[2] = color._blue;
|
|
return;
|
|
}
|
|
(this->_footprintColor1)._offset[0] = color._red;
|
|
(this->_footprintColor1)._offset[1] = color._green;
|
|
(this->_footprintColor1)._offset[2] = color._blue;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007b9940
|
|
byte Entity_Player::is_footstep_triggered(int foot)
|
|
{
|
|
byte isAnyFootstep;
|
|
byte isLeftFootstep;
|
|
Sprite *costumeSprite;
|
|
int *anm2Id;
|
|
int costumeIndex;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
costumeIndex = this->_playerCostumeMap[1]._index;
|
|
if (-1 < costumeIndex) {
|
|
costumeSprite = GHIDRA_CAST<Sprite *>((costumeIndex * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin)));
|
|
anm2Id = *GHIDRA_CAST<int **>(costumeSprite[1]._filename._buf);
|
|
if (((anm2Id != GHIDRA_CAST<int *>(0x0)) && (*anm2Id == 3)) && (anm2Id[1] == 0x271)) {
|
|
if (foot != -1) {
|
|
if (foot == 0) {
|
|
isAnyFootstep = (GHIDRA_CAST<Sprite *>((costumeSprite)))->Sprite::IsEventTriggered("LeftFootstep");
|
|
return isAnyFootstep;
|
|
}
|
|
return 0;
|
|
}
|
|
isAnyFootstep = (GHIDRA_CAST<Sprite *>((costumeSprite)))->Sprite::IsEventTriggered("LeftFootstep");
|
|
if (isAnyFootstep != 0) {
|
|
return 1;
|
|
}
|
|
isAnyFootstep = (GHIDRA_CAST<Sprite *>((costumeSprite)))->Sprite::IsEventTriggered("RightFootstep");
|
|
if (isAnyFootstep == 0) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
}
|
|
if ((((this->_flags & 0x4000) == 0) &&
|
|
(isAnyFootstep = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), isAnyFootstep == 0)) &&
|
|
((game->_frameCount % 6 == 0 && (this->_canFly == 0)))) {
|
|
isAnyFootstep = 1;
|
|
isLeftFootstep = (GHIDRA_CAST<Game *>((game)))->Game::IsPaused();
|
|
if ((isLeftFootstep == 0) && (game->_frameCount % 0xc == 0)) {
|
|
isLeftFootstep = 1;
|
|
goto LAB_007b9a30;
|
|
}
|
|
}
|
|
else {
|
|
isAnyFootstep = 0;
|
|
}
|
|
isLeftFootstep = 0;
|
|
LAB_007b9a30:
|
|
if (foot == -1) {
|
|
return isAnyFootstep;
|
|
}
|
|
if (foot == 0) {
|
|
return isLeftFootstep;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007b9b50
|
|
void Entity_Player::update_pitfall()
|
|
{
|
|
Vector pos;
|
|
byte bVar1;
|
|
byte isRightPressed;
|
|
byte isUpPressed;
|
|
byte isDownPressed;
|
|
byte *curAnimName;
|
|
uint cmpResult;
|
|
EntityRef *damageRefPtr;
|
|
int iVar2;
|
|
Vector *pVVar3;
|
|
char *unused;
|
|
Entity_Player *extraout_ECX;
|
|
int unused_00;
|
|
undefined4 extraout_ECX_00;
|
|
int unused_01;
|
|
bool isLess;
|
|
Vector landingPos;
|
|
Vector doorPos;
|
|
Vector freeDoorPos;
|
|
EntityRef damageRef;
|
|
Room *room;
|
|
|
|
iVar2 = this->_pitfallState;
|
|
if (iVar2 != 0) {
|
|
if (*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0) {
|
|
if (this->_dead != 0) {
|
|
return;
|
|
}
|
|
unused = GHIDRA_CAST<char *>(this);
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
curAnimName = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((curAnimName + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<byte **>(curAnimName);
|
|
}
|
|
unused = "FallIn";
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
isLess = bVar1 < (byte)*unused;
|
|
if (bVar1 != *unused) {
|
|
LAB_007b9bd8:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007b9bdd;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
isLess = bVar1 < (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((byte)(GHIDRA_CAST<Entity_Player *>(unused)))) + 0x1)));
|
|
if (bVar1 != (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(unused)))) + 0x1)))) goto LAB_007b9bd8;
|
|
curAnimName = curAnimName + 2;
|
|
unused = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(unused)))) + 0x2)));
|
|
} while (bVar1 != 0);
|
|
cmpResult = 0;
|
|
LAB_007b9bdd:
|
|
if ((cmpResult == 0) && (iVar2 == 1)) {
|
|
this->_pitfallState = 2;
|
|
damageRefPtr = (GHIDRA_CAST<EntityRef *>((&damageRef)))->EntityRef::EntityRef();
|
|
this->TakeDamage(0x3f800000,0x80000,0,damageRefPtr,0x1e);
|
|
unused = GHIDRA_CAST<char *>(extraout_ECX);
|
|
}
|
|
}
|
|
if (((this->_pitfallState != 4) && (this->_pitfallState == 2)) &&
|
|
(this->_pitfallTimer = this->_pitfallTimer + 1, 0x27 < this->_pitfallTimer)) {
|
|
bVar1 = input_is_action_pressed(0,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),GHIDRA_INT(unused));
|
|
isRightPressed = input_is_action_pressed(1,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_00);
|
|
isUpPressed = input_is_action_pressed
|
|
(2,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),
|
|
CONCAT31((int3)(GHIDRA_UINT(extraout_ECX_00) >> 8),bVar1 | isRightPressed)
|
|
);
|
|
isDownPressed = input_is_action_pressed(3,this->_controllerIndex,GHIDRA_CAST<Entity *>(this),unused_01);
|
|
if ((isDownPressed != 0 || ((bVar1 | isRightPressed) != 0 || isUpPressed != 0)) ||
|
|
(0x77 < this->_pitfallTimer)) {
|
|
landingPos.x = (this->_pos).x;
|
|
landingPos.y = (this->_pos).y;
|
|
room = g_game->_room;
|
|
iVar2 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(this->_pos);
|
|
if (iVar2 < 1) {
|
|
this->_pitfallState = 3;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("JumpOut"));
|
|
}
|
|
else {
|
|
Room::FindFreePickupSpawnPosition(room,&landingPos,&landingPos,0.0,1,0,0);
|
|
room = g_game->_room;
|
|
pos.y = landingPos.y;
|
|
pos.x = landingPos.x;
|
|
iVar2 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(pos);
|
|
if (((0 < iVar2) && (g_game->_enterDoor + 1U < 9)) &&
|
|
(room->_doors[g_game->_enterDoor] != GHIDRA_CAST<GridEntity *>(0x0))) {
|
|
pVVar3 = (GHIDRA_CAST<GridEntity *>((room->_doors[g_game->_enterDoor])))->GridEntity::Position(&doorPos);
|
|
pVVar3 = Room::FindFreePickupSpawnPosition(room,&freeDoorPos,pVVar3,0.0,1,0,0);
|
|
landingPos.x = pVVar3->x;
|
|
landingPos.y = pVVar3->y;
|
|
}
|
|
Teleport(this,&landingPos,0,0);
|
|
this->_pitfallState = 3;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("JumpOut"));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetLastFrame();
|
|
}
|
|
this->_damageCooldown = 0x78;
|
|
}
|
|
}
|
|
if ((this->_pitfallState == 3) &&
|
|
(((this->_sprite)._animState._animData == (void *)0x0 ||
|
|
((this->_sprite)._animState._isPlaying == 0)))) {
|
|
this->_isPlayingExtraAnimation = 0;
|
|
this->_pitfallTimer = 0;
|
|
this->_pitfallState = 0;
|
|
this->_isControlsEnabled = 1;
|
|
this->_entityCollisionClass = 4;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar2 == 3) {
|
|
return;
|
|
}
|
|
if ((g_game->_roomTransition)._animation != 2) {
|
|
return;
|
|
}
|
|
}
|
|
this->_isPlayingExtraAnimation = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007b9e10
|
|
void Entity_Player::TryDecreaseGlowingHourglassUses(int unk1, byte unk2)
|
|
{
|
|
byte isCheck;
|
|
int iVar1;
|
|
int iVar2;
|
|
char isDecreasePending;
|
|
ActiveItemDesc *active;
|
|
uint slot;
|
|
void *boxContents;
|
|
|
|
active = this->_activeDesc;
|
|
slot = 0;
|
|
isDecreasePending = (char)unk1;
|
|
do {
|
|
if (active->_item == 0x1a6) {
|
|
if (active->_varData < 3) {
|
|
if (unk2 == 0) {
|
|
if (isDecreasePending != '\0') {
|
|
active->_varData = active->_varData + 1;
|
|
goto LAB_007b9e7b;
|
|
}
|
|
}
|
|
else {
|
|
this->_activeDesc[0]._varData = 3;
|
|
}
|
|
}
|
|
}
|
|
else if (((active->_item == 0x1dd) && (isCheck = VoidHasCollectible(this,0x1a6), isCheck != 0))
|
|
&& (isDecreasePending != '\0')) {
|
|
SetActiveCharge(this,0,slot);
|
|
LAB_007b9e7b:
|
|
isDecreasePending = '\0';
|
|
}
|
|
slot = slot + 1;
|
|
active = active + 1;
|
|
if (3 < slot) {
|
|
if (((this->_movingBoxContents)._begin != (this->_movingBoxContents)._end) &&
|
|
(isCheck = HasCollectible(this,0x20b,0), isCheck != 0)) {
|
|
unk1 = 0;
|
|
boxContents = (this->_movingBoxContents)._begin;
|
|
iVar1 = GHIDRA_INT((this->_movingBoxContents)._end) - GHIDRA_INT(boxContents);
|
|
iVar2 = iVar1 >> 0x1f;
|
|
if (iVar1 / 0x78 + iVar2 != iVar2) {
|
|
iVar2 = 0;
|
|
do {
|
|
if (((*GHIDRA_CAST<int *>((iVar2 + GHIDRA_INT(boxContents))) == 5) &&
|
|
(*GHIDRA_CAST<int *>((iVar2 + 4 + GHIDRA_INT(boxContents))) == 100)) &&
|
|
(*GHIDRA_CAST<int *>((iVar2 + 8 + GHIDRA_INT(boxContents))) == 0x1a6)) {
|
|
if (unk2 == 0) {
|
|
if ((isDecreasePending != '\0') &&
|
|
(iVar1 = *GHIDRA_CAST<int *>((iVar2 + 0x5c + GHIDRA_INT(boxContents))), iVar1 < 3)) {
|
|
*GHIDRA_CAST<int *>((iVar2 + 0x5c + GHIDRA_INT(boxContents))) = iVar1 + 1;
|
|
isDecreasePending = '\0';
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>((iVar2 + 0x5c + GHIDRA_INT(boxContents))) = 3;
|
|
}
|
|
}
|
|
boxContents = (this->_movingBoxContents)._begin;
|
|
iVar2 = iVar2 + 0x78;
|
|
unk1 = unk1 + 1;
|
|
} while (GHIDRA_UINT(unk1) <
|
|
GHIDRA_UINT(((GHIDRA_INT((this->_movingBoxContents)._end) - GHIDRA_INT(boxContents)) / 0x78)));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 007b9f60
|
|
byte Entity_Player::GetMouseAimTarget(Vector *outTarget, byte isSkipNetCursor)
|
|
{
|
|
void *pvVar1;
|
|
byte bVar2;
|
|
char isLastRef;
|
|
uint uVar3;
|
|
int netDevice;
|
|
int iVar4;
|
|
int *windowSize;
|
|
Entity *focusEntity;
|
|
int unused;
|
|
int extraout_ECX;
|
|
float extraHeight;
|
|
float pixelScale;
|
|
int windowSizeBuf [2];
|
|
int device;
|
|
int *deviceRefCount;
|
|
double cursorY;
|
|
double cursorX;
|
|
float focusX;
|
|
float local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
int local_8;
|
|
float cameraY;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00affddd;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((windowSizeBuf + 0xe));
|
|
ExceptionList = &local_10;
|
|
iVar4 = this->_controllerIndex;
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&device,iVar4);
|
|
local_8 = 0;
|
|
if (device == 0) {
|
|
netDevice = 0;
|
|
}
|
|
else {
|
|
netDevice = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0,uVar3);
|
|
}
|
|
if (isSkipNetCursor == 0) {
|
|
if ((netDevice == 0) || (*GHIDRA_CAST<char *>((netDevice + 0x3d4)) == '\0')) goto LAB_007b9fe7;
|
|
outTarget->x = *GHIDRA_CAST<float *>((netDevice + 0x398));
|
|
outTarget->y = *GHIDRA_CAST<float *>((netDevice + 0x39c));
|
|
LAB_007ba1ff:
|
|
focusEntity = GetFocusEntity(this);
|
|
if (focusEntity == GHIDRA_CAST<Entity *>(0x0)) {
|
|
focusX = (this->_pos).x;
|
|
local_14 = (this->_pos).y;
|
|
}
|
|
else {
|
|
focusX = (focusEntity->_pos).x;
|
|
local_14 = (focusEntity->_pos).y;
|
|
}
|
|
outTarget->x = (outTarget->x - focusX) * 0.2;
|
|
outTarget->y = (outTarget->y - local_14) * 0.2;
|
|
}
|
|
else {
|
|
if (netDevice != 0) {
|
|
if (*GHIDRA_CAST<int *>((netDevice + 0x378)) == 0) {
|
|
iVar4 = -0x21524111;
|
|
}
|
|
else {
|
|
iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((netDevice + 0x378)) + 0xc));
|
|
}
|
|
}
|
|
LAB_007b9fe7:
|
|
bVar2 = 0;
|
|
if (((g_manager->_optionsConfig)._enableMouseControl == 0) || (iVar4 != 0)) goto LAB_007ba260;
|
|
iVar4 = glfwGetMouseButton();
|
|
pvVar1 = g_glfwWindow;
|
|
if (iVar4 == 0) goto LAB_007ba260;
|
|
if (g_glfwWindow == (void *)0x0) {
|
|
_wassert(L"window != NULL",
|
|
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c"
|
|
,0x310);
|
|
}
|
|
cursorX = 0.0;
|
|
cursorY = 0.0;
|
|
if (_glfw == 0) {
|
|
_glfwInputError(0x10001,0);
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x70)) == 0x34003) {
|
|
cursorX = *GHIDRA_CAST<double *>((GHIDRA_CAST<char *>(pvVar1) + 0x1e0));
|
|
cursorY = *GHIDRA_CAST<double *>((GHIDRA_CAST<char *>(pvVar1) + 0x1e8));
|
|
}
|
|
else {
|
|
(*DAT_00c736a0)(pvVar1,&cursorX,&cursorY);
|
|
}
|
|
_isSkipNetCursor = (float)cursorX;
|
|
local_14 = (float)cursorY;
|
|
bVar2 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsMirrorWorld();
|
|
iVar4 = unused;
|
|
if (bVar2 != 0) {
|
|
windowSize = glfw_get_window_size(windowSizeBuf,unused);
|
|
_isSkipNetCursor =
|
|
(float)((double)*windowSize + __uint_to_double_fixup[-(*windowSize >> 0x1f)]) -
|
|
_isSkipNetCursor;
|
|
iVar4 = extraout_ECX;
|
|
}
|
|
windowSize = glfw_get_window_size(windowSizeBuf,iVar4);
|
|
manager = g_manager;
|
|
extraHeight = g_screenHeight - 182.0;
|
|
pixelScale = (float)((double)windowSize[1] + __uint_to_double_fixup[-(windowSize[1] >> 0x1f)]) /
|
|
DAT_00c79980;
|
|
cameraY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1208));
|
|
outTarget->x = ((_isSkipNetCursor / pixelScale - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1204))) -
|
|
(g_screenWidth - 338.0) * 0.5) / 0.65 + 60.0;
|
|
outTarget->y = ((local_14 / pixelScale - cameraY) - extraHeight * 0.5) / 0.65 + 140.0;
|
|
if (manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((manager + 1))) goto LAB_007ba1ff;
|
|
}
|
|
bVar2 = 1;
|
|
LAB_007ba260:
|
|
local_8 = 1;
|
|
if (deviceRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*deviceRefCount + 0xc))();
|
|
if ((isLastRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&device);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return bVar2;
|
|
}
|
|
|
|
// 007ba2b0
|
|
void Entity_Player::update_baby_skin_effects()
|
|
{
|
|
Entity_Player *game = this;
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
Entity_Familiar **ppEVar3;
|
|
uint uVar4;
|
|
Entity *spawnedEntity;
|
|
int iVar5;
|
|
BitSet128 *bombFlags;
|
|
int *creepEffect;
|
|
void *pvVar6;
|
|
uint rngResult;
|
|
Entity_Player *tmpPlayer;
|
|
TearParams *pTVar7;
|
|
int enemyCount;
|
|
Entity_Familiar **ppEVar8;
|
|
Game *game;
|
|
float fVar9;
|
|
float fVar10;
|
|
undefined4 uVar11;
|
|
TypeDescriptor *pTVar12;
|
|
TypeDescriptor *pTVar13;
|
|
undefined4 rngResult;
|
|
EntityRef sourceRef;
|
|
int roomEntity;
|
|
Entity_Familiar *local_a4 [2];
|
|
Entity_Familiar *local_9c;
|
|
float local_98;
|
|
undefined1 local_94 [12];
|
|
undefined4 *local_88;
|
|
Entity_Player *local_84;
|
|
int i;
|
|
TearParams tearHitParams;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
float local_8;
|
|
float pullStrength;
|
|
undefined1 *blueFlyRef;
|
|
qword bombFlagsHigh;
|
|
qword bombFlagsLow;
|
|
|
|
game = g_game;
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00affe10;
|
|
local_10 = ExceptionList;
|
|
rngResult = __security_cookie ^ GHIDRA_UINT(((&tearHitParams)[1]._tearColor._colorize + 3));
|
|
if (game->_dead != 0) {
|
|
return;
|
|
}
|
|
iVar5 = game->_babySkin;
|
|
ExceptionList = &local_10;
|
|
local_84 = game;
|
|
local_14 = rngResult;
|
|
if (iVar5 == 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x78,game->_index);
|
|
if ((bVar2 != 0) && (rngResult = Random(), game = g_game, rngResult % 0x1e == 0)) {
|
|
enemyCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12c4)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12c0));
|
|
iVar5 = 0;
|
|
if (0 < enemyCount) {
|
|
iVar5 = enemyCount;
|
|
}
|
|
if ((iVar5 < 1) || (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::HasEntityFlags(0x4000), bVar2 != 0))
|
|
goto LAB_007bb592;
|
|
Room::FindFreePickupSpawnPosition(game->_room,GHIDRA_CAST<Vector *>((local_94 + 8)),&game->_pos,0.0,1,0,0);
|
|
game->_numBlueSpiders = game->_numBlueSpiders + 1;
|
|
spawn_blue_spider(GHIDRA_CAST<Vector *>((local_94 + 8)),GHIDRA_CAST<Entity *>(game),&g_vectorZero);
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
if (iVar5 == 5) {
|
|
i = 0;
|
|
local_88 = g_game->_room;
|
|
if (local_88[0x499] != 0) {
|
|
do {
|
|
roomEntity = *GHIDRA_CAST<int *>((local_88[0x497] + i * 4));
|
|
if ((((1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((roomEntity + 0x28)) == 1)) ||
|
|
(*GHIDRA_CAST<int *>((roomEntity + 0x28)) - 10U < 0x3de)) || (*GHIDRA_CAST<int *>((roomEntity + 0x28)) == 9)) {
|
|
local_a4[1] = GHIDRA_CAST<Entity_Familiar *>((game->_pos).y);
|
|
local_9c = GHIDRA_CAST<Entity_Familiar *>((game->_pos).x);
|
|
local_98 = (float)local_a4[1] - *GHIDRA_CAST<float *>((roomEntity + 0x340));
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(((float)local_9c - *GHIDRA_CAST<float *>((roomEntity + 0x33c))));
|
|
fVar9 = sqrtf(local_98 * local_98 + (float)local_84 * (float)local_84);
|
|
if (0.0 < fVar9) {
|
|
local_84 = GHIDRA_CAST<Entity_Player *>(((float)local_84 * (1.0 / fVar9)));
|
|
local_98 = local_98 * (1.0 / fVar9);
|
|
}
|
|
local_a4[0] = GHIDRA_CAST<Entity_Familiar *>(0x3f666666);
|
|
fVar9 = (float)local_a4[1] - *GHIDRA_CAST<float *>((roomEntity + 0x340));
|
|
fVar10 = (float)local_9c - *GHIDRA_CAST<float *>((roomEntity + 0x33c));
|
|
fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10);
|
|
local_9c = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
local_a4[1] = GHIDRA_CAST<Entity_Familiar *>((((300.0 - fVar9) * 0.9) / 300.0));
|
|
ppEVar8 = local_a4 + 1;
|
|
if ((float)local_a4[1] <= 0.0) {
|
|
ppEVar8 = local_a4 + 2;
|
|
}
|
|
ppEVar3 = local_a4;
|
|
if ((float)*ppEVar8 <= 0.9 && (float)*ppEVar8 != 0.9) {
|
|
ppEVar3 = ppEVar8;
|
|
}
|
|
fVar9 = *GHIDRA_CAST<float *>((roomEntity + 0x36c));
|
|
pullStrength = (float)*ppEVar3;
|
|
if (fVar9 != 0.0) {
|
|
*GHIDRA_CAST<float *>((roomEntity + 0x360)) =
|
|
(pullStrength * (float)local_84 * *GHIDRA_CAST<float *>((roomEntity + 0x39c))) / fVar9 +
|
|
*GHIDRA_CAST<float *>((roomEntity + 0x360));
|
|
*GHIDRA_CAST<float *>((roomEntity + 0x364)) =
|
|
(pullStrength * local_98 * *GHIDRA_CAST<float *>((roomEntity + 0x39c))) / fVar9 +
|
|
*GHIDRA_CAST<float *>((roomEntity + 0x364));
|
|
}
|
|
}
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT(local_88[0x499]));
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
if (iVar5 == 6) {
|
|
if ((g_game->_frameCount - game->_spawnFrame) % 900 != 0) goto LAB_007bb592;
|
|
uVar4 = Random();
|
|
if ((uVar4 & 1) == 0) {
|
|
game = g_game;
|
|
if (g_game->_frameCount - game->_spawnFrame < 6) goto LAB_007bb592;
|
|
uVar4 = Random();
|
|
rngResult = 0;
|
|
pTVar13 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor;
|
|
pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar11 = 0;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,3,&game->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(game),0,uVar4);
|
|
iVar5 = __RTDynamicCast(spawnedEntity,uVar11,pTVar12,pTVar13,rngResult,rngResult);
|
|
if (iVar5 != 0) {
|
|
bombFlags = GetBombFlags(game,GHIDRA_CAST<BitSet128 *>(local_94),0);
|
|
bombFlagsLow = bombFlags->_l;
|
|
uVar11 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&bombFlags->_l) + 4));
|
|
bombFlagsHigh = bombFlags->_h;
|
|
rngResult = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&bombFlags->_h) + 4));
|
|
*GHIDRA_CAST<undefined1 *>((iVar5 + 0x463)) = 1;
|
|
*GHIDRA_CAST<int *>((iVar5 + 0x438)) = GHIDRA_INT(bombFlagsLow);
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x43c)) = uVar11;
|
|
*GHIDRA_CAST<int *>((iVar5 + 0x440)) = GHIDRA_INT(bombFlagsHigh);
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x444)) = rngResult;
|
|
}
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
if (iVar5 == 10) {
|
|
uVar4 = Random();
|
|
if (uVar4 % 0x50 == 0) {
|
|
uVar4 = Random();
|
|
rngResult = 0;
|
|
pTVar13 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar11 = 0;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,&game->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(game),0,uVar4)
|
|
;
|
|
creepEffect = GHIDRA_CAST<int *>(__RTDynamicCast(spawnedEntity,uVar11,pTVar12,pTVar13,rngResult,rngResult));
|
|
rngResult = Random();
|
|
fVar10 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.2;
|
|
fVar9 = fVar10 * g_vectorOne.x;
|
|
creepEffect[0x3a] = GHIDRA_INT((fVar10 * g_vectorOne.y));
|
|
creepEffect[0x39] = GHIDRA_INT(fVar9);
|
|
(**(code **)(*creepEffect + 0xc))();
|
|
}
|
|
bVar2 = IsExtraAnimationFinished(game);
|
|
if (bVar2 == 0) goto LAB_007bb58c;
|
|
LAB_007bb576:
|
|
(GHIDRA_CAST<ANM2 *>((&game->_sprite)))->ANM2::PlayOverlay(GHIDRA_CAST<byte *>("Dripping"),0);
|
|
(game->_sprite)._overlayRenderFirst = 1;
|
|
goto LAB_007bb58c;
|
|
}
|
|
if (iVar5 == 3) {
|
|
pvVar6 = (GHIDRA_CAST<ANM2 *>((&game->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST<byte *>("Dripping"));
|
|
if (pvVar6 != (void *)0x0) {
|
|
bVar2 = IsExtraAnimationFinished(game);
|
|
if (bVar2 != 0) goto LAB_007bb576;
|
|
goto LAB_007bb58c;
|
|
}
|
|
LAB_007bade5:
|
|
if (game->_babySkin == 0x28) {
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0xf8);
|
|
if (bVar2 != 0) goto LAB_007bae5e;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 == 0) || (rngResult = Random(), rngResult % 0x32 != 0)) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x3e0 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU
|
|
))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x3e0));
|
|
goto LAB_007bad9f;
|
|
}
|
|
LAB_007bad98:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = 0;
|
|
goto LAB_007bad9f;
|
|
}
|
|
LAB_007bae5e:
|
|
if (game->_babySkin == 0x29) {
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0xce);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 == 0) || (rngResult = Random(), rngResult % 0x32 != 0)) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x338 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) &
|
|
0xfffffffcU))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x338));
|
|
goto LAB_007bad9f;
|
|
}
|
|
goto LAB_007bad98;
|
|
}
|
|
}
|
|
if (game->_babySkin == 0x2b) {
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x7a);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 == 0) || (rngResult = Random(), rngResult % 0x32 != 0)) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x1e8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) &
|
|
0xfffffffcU))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x1e8));
|
|
goto LAB_007bad9f;
|
|
}
|
|
goto LAB_007bad98;
|
|
}
|
|
}
|
|
if (game->_babySkin == 0x2d) {
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0xd6);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 == 0) || (rngResult = Random(), rngResult % 0x32 != 0)) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x358 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) &
|
|
0xfffffffcU))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x358));
|
|
goto LAB_007bad9f;
|
|
}
|
|
goto LAB_007bad98;
|
|
}
|
|
}
|
|
iVar5 = game->_babySkin;
|
|
if (iVar5 != 0x30) {
|
|
if (iVar5 == 0x2f) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(7,game->_index);
|
|
if (bVar2 != 0) {
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_94),
|
|
&game->_pos,150.0,8);
|
|
local_8 = 0.0;
|
|
i = 0;
|
|
if (local_88 != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
do {
|
|
iVar5 = i;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x4))) + i * 4)))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 != 0) {
|
|
pcVar1 = *(code **)(**GHIDRA_CAST<int **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x4))) + iVar5 * 4)) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(local_84));
|
|
rngResult = Random();
|
|
pTVar7 = GetTearHitParams(local_84,&tearHitParams,1,1.0,(rngResult & 1) * 2 + -1,
|
|
GHIDRA_CAST<Entity *>(0x0));
|
|
(*pcVar1)(pTVar7->_tearDamage * 0.3,0,0,&sourceRef,0x1e);
|
|
iVar5 = i;
|
|
}
|
|
i = iVar5 + 1;
|
|
} while (GHIDRA_UINT(i) < local_88);
|
|
game = local_84;
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((local_94)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
if (iVar5 != 0x32) {
|
|
LAB_007bb2d2:
|
|
if (game->_babySkin == 0x33) {
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x22);
|
|
if (bVar2 == 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x88 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) &
|
|
0xfffffffcU))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x88));
|
|
goto LAB_007bad9f;
|
|
}
|
|
goto LAB_007bad98;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
}
|
|
game = g_game;
|
|
if (game->_babySkin == 0x34) {
|
|
bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(g_game->_room) + 0x7310)),0x40);
|
|
if (bVar2 != 0) goto LAB_007bb44f;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if (bVar2 == 0) goto LAB_007bb592;
|
|
rngResult = Random();
|
|
if (rngResult % 0x32 != 0) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU)) <
|
|
0x101) {
|
|
LAB_007bb3be:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x100));
|
|
}
|
|
LAB_007bb3c8:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x4))) = GHIDRA_CAST<undefined1 *>(0x0);
|
|
local_88 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x8))) = 0x96;
|
|
TemporaryEffects::AddEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(g_game->_room) + 0x7310)),local_94,1,1);
|
|
}
|
|
else {
|
|
if ((game->_babySkin == 0x31) &&
|
|
(tmpPlayer = GetMainPlayer(game), *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((tmpPlayer)) + 0x18e0)))) < 1)) {
|
|
tmpPlayer = GetMainPlayer(game);
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((tmpPlayer)) + 0x18e0))));
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((tmpPlayer)) + 0x18e0)))) = iVar5;
|
|
goto LAB_007bb58c;
|
|
}
|
|
game = g_game;
|
|
LAB_007bb44f:
|
|
iVar5 = game->_babySkin;
|
|
if (iVar5 == 0x35) {
|
|
bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(game->_room) + 0x7310)),0xd7);
|
|
if (bVar2 != 0) {
|
|
LAB_007bb562:
|
|
if (game->_isCoopGhost == 0) goto LAB_007bb592;
|
|
LAB_007bb56b:
|
|
bVar2 = IsExtraAnimationFinished(game);
|
|
if (bVar2 == 0) goto LAB_007bb592;
|
|
goto LAB_007bb576;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if (bVar2 == 0) goto LAB_007bb592;
|
|
rngResult = Random();
|
|
if (rngResult % 0x32 == 0) {
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU
|
|
)) < 0x35d) goto LAB_007bb3be;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x35c));
|
|
goto LAB_007bb3c8;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 != 0x37) {
|
|
if ((iVar5 != 0x3a) && (iVar5 != 0x3b)) goto LAB_007bb562;
|
|
goto LAB_007bb56b;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1b14)))) != 0) goto LAB_007bb592;
|
|
rngResult = 0;
|
|
pTVar13 = &IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor;
|
|
pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar11 = 0;
|
|
spawnedEntity = AddBlueFlies(game,1,&game->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
local_a4[0] = (Entity_Familiar *)
|
|
__RTDynamicCast(spawnedEntity,uVar11,pTVar12,pTVar13,rngResult);
|
|
(GHIDRA_CAST<Entity_Familiar *>((local_a4[0])))->Entity_Familiar::set_player(game);
|
|
blueFlyRef = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1b14)));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1b14)))) != 0) {
|
|
local_88 = GHIDRA_CAST<undefined4 *>(blueFlyRef);
|
|
std::multiset<unsigned_int>::erase(&local_88);
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>(blueFlyRef) = local_a4[0];
|
|
if (local_a4[0] != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(blueFlyRef);
|
|
}
|
|
}
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x19b);
|
|
if (bVar2 != 0) goto LAB_007bb2d2;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 == 0) || (rngResult = Random(), rngResult % 0x32 != 0)) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU)) <
|
|
0x66d) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x4))) = &DAT_00000005;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x66c));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x4))) = &DAT_00000005;
|
|
}
|
|
goto LAB_007bada9;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
local_98 = 0.0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(local_98));
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[0];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[0] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 1;
|
|
EvaluateItems(tmpPlayer);
|
|
fVar9 = local_98;
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(local_98));
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[1];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[1] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 2;
|
|
EvaluateItems(tmpPlayer);
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(fVar9));
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[2];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[2] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x10;
|
|
EvaluateItems(tmpPlayer);
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(fVar9));
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[3];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[3] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0xc;
|
|
EvaluateItems(tmpPlayer);
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(fVar9));
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[4];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[4] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x400;
|
|
EvaluateItems(tmpPlayer);
|
|
local_98 = (float)(GHIDRA_INT(fVar9) + 1);
|
|
} while (GHIDRA_UINT(local_98) <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 == 0x1f) {
|
|
if (game->_coopBabyBuffTimers[0] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[0];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[0] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 1;
|
|
EvaluateItems(tmpPlayer);
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x20) {
|
|
if (game->_coopBabyBuffTimers[1] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[1];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[1] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 2;
|
|
EvaluateItems(tmpPlayer);
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x21) {
|
|
if (game->_coopBabyBuffTimers[2] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[2];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[2] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x10;
|
|
EvaluateItems(tmpPlayer);
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x22) {
|
|
if (game->_coopBabyBuffTimers[3] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[3];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[3] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0xc;
|
|
EvaluateItems(tmpPlayer);
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x23) {
|
|
if (game->_coopBabyBuffTimers[4] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[4];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[4] = iVar5;
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x400;
|
|
EvaluateItems(tmpPlayer);
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x24) {
|
|
if (game->_coopBabyBuffTimers[5] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[5];
|
|
if (iVar5 < 1) {
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x800;
|
|
EvaluateItems(tmpPlayer);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[5];
|
|
}
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
i = i + 1;
|
|
tmpPlayer->_coopBabyBuffTimers[5] = iVar5;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x25) {
|
|
if (game->_coopBabyBuffTimers[6] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(i);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[6];
|
|
if (iVar5 < 1) {
|
|
tmpPlayer->_cacheFlags = tmpPlayer->_cacheFlags | 0x800;
|
|
EvaluateItems(tmpPlayer);
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[6];
|
|
}
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
i = i + 1;
|
|
tmpPlayer->_coopBabyBuffTimers[6] = iVar5;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
game = g_game;
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 == 0x26) {
|
|
if (game->_coopBabyBuffTimers[7] < 1) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 != 0) && (rngResult = Random(), rngResult % 0x32 == 0)) {
|
|
i = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(i);
|
|
game = g_game;
|
|
iVar5 = tmpPlayer->_coopBabyBuffTimers[7];
|
|
if (iVar5 < 0x96) {
|
|
iVar5 = 0x96;
|
|
}
|
|
tmpPlayer->_coopBabyBuffTimers[7] = iVar5;
|
|
i = i + 1;
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((game->_playerManager)._playerList._begin) >> 2)));
|
|
game = local_84;
|
|
}
|
|
goto LAB_007bb592;
|
|
}
|
|
goto LAB_007bb58c;
|
|
}
|
|
goto LAB_007bade5;
|
|
}
|
|
if (iVar5 != 0x27) goto LAB_007bade5;
|
|
tmpPlayer = GetMainPlayer(game);
|
|
bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x14);
|
|
if (bVar2 != 0) goto LAB_007bade5;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(game))))->Entity::IsFrame(0x1e,0);
|
|
if ((bVar2 == 0) || (rngResult = Random(), rngResult % 0x32 != 0)) goto LAB_007bb58c;
|
|
pvVar6 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU)) < 0x51)
|
|
goto LAB_007bad98;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x50));
|
|
LAB_007bad9f:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x4))) = GHIDRA_CAST<undefined1 *>(0x0);
|
|
LAB_007bada9:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_94)) + 0x8))) = 0x96;
|
|
local_88 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
tmpPlayer = GetMainPlayer(game);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&tmpPlayer->_temporaryeffects)))->TemporaryEffects::AddEffect(local_94,1,1);
|
|
}
|
|
LAB_007bb58c:
|
|
game = g_game;
|
|
LAB_007bb592:
|
|
fVar9 = sin((float)game->_frameCount * 0.2);
|
|
(game->_posOffset).y = fVar9 + fVar9;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007bb5e0
|
|
void Entity_Player::coop_baby_death_effect()
|
|
{
|
|
Vector velocity;
|
|
Vector targetPos;
|
|
qword qVar1;
|
|
qword qVar2;
|
|
uint rngValue;
|
|
Vector *spawnPos;
|
|
Entity *spawned;
|
|
BitSet128 *pBVar3;
|
|
int *effect;
|
|
undefined4 extraout_EAX;
|
|
int iVar4;
|
|
float fVar5;
|
|
undefined1 auStack_58 [4];
|
|
float local_54;
|
|
Entity_Player *local_50;
|
|
float local_4c;
|
|
undefined1 local_48 [16];
|
|
Color effectColor;
|
|
uint local_c;
|
|
Game *game;
|
|
undefined4 temp_10305fbffd8d0a;
|
|
undefined4 temp_12305fbffd8d0a;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(auStack_58);
|
|
iVar4 = this->_babySkin;
|
|
local_50 = this;
|
|
if (iVar4 == 0) {
|
|
rngValue = Random();
|
|
iVar4 = rngValue % 3 + 1;
|
|
if (iVar4 != 0) {
|
|
do {
|
|
rngValue = Random();
|
|
fVar5 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_50 = GHIDRA_CAST<Entity_Player *>((fVar5 + fVar5));
|
|
rngValue = Random();
|
|
local_54 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)])
|
|
* 2.3283064e-10 * 40.0;
|
|
fVar5 = cos((float)local_50);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_48)) + 0x0))) = fVar5 * local_54 + (this->_pos).x;
|
|
fVar5 = sin((float)local_50);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_48)) + 0x4))) = fVar5 * local_54 + (this->_pos).y;
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
spawn_blue_spider(GHIDRA_CAST<Vector *>(local_48),GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 == 1) {
|
|
rngValue = Random();
|
|
game = g_game;
|
|
spawnPos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::FindFreeTilePosition(GHIDRA_CAST<Vector *>(local_48),&local_50->_pos,0.0);
|
|
(GHIDRA_CAST<Game *>((game)))->Game::SpawnEx(5,10,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_50),0,rngValue,0);
|
|
return;
|
|
}
|
|
if (iVar4 == 3) {
|
|
iVar4 = 0;
|
|
do {
|
|
local_54 = (float)iVar4 * 0.017453292;
|
|
fVar5 = cos(local_54);
|
|
local_50 = GHIDRA_CAST<Entity_Player *>((fVar5 * 10.0));
|
|
local_4c = sin(local_54);
|
|
local_4c = local_4c * 10.0;
|
|
velocity.y = local_4c;
|
|
velocity.x = (float)local_50;
|
|
FireTear(this,&this->_pos,velocity,3,GHIDRA_CAST<Entity *>(0x0),1.0);
|
|
iVar4 = iVar4 + 0x2d;
|
|
} while (iVar4 < 0x168);
|
|
return;
|
|
}
|
|
if (iVar4 == 6) {
|
|
rngValue = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(4,3,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,rngValue,0);
|
|
iVar4 = __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0);
|
|
if (iVar4 != 0) {
|
|
pBVar3 = GetBombFlags(this,GHIDRA_CAST<BitSet128 *>(local_48),0);
|
|
qVar1 = pBVar3->_l;
|
|
temp_10305fbffd8d0a = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar3->_l) + 4));
|
|
qVar2 = pBVar3->_h;
|
|
temp_12305fbffd8d0a = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar3->_h) + 4));
|
|
*GHIDRA_CAST<undefined1 *>((iVar4 + 0x463)) = 1;
|
|
*GHIDRA_CAST<int *>((iVar4 + 0x438)) = GHIDRA_INT(qVar1);
|
|
*GHIDRA_CAST<undefined4 *>((iVar4 + 0x43c)) = temp_10305fbffd8d0a;
|
|
*GHIDRA_CAST<int *>((iVar4 + 0x440)) = GHIDRA_INT(qVar2);
|
|
*GHIDRA_CAST<undefined4 *>((iVar4 + 0x444)) = temp_12305fbffd8d0a;
|
|
return;
|
|
}
|
|
}
|
|
else if (iVar4 == 9) {
|
|
rngValue = Random();
|
|
iVar4 = rngValue % 3 + 1;
|
|
if (iVar4 != 0) {
|
|
do {
|
|
Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>(local_48),&this->_pos,100.0,0,0,0);
|
|
targetPos.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_48)) + 0x4)));
|
|
targetPos.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_48)) + 0x0)));
|
|
Entity_NPC::ThrowSpider(&this->_pos,GHIDRA_CAST<Entity *>(this),targetPos,0,-30.0);
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
return;
|
|
}
|
|
}
|
|
else if (iVar4 == 0xf) {
|
|
rngValue = Random();
|
|
local_54 = (float)(rngValue % 3 + 1);
|
|
if (local_54 != 0.0) {
|
|
do {
|
|
rngValue = Random();
|
|
spawnPos = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>(local_48),&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,0x14,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,rngValue,0);
|
|
local_54 = (float)(GHIDRA_INT(local_54) + -1);
|
|
} while (local_54 != 0.0);
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 == 0x13) {
|
|
rngValue = Random();
|
|
game = g_game;
|
|
spawnPos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::FindFreeTilePosition(GHIDRA_CAST<Vector *>(local_48),&local_50->_pos,0.0);
|
|
(GHIDRA_CAST<Game *>((game)))->Game::SpawnEx(5,0x28,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,rngValue,0);
|
|
return;
|
|
}
|
|
if (iVar4 == 10) {
|
|
rngValue = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x25,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,rngValue
|
|
,0);
|
|
effect = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
|
|
,&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0
|
|
));
|
|
(GHIDRA_CAST<Color *>((&effectColor)))->Color::Color();
|
|
(**(code **)(*effect + 0x3c))(extraout_EAX,0xffffffff,0xff,0,1);
|
|
(**(code **)(*effect + 0xc))();
|
|
return;
|
|
}
|
|
if (iVar4 == 0xe) {
|
|
rngValue = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,0,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,rngValue,0);
|
|
return;
|
|
}
|
|
if (iVar4 == 0x16) {
|
|
rngValue = Random();
|
|
AddBlueFlies(this,rngValue % 3 + 1,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
return;
|
|
}
|
|
if ((iVar4 == 2) || (iVar4 == 0x37)) {
|
|
effect = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14))));
|
|
if (effect == GHIDRA_CAST<int *>(0x0)) {
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 == 0x17) {
|
|
rngValue = Random();
|
|
game = g_game;
|
|
spawnPos = Room::FindFreeTilePosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>(local_48),&local_50->_pos,0.0);
|
|
(GHIDRA_CAST<Game *>((game)))->Game::SpawnEx(5,10,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_50),2,rngValue,0);
|
|
return;
|
|
}
|
|
if (iVar4 == 0x2e) {
|
|
UseCard(this,0x14,0);
|
|
return;
|
|
}
|
|
if (iVar4 != 0x38) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) == GHIDRA_CAST<int *>(0x0)) {
|
|
return;
|
|
}
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) + 0x28))();
|
|
effect = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b14)))) + 0x3c0));
|
|
if (effect == GHIDRA_CAST<int *>(0x0)) {
|
|
return;
|
|
}
|
|
if (effect[10] != 3) {
|
|
return;
|
|
}
|
|
if (effect[0xb] != 0x21) {
|
|
return;
|
|
}
|
|
}
|
|
(**(code **)(*effect + 0x28))();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007bc740
|
|
void Entity_Player::InitPostLevelInitStats()
|
|
{
|
|
code *pcVar1;
|
|
int *piVar2;
|
|
byte bVar3;
|
|
char cVar4;
|
|
PersistentGameData *pPVar5;
|
|
Entity_Player *tmpPlayer;
|
|
int iVar6;
|
|
ItemConfig_Item *collectibleConfig;
|
|
void *pvVar7;
|
|
Entity *familiar;
|
|
byte shift2;
|
|
byte shift3;
|
|
ColorMod *other;
|
|
NetplayManager *netplayManager;
|
|
undefined4 *playerList;
|
|
void *collectibles;
|
|
Game *extraout_EDX;
|
|
Game *extraout_EDX_00;
|
|
Game *extraout_EDX_01;
|
|
Game *pGVar8;
|
|
Game *extraout_EDX_02;
|
|
uint uVar9;
|
|
uint uVar10;
|
|
uint uVar11;
|
|
Entity_Player *pEVar12;
|
|
int *piVar13;
|
|
int iVar14;
|
|
int *piVar15;
|
|
ChallengeParam *pCVar16;
|
|
undefined1 local_120 [8];
|
|
int local_118;
|
|
undefined1 local_114 [8];
|
|
int local_10c;
|
|
ulonglong deviceUserId;
|
|
ulonglong playerUserId;
|
|
undefined4 razorBladeId;
|
|
undefined4 woodenNickelId;
|
|
undefined4 d6Id;
|
|
int tmpEffect [3];
|
|
undefined4 local_e0;
|
|
undefined8 local_dc;
|
|
uint local_d4;
|
|
ChallengeParam *local_d0;
|
|
RNG rng;
|
|
uint local_bc;
|
|
ChallengeParam *pCStack_b8;
|
|
ItemConfig *local_b4;
|
|
int rngShift3;
|
|
uint local_ac;
|
|
uint uStack_a8;
|
|
PersistentGameData *local_a4;
|
|
undefined4 dailyItemId1;
|
|
undefined4 dailyItemId2;
|
|
undefined4 dailyItemId3;
|
|
PersistentGameData *local_94;
|
|
uint local_90;
|
|
Entity_Player *playerCopy;
|
|
undefined4 dailyItemId4;
|
|
int *itemsBegin;
|
|
int *itemsEnd;
|
|
int *itemsCapacity;
|
|
Manager *local_78;
|
|
int *local_74;
|
|
Color tintColor;
|
|
RNG cardRng;
|
|
RNG local_34;
|
|
RNG tmpRng;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Entity_Player *twin;
|
|
Manager *manager;
|
|
|
|
pGVar8 = g_game;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00affeb0;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
uVar9 = this->_initSeed;
|
|
rng._shift1 = 1;
|
|
rng._shift2 = 5;
|
|
rngShift3 = 0x13;
|
|
rng._shift3 = 0x13;
|
|
rng._seed = uVar9;
|
|
local_90 = uVar9;
|
|
playerCopy = this;
|
|
local_d0 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
uStack_a8 = playerCopy->_playerType;
|
|
if ((GHIDRA_INT(uStack_a8) < 0) ||
|
|
((GHIDRA_INT((g_manager->_entityConfig)._players._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148 <= GHIDRA_INT(uStack_a8))) {
|
|
local_a4 = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
LAB_007bc81f:
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Could not load config for player type %d\n"));
|
|
pGVar8 = g_game;
|
|
}
|
|
else {
|
|
local_a4 = (PersistentGameData *)
|
|
(uStack_a8 * 0x148 + GHIDRA_INT((g_manager->_entityConfig)._players._begin));
|
|
if (local_a4 == GHIDRA_CAST<PersistentGameData *>(0x0)) goto LAB_007bc81f;
|
|
}
|
|
pEVar12 = playerCopy;
|
|
manager = g_manager;
|
|
pCStack_b8 = GHIDRA_CAST<ChallengeParam *>(pGVar8->_frameCount);
|
|
local_94 = &g_manager->_persistentGameData;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
iVar14 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((playerCopy)) + 0x1e50))));
|
|
if (iVar14 == 0) {
|
|
local_dc = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_dc)) + 0x4))) = GHIDRA_CAST<ItemConfig *>(0x0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_dc)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(playerUserId)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_dc)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(playerUserId)) + 0x0))) = GHIDRA_UINT(local_dc);
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(playerUserId)) + 0x4))) = *GHIDRA_CAST<ItemConfig **>((iVar14 + 0xc));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(playerUserId)) + 0x0))) = *GHIDRA_CAST<uint *>((iVar14 + 8));
|
|
}
|
|
local_b4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(playerUserId)) + 0x4)));
|
|
uStack_a8 = GHIDRA_UINT(playerUserId);
|
|
FUN_00731ee0(local_114,&playerUserId);
|
|
if ((((*GHIDRA_CAST<char *>((local_10c + 0xd)) == '\0') && (*GHIDRA_CAST<undefined1 **>((local_10c + 0x14)) <= local_b4))
|
|
&& ((*GHIDRA_CAST<undefined1 **>((local_10c + 0x14)) < local_b4 ||
|
|
(*GHIDRA_CAST<uint *>((local_10c + 0x10)) <= uStack_a8)))) &&
|
|
((local_10c != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xc0)))) &&
|
|
(pPVar5 = GHIDRA_CAST<PersistentGameData *>(FUN_00914150(&playerUserId)),
|
|
pPVar5 != GHIDRA_CAST<PersistentGameData *>(0x0))))) {
|
|
local_94 = pPVar5;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar12)) + 0x1e50)))) == 0) {
|
|
local_dc = 0;
|
|
}
|
|
KAGE_LogMessage(4,(byte *)
|
|
"Entity_Player::InitPostLevelInitStats -> Failed to find save data for player %llu, this will incorrectly use the local save data for this player!\n"
|
|
);
|
|
}
|
|
pGVar8 = g_game;
|
|
}
|
|
manager = g_manager;
|
|
bVar3 = (GHIDRA_CAST<TemporaryEffects *>((&playerCopy->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x29b);
|
|
pEVar12 = playerCopy;
|
|
if (bVar3 != 0) {
|
|
EvaluateItems(playerCopy);
|
|
tmpPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
ConsumableCountChanged(tmpPlayer,-1);
|
|
goto LAB_007bea6e;
|
|
}
|
|
iVar14 = *GHIDRA_CAST<int *>((local_a4->_achievements + 0x90));
|
|
if (iVar14 == 0) {
|
|
iVar14 = *GHIDRA_CAST<int *>((local_a4->_achievements + 0x94));
|
|
if (iVar14 == 0) {
|
|
if (playerCopy->_playerType == 1) {
|
|
if ((local_94->_achievements[0x14c] != 0) ||
|
|
(((manager->_state == 2 && (pGVar8 != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((pGVar8->_dailyChallenge)._id != 0 || (pGVar8->_isDebug != 0)))))) {
|
|
uVar11 = (GHIDRA_CAST<ItemPool *>((&pGVar8->_itemPool)))->ItemPool::ForceAddPillEffect(5);
|
|
uVar10 = 0;
|
|
do {
|
|
uStack_a8 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::ForceAddPillEffect(7);
|
|
if ((uVar11 != uStack_a8) ||
|
|
(uVar11 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::ForceAddPillEffect(5), uVar11 != uStack_a8))
|
|
break;
|
|
uVar10 = uVar10 + 1;
|
|
} while (uVar10 < 10);
|
|
AddPocketItem(playerCopy,uVar11,0);
|
|
uVar10 = -GHIDRA_UINT(((uVar11 & 0x7ff) != 0)) & uVar11 & 0x7ff;
|
|
uVar11 = 0xe;
|
|
if (uVar10 < 0xe) {
|
|
uVar11 = uVar10;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((&g_game->_itemPool + 1)) + uVar11 + 0x3c)) = 1;
|
|
}
|
|
pEVar12 = playerCopy;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar14 < 1) {
|
|
iVar14 = ItemPool::GetPill(playerCopy->_initSeed);
|
|
}
|
|
AddPocketItem(pEVar12,iVar14,0);
|
|
}
|
|
}
|
|
else if (iVar14 < 1) {
|
|
iVar14 = playerCopy->_initSeed;
|
|
iVar6 = ItemPool::GetCardEx(iVar14,0x19,10,10,1);
|
|
cardRng._shift1 = 5;
|
|
cardRng._shift2 = 9;
|
|
cardRng._shift3 = 7;
|
|
cardRng._seed = iVar14;
|
|
iVar14 = lua_callback_run_get_card(&cardRng,iVar6,1,1,0);
|
|
AddPocketItem(pEVar12,iVar14,1);
|
|
uVar9 = local_90;
|
|
}
|
|
else {
|
|
AddPocketItem(playerCopy,iVar14,1);
|
|
}
|
|
std::vector<int>::copy_constructor(local_a4->_achievements + 0x9c);
|
|
pPVar5 = local_94;
|
|
local_8 = 0;
|
|
if (g_game->_challenge == 0) {
|
|
if ((pEVar12->_playerType == 0) &&
|
|
((local_94->_achievements[0x1d] != 0 ||
|
|
((g_manager->_state == 2 &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
d6Id = 0x69;
|
|
if (itemsEnd == itemsCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(itemsEnd,&d6Id);
|
|
}
|
|
else {
|
|
*itemsEnd = 0x69;
|
|
itemsEnd = itemsEnd + 1;
|
|
}
|
|
}
|
|
if ((pEVar12->_playerType == 0xe) &&
|
|
((pPVar5->_achievements[0xec] != 0 ||
|
|
(((g_manager->_state == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
woodenNickelId = 0x15d;
|
|
if (itemsEnd == itemsCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(itemsEnd,&woodenNickelId);
|
|
}
|
|
else {
|
|
*itemsEnd = 0x15d;
|
|
itemsEnd = itemsEnd + 1;
|
|
}
|
|
}
|
|
if ((pEVar12->_playerType == 5) &&
|
|
((pPVar5->_achievements[0xf8] != 0 ||
|
|
(((g_manager->_state == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
razorBladeId = 0x7e;
|
|
if (itemsEnd == itemsCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(itemsEnd,&razorBladeId);
|
|
}
|
|
else {
|
|
*itemsEnd = 0x7e;
|
|
itemsEnd = itemsEnd + 1;
|
|
}
|
|
}
|
|
}
|
|
switch((g_game->_dailyChallenge)._specialDailyId) {
|
|
case 1:
|
|
AddBombs(pEVar12,99);
|
|
break;
|
|
case 3:
|
|
pEVar12->_luckModifier = pEVar12->_luckModifier + 7;
|
|
dailyItemId2 = 0x17e;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
dailyItemId1 = 200;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
dailyItemId3 = 0x3f;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
break;
|
|
case 5:
|
|
piVar15 = GHIDRA_CAST<int *>((GHIDRA_INT((pEVar12->_pillEffectUses)._begin) + 0x48));
|
|
*piVar15 = *piVar15 + 0x12;
|
|
pEVar12->_cacheFlags = pEVar12->_cacheFlags | 0x400;
|
|
(GHIDRA_CAST<Color *>((&tintColor)))->Color::Color();
|
|
tintColor._colorize[0] = 0.0;
|
|
tintColor._colorize[1] = 1.0;
|
|
tintColor._colorize[2] = 0.0;
|
|
tintColor._colorize[3] = 0.6;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar12)) + 0x16e0)))))))->Color::operator_assign(other);
|
|
pEVar12->SetColor(&tintColor,1,0xff,0,1);
|
|
break;
|
|
case 6:
|
|
dailyItemId3 = 0x8a;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 7;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
dailyItemId1 = 0x53;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
break;
|
|
case 8:
|
|
dailyItemId3 = 0x1f;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 0x29;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
dailyItemId1 = 0x37;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
break;
|
|
case 9:
|
|
dailyItemId3 = 0xa3;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 0x43;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
dailyItemId1 = 8;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
dailyItemId4 = 0x10c;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x109);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
local_74 = GHIDRA_CAST<int *>(0xf7);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
break;
|
|
case 10:
|
|
local_74 = GHIDRA_CAST<int *>(0xaf);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0xaa);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x74;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0xb:
|
|
local_74 = GHIDRA_CAST<int *>(0xbf);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x1a2);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0xae;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0xc:
|
|
local_74 = GHIDRA_CAST<int *>(0x34);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x16e);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x14a;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x247;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
break;
|
|
case 0xd:
|
|
dailyItemId1 = 0x1a8;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
break;
|
|
case 0xe:
|
|
itemsEnd = itemsBegin;
|
|
dailyItemId1 = 0x51;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
break;
|
|
case 0x10:
|
|
dailyItemId1 = 0x30;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
break;
|
|
case 0x11:
|
|
dailyItemId1 = 0x84;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
dailyItemId2 = 0xad;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
break;
|
|
case 0x12:
|
|
dailyItemId2 = 0x5d;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) >> 2 < 0x24) {
|
|
AddCostume(pEVar12,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
}
|
|
else {
|
|
AddCostume(pEVar12,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x8c)),0);
|
|
}
|
|
break;
|
|
case 0x13:
|
|
dailyItemId2 = 0x84;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
dailyItemId1 = 0x4a;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
AddKeys(pEVar12,1);
|
|
break;
|
|
case 0x14:
|
|
local_74 = GHIDRA_CAST<int *>(0x91);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x86);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0xd4;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x16:
|
|
local_74 = GHIDRA_CAST<int *>(0x17a);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(&DAT_00000006);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0xd1;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x123;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
break;
|
|
case 0x17:
|
|
local_74 = GHIDRA_CAST<int *>(0x96);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x1be);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x56;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x18:
|
|
local_74 = GHIDRA_CAST<int *>(0x14a);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x1b4);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x19:
|
|
local_74 = GHIDRA_CAST<int *>(0x174);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x74);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x3f;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x164;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 0x8b;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
break;
|
|
case 0x1a:
|
|
local_74 = GHIDRA_CAST<int *>(0x19d);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x186);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 499;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x1b:
|
|
local_74 = GHIDRA_CAST<int *>(&DAT_00000068);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x18d);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x1c9;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x1d:
|
|
local_74 = GHIDRA_CAST<int *>(&DAT_00000043);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(&DAT_00000008);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0xa3;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 99;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 100;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
dailyItemId1 = 0x142;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId1);
|
|
break;
|
|
case 0x1e:
|
|
local_74 = GHIDRA_CAST<int *>(0x111);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x13c);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x173;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x51;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 0x81;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
break;
|
|
case 0x1f:
|
|
local_74 = GHIDRA_CAST<int *>(0xb4);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x1bf);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x1e4;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x74;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
break;
|
|
case 0x20:
|
|
local_74 = GHIDRA_CAST<int *>(0x44);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x243);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x21:
|
|
local_74 = GHIDRA_CAST<int *>(0x11a);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x13a);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x22:
|
|
local_74 = GHIDRA_CAST<int *>(0x1a8);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0xa6);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x23:
|
|
local_74 = GHIDRA_CAST<int *>(0xd2);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x24);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x178;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x24:
|
|
local_74 = GHIDRA_CAST<int *>(0x12);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
break;
|
|
case 0x25:
|
|
local_74 = GHIDRA_CAST<int *>(0x7f);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
break;
|
|
case 0x26:
|
|
local_74 = GHIDRA_CAST<int *>(0x1e0);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x97);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x10c;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x27:
|
|
local_74 = GHIDRA_CAST<int *>(0xf5);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x7b);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x5f;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x28:
|
|
local_74 = GHIDRA_CAST<int *>(0x76);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x26);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0xdd;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x139;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
dailyItemId2 = 3;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId2);
|
|
break;
|
|
case 0x2a:
|
|
local_74 = GHIDRA_CAST<int *>(0xb6);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0xb3);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x176;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x2b:
|
|
local_74 = GHIDRA_CAST<int *>(0xe8);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x151);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x2d:
|
|
local_74 = GHIDRA_CAST<int *>(0x13a);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x81);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x2e:
|
|
local_74 = GHIDRA_CAST<int *>(0x34);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x16e);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x2f:
|
|
local_74 = GHIDRA_CAST<int *>(0x192);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
break;
|
|
case 0x30:
|
|
local_74 = GHIDRA_CAST<int *>(0x9c);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x11e);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x4a;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x4b;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
break;
|
|
case 0x31:
|
|
local_74 = GHIDRA_CAST<int *>(0x13c);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x173);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x16e;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
dailyItemId3 = 0x111;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId3);
|
|
break;
|
|
case 0x32:
|
|
local_74 = GHIDRA_CAST<int *>(0x11e);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x4b);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
dailyItemId4 = 0x9c;
|
|
std::vector<unsigned_int>::push_back(&dailyItemId4);
|
|
break;
|
|
case 0x33:
|
|
local_74 = GHIDRA_CAST<int *>(0xf9);
|
|
std::vector<unsigned_int>::push_back(&local_74);
|
|
local_78 = GHIDRA_CAST<Manager *>(0x19e);
|
|
std::vector<unsigned_int>::push_back(&local_78);
|
|
break;
|
|
case 0x34:
|
|
itemsEnd = itemsBegin;
|
|
}
|
|
pEVar12 = playerCopy;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
uVar11 = 0;
|
|
uStack_a8 = GHIDRA_INT(itemsEnd) - GHIDRA_INT(itemsBegin) >> 2;
|
|
if (uStack_a8 != 0) {
|
|
do {
|
|
uVar9 = itemsBegin[uVar11];
|
|
AddCollectible(pEVar12,uVar9,-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar9,0,0);
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar9)) goto LAB_007bd89b;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar9) < 0) {
|
|
if ((GHIDRA_INT(uVar9) < 0) &&
|
|
(pvVar7 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar9) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar7) >> 2)) {
|
|
iVar14 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar7) + ~uVar9 * 4));
|
|
}
|
|
else {
|
|
iVar14 = 0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007bd89b:
|
|
pvVar7 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar7) >> 2 <= GHIDRA_INT(uVar9))
|
|
goto LAB_007bd8ee;
|
|
iVar14 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + uVar9 * 4));
|
|
}
|
|
if (iVar14 != 0) {
|
|
tmpEffect[2] = *GHIDRA_CAST<int *>((iVar14 + 0x78));
|
|
tmpEffect[1] = 0;
|
|
local_e0 = 0;
|
|
tmpEffect[0] = iVar14;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar12->_temporaryeffects)))->TemporaryEffects::RemoveEffect(tmpEffect,1);
|
|
}
|
|
}
|
|
LAB_007bd8ee:
|
|
uVar11 = uVar11 + 1;
|
|
} while (uVar11 < uStack_a8);
|
|
uVar9 = local_90;
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Tidy(&itemsBegin);
|
|
pEVar12 = playerCopy;
|
|
apply_innate_collectibles(playerCopy);
|
|
if (g_game->_challenge == 0x2c) {
|
|
SetPocketActiveItem(pEVar12,0x244,2,0);
|
|
pEVar12->_activeDesc[2]._varData = 0x14;
|
|
pGVar8 = extraout_EDX_00;
|
|
}
|
|
else {
|
|
pGVar8 = extraout_EDX;
|
|
if (*GHIDRA_CAST<int *>((local_a4->_achievements + 0xb8)) != 0) {
|
|
SetPocketActiveItem(pEVar12,*GHIDRA_CAST<int *>((local_a4->_achievements + 0xb8)),2,0);
|
|
pGVar8 = extraout_EDX_01;
|
|
}
|
|
}
|
|
iVar14 = *GHIDRA_CAST<int *>((local_a4->_achievements + 0xa8));
|
|
if (iVar14 != 0) goto LAB_007bdacf;
|
|
if (g_game->_challenge == 0) {
|
|
iVar6 = pEVar12->_playerType;
|
|
if (iVar6 == 0xe) {
|
|
if ((local_94->_achievements[0xed] != 0) ||
|
|
((g_manager->_state == 2 &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
iVar14 = 0x53;
|
|
}
|
|
}
|
|
else if (iVar6 == 2) {
|
|
if ((local_94->_achievements[0xf5] != 0) ||
|
|
((g_manager->_state == 2 &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
iVar14 = 0x13;
|
|
}
|
|
}
|
|
else if ((iVar6 == 6) &&
|
|
((local_94->_achievements[0x14e] != 0 ||
|
|
((g_manager->_state == 2 &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
iVar14 = 0x22;
|
|
}
|
|
}
|
|
pGVar8 = g_game;
|
|
switch((g_game->_dailyChallenge)._specialDailyId) {
|
|
case 4:
|
|
iVar14 = 0x3d;
|
|
break;
|
|
default:
|
|
if (iVar14 != 0) break;
|
|
goto LAB_007bdb1f;
|
|
case 0x12:
|
|
iVar14 = 8;
|
|
break;
|
|
case 0x19:
|
|
iVar14 = 3;
|
|
AddTrinket(pEVar12,0x48,1);
|
|
pGVar8 = g_game;
|
|
pvVar7 = (g_game->_itemPool)._trinketPoolItems._begin;
|
|
if (((0x48 < GHIDRA_INT((g_game->_itemPool)._trinketPoolItems._end) - GHIDRA_INT(pvVar7) >> 3) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar7) + 0x244)) != '\0')) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar7) + 0x245)) != '\0')) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(pvVar7) + 0x244)) = 0;
|
|
piVar15 = &(pGVar8->_itemPool)._numAvailableTrinkets;
|
|
*piVar15 = *piVar15 + -1;
|
|
}
|
|
break;
|
|
case 0x1e:
|
|
case 0x31:
|
|
iVar14 = 0x35;
|
|
}
|
|
LAB_007bdacf:
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
AddTrinket(pEVar12,iVar14,1);
|
|
pGVar8 = g_game;
|
|
if (((0 < iVar14) &&
|
|
(pvVar7 = (g_game->_itemPool)._trinketPoolItems._begin,
|
|
iVar14 < GHIDRA_INT((g_game->_itemPool)._trinketPoolItems._end) - GHIDRA_INT(pvVar7) >> 3)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar7) + iVar14 * 8 + 4)) != '\0' &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar7) + iVar14 * 8 + 5)) != '\0')))) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(pvVar7) + iVar14 * 8 + 4)) = 0;
|
|
piVar15 = &(pGVar8->_itemPool)._numAvailableTrinkets;
|
|
*piVar15 = *piVar15 + -1;
|
|
}
|
|
}
|
|
LAB_007bdb1f:
|
|
pPVar5 = local_a4;
|
|
if (*GHIDRA_CAST<int *>((local_a4->_achievements + 0x90)) == 0) {
|
|
iVar14 = (g_game->_dailyChallenge)._specialDailyId;
|
|
if (iVar14 == 0x27) {
|
|
iVar14 = 0x31;
|
|
}
|
|
else if (iVar14 == 0x30) {
|
|
iVar14 = 0x15;
|
|
}
|
|
else {
|
|
if (iVar14 != 0x32) goto LAB_007bdb5f;
|
|
iVar14 = 0xc;
|
|
}
|
|
AddPocketItem(pEVar12,iVar14,1);
|
|
pGVar8 = extraout_EDX_02;
|
|
}
|
|
LAB_007bdb5f:
|
|
local_94 = (PersistentGameData *)
|
|
CONCAT31((int3)(GHIDRA_UINT(pGVar8) >> 8),*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2);
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) &&
|
|
(g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1)))) {
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&local_dc,pEVar12->_controllerIndex);
|
|
local_8 = 1;
|
|
if (GHIDRA_UINT(local_dc) != 0) {
|
|
iVar14 = __RTDynamicCast(GHIDRA_UINT(local_dc),0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0);
|
|
if (iVar14 != 0) {
|
|
iVar14 = *GHIDRA_CAST<int *>((iVar14 + 0x374));
|
|
if (iVar14 == 0) {
|
|
local_ac = 0;
|
|
uVar11 = local_ac;
|
|
uStack_a8 = 0;
|
|
local_ac = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deviceUserId)) + 0x0))) = local_ac;
|
|
uVar10 = uStack_a8;
|
|
local_ac = uVar11;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deviceUserId)) + 0x0))) = *GHIDRA_CAST<uint *>((iVar14 + 8));
|
|
uVar10 = *GHIDRA_CAST<uint *>((iVar14 + 0xc));
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deviceUserId)) + 0x4))) = uVar10;
|
|
uStack_a8 = GHIDRA_UINT(deviceUserId);
|
|
FUN_00731ee0(local_120,&deviceUserId);
|
|
if (((*GHIDRA_CAST<char *>((local_118 + 0xd)) != '\0') || (uVar10 < *GHIDRA_CAST<uint *>((local_118 + 0x14)))) ||
|
|
((uVar10 <= *GHIDRA_CAST<uint *>((local_118 + 0x14)) && (uStack_a8 < *GHIDRA_CAST<uint *>((local_118 + 0x10)))))) {
|
|
local_118 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xc8))));
|
|
}
|
|
local_94 = GHIDRA_CAST<PersistentGameData *>((GHIDRA_UINT(local_94) & 0xff));
|
|
if (local_118 != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xc8))))) {
|
|
local_94 = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
}
|
|
pPVar5 = local_a4;
|
|
}
|
|
}
|
|
local_8 = 2;
|
|
if ((((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_dc)) + 0x4))) != GHIDRA_CAST<ItemConfig *>(0x0)) &&
|
|
(cVar4 = (**(code **)(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_dc))) + 0x4))) + 0xc))(), cVar4 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&local_dc);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
if (((char)local_94 != '\0') && ((*GHIDRA_CAST<int *>(pPVar5) == 9 || (*GHIDRA_CAST<int *>(pPVar5) == 0x1e)))) {
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
bVar3 = (byte)rng._shift1;
|
|
uVar9 = uVar9 >> (bVar3 & 0x1f) ^ uVar9;
|
|
shift2 = (byte)rng._shift2;
|
|
uVar9 = uVar9 << (shift2 & 0x1f) ^ uVar9;
|
|
shift3 = (byte)rngShift3;
|
|
uVar9 = uVar9 >> (shift3 & 0x1f) ^ uVar9;
|
|
if (uVar9 == (uVar9 / 3) * 3) {
|
|
bVar3 = 1;
|
|
uVar11 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetTrinket(0);
|
|
AddTrinket(pEVar12,uVar11,bVar3);
|
|
}
|
|
else {
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar9 = uVar9 >> (bVar3 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << (shift2 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 >> (shift3 & 0x1f) ^ uVar9;
|
|
if ((uVar9 & 1) == 0) {
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar9 = uVar9 >> (bVar3 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << (shift2 & 0x1f) ^ uVar9;
|
|
rng._seed = uVar9 >> (shift3 & 0x1f) ^ uVar9;
|
|
if ((rng._seed & 1U) == 0) {
|
|
uVar9 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
iVar14 = ItemPool::GetCardEx(uVar9,0x19,0,0,1);
|
|
tmpRng._shift1 = 5;
|
|
tmpRng._shift2 = 9;
|
|
tmpRng._shift3 = 7;
|
|
tmpRng._seed = uVar9;
|
|
iVar14 = lua_callback_run_get_card(&tmpRng,iVar14,0,0,0);
|
|
AddPocketItem(pEVar12,iVar14,1);
|
|
}
|
|
else {
|
|
uVar9 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
iVar14 = ItemPool::GetPill(uVar9);
|
|
AddPocketItem(pEVar12,iVar14,0);
|
|
}
|
|
uVar9 = rng._seed;
|
|
rngShift3 = rng._shift3;
|
|
}
|
|
}
|
|
local_90 = 0;
|
|
local_94 = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
uStack_a8 = 100;
|
|
do {
|
|
uVar11 = (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2) - 1;
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar9 = uVar9 >> ((byte)rng._shift1 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << ((byte)rng._shift2 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 >> ((byte)rngShift3 & 0x1f) ^ uVar9;
|
|
uVar10 = 0;
|
|
if (uVar11 != 0) {
|
|
uVar10 = uVar9 % uVar11;
|
|
}
|
|
uVar10 = uVar10 + 1;
|
|
local_b4 = &g_manager->_itemConfig;
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar10)) goto LAB_007bdf2c;
|
|
LAB_007bdf3f:
|
|
piVar15 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(uVar10) < 0) {
|
|
if ((GHIDRA_INT(uVar10) < 0) &&
|
|
(pvVar7 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar10) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar7) >> 2)) {
|
|
piVar15 = GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar7) + ~uVar10 * 4)));
|
|
}
|
|
else {
|
|
piVar15 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_007bdf2c:
|
|
pvVar7 = (local_b4->_collectibles)._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar7) >> 2 <= GHIDRA_INT(uVar10))
|
|
goto LAB_007bdf3f;
|
|
piVar15 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar7) + uVar10 * 4));
|
|
}
|
|
rng._seed = uVar9;
|
|
if (((((uVar10 != 0) &&
|
|
(GHIDRA_INT(uVar10) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((local_b4->_collectibles)._begin) >> 2)) && (uVar10 != 0xeb)) &&
|
|
((uVar10 != 0x2b && (uVar10 != 0x3d)))) &&
|
|
((collectibleConfig = (GHIDRA_CAST<ItemConfig *>((local_b4)))->ItemConfig::GetCollectible(uVar10),
|
|
collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0) && ((piVar15[0x2f] & 1U) == 0)))) {
|
|
bVar3 = (GHIDRA_CAST<Item *>((piVar15)))->Item::IsAvailable(0xffffffff);
|
|
if (bVar3 != 0) {
|
|
if (*piVar15 == 3) {
|
|
if (local_94 == GHIDRA_CAST<PersistentGameData *>(0x0)) {
|
|
local_94 = GHIDRA_CAST<PersistentGameData *>(uVar10);
|
|
}
|
|
}
|
|
else if (local_90 == 0) {
|
|
local_90 = uVar10;
|
|
}
|
|
}
|
|
}
|
|
pEVar12 = playerCopy;
|
|
uVar11 = local_90;
|
|
uStack_a8 = uStack_a8 - 1;
|
|
} while (uStack_a8 != 0);
|
|
local_90 = uVar9;
|
|
if (local_94 != GHIDRA_CAST<PersistentGameData *>(0x0)) {
|
|
AddCollectible(playerCopy,GHIDRA_INT(local_94),-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,GHIDRA_INT(local_94),0,0);
|
|
}
|
|
if (uVar11 != 0) {
|
|
AddCollectible(pEVar12,uVar11,-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar11,0,0);
|
|
}
|
|
pEVar12 = playerCopy;
|
|
}
|
|
pCVar16 = local_d0;
|
|
if (local_d0->_isMegaSatan != 0) {
|
|
AddCollectible(pEVar12,0xee,0,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,0xee,0,0);
|
|
AddCollectible(pEVar12,0xef,0,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,0xef,0,0);
|
|
}
|
|
if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) {
|
|
if (pCStack_b8 == GHIDRA_CAST<ChallengeParam *>(0x0)) {
|
|
local_a4 = &g_manager->_persistentGameData;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
iVar14 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar12)) + 0x1e50))));
|
|
if (iVar14 == 0) {
|
|
local_bc = 0;
|
|
uVar11 = local_bc;
|
|
pCStack_b8 = GHIDRA_CAST<ChallengeParam *>(0x0);
|
|
local_bc = 0;
|
|
local_d4 = local_bc;
|
|
pCVar16 = pCStack_b8;
|
|
local_bc = uVar11;
|
|
}
|
|
else {
|
|
local_d4 = *GHIDRA_CAST<uint *>((iVar14 + 8));
|
|
pCVar16 = *GHIDRA_CAST<ChallengeParam **>((iVar14 + 0xc));
|
|
}
|
|
pCStack_b8 = GHIDRA_CAST<ChallengeParam *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xc0))));
|
|
local_d0 = pCVar16;
|
|
uStack_a8 = local_d4;
|
|
FUN_00731ee0(&local_34._shift1,&local_d4);
|
|
if ((((*GHIDRA_CAST<char *>((local_34._shift3 + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<ChallengeParam **>((local_34._shift3 + 0x14)) <= pCVar16)) &&
|
|
((*GHIDRA_CAST<ChallengeParam **>((local_34._shift3 + 0x14)) < pCVar16 ||
|
|
(*GHIDRA_CAST<uint *>((local_34._shift3 + 0x10)) <= uStack_a8)))) &&
|
|
(local_34._shift3 != *GHIDRA_CAST<int *>((pCStack_b8->_name)._buf))) {
|
|
local_a4 = GHIDRA_CAST<PersistentGameData *>(FUN_00914150(&local_d4));
|
|
}
|
|
else {
|
|
local_a4 = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
}
|
|
}
|
|
local_94 = GHIDRA_CAST<PersistentGameData *>(local_a4->_eventCounters[0x72]);
|
|
local_b4 = GHIDRA_CAST<ItemConfig *>((GHIDRA_UINT(local_94) >> 0x10));
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
local_b4 = GHIDRA_CAST<ItemConfig *>((GHIDRA_UINT(local_94) & 0xffff));
|
|
}
|
|
if (GHIDRA_CAST<ItemConfig *>(0x2) < local_b4) {
|
|
local_b4 = GHIDRA_CAST<ItemConfig *>(0x2);
|
|
}
|
|
if (local_b4 != GHIDRA_CAST<ItemConfig *>(0x0)) {
|
|
do {
|
|
uStack_a8 = 0;
|
|
LAB_007be1e0:
|
|
uVar11 = (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2) - 1;
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar9 = uVar9 >> ((byte)rng._shift1 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << ((byte)rng._shift2 & 0x1f) ^ uVar9;
|
|
rng._seed = uVar9 >> ((byte)rngShift3 & 0x1f) ^ uVar9;
|
|
uVar9 = 0;
|
|
if (uVar11 != 0) {
|
|
uVar9 = GHIDRA_UINT(rng._seed) % uVar11;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar9)) goto LAB_007be280;
|
|
LAB_007be29a:
|
|
piVar15 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(uVar9) < 0) {
|
|
if ((-1 < GHIDRA_INT(uVar9)) ||
|
|
(pvVar7 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar7) >> 2 <=
|
|
GHIDRA_INT(~uVar9))) goto LAB_007be29a;
|
|
piVar15 = GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar7) + ~uVar9 * 4)));
|
|
}
|
|
else {
|
|
LAB_007be280:
|
|
pvVar7 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar7) >> 2 <= GHIDRA_INT(uVar9))
|
|
goto LAB_007be29a;
|
|
piVar15 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar7) + uVar9 * 4));
|
|
}
|
|
local_90 = rng._seed;
|
|
if ((((uVar9 == 0) ||
|
|
(GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2 <= GHIDRA_INT(uVar9))) ||
|
|
(uVar9 == 0xeb)) ||
|
|
(((uVar9 == 0x2b || (uVar9 == 0x3d)) ||
|
|
((collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(uVar9),
|
|
collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0) || ((piVar15[0x2f] & 1U) != 0)))))) {
|
|
LAB_007be376:
|
|
uStack_a8 = uStack_a8 + 1;
|
|
pEVar12 = playerCopy;
|
|
if (99 < GHIDRA_INT(uStack_a8)) goto LAB_007be345;
|
|
uVar9 = local_90;
|
|
goto LAB_007be1e0;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Item *>((piVar15)))->Item::IsAvailable(0xffffffff);
|
|
pEVar12 = playerCopy;
|
|
if ((bVar3 == 0) || ((*piVar15 == 3 && (playerCopy->_activeDesc[0]._item != 0))))
|
|
goto LAB_007be376;
|
|
AddCollectible(playerCopy,uVar9,-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar9,0,0);
|
|
LAB_007be345:
|
|
local_b4 = GHIDRA_CAST<ItemConfig *>((GHIDRA_INT((local_b4 + -1)) + 0x10f));
|
|
if (local_b4 == GHIDRA_CAST<ItemConfig *>(0x0)) goto code_r0x007be352;
|
|
uVar9 = local_90;
|
|
} while( true );
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
twin = *GHIDRA_CAST<Entity_Player **>(&pEVar12->_twinPlayer);
|
|
if ((((twin == GHIDRA_CAST<Entity_Player *>(0x0)) || (twin->_playerIndex == -1)) ||
|
|
(pEVar12->_playerIndex <= twin->_playerIndex)) || (twin == pEVar12)) {
|
|
piVar15 = (pCVar16->_collectibleList)._begin;
|
|
if (piVar15 < (pCVar16->_collectibleList)._end) {
|
|
do {
|
|
iVar14 = *piVar15;
|
|
if (iVar14 < 0) {
|
|
RemoveCollectible(pEVar12,-iVar14,0,0,1);
|
|
}
|
|
else {
|
|
AddCollectible(pEVar12,iVar14,-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,*piVar15,0,0);
|
|
}
|
|
piVar15 = piVar15 + 1;
|
|
} while (piVar15 < (pCVar16->_collectibleList)._end);
|
|
}
|
|
piVar15 = (pCVar16->_trinketList)._begin;
|
|
if (piVar15 < (pCVar16->_trinketList)._end) {
|
|
do {
|
|
AddTrinket(pEVar12,*piVar15,1);
|
|
pGVar8 = g_game;
|
|
iVar14 = *piVar15;
|
|
if (((0 < iVar14) &&
|
|
(pvVar7 = (g_game->_itemPool)._trinketPoolItems._begin,
|
|
iVar14 < GHIDRA_INT((g_game->_itemPool)._trinketPoolItems._end) - GHIDRA_INT(pvVar7) >> 3)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar7) + iVar14 * 8 + 4)) != '\0' &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar7) + iVar14 * 8 + 5)) != '\0')))) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(pvVar7) + iVar14 * 8 + 4)) = 0;
|
|
piVar13 = &(pGVar8->_itemPool)._numAvailableTrinkets;
|
|
*piVar13 = *piVar13 + -1;
|
|
}
|
|
piVar15 = piVar15 + 1;
|
|
pCVar16 = local_d0;
|
|
} while (piVar15 < (local_d0->_trinketList)._end);
|
|
}
|
|
if (pCVar16->_startingPill != -1) {
|
|
uVar9 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::ForceAddPillEffect(pCVar16->_startingPill);
|
|
AddPocketItem(pEVar12,uVar9,0);
|
|
uVar11 = -GHIDRA_UINT(((uVar9 & 0x7ff) != 0)) & uVar9 & 0x7ff;
|
|
uVar9 = 0xe;
|
|
if (uVar11 < 0xe) {
|
|
uVar9 = uVar11;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((&g_game->_itemPool + 1)) + uVar9 + 0x3c)) = 1;
|
|
}
|
|
iVar14 = pCVar16->_startingCard;
|
|
if (iVar14 != 0) {
|
|
if (iVar14 == -1) {
|
|
if (local_90 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
local_90 = local_90 >> ((byte)rng._shift1 & 0x1f) ^ local_90;
|
|
local_90 = local_90 << ((byte)rng._shift2 & 0x1f) ^ local_90;
|
|
uVar9 = local_90 >> ((byte)rngShift3 & 0x1f) ^ local_90;
|
|
rng._seed = uVar9;
|
|
local_90 = uVar9;
|
|
iVar14 = ItemPool::GetCardEx(uVar9,0x19,0,0,1);
|
|
local_34._shift1 = 5;
|
|
local_34._shift2 = 9;
|
|
local_34._shift3 = 7;
|
|
local_34._seed = uVar9;
|
|
iVar14 = lua_callback_run_get_card(&local_34,iVar14,0,0,0);
|
|
AddPocketItem(pEVar12,iVar14,1);
|
|
goto LAB_007be608;
|
|
}
|
|
AddPocketItem(pEVar12,iVar14,1);
|
|
}
|
|
}
|
|
else {
|
|
piVar15 = (pCVar16->_collectibleTwinList)._begin;
|
|
if (piVar15 < (pCVar16->_collectibleTwinList)._end) {
|
|
do {
|
|
iVar14 = *piVar15;
|
|
if (iVar14 < 0) {
|
|
RemoveCollectible(pEVar12,-iVar14,0,0,1);
|
|
}
|
|
else {
|
|
AddCollectible(pEVar12,iVar14,-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,*piVar15,0,0);
|
|
}
|
|
piVar15 = piVar15 + 1;
|
|
} while (piVar15 < (pCVar16->_collectibleTwinList)._end);
|
|
}
|
|
}
|
|
}
|
|
LAB_007be602:
|
|
uVar9 = local_90;
|
|
goto LAB_007be608;
|
|
code_r0x007be352:
|
|
netplayManager = &g_manager->_netplayManager;
|
|
if (*netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
uVar11 = GHIDRA_UINT(local_94) & 0xffff0000;
|
|
}
|
|
else {
|
|
uVar11 = GHIDRA_UINT(local_94) & 0xffff;
|
|
}
|
|
local_a4->_eventCounters[0x72] = uVar11;
|
|
pvVar7 = (GHIDRA_CAST<InputManager *>((netplayManager)))->InputManager::GetDeviceByPlayerEntity(pEVar12);
|
|
if (pvVar7 == (void *)0x0) goto LAB_007be602;
|
|
cVar4 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x370)) + 0x14))();
|
|
uVar9 = local_90;
|
|
if (cVar4 != '\0') {
|
|
g_manager[1]._persistentGameData._eventCounters[0x83] = uVar11;
|
|
}
|
|
LAB_007be608:
|
|
EvaluateItems(pEVar12);
|
|
pGVar8 = g_game;
|
|
playerList = (g_game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT(playerList) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerList = (pGVar8->_playerManager)._playerList._begin;
|
|
}
|
|
ConsumableCountChanged(GHIDRA_CAST<Entity_Player *>(*playerList),-1);
|
|
if (pEVar12->_replacedPlayer == (void *)0x0) {
|
|
iVar14 = pEVar12->_playerType;
|
|
if (iVar14 == 0x13) {
|
|
tmpPlayer = InitTwin(pEVar12,0x14);
|
|
InitPostLevelInitStats(tmpPlayer);
|
|
}
|
|
else if (iVar14 == 0x23) {
|
|
if (pEVar12->_isCoopGhost == 0) {
|
|
tmpPlayer = InitTwin(pEVar12,0x28);
|
|
InitPostLevelInitStats(tmpPlayer);
|
|
}
|
|
}
|
|
else if (iVar14 == 0x22) {
|
|
uVar11 = Random();
|
|
familiar = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xe7,&pEVar12->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar12),0x19,
|
|
uVar11);
|
|
familiar->Update();
|
|
}
|
|
else if ((iVar14 == 0x25) && (g_game->_challenge != 0x2c)) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar12->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x6d,-1);
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) >> 2 < 0x6e) {
|
|
tmpEffect[0] = 0;
|
|
}
|
|
else {
|
|
tmpEffect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x1b4));
|
|
}
|
|
tmpEffect[1] = 0;
|
|
local_e0 = 0;
|
|
tmpRng._shift1 = 0xb;
|
|
tmpRng._shift2 = 7;
|
|
uVar11 = (g_game->_devilAngelRoomRNG)._seed;
|
|
pCStack_b8 = GHIDRA_CAST<ChallengeParam *>(0xc);
|
|
if (uVar11 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar11 = uVar11 >> 0xb ^ uVar11;
|
|
uVar11 = uVar11 << 7 ^ uVar11;
|
|
tmpEffect[2] = ((uVar11 >> 0xc ^ uVar11) % 0x14) * 0x1e + 0x262;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&pEVar12->_temporaryeffects)))->TemporaryEffects::AddEffect(tmpEffect,1,1);
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
if (g_game->_challenge == 0x1f) {
|
|
itemsBegin = GHIDRA_CAST<int *>(0x0);
|
|
itemsEnd = GHIDRA_CAST<int *>(0x0);
|
|
local_a4 = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
itemsCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 3;
|
|
local_78 = g_manager;
|
|
pvVar7 = (g_manager->_itemConfig)._collectibles._end;
|
|
collectibles = (g_manager->_itemConfig)._collectibles._begin;
|
|
uVar11 = GHIDRA_INT(pvVar7) - GHIDRA_INT(collectibles) >> 2;
|
|
if (uVar11 != 0) {
|
|
if (0x3fffffff < uVar11) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
std::vector<unsigned_int>::_Reallocate(uVar11);
|
|
pvVar7 = (manager->_itemConfig)._collectibles._end;
|
|
collectibles = (manager->_itemConfig)._collectibles._begin;
|
|
}
|
|
uVar11 = 0;
|
|
piVar15 = itemsEnd;
|
|
local_a4 = GHIDRA_CAST<PersistentGameData *>(itemsCapacity);
|
|
if (GHIDRA_INT(pvVar7) - GHIDRA_INT(collectibles) >> 2 != 0) {
|
|
do {
|
|
local_74 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(collectibles) + uVar11 * 4));
|
|
if (uVar11 != 0) {
|
|
pvVar7 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((((GHIDRA_INT(uVar11) < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar7) >> 2)
|
|
&& (uVar11 != 0xeb)) && (uVar11 != 0x2b)) && (uVar11 != 0x3d)) {
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar11)) goto LAB_007be8da;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar11) < 0) {
|
|
if ((GHIDRA_INT(uVar11) < 0) &&
|
|
(pvVar7 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar11) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar7) >> 2))
|
|
{
|
|
iVar14 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar7) + ~uVar11 * 4));
|
|
}
|
|
else {
|
|
iVar14 = 0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007be8da:
|
|
iVar14 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + uVar11 * 4));
|
|
}
|
|
if (((iVar14 != 0) && ((local_74[0x2f] & 1U) == 0)) && (*local_74 != 3)) {
|
|
bVar3 = (GHIDRA_CAST<Item *>((local_74)))->Item::IsAvailable(0xffffffff);
|
|
if (bVar3 != 0) {
|
|
pCStack_b8 = GHIDRA_CAST<ChallengeParam *>(local_74[1]);
|
|
if (GHIDRA_CAST<PersistentGameData *>(piVar15) == local_a4) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(piVar15,&pCStack_b8);
|
|
local_a4 = GHIDRA_CAST<PersistentGameData *>(itemsCapacity);
|
|
piVar15 = itemsEnd;
|
|
}
|
|
else {
|
|
*piVar15 = GHIDRA_INT(pCStack_b8);
|
|
itemsEnd = piVar15 + 1;
|
|
piVar15 = itemsEnd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
uVar11 = uVar11 + 1;
|
|
collectibles = (local_78->_itemConfig)._collectibles._begin;
|
|
} while (uVar11 < GHIDRA_UINT((GHIDRA_INT((local_78->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibles)
|
|
>> 2)));
|
|
uVar9 = local_90;
|
|
}
|
|
local_d0 = GHIDRA_CAST<ChallengeParam *>(0x0);
|
|
piVar13 = itemsBegin;
|
|
do {
|
|
piVar2 = itemsBegin;
|
|
if (piVar13 == piVar15) break;
|
|
uVar11 = GHIDRA_INT(piVar15) - GHIDRA_INT(itemsBegin) >> 2;
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar9 = uVar9 >> ((byte)rng._shift1 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << ((byte)rng._shift2 & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 >> ((byte)rngShift3 & 0x1f) ^ uVar9;
|
|
uVar10 = 0;
|
|
if (uVar11 != 0) {
|
|
uVar10 = uVar9 % uVar11;
|
|
}
|
|
if (uVar10 < (GHIDRA_INT(piVar15) - GHIDRA_INT(itemsBegin) >> 2) - 1U) {
|
|
iVar14 = itemsBegin[uVar10];
|
|
itemsBegin[uVar10] = piVar15[-1];
|
|
piVar15[-1] = iVar14;
|
|
}
|
|
piVar15 = piVar15 + -1;
|
|
AddCollectible(playerCopy,*piVar15,0,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,*piVar15,0,0);
|
|
local_d0 = GHIDRA_CAST<ChallengeParam *>(((local_d0->_name)._buf + 1));
|
|
piVar13 = piVar2;
|
|
itemsEnd = piVar15;
|
|
} while (local_d0 < GHIDRA_CAST<ChallengeParam *>(0xa));
|
|
local_8 = 0xffffffff;
|
|
if (piVar13 != GHIDRA_CAST<int *>(0x0)) {
|
|
deallocate(piVar13,GHIDRA_INT(local_a4) - GHIDRA_INT(piVar13) >> 2);
|
|
}
|
|
pEVar12 = playerCopy;
|
|
}
|
|
if (g_game->_challenge == 0x2b) {
|
|
iVar14 = 3;
|
|
do {
|
|
AddItemCard(pEVar12,0);
|
|
iVar14 = iVar14 + -1;
|
|
} while (iVar14 != 0);
|
|
}
|
|
LAB_007bea6e:
|
|
pEVar12->_postLevelInitFinished = 1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007bebb0
|
|
void Entity_Player::update_player_skin()
|
|
{
|
|
undefined4 uVar1;
|
|
undefined4 uVar2;
|
|
undefined4 uVar3;
|
|
void *pvVar4;
|
|
ChallengeParam *challengeParams;
|
|
ItemConfig_Item *costume;
|
|
std_string *strResult;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
byte extraout_CL_01;
|
|
byte extraout_CL_02;
|
|
byte extraout_CL_03;
|
|
byte extraout_CL_04;
|
|
int iVar5;
|
|
char *freePtr;
|
|
void *extraout_ECX;
|
|
void *extraout_ECX_00;
|
|
void *extraout_ECX_01;
|
|
undefined1 *freeSize;
|
|
uint uVar6;
|
|
Game *game;
|
|
std_string *playerName;
|
|
byte unk;
|
|
Entity_Player *local_78;
|
|
LayerState *local_74;
|
|
EntityConfig_Player *playerConfig;
|
|
void *displayName [5];
|
|
uint displayNameCapacity;
|
|
void *skinColorStr [5];
|
|
uint skinColorStrCapacity;
|
|
std_string local_3c;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
void *local_14;
|
|
|
|
game = g_game;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((skinColorStr + 0x14));
|
|
local_14 = (void *)0xffffffff;
|
|
puStack_18 = &LAB_00affefd;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((skinColorStr + 0x11));
|
|
ExceptionList = &local_1c;
|
|
local_78 = this;
|
|
if (this->_isCoopGhost != 0) {
|
|
reset_body_sprite(this);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
iVar5 = this->_playerType;
|
|
if ((iVar5 < 0) ||
|
|
(pvVar4 = (g_manager->_entityConfig)._players._begin,
|
|
(GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(pvVar4)) / 0x148 <= iVar5)) {
|
|
playerConfig = GHIDRA_CAST<EntityConfig_Player *>(0x0);
|
|
}
|
|
else {
|
|
playerConfig = GHIDRA_CAST<EntityConfig_Player *>((iVar5 * 0x148 + GHIDRA_INT(pvVar4)));
|
|
}
|
|
this->_bodyColor = -1;
|
|
this->_headColor = -1;
|
|
if (game->_challenge == 0x1e) {
|
|
uVar6 = 0;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((skinColorStr + 0x14));
|
|
do {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = std::_Allocate(0x30);
|
|
local_3c._size = 0x26;
|
|
local_3c._capacity = GHIDRA_UINT(&DAT_0000002f);
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0))),"gfx/characters/costumes/NiceLilith.png",0x27);
|
|
local_14 = (void *)0x0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar6,&local_3c);
|
|
local_14 = (void *)0xffffffff;
|
|
unk = extraout_CL;
|
|
if (&DAT_0000000f < local_3c._capacity) {
|
|
freeSize = GHIDRA_CAST<undefined1 *>((local_3c._capacity + 1));
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0)));
|
|
if (GHIDRA_CAST<undefined1 *>(0xfff) < freeSize) {
|
|
freePtr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4));
|
|
freeSize = GHIDRA_CAST<undefined1 *>((local_3c._capacity + 0x24));
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) goto LAB_007bee2a;
|
|
}
|
|
operator_delete(freePtr,GHIDRA_UINT(freeSize));
|
|
unk = extraout_CL_00;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 0xf);
|
|
LAB_007bee42:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics(unk);
|
|
}
|
|
else {
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((skinColorStr + 0x14));
|
|
if ((playerConfig->_skinPath)._size != 0) {
|
|
uVar6 = 0;
|
|
local_74 = GHIDRA_CAST<LayerState *>(&playerConfig->_skinPath);
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((skinColorStr + 0x14));
|
|
do {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar6,GHIDRA_CAST<std_string *>(local_74));
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < 0xf);
|
|
local_74 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ghost"));
|
|
this = local_78;
|
|
if (local_74 == GHIDRA_CAST<LayerState *>(0x0)) {
|
|
unk = extraout_CL_01;
|
|
}
|
|
else {
|
|
iVar5 = local_78->_playerType;
|
|
pvVar4 = (void *)FUN_004562f0(skinColorStr);
|
|
local_14 = (void *)0x1;
|
|
strResult = costume_path_apply_skin_color(&local_3c,pvVar4,-1,iVar5,GHIDRA_CAST<byte *>(0x0),GHIDRA_CAST<byte *>(0x0))
|
|
;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
if (local_74->_layerData == GHIDRA_CAST<int *>(0x0)) {
|
|
iVar5 = -1;
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>(local_74->_layerData);
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(iVar5,strResult);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
unk = extraout_CL_02;
|
|
if (&DAT_0000000f < local_3c._capacity) {
|
|
freeSize = GHIDRA_CAST<undefined1 *>((local_3c._capacity + 1));
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0)));
|
|
if (GHIDRA_CAST<undefined1 *>(0xfff) < freeSize) {
|
|
freePtr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4));
|
|
freeSize = GHIDRA_CAST<undefined1 *>((local_3c._capacity + 0x24));
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr)))))
|
|
goto LAB_007bee2a;
|
|
}
|
|
operator_delete(freePtr,GHIDRA_UINT(freeSize));
|
|
unk = extraout_CL_03;
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
local_3c._size = 0;
|
|
local_3c._capacity = GHIDRA_UINT(&DAT_0000000f);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < skinColorStrCapacity) {
|
|
uVar6 = skinColorStrCapacity + 1;
|
|
pvVar4 = skinColorStr[0];
|
|
if (0xfff < uVar6) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(skinColorStr[0]) + -4);
|
|
uVar6 = skinColorStrCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(skinColorStr[0]) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
LAB_007bee2a:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,uVar6);
|
|
unk = extraout_CL_04;
|
|
}
|
|
}
|
|
goto LAB_007bee42;
|
|
}
|
|
}
|
|
iVar5 = playerConfig->_costumeID;
|
|
if (iVar5 == -1) {
|
|
UpdateCostumes(this);
|
|
}
|
|
else if ((iVar5 < 0) ||
|
|
(pvVar4 = (g_manager->_itemConfig)._nullItems._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar4) >> 2 <= iVar5)) {
|
|
AddCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0),0);
|
|
}
|
|
else {
|
|
AddCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar4) + iVar5 * 4)),0);
|
|
}
|
|
game = g_game;
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if (challengeParams->_canShoot == 0) {
|
|
if ((this->_playerType != 0x23) && (this->_playerType != 0x28)) {
|
|
pvVar4 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar4) & 0xfffffffcU)) < 0x39)
|
|
{
|
|
costume = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
costume = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar4) + 0x38));
|
|
}
|
|
AddCostume(this,costume,0);
|
|
goto LAB_007beef4;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LAB_007beef4:
|
|
game = g_game;
|
|
}
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(0x36);
|
|
std::set<int>::find_node(GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&local_3c) + 0xc)),&local_78);
|
|
if (((*GHIDRA_CAST<char *>((local_3c._capacity + 0xd)) != '\0') || (0x36 < *GHIDRA_CAST<int *>((local_3c._capacity + 0x10)))
|
|
) || ((void *)local_3c._capacity == (game->_seedEffects)._seedEffects)) {
|
|
pvVar4 = extraout_ECX;
|
|
if ((game->_dailyChallenge)._specialDailyId != 0x13) goto LAB_007bef66;
|
|
}
|
|
pvVar4 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar4) & 0xfffffffcU)) < 0x41) {
|
|
costume = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
costume = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar4) + 0x40));
|
|
}
|
|
AddCostume(this,costume,0);
|
|
pvVar4 = extraout_ECX_00;
|
|
game = g_game;
|
|
LAB_007bef66:
|
|
if ((game->_challenge == 0x2a) && (this->_playerType == 0x23)) {
|
|
pvVar4 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar4) & 0xfffffffcU)) < 0x1a9) {
|
|
costume = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
costume = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar4) + 0x1a8));
|
|
}
|
|
AddCostume(this,costume,0);
|
|
pvVar4 = extraout_ECX_01;
|
|
}
|
|
strResult = (GHIDRA_CAST<EntityConfig_Player *>((playerConfig)))->EntityConfig_Player::GetDisplayName(GHIDRA_CAST<std_string *>(displayName),pvVar4);
|
|
playerName = &this->_name;
|
|
if (playerName != strResult) {
|
|
(GHIDRA_CAST<std::string *>((playerName->_buf)))->std::string::_Tidy_deallocate();
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>((strResult->_buf + 4));
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((strResult->_buf + 8));
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((strResult->_buf + 0xc));
|
|
*GHIDRA_CAST<undefined4 *>(playerName->_buf) = *GHIDRA_CAST<undefined4 *>(strResult->_buf);
|
|
*GHIDRA_CAST<undefined4 *>(((this->_name)._buf + 4)) = uVar1;
|
|
*GHIDRA_CAST<undefined4 *>(((this->_name)._buf + 8)) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>(((this->_name)._buf + 0xc)) = uVar3;
|
|
uVar6 = strResult->_capacity;
|
|
(this->_name)._size = strResult->_size;
|
|
(this->_name)._capacity = uVar6;
|
|
strResult->_size = 0;
|
|
strResult->_capacity = 0xf;
|
|
strResult->_buf[0] = '\0';
|
|
}
|
|
if (0xf < displayNameCapacity) {
|
|
uVar6 = displayNameCapacity + 1;
|
|
pvVar4 = displayName[0];
|
|
if (0xfff < uVar6) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(displayName[0]) + -4);
|
|
uVar6 = displayNameCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(displayName[0]) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,uVar6);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007bf040
|
|
void Entity_Player::InitBabySkin()
|
|
{
|
|
byte unk;
|
|
Entity_Player *pEVar1;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *extraout_ECX_00;
|
|
Entity_Player *extraout_ECX_01;
|
|
uint uVar2;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
uVar2 = this->_babySkin;
|
|
if (uVar2 < 0x47) {
|
|
pEVar1 = (Entity_Player *)
|
|
(GHIDRA_INT((g_manager->_entityConfig)._babies._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._babies._begin));
|
|
if (GHIDRA_UINT((GHIDRA_INT(pEVar1) / 0x38)) <= uVar2) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Baby list is smaller than requested baby %d!"));
|
|
pEVar1 = extraout_ECX;
|
|
}
|
|
uVar2 = 0;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&this->_sprite),uVar2,
|
|
(std_string *)
|
|
(GHIDRA_INT((manager->_entityConfig)._babies._begin) + this->_babySkin * 0x38 + 0x1c));
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics(unk);
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
pEVar1 = this;
|
|
if (uVar2 == 0x47) {
|
|
uVar2 = this->_subtype;
|
|
if ((uVar2 < 0x47) ||
|
|
(GHIDRA_UINT(((GHIDRA_INT((g_manager->_entityConfig)._babies._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._babies._begin)) / 0x38)) <= uVar2)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Bad baby basic id %d"));
|
|
uVar2 = this->_subtype;
|
|
pEVar1 = extraout_ECX_00;
|
|
if (uVar2 < 0x47) goto LAB_007bf18d;
|
|
}
|
|
pEVar1 = (Entity_Player *)
|
|
(GHIDRA_INT((manager->_entityConfig)._babies._end) -
|
|
GHIDRA_INT((manager->_entityConfig)._babies._begin));
|
|
if ((uVar2 < GHIDRA_UINT((GHIDRA_INT(pEVar1) / 0x38))) && (uVar2 = 0, (this->_sprite)._layerCount != 0)) {
|
|
do {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&this->_sprite),uVar2,
|
|
(std_string *)
|
|
(GHIDRA_INT((manager->_entityConfig)._babies._begin) + this->_subtype * 0x38 + 0x1c));
|
|
uVar2 = uVar2 + 1;
|
|
pEVar1 = extraout_ECX_01;
|
|
} while (uVar2 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
}
|
|
}
|
|
LAB_007bf18d:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics((byte)pEVar1);
|
|
return;
|
|
}
|
|
|
|
// 007bf1a0
|
|
Entity_Laser * Entity_Player::FireDelayedBrimstone(float angle, Entity *parent)
|
|
{
|
|
byte bVar1;
|
|
int brimstoneCount;
|
|
Entity_Laser *laser;
|
|
uint uVar2;
|
|
float *maxDistancePtr;
|
|
uint uVar3;
|
|
int variant;
|
|
uint uVar4;
|
|
bool bVar5;
|
|
float fVar6;
|
|
undefined1 uStack_99;
|
|
undefined1 hitParams [16];
|
|
float fStack_7c;
|
|
uint uStack_58;
|
|
uint uStack_54;
|
|
uint uStack_50;
|
|
uint uStack_4c;
|
|
float fStack_44;
|
|
uint local_c;
|
|
EntityPtr *parentRef;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(hitParams);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitParams)) + 0x4))) = angle;
|
|
variant = 1;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitParams)) + 0x8))) = parent;
|
|
bVar1 = HasCollectible(this,0x44,0);
|
|
if (bVar1 != 0) {
|
|
variant = 9;
|
|
}
|
|
brimstoneCount = GetCollectibleNum(this,0x76,0);
|
|
if ((1 < brimstoneCount) && (bVar5 = variant == 9, variant = 0xb, bVar5)) {
|
|
variant = 0xe;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitParams)) + 0xc))) = (parent->_pos).x;
|
|
fStack_7c = (parent->_pos).y;
|
|
laser = Entity_Laser::ShootAngle
|
|
(variant,GHIDRA_CAST<Vector *>((hitParams + 0xc)),(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)hitParams)) + 0x4))),10,
|
|
&parent->_posOffset,GHIDRA_CAST<Entity *>(this),0);
|
|
fVar6 = 0.0;
|
|
laser->SetColor(&this->_laserColor,0xffffffff,0xff);
|
|
uVar2 = Random();
|
|
GetTearHitParams(this,GHIDRA_CAST<TearParams *>(hitParams),2,1.0,(uVar2 & 1) * 2 + -1,GHIDRA_CAST<Entity *>(0x0));
|
|
laser->SetCollisionDamage(fStack_44);
|
|
uVar4 = ~GHIDRA_UINT(g_tearFlagOccult._h);
|
|
uVar3 = ~(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOccult._h)) + 0x4)));
|
|
uVar2 = ~(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOccult._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&(laser->_tearFlags)._l) = ~GHIDRA_UINT(g_tearFlagOccult._l) & uStack_58;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(laser->_tearFlags)._l) + 4)) = uVar2 & uStack_54;
|
|
*GHIDRA_CAST<uint *>(&(laser->_tearFlags)._h) = uVar4 & uStack_50;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(laser->_tearFlags)._h) + 4)) = uVar3 & uStack_4c;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((laser)) + 0x517))) = 1;
|
|
fVar6 = sin(fVar6 * 0.017453292);
|
|
if (fVar6 <= -0.5) {
|
|
fVar6 = -10.0;
|
|
}
|
|
else {
|
|
fVar6 = 3000.0;
|
|
}
|
|
parentRef = &laser->_parent;
|
|
laser->_renderDepthOffset = fVar6;
|
|
if (*parentRef != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase(hitParams + -0x14);
|
|
}
|
|
*parentRef = (EntityPtr)0x1;
|
|
std::multiset<unsigned_int>::insert(parentRef);
|
|
if ((this->_playerType != 7) &&
|
|
(bVar1 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasTrinketEffect(0xa2), bVar1 == 0)) {
|
|
return laser;
|
|
}
|
|
bVar1 = HasCollectible(this,0x76,0);
|
|
if (bVar1 == 0) {
|
|
maxDistancePtr = GHIDRA_CAST<float *>((hitParams + -0x10));
|
|
if (this->_tearrange * 0.25 + 32.0 <= 60.0) {
|
|
maxDistancePtr = GHIDRA_CAST<float *>((hitParams + -0x14));
|
|
}
|
|
laser->_maxDistance = *maxDistancePtr;
|
|
}
|
|
return laser;
|
|
}
|
|
|
|
// 007bf3d0
|
|
byte Entity_Player::CanPickupItem()
|
|
{
|
|
byte bVar1;
|
|
byte *animChar;
|
|
uint compareResult;
|
|
char *deathChar;
|
|
byte *otherAnimChar;
|
|
byte *animName;
|
|
bool isLess;
|
|
|
|
animName = (this->_sprite)._animState._animData;
|
|
if (animName == GHIDRA_CAST<byte *>(0x0)) {
|
|
animName = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint *>((animName + 0x14))) {
|
|
animName = *GHIDRA_CAST<byte **>(animName);
|
|
}
|
|
if ((this->_isPlayingExtraAnimation != 0) || (this->_isPlayingItemAnimation != 0)) {
|
|
otherAnimChar = &DAT_00b1d3b0;
|
|
animChar = animName;
|
|
do {
|
|
bVar1 = *animChar;
|
|
isLess = bVar1 < *otherAnimChar;
|
|
if (bVar1 != *otherAnimChar) {
|
|
LAB_007bf423:
|
|
compareResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf428;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = animChar[1];
|
|
isLess = bVar1 < otherAnimChar[1];
|
|
if (bVar1 != otherAnimChar[1]) goto LAB_007bf423;
|
|
animChar = animChar + 2;
|
|
otherAnimChar = otherAnimChar + 2;
|
|
} while (bVar1 != 0);
|
|
compareResult = 0;
|
|
LAB_007bf428:
|
|
if ((compareResult != 0) && (bVar1 = IsHoldingItem(this), bVar1 == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
if (this->_dead == 0) {
|
|
deathChar = "Death";
|
|
do {
|
|
bVar1 = *animName;
|
|
isLess = bVar1 < (byte)*deathChar;
|
|
if (bVar1 != *deathChar) {
|
|
LAB_007bf465:
|
|
compareResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf46a;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = animName[1];
|
|
isLess = bVar1 < (byte)deathChar[1];
|
|
if (bVar1 != deathChar[1]) goto LAB_007bf465;
|
|
animName = animName + 2;
|
|
deathChar = deathChar + 2;
|
|
} while (bVar1 != 0);
|
|
compareResult = 0;
|
|
LAB_007bf46a:
|
|
if ((compareResult != 0) && (this->_megaBlastDuration < 1)) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007bf490
|
|
byte Entity_Player::IsHoldingItem()
|
|
{
|
|
byte *animName;
|
|
byte *animCursor;
|
|
uint cmpResult;
|
|
char *expectedCursor;
|
|
bool isLess;
|
|
byte ch;
|
|
|
|
animName = (this->_bodySprite)._animState._animData;
|
|
if (animName == GHIDRA_CAST<byte *>(0x0)) {
|
|
animName = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint *>((animName + 0x14))) {
|
|
animName = *GHIDRA_CAST<byte **>(animName);
|
|
}
|
|
expectedCursor = "Pickup";
|
|
animCursor = animName;
|
|
do {
|
|
ch = *animCursor;
|
|
isLess = ch < (byte)*expectedCursor;
|
|
if (ch != *expectedCursor) {
|
|
LAB_007bf4d1:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf4d6;
|
|
}
|
|
if (ch == 0) break;
|
|
ch = animCursor[1];
|
|
isLess = ch < (byte)expectedCursor[1];
|
|
if (ch != expectedCursor[1]) goto LAB_007bf4d1;
|
|
animCursor = animCursor + 2;
|
|
expectedCursor = expectedCursor + 2;
|
|
} while (ch != 0);
|
|
cmpResult = 0;
|
|
LAB_007bf4d6:
|
|
if (cmpResult != 0) {
|
|
expectedCursor = "Pickup_Online";
|
|
animCursor = animName;
|
|
do {
|
|
ch = *animCursor;
|
|
isLess = ch < (byte)*expectedCursor;
|
|
if (ch != *expectedCursor) {
|
|
LAB_007bf505:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf50a;
|
|
}
|
|
if (ch == 0) break;
|
|
ch = animCursor[1];
|
|
isLess = ch < (byte)expectedCursor[1];
|
|
if (ch != expectedCursor[1]) goto LAB_007bf505;
|
|
animCursor = animCursor + 2;
|
|
expectedCursor = expectedCursor + 2;
|
|
} while (ch != 0);
|
|
cmpResult = 0;
|
|
LAB_007bf50a:
|
|
if (cmpResult != 0) {
|
|
expectedCursor = "LiftItem";
|
|
animCursor = animName;
|
|
do {
|
|
ch = *animCursor;
|
|
isLess = ch < (byte)*expectedCursor;
|
|
if (ch != *expectedCursor) {
|
|
LAB_007bf540:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf545;
|
|
}
|
|
if (ch == 0) break;
|
|
ch = animCursor[1];
|
|
isLess = ch < (byte)expectedCursor[1];
|
|
if (ch != expectedCursor[1]) goto LAB_007bf540;
|
|
animCursor = animCursor + 2;
|
|
expectedCursor = expectedCursor + 2;
|
|
} while (ch != 0);
|
|
cmpResult = 0;
|
|
LAB_007bf545:
|
|
if (cmpResult != 0) {
|
|
expectedCursor = "HideItem";
|
|
animCursor = animName;
|
|
do {
|
|
ch = *animCursor;
|
|
isLess = ch < (byte)*expectedCursor;
|
|
if (ch != *expectedCursor) {
|
|
LAB_007bf570:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf575;
|
|
}
|
|
if (ch == 0) break;
|
|
ch = animCursor[1];
|
|
isLess = ch < (byte)expectedCursor[1];
|
|
if (ch != expectedCursor[1]) goto LAB_007bf570;
|
|
animCursor = animCursor + 2;
|
|
expectedCursor = expectedCursor + 2;
|
|
} while (ch != 0);
|
|
cmpResult = 0;
|
|
LAB_007bf575:
|
|
if (cmpResult != 0) {
|
|
expectedCursor = "UseItem";
|
|
do {
|
|
ch = *animName;
|
|
isLess = ch < (byte)*expectedCursor;
|
|
if (ch != *expectedCursor) {
|
|
LAB_007bf5a0:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007bf5a5;
|
|
}
|
|
if (ch == 0) break;
|
|
ch = animName[1];
|
|
isLess = ch < (byte)expectedCursor[1];
|
|
if (ch != expectedCursor[1]) goto LAB_007bf5a0;
|
|
animName = animName + 2;
|
|
expectedCursor = expectedCursor + 2;
|
|
} while (ch != 0);
|
|
cmpResult = 0;
|
|
LAB_007bf5a5:
|
|
if (cmpResult != 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007bf5c0
|
|
byte Entity_Player::IsHeldItemVisible()
|
|
{
|
|
byte isHoldingItem;
|
|
void *nullFrame;
|
|
|
|
isHoldingItem = IsHoldingItem(this);
|
|
if ((isHoldingItem != 0) && ((this->_bodySprite)._animState._animData != (void *)0x0)) {
|
|
nullFrame = (GHIDRA_CAST<AnimationState *>((&(this->_bodySprite)._animState)))->AnimationState::GetNullFrameById(0);
|
|
if (nullFrame != (void *)0x0) {
|
|
return *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(nullFrame) + 0xc));
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007bf5f0
|
|
void Entity_Player::AddBlueSpider(Vector *position)
|
|
{
|
|
uint seed;
|
|
Entity *spider;
|
|
undefined4 flagsHigh;
|
|
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
seed = Random();
|
|
spider = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x49,position,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,seed,0);
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&spider->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&spider->_flags) = GHIDRA_UINT(spider->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&spider->_flags) + 4)) = flagsHigh;
|
|
return;
|
|
}
|
|
|
|
// 007bf640
|
|
Entity_Familiar * Entity_Player::ThrowBlueSpider(Vector *position, Vector *target)
|
|
{
|
|
Entity_Familiar *extraout_EAX;
|
|
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
spawn_blue_spider(position,GHIDRA_CAST<Entity *>(this),target);
|
|
return extraout_EAX;
|
|
}
|
|
|
|
// 007bf660
|
|
void Entity_Player::RemoveBlueSpider()
|
|
{
|
|
this->_numBlueSpiders = this->_numBlueSpiders + -1;
|
|
return;
|
|
}
|
|
|
|
// 007bf670
|
|
int Entity_Player::GetExtraLives()
|
|
{
|
|
int extraLives;
|
|
void *collectibleCounts;
|
|
|
|
collectibleCounts = (this->_collectibleCounts)._begin;
|
|
extraLives = GHIDRA_INT(this->_deadCatLives) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0xac0)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0x530)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0x4dc)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0x350)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0x284)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0x2c));
|
|
if (this->_playerType == 0x1f) {
|
|
extraLives = extraLives + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleCounts) + 0x9ac));
|
|
}
|
|
return GHIDRA_UINT((this->_playerType == 8)) + extraLives;
|
|
}
|
|
|
|
// 007c2e90
|
|
uint Entity_Player::GetGlitchBabySubType()
|
|
{
|
|
code *pcVar1;
|
|
byte isUnlocked;
|
|
uint rngValue;
|
|
void *babiesBegin;
|
|
void *extraout_EDX;
|
|
void *pvVar2;
|
|
int babyOffset;
|
|
int *candidatesEnd;
|
|
int *candidatesEndSlot;
|
|
void *local_1c;
|
|
uint babyIndex;
|
|
void *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
uint babyCount;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
puStack_c = &LAB_00afff3d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
rngValue = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0xa8))));
|
|
candidatesEndSlot = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
local_14 = (g_manager->_entityConfig)._babies._end;
|
|
babiesBegin = (g_manager->_entityConfig)._babies._begin;
|
|
babyCount = (GHIDRA_INT(local_14) - GHIDRA_INT(babiesBegin)) / 0x38;
|
|
local_1c = babiesBegin;
|
|
if (babyCount != 0) {
|
|
if (0x3fffffff < babyCount) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
std::vector<unsigned_int>::_Reallocate(babyCount);
|
|
local_14 = (manager->_entityConfig)._babies._end;
|
|
babiesBegin = (manager->_entityConfig)._babies._begin;
|
|
}
|
|
candidatesEnd = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = (void *)(GHIDRA_INT(local_14) - GHIDRA_INT(babiesBegin));
|
|
babyIndex = 0;
|
|
if (GHIDRA_INT(local_14) / 0x38 + (GHIDRA_INT(local_14) >> 0x1f) != GHIDRA_INT(local_14) >> 0x1f) {
|
|
babyOffset = 0;
|
|
do {
|
|
pvVar2 = (void *)(babyOffset + GHIDRA_INT(babiesBegin));
|
|
if ((*GHIDRA_CAST<int *>((babyOffset + GHIDRA_INT(babiesBegin))) != 0x19) &&
|
|
(*GHIDRA_CAST<int *>((babyOffset + GHIDRA_INT(babiesBegin))) != 0x18)) {
|
|
if (-1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x34))) {
|
|
isUnlocked = PersistentGameData::Unlocked
|
|
(&g_manager->_persistentGameData,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x34)));
|
|
pvVar2 = extraout_EDX;
|
|
if (isUnlocked == 0) goto LAB_007c2fce;
|
|
}
|
|
if (candidatesEnd == GHIDRA_CAST<int *>(0x0)) {
|
|
local_1c = pvVar2;
|
|
std::vector<unsigned_int>::_Emplace_reallocate(0,&local_1c);
|
|
candidatesEnd = candidatesEndSlot;
|
|
}
|
|
else {
|
|
*candidatesEnd = GHIDRA_INT(pvVar2);
|
|
candidatesEndSlot = candidatesEnd + 1;
|
|
candidatesEnd = candidatesEndSlot;
|
|
}
|
|
}
|
|
LAB_007c2fce:
|
|
babyOffset = babyOffset + 0x38;
|
|
babyIndex = babyIndex + 1;
|
|
babiesBegin = (manager->_entityConfig)._babies._begin;
|
|
local_1c = babiesBegin;
|
|
} while (babyIndex <
|
|
GHIDRA_UINT(((GHIDRA_INT((manager->_entityConfig)._babies._end) - GHIDRA_INT(babiesBegin)) / 0x38)));
|
|
}
|
|
if (candidatesEnd == GHIDRA_CAST<int *>(0x0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[err] Couldn\'t select a baby subtype!\n"));
|
|
ExceptionList = local_10;
|
|
return 0x47;
|
|
}
|
|
if (rngValue == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
rngValue = (*pcVar1)();
|
|
return rngValue;
|
|
}
|
|
rngValue = rngValue >> 5 ^ rngValue;
|
|
rngValue = rngValue << 9 ^ rngValue;
|
|
if (GHIDRA_INT(candidatesEnd) >> 2 == 0) {
|
|
rngValue = 0;
|
|
}
|
|
else {
|
|
rngValue = (rngValue >> 7 ^ rngValue) % GHIDRA_UINT((GHIDRA_INT(candidatesEnd) >> 2));
|
|
}
|
|
ExceptionList = local_10;
|
|
return **GHIDRA_CAST<uint **>((rngValue * 4));
|
|
}
|
|
|
|
// 007c3100
|
|
byte Entity_Player::HasInvincibility(ulonglong damageFlags, EntityRef *source)
|
|
{
|
|
byte isInvincible;
|
|
byte isBloodSlotSource;
|
|
void *effect;
|
|
bool isRedHeartDamage;
|
|
bool isBloodSlotSource;
|
|
TemporaryEffects *tempEffects;
|
|
|
|
if ((damageFlags & 0x2000) != 0) {
|
|
return 0;
|
|
}
|
|
isRedHeartDamage = (damageFlags & 0x20) != 0;
|
|
tempEffects = &this->_temporaryeffects;
|
|
isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x3a);
|
|
if (isInvincible == 0) {
|
|
LAB_007c3182:
|
|
isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x5d);
|
|
if (((((((isInvincible == 0) &&
|
|
(isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x4d),
|
|
isInvincible == 0)) &&
|
|
(isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x12a),
|
|
isInvincible == 0)) &&
|
|
(isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c),
|
|
isInvincible == 0)) &&
|
|
(((isInvincible = HasCollectible(this,0xd2,0), isInvincible == 0 || (this->_mass != 1000.0)
|
|
) || (isRedHeartDamage)))) &&
|
|
(((isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x146),
|
|
isInvincible == 0 &&
|
|
((isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(299),
|
|
isInvincible == 0 ||
|
|
(effect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(299),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(effect) + 8)) == 0)))) &&
|
|
((isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x3b), isInvincible == 0 ||
|
|
(isRedHeartDamage)))))) &&
|
|
((((isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasNullEffect(0x3f), isInvincible == 0 ||
|
|
(isRedHeartDamage)) &&
|
|
(((isInvincible = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x2c1),
|
|
isInvincible == 0 && (this->_darkArtsBlastPending == 0)) || (isRedHeartDamage)))) &&
|
|
((this->_suplexState == 0 || (isRedHeartDamage)))))) {
|
|
isBloodSlotSource = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
isInvincible = 0;
|
|
if (isBloodSlotSource == 0) goto LAB_007c3287;
|
|
}
|
|
}
|
|
else if (source != GHIDRA_CAST<EntityRef *>(0x0)) {
|
|
if (source->_type == 6) {
|
|
if (source->_variant == 2) {
|
|
isBloodSlotSource = true;
|
|
goto LAB_007c3167;
|
|
}
|
|
isBloodSlotSource = false;
|
|
if (source->_variant != 5) goto LAB_007c3167;
|
|
}
|
|
else {
|
|
isBloodSlotSource = false;
|
|
LAB_007c3167:
|
|
if (!isBloodSlotSource) goto LAB_007c3285;
|
|
}
|
|
effect = (GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::GetCollectibleEffect(0x3a);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(effect) + 0xc)) != 0) goto LAB_007c3182;
|
|
}
|
|
LAB_007c3285:
|
|
isInvincible = 1;
|
|
LAB_007c3287:
|
|
if ((this->_variant == 1) && (this->_babySkin == 0x18)) {
|
|
isInvincible = 1;
|
|
}
|
|
if (this->_isCoopGhost != 0) {
|
|
isInvincible = 1;
|
|
}
|
|
return isInvincible;
|
|
}
|
|
|
|
// 007c32c0
|
|
byte Entity_Player::IsInvisible()
|
|
{
|
|
byte isHasEffect;
|
|
int *effect;
|
|
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (effect = (this->_temporaryeffects)._effects._begin;
|
|
effect != (this->_temporaryeffects)._effects._end; effect = effect + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*effect) == 2) && ((GHIDRA_CAST<int *>(*effect))[1] == 0x45)) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1f1);
|
|
if ((isHasEffect == 0) && (this->_playerType != 0x23)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007c3320
|
|
byte Entity_Player::HasPoisonImmunity()
|
|
{
|
|
byte isHasCollectible;
|
|
|
|
isHasCollectible = HasCollectible(this,0x252,0);
|
|
if (isHasCollectible == 0) {
|
|
isHasCollectible = HasCollectible(this,0x8c,0);
|
|
if ((isHasCollectible == 0) &&
|
|
(((this->_hasCurseMistEffect != 0 || (this->_isCoopGhost != 0)) ||
|
|
(this->_playerForms[4] < 3)))) {
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007c3380
|
|
byte Entity_Player::CanCrushRocks()
|
|
{
|
|
byte isHasEffect;
|
|
int zodiacEffect;
|
|
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x53);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = HasCollectible(this,0x12e,0);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x12e);
|
|
if (isHasEffect == 0) {
|
|
zodiacEffect = GetZodiacEffect(this);
|
|
if (zodiacEffect != 0x12e) {
|
|
isHasEffect = HasCollectible(this,0x13a,0);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = HasPlayerForm(this,0xd);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
if (isHasEffect == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007c3410
|
|
byte Entity_Player::CanPickRedHearts()
|
|
{
|
|
byte isFullHearts;
|
|
int iVar1;
|
|
Entity_Player *heartPlayer;
|
|
Entity_Player *extraout_ECX;
|
|
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0));
|
|
if (iVar1 == 0x24) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1dac)) < 99) {
|
|
return 1;
|
|
}
|
|
LAB_007c3453:
|
|
iVar1 = GetHealthType(this);
|
|
heartPlayer = extraout_ECX;
|
|
if (iVar1 == 3) {
|
|
return 0;
|
|
}
|
|
LAB_007c343f:
|
|
isFullHearts = HasFullHearts(heartPlayer);
|
|
return isFullHearts ^ 1;
|
|
}
|
|
if (iVar1 != 0x28) {
|
|
if ((iVar1 != 0x11) ||
|
|
(heartPlayer = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x1d98)), heartPlayer == GHIDRA_CAST<Entity_Player *>(0x0)
|
|
)) goto LAB_007c3453;
|
|
goto LAB_007c343f;
|
|
}
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) == (EntityPtr)0x0) goto LAB_007c3453;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
} while( true );
|
|
}
|
|
|
|
// 007c3460
|
|
byte Entity_Player::CanPickSoulHearts()
|
|
{
|
|
int activeMaxCharge;
|
|
int activeMaxCharge;
|
|
int *activeCharge;
|
|
uint activeSlot;
|
|
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return this->_maxHearts < 0xa0;
|
|
}
|
|
while( true ) {
|
|
while (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x28) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x10) ||
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)) == (EntityPtr)0x0)) goto LAB_007c34ac;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)));
|
|
}
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) == (EntityPtr)0x0) break;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
LAB_007c34ac:
|
|
activeCharge = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x1588));
|
|
activeSlot = 0;
|
|
do {
|
|
if ((activeCharge[-2] == 0x249) &&
|
|
(activeMaxCharge = *activeCharge, activeMaxCharge = GetActiveMaxCharge(this,activeSlot),
|
|
activeMaxCharge < activeMaxCharge)) {
|
|
return 1;
|
|
}
|
|
activeSlot = activeSlot + 1;
|
|
activeCharge = activeCharge + 8;
|
|
} while (activeSlot < 4);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x12) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da8)) < 99) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x10) {
|
|
return 0;
|
|
}
|
|
activeMaxCharge = GetHeartLimit(this,0);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340))
|
|
< activeMaxCharge) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007c3550
|
|
byte Entity_Player::CanPickBlackHearts()
|
|
{
|
|
byte bVar1;
|
|
uint uVar2;
|
|
uint halfHeartIdx;
|
|
int soulHearts;
|
|
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return this->_maxHearts < 0xa0;
|
|
}
|
|
while( true ) {
|
|
while (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x28) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x10) ||
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)) == (EntityPtr)0x0)) goto LAB_007c359c;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)));
|
|
}
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) == (EntityPtr)0x0) break;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
LAB_007c359c:
|
|
bVar1 = CanPickSoulHearts(this);
|
|
if (bVar1 != 0) {
|
|
return 1;
|
|
}
|
|
soulHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c));
|
|
halfHeartIdx = 1;
|
|
if (1 < soulHearts) {
|
|
if (soulHearts < 1) {
|
|
return 1;
|
|
}
|
|
do {
|
|
if (GHIDRA_INT(halfHeartIdx) < 1) {
|
|
return 1;
|
|
}
|
|
uVar2 = halfHeartIdx & 0x80000001;
|
|
if (GHIDRA_INT(uVar2) < 0) {
|
|
uVar2 = (uVar2 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if (uVar2 != 1) {
|
|
return 1;
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1350)) & 1 << ((byte)(GHIDRA_INT((halfHeartIdx - 1)) / 2) & 0x1f)) == 0)
|
|
{
|
|
return 1;
|
|
}
|
|
halfHeartIdx = halfHeartIdx + 2;
|
|
} while (GHIDRA_INT(halfHeartIdx) < soulHearts);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007c3620
|
|
void Entity_Player::RemoveSkinCostume()
|
|
{
|
|
int iVar1;
|
|
void *pvVar2;
|
|
|
|
iVar1 = this->_playerType;
|
|
if (-1 < iVar1) {
|
|
if (((iVar1 < (GHIDRA_INT((g_manager->_entityConfig)._players._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148) &&
|
|
(pvVar2 = (void *)(iVar1 * 0x148 + GHIDRA_INT((g_manager->_entityConfig)._players._begin)),
|
|
pvVar2 != (void *)0x0)) && (iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0xac)), iVar1 != -1)) {
|
|
if ((-1 < iVar1) &&
|
|
(pvVar2 = (g_manager->_itemConfig)._nullItems._begin,
|
|
iVar1 < GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar2) >> 2)) {
|
|
RemoveCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + iVar1 * 4)));
|
|
return;
|
|
}
|
|
RemoveCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c36b0
|
|
void Entity_Player::ResetItemState()
|
|
{
|
|
byte bVar1;
|
|
ItemConfig_Item *Item;
|
|
int *eraseResult;
|
|
void *pvVar2;
|
|
byte *animNameCursor;
|
|
uint uVar3;
|
|
char *targetNameCursor;
|
|
bool isLess;
|
|
undefined1 eraseResultBuf [4];
|
|
|
|
if (this->_itemState == 0x31) {
|
|
TryRemoveCollectibleCostume(this,0x31,0);
|
|
}
|
|
else if (this->_itemState == 0x152) {
|
|
pvVar2 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar2) & 0xfffffffcU)) < 0x79) {
|
|
Item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
Item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + 0x78));
|
|
}
|
|
RemoveCostume(this,Item);
|
|
}
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
pvVar2 = (this->_costumeSpriteDescs)._begin;
|
|
if (pvVar2 != (this->_costumeSpriteDescs)._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar2) + 0x129)) == '\0') {
|
|
pvVar2 = (void *)(GHIDRA_INT(pvVar2) + 0x130);
|
|
}
|
|
else {
|
|
eraseResult = GHIDRA_CAST<int *>(std)::vector<CostumeSprite>::erase(eraseResultBuf,pvVar2);
|
|
pvVar2 = (void *)*eraseResult;
|
|
}
|
|
} while (pvVar2 != (this->_costumeSpriteDescs)._end);
|
|
}
|
|
UpdateCostumes(this);
|
|
}
|
|
if ((this->_isPlayingExtraAnimation != 0) || (this->_isPlayingItemAnimation != 0)) {
|
|
if (((this->_bodySprite)._animState._animData != (void *)0x0) &&
|
|
((this->_bodySprite)._animState._isPlaying != 0)) {
|
|
animNameCursor = (this->_bodySprite)._animState._animData;
|
|
if (animNameCursor == GHIDRA_CAST<byte *>(0x0)) {
|
|
animNameCursor = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint *>((animNameCursor + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<byte **>(animNameCursor);
|
|
}
|
|
targetNameCursor = "HideItem";
|
|
do {
|
|
bVar1 = *animNameCursor;
|
|
isLess = bVar1 < (byte)*targetNameCursor;
|
|
if (bVar1 != *targetNameCursor) {
|
|
LAB_007c37b3:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007c37b8;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = animNameCursor[1];
|
|
isLess = bVar1 < (byte)targetNameCursor[1];
|
|
if (bVar1 != targetNameCursor[1]) goto LAB_007c37b3;
|
|
animNameCursor = animNameCursor + 2;
|
|
targetNameCursor = targetNameCursor + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_007c37b8:
|
|
if (uVar3 == 0) goto LAB_007c37d4;
|
|
}
|
|
if (this->_itemState == 0x25c) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
}
|
|
}
|
|
LAB_007c37d4:
|
|
this->_itemState = 0;
|
|
return;
|
|
}
|
|
|
|
// 007c37f0
|
|
void Entity_Player::SetShootingCooldown(int cooldown)
|
|
{
|
|
int *maxCooldown;
|
|
int *fireBlockCooldown;
|
|
|
|
fireBlockCooldown = &this->_fireBlockCooldown;
|
|
maxCooldown = &cooldown;
|
|
if (cooldown < *fireBlockCooldown) {
|
|
maxCooldown = fireBlockCooldown;
|
|
}
|
|
*fireBlockCooldown = *maxCooldown;
|
|
return;
|
|
}
|
|
|
|
// 007c3810
|
|
byte Entity_Player::NeedsCharge(int slot)
|
|
{
|
|
byte bVar1;
|
|
ItemConfig_Item *item;
|
|
int iVar2;
|
|
uint activeSlot;
|
|
|
|
if (slot < 0) {
|
|
activeSlot = 0;
|
|
do {
|
|
bVar1 = NeedsCharge(this,activeSlot);
|
|
if (bVar1 != 0) {
|
|
return 1;
|
|
}
|
|
activeSlot = activeSlot + 1;
|
|
} while (activeSlot < 4);
|
|
return 0;
|
|
}
|
|
if ((slot < 4) && (iVar2 = this->_activeDesc[slot]._item, iVar2 != 0)) {
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar2);
|
|
iVar2 = GetActiveMaxCharge(this,slot);
|
|
if ((item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) &&
|
|
(((item->type == 3 && (iVar2 != 2)) && (iVar2 = GetActiveMaxCharge(this,slot), iVar2 != 0))))
|
|
{
|
|
if (iVar2 <= this->_activeDesc[slot]._charge) {
|
|
bVar1 = HasCollectible(this,0x3f,0);
|
|
if (bVar1 == 0) {
|
|
return 0;
|
|
}
|
|
if (iVar2 <= this->_activeDesc[slot]._batteryCharge) {
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007c38c0
|
|
byte Entity_Player::FullCharge(int slot, byte isForce, byte isOvercharge)
|
|
{
|
|
byte slotResult;
|
|
ItemConfig_Item *item;
|
|
int maxCharge;
|
|
int chargeAmount;
|
|
uint activeSlot;
|
|
byte result;
|
|
|
|
if (slot < 0) {
|
|
result = 0;
|
|
activeSlot = 0;
|
|
do {
|
|
slotResult = FullCharge(this,activeSlot,isForce,0);
|
|
activeSlot = activeSlot + 1;
|
|
result = result + slotResult;
|
|
} while (activeSlot < 4);
|
|
return result;
|
|
}
|
|
if (3 < slot) {
|
|
return 0;
|
|
}
|
|
result = 0;
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(this->_activeDesc[slot]._item);
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
maxCharge = GetActiveMaxCharge(this,slot);
|
|
chargeAmount = maxCharge * 2;
|
|
if ((this->_activeDesc[slot]._item == 0x1b9) && (isForce == 0)) {
|
|
chargeAmount = maxCharge / 2;
|
|
}
|
|
chargeAmount = AddActiveCharge(this,chargeAmount,slot,1,isOvercharge,isForce);
|
|
result = (byte)chargeAmount;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// 007c3980
|
|
void Entity_Player::add_random_stat_up(RNG *rng)
|
|
{
|
|
code *pcVar1;
|
|
uint rngSeed;
|
|
int *statModifiers [4];
|
|
int *local_10;
|
|
int *local_c;
|
|
int *local_8;
|
|
|
|
local_8 = GHIDRA_CAST<int *>((__security_cookie ^ GHIDRA_UINT((statModifiers + 7))));
|
|
statModifiers[0] = &this->_speedModifier;
|
|
rngSeed = rng->_seed;
|
|
statModifiers[1] = &this->_fireDelayModifier;
|
|
statModifiers[2] = &this->_damageModifier;
|
|
statModifiers[3] = &this->_tearRangeModifier;
|
|
local_10 = &this->_shotSpeedModifier;
|
|
local_c = &this->_luckModifier;
|
|
if (rngSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
rngSeed = rng->_seed;
|
|
if (rngSeed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
rngSeed = rngSeed >> ((byte)rng->_shift1 & 0x1f) ^ rngSeed;
|
|
rngSeed = rngSeed << ((byte)rng->_shift2 & 0x1f) ^ rngSeed;
|
|
rngSeed = rngSeed >> ((byte)rng->_shift3 & 0x1f) ^ rngSeed;
|
|
rng->_seed = rngSeed;
|
|
*statModifiers[rngSeed % 6] = *statModifiers[rngSeed % 6] + 1;
|
|
this->_cacheFlags = this->_cacheFlags | 0x41f;
|
|
EvaluateItems(this);
|
|
if ((this->_pitfallState == 0) && (this->_dead == 0)) {
|
|
AnimateHappy(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c3a60
|
|
void Entity_Player::preload_item_sounds()
|
|
{
|
|
byte isOwned;
|
|
undefined1 *loadedCount;
|
|
Manager *manager;
|
|
void *sounds;
|
|
|
|
manager = g_manager;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f1))) != '\0') {
|
|
sounds = (g_manager->_sfxManager)._sounds._begin;
|
|
if (0x102 < (GHIDRA_INT((g_manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x1bd08)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x1bb70)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x1bd09)) = 0;
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x96 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x10368)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 66000)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x10369)) = 0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f3))) != '\0') {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x85 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0xe630)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0xe498)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0xe631)) = 0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f2))) != '\0') {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (7 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0xda0)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0xc08)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0xda1)) = 0;
|
|
}
|
|
}
|
|
isOwned = HasCollectible(this,0x9b,0);
|
|
if (isOwned != 0) {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0xed < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x198f0)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x19758)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x198f1)) = 0;
|
|
}
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x37 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x6020)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x5e88)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x6021)) = 0;
|
|
}
|
|
isOwned = HasCollectible(this,0x31,0);
|
|
if (isOwned != 0) {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (5 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0xa30)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x898)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0xa31)) = 0;
|
|
}
|
|
}
|
|
if (this->_activeDesc[0]._item != 0) {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0xab < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x12780)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x125e8)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x12781)) = 0;
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0xda < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x17848)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x176b0)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x17849)) = 0;
|
|
}
|
|
isOwned = HasCollectible(this,0x3f,0);
|
|
if (isOwned == 0) {
|
|
isOwned = HasTrinket(this,3,0);
|
|
if (isOwned == 0) goto LAB_007c3e5c;
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0xaa < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x125c8)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x12430)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x125c9)) = 0;
|
|
}
|
|
}
|
|
LAB_007c3e5c:
|
|
isOwned = HasCollectible(this,0x24,0);
|
|
if (isOwned != 0) {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x25 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x4130)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x3f98)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x4131)) = 0;
|
|
}
|
|
}
|
|
isOwned = HasCollectible(this,0x2d,0);
|
|
if (isOwned == 0) {
|
|
isOwned = HasCollectible(this,0x3e,0);
|
|
if (isOwned == 0) goto LAB_007c3f3a;
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x9d < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x10f70)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x10dd8)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x10f71)) = 0;
|
|
}
|
|
LAB_007c3f3a:
|
|
isOwned = HasCollectible(this,0x53,0);
|
|
if (isOwned != 0) {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x77 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0xce20)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0xcc88)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0xce21)) = 0;
|
|
}
|
|
}
|
|
if ((this->_pocketSlots[1] == 0) && (this->_pocketSlots[0] != 0)) {
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x84 < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0xe478)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0xe2e0)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0xe479)) = 0;
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x10c < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x1ce38)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x1cca0)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x1ce39)) = 0;
|
|
}
|
|
sounds = (manager->_sfxManager)._sounds._begin;
|
|
if (0x10b < (GHIDRA_INT((manager->_sfxManager)._sounds._end) - GHIDRA_INT(sounds)) / 0x1b8) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sounds) + 0x1cc80)) == '\0') {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Preload sound %d.\n"));
|
|
(GHIDRA_CAST<SoundEffect *>((GHIDRA_CAST<SoundEffect *>((GHIDRA_INT(sounds) + 0x1cae8)))))->SoundEffect::Load();
|
|
loadedCount = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_sfxManager))) + 0xc)));
|
|
*GHIDRA_CAST<int *>(loadedCount) = *GHIDRA_CAST<int *>(loadedCount) + 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(sounds) + 0x1cc81)) = 0;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c40e0
|
|
byte Entity_Player::CanUsePill(int pillEffect)
|
|
{
|
|
byte isInstantDeathCursed;
|
|
int minHealth;
|
|
int iVar1;
|
|
|
|
if (pillEffect == 1) {
|
|
isInstantDeathCursed = HasInstantDeathCurse(this);
|
|
if (isInstantDeathCursed == 0) {
|
|
iVar1 = (this->_boneHearts - this->_rottenHearts) + this->_soulHearts + this->_redHearts;
|
|
LAB_007c410f:
|
|
minHealth = 0x10;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
minHealth = 2;
|
|
}
|
|
return minHealth < iVar1;
|
|
}
|
|
}
|
|
else {
|
|
if (pillEffect != 6) {
|
|
return 1;
|
|
}
|
|
isInstantDeathCursed = HasInstantDeathCurse(this);
|
|
if (isInstantDeathCursed == 0) {
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 == 1) {
|
|
iVar1 = this->_soulHearts;
|
|
}
|
|
else {
|
|
if (iVar1 == 3) {
|
|
return 0;
|
|
}
|
|
if (iVar1 == 4) {
|
|
iVar1 = this->_boneHearts * 2;
|
|
}
|
|
else {
|
|
iVar1 = this->_maxHearts;
|
|
}
|
|
}
|
|
goto LAB_007c410f;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007c4180
|
|
void Entity_Player::UsePill(int pillEffect, int pillColor, uint useFlags)
|
|
{
|
|
std_vector *onlineStats;
|
|
int iVar1;
|
|
code *pcVar2;
|
|
ANM2 *pAVar3;
|
|
undefined2 *puVar4;
|
|
char cVar5;
|
|
byte bVar6;
|
|
void *pvVar7;
|
|
uint uVar8;
|
|
uint uVar9;
|
|
std_string *pillNameResult;
|
|
StringTable *pillRng;
|
|
char *pcVar10;
|
|
undefined4 *puVar11;
|
|
uint uVar12;
|
|
ColorMod *color;
|
|
int iVar13;
|
|
undefined3 extraout_var;
|
|
Game *game;
|
|
int *piVar14;
|
|
ItemConfig_Item *itemConfig;
|
|
Entity_Player *pEVar15;
|
|
Entity_Tear *tear;
|
|
BitSet128 *tearFlags;
|
|
uint uVar16;
|
|
Entity *tmpEntity;
|
|
Vector *pVVar17;
|
|
uint *rngState;
|
|
byte *pbVar18;
|
|
byte *pbVar19;
|
|
ColorMod *color_00;
|
|
Manager *extraout_ECX;
|
|
Manager *extraout_ECX_00;
|
|
Manager *extraout_ECX_01;
|
|
Manager *extraout_ECX_02;
|
|
Manager *extraout_ECX_03;
|
|
ColorMod *other;
|
|
Manager *extraout_ECX_04;
|
|
Manager *extraout_ECX_05;
|
|
Manager *extraout_ECX_06;
|
|
Manager *extraout_ECX_07;
|
|
Manager *extraout_ECX_08;
|
|
void *Effect;
|
|
Vector *direction;
|
|
Manager *extraout_ECX_09;
|
|
Manager *extraout_ECX_10;
|
|
Manager *extraout_ECX_11;
|
|
Manager *extraout_ECX_12;
|
|
ColorMod *other_00;
|
|
Color *this_01;
|
|
Manager *extraout_ECX_13;
|
|
Manager *extraout_ECX_14;
|
|
ColorMod *other_01;
|
|
Manager *extraout_ECX_15;
|
|
ColorMod *other_02;
|
|
Manager *extraout_ECX_16;
|
|
ColorMod *other_03;
|
|
Manager *extraout_ECX_17;
|
|
ColorMod *other_04;
|
|
undefined2 *puVar20;
|
|
Manager *extraout_ECX_18;
|
|
Manager *extraout_ECX_19;
|
|
Manager *extraout_ECX_20;
|
|
Manager *extraout_ECX_21;
|
|
Manager *extraout_ECX_22;
|
|
undefined4 extraout_ECX_23;
|
|
undefined4 extraout_ECX_24;
|
|
Vector *direction_00;
|
|
ColorMod *color_01;
|
|
Manager *extraout_ECX_25;
|
|
Manager *extraout_ECX_26;
|
|
Manager *extraout_ECX_27;
|
|
Manager *pMVar21;
|
|
Manager *extraout_ECX_28;
|
|
Manager *extraout_ECX_29;
|
|
Manager *extraout_ECX_30;
|
|
Manager *extraout_ECX_31;
|
|
Manager *extraout_ECX_32;
|
|
Manager *extraout_ECX_33;
|
|
Manager *extraout_ECX_34;
|
|
Manager *extraout_ECX_35;
|
|
Manager *extraout_ECX_36;
|
|
void *Effect_00;
|
|
Manager *extraout_ECX_37;
|
|
Manager *extraout_ECX_38;
|
|
Manager *extraout_ECX_39;
|
|
Manager *extraout_ECX_40;
|
|
Manager *extraout_ECX_41;
|
|
Manager *extraout_ECX_42;
|
|
Manager *extraout_ECX_43;
|
|
Manager *extraout_ECX_44;
|
|
Manager *extraout_ECX_45;
|
|
Manager *extraout_ECX_46;
|
|
Manager *extraout_ECX_47;
|
|
Manager *extraout_ECX_48;
|
|
Manager *extraout_ECX_49;
|
|
Manager *extraout_ECX_50;
|
|
float **ppfVar22;
|
|
char extraout_DL;
|
|
ItemPool **textCapacity;
|
|
char *size;
|
|
RNG *pillRng;
|
|
int extraout_EDX;
|
|
ItemPool *pIVar23;
|
|
byte *copySrc;
|
|
float *pfVar24;
|
|
byte *copyDst;
|
|
bool bVar25;
|
|
float rngFloat;
|
|
char acStackY_308 [128];
|
|
void *in_stack_fffffd8c;
|
|
int in_stack_fffffd90;
|
|
char *in_stack_fffffd94;
|
|
byte flashHUD;
|
|
int iVar26;
|
|
float fVar27;
|
|
byte force;
|
|
float blueOffset;
|
|
uint useFlagsLocal;
|
|
Manager *pillConfig;
|
|
Vector local_230;
|
|
undefined1 tempEffect [4];
|
|
float *local_224;
|
|
Vector local_220;
|
|
byte local_216;
|
|
char isSkipStatDown;
|
|
undefined4 local_214;
|
|
float *local_210;
|
|
Manager *local_20c;
|
|
ItemPool *local_208;
|
|
uint isHorsePill;
|
|
Color luckUpColor;
|
|
Color tearsUpColor;
|
|
Color effectColor;
|
|
Color local_17c;
|
|
Color CStack_150;
|
|
std_string pillDescription;
|
|
std_string pillName;
|
|
undefined1 local_ec [8];
|
|
float fStack_e4;
|
|
float fStack_e0;
|
|
float fStack_dc;
|
|
float **local_d8;
|
|
float fStack_d4;
|
|
float fStack_d0;
|
|
float fStack_cc;
|
|
float local_c8;
|
|
undefined1 *local_c4;
|
|
undefined1 local_c0 [20];
|
|
undefined1 local_ac [4];
|
|
byte experimentalText [132];
|
|
uint stackCookie;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
undefined4 flagsHigh;
|
|
|
|
game = g_game;
|
|
puStack_20 = experimentalText + 0xa4;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afff9c;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((experimentalText + 0x98));
|
|
ExceptionList = &local_1c;
|
|
onlineStats = &g_game->_onlinePlayerStats;
|
|
g_game->_bloomDuration = 0x1e;
|
|
game->_bloomTimer = 0x1e;
|
|
game->_bloomStrength = 1.0;
|
|
Player_stats_add(onlineStats,6,this,1.0);
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
useFlagsLocal = useFlags;
|
|
}
|
|
else {
|
|
pvVar7 = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::GetDeviceByPlayerEntity(this);
|
|
if ((pvVar7 == (void *)0x0) ||
|
|
(cVar5 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x370)) + 0x14))(), cVar5 != '\0')) {
|
|
useFlagsLocal = useFlags;
|
|
}
|
|
else {
|
|
useFlagsLocal = useFlags | 0x900;
|
|
}
|
|
}
|
|
isHorsePill = GHIDRA_UINT(pillColor) >> 0xb & 0xffffff01;
|
|
uVar8 = pillColor & 0x7ff;
|
|
if (uVar8 == 0xe) {
|
|
pvVar7 = (this->_collectibleRNGs)._begin;
|
|
rngState = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar7) + 0x4b0));
|
|
local_208 = &g_game->_itemPool;
|
|
uVar9 = *rngState;
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar9 = *rngState;
|
|
if (uVar9 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar9 = uVar9 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar7) + 0x4b4)) & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar7) + 0x4b8)) & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar7) + 0x4bc)) & 0x1f) ^ uVar9;
|
|
*rngState = uVar9;
|
|
in_stack_fffffd94 = GHIDRA_CAST<char *>(0x7c4310);
|
|
(GHIDRA_CAST<ItemPool *>((local_208)))->ItemPool::on_pill_used(pillColor,uVar9,rngState);
|
|
}
|
|
else {
|
|
uVar12 = -GHIDRA_UINT((uVar8 != 0)) & uVar8;
|
|
uVar9 = 0xe;
|
|
if (uVar12 < 0xe) {
|
|
uVar9 = uVar12;
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((&g_game->_itemPool + 1)) + uVar9 + 0x3c)) = 1;
|
|
}
|
|
pillName._size = 0;
|
|
pillName._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) = GHIDRA_CAST<float **>(0x0);
|
|
pillDescription._size = 0;
|
|
pillDescription._capacity = 0xf;
|
|
pillDescription._buf[0] = '\0';
|
|
pillDescription._buf[1] = '\0';
|
|
pillDescription._buf[2] = '\0';
|
|
pillDescription._buf[3] = '\0';
|
|
local_14 = 1;
|
|
local_20c = g_manager;
|
|
if ((pillEffect < 0) ||
|
|
(pvVar7 = (g_manager->_itemConfig)._pillEffects._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._pillEffects._end) - GHIDRA_INT(pvVar7) >> 2 <= pillEffect)) {
|
|
pillConfig = GHIDRA_CAST<Manager *>(0x0);
|
|
}
|
|
else {
|
|
pillConfig = *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(pvVar7) + pillEffect * 4));
|
|
}
|
|
if (g_game->_challenge == 0x20) {
|
|
if (-1 < pillEffect) {
|
|
if (pillEffect < 0x32) {
|
|
rngState = GHIDRA_CAST<uint *>((pillEffect * 0x10 + GHIDRA_INT((this->_pillRNGs)._begin)));
|
|
uVar9 = *rngState;
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar9 = *rngState;
|
|
if (uVar9 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar9 = uVar9 >> ((byte)rngState[1] & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 << ((byte)rngState[2] & 0x1f) ^ uVar9;
|
|
local_208 = GHIDRA_CAST<ItemPool *>((uVar9 >> ((byte)rngState[3] & 0x1f)));
|
|
uVar9 = GHIDRA_UINT(local_208) ^ uVar9;
|
|
*rngState = uVar9;
|
|
uVar9 = uVar9 % 0x32;
|
|
pvVar7 = (local_20c->_itemConfig)._pillEffects._begin;
|
|
if (GHIDRA_INT((local_20c->_itemConfig)._pillEffects._end) - GHIDRA_INT(pvVar7) >> 2 <= GHIDRA_INT(uVar9)) {
|
|
pillConfig = GHIDRA_CAST<Manager *>(0x0);
|
|
goto LAB_007c46b3;
|
|
}
|
|
pillConfig = *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(pvVar7) + uVar9 * 4));
|
|
}
|
|
LAB_007c4477:
|
|
if (pillConfig != GHIDRA_CAST<Manager *>(0x0)) {
|
|
pillNameResult = (GHIDRA_CAST<PocketItemConfig *>((pillConfig)))->PocketItemConfig::GetName(GHIDRA_CAST<std_string *>(local_c0),0x14);
|
|
if (&pillName != pillNameResult) {
|
|
if (0xf < pillName._capacity) {
|
|
uVar9 = pillName._capacity + 1;
|
|
ppfVar22 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<float **>(pillName._buf))) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
ppfVar22 = *GHIDRA_CAST<float ***>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) + -4));
|
|
uVar9 = pillName._capacity + 0x24;
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) + (-4 - GHIDRA_INT(ppfVar22)))))
|
|
goto LAB_007c453e;
|
|
}
|
|
operator_delete(ppfVar22,uVar9);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(pillNameResult->_buf);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((pillNameResult->_buf + 4));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((pillNameResult->_buf + 8));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((pillNameResult->_buf + 0xc));
|
|
pillName._size = pillNameResult->_size;
|
|
pillName._capacity = pillNameResult->_capacity;
|
|
pillNameResult->_size = 0;
|
|
pillNameResult->_capacity = 0xf;
|
|
pillNameResult->_buf[0] = '\0';
|
|
}
|
|
if (0xf < GHIDRA_UINT(local_ac)) {
|
|
uVar9 = GHIDRA_INT(local_ac) + 1;
|
|
pvVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_c0)) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x0))) + -4);
|
|
uVar9 = GHIDRA_INT(local_ac) + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x0))) + (-4 - GHIDRA_INT(pvVar7))))) {
|
|
LAB_007c453e:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar7,uVar9);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x10))) = 0;
|
|
local_ac = (undefined1 [4])0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x0))) & 0xffffff00;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pillConfig->_persistentGameData))) + 0x1c)))) == 0) {
|
|
CStack_150._colorize[1] = 0.0;
|
|
CStack_150._offset[2] = 2.10195e-44;
|
|
CStack_150._offset[1] = 0.0;
|
|
}
|
|
else {
|
|
pbVar19 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pillConfig->_persistentGameData))) + 0xc)));
|
|
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pillConfig->_persistentGameData))) + 0x20))))) {
|
|
pbVar19 = *GHIDRA_CAST<byte **>(pbVar19);
|
|
}
|
|
pillRng = &g_manager->_stringTable;
|
|
local_20c = *GHIDRA_CAST<Manager **>(pillRng);
|
|
if (*pbVar19 == 0x23) {
|
|
local_208 = GHIDRA_CAST<ItemPool *>((pbVar19 + 1));
|
|
local_214 = (float)(GHIDRA_UINT(local_214) & 0xffffff);
|
|
in_stack_fffffd94 = "PocketItems";
|
|
in_stack_fffffd90 = 0x7c45e5;
|
|
StringTable::get_string
|
|
(pillRng,GHIDRA_CAST<byte *>("PocketItems"),GHIDRA_INT(local_20c),GHIDRA_CAST<byte *>(local_208),
|
|
GHIDRA_CAST<byte *>((GHIDRA_INT(&local_214) + 3)));
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) == '\0') {
|
|
local_216 = 0;
|
|
in_stack_fffffd94 = "PocketItems";
|
|
in_stack_fffffd90 = 0x7c461e;
|
|
pbVar19 = StringTable::get_string
|
|
(pillRng,GHIDRA_CAST<byte *>("PocketItems"),GHIDRA_INT(local_20c),GHIDRA_CAST<byte *>(local_208),
|
|
&local_216);
|
|
}
|
|
}
|
|
CStack_150._colorize[1] = 0.0;
|
|
CStack_150._offset[1] = 0.0;
|
|
CStack_150._offset[2] = 2.10195e-44;
|
|
pbVar18 = pbVar19;
|
|
do {
|
|
bVar6 = *pbVar18;
|
|
pbVar18 = pbVar18 + 1;
|
|
} while (bVar6 != 0);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((CStack_150._colorize + 1)))))->std::string::assign(pbVar19,
|
|
GHIDRA_INT(pbVar18) - GHIDRA_INT((pbVar19 + 1)));
|
|
}
|
|
if (0xf < pillDescription._capacity) {
|
|
uVar9 = pillDescription._capacity + 1;
|
|
pvVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)pillDescription._buf)) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) + -4);
|
|
uVar9 = pillDescription._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) - GHIDRA_INT(pvVar7)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar7,uVar9);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) = CStack_150._colorize[1];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x4))) = CStack_150._colorize[2];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x8))) = CStack_150._colorize[3];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0xc))) = CStack_150._offset[0];
|
|
pillDescription._size = GHIDRA_UINT(CStack_150._offset[1]);
|
|
pillDescription._capacity = GHIDRA_UINT(CStack_150._offset[2]);
|
|
}
|
|
}
|
|
}
|
|
else if (-1 < pillEffect) goto LAB_007c4477;
|
|
LAB_007c46b3:
|
|
game = g_game;
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x1d);
|
|
std::set<int>::find_node();
|
|
pMVar21 = g_manager;
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_220.y) + 0xd)) != '\0') ||
|
|
(pfVar24 = GHIDRA_CAST<float *>(local_220.y), 0x1d < GHIDRA_INT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_220.y) + 0x10))))) {
|
|
pfVar24 = (game->_seedEffects)._seedEffects;
|
|
}
|
|
if (pfVar24 != (game->_seedEffects)._seedEffects) {
|
|
local_214 = (float)(GHIDRA_UINT(local_214) & 0xffffff);
|
|
in_stack_fffffd94 = "PocketItems";
|
|
in_stack_fffffd90 = 0x7c472f;
|
|
StringTable::get_string
|
|
(&g_manager->_stringTable,GHIDRA_CAST<byte *>("PocketItems"),*GHIDRA_CAST<int *>(&g_manager->_stringTable),
|
|
GHIDRA_CAST<byte *>(0xb67da9),GHIDRA_CAST<byte *>((GHIDRA_INT(&local_214) + 3)));
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) == '\0') {
|
|
local_216 = 0;
|
|
in_stack_fffffd94 = "PocketItems";
|
|
in_stack_fffffd90 = 0x7c4761;
|
|
pcVar10 = GHIDRA_CAST<char *>(StringTable)::get_string
|
|
(&pMVar21->_stringTable,GHIDRA_CAST<byte *>("PocketItems"),
|
|
*GHIDRA_CAST<int *>(&pMVar21->_stringTable),GHIDRA_CAST<byte *>(0xb67da9),&local_216);
|
|
}
|
|
else {
|
|
pcVar10 = "#QUESTION_MARKS_NAME";
|
|
}
|
|
pbVar19 = GHIDRA_CAST<byte *>(pcVar10);
|
|
do {
|
|
bVar6 = *pbVar19;
|
|
pbVar19 = pbVar19 + 1;
|
|
} while (bVar6 != 0);
|
|
(GHIDRA_CAST<std::string *>((pillName._buf)))->std::string::assign(GHIDRA_CAST<byte *>(pcVar10),GHIDRA_INT(pbVar19) - GHIDRA_INT((pcVar10 + 1)));
|
|
pillDescription._size = 0;
|
|
pillNameResult = &pillDescription;
|
|
if (0xf < pillDescription._capacity) {
|
|
pillNameResult = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(pillDescription._buf))) + 0x0)));
|
|
}
|
|
pillNameResult->_buf[0] = '\0';
|
|
}
|
|
game = g_game;
|
|
textCapacity = &local_208;
|
|
ppfVar22 = &local_224;
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x9);
|
|
iVar26 = 0x7c47d0;
|
|
std::set<int>::find_node();
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_220.y) + 0xd)) != '\0') ||
|
|
(pfVar24 = GHIDRA_CAST<float *>(local_220.y), 9 < GHIDRA_INT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_220.y) + 0x10))))) {
|
|
pfVar24 = (game->_seedEffects)._seedEffects;
|
|
}
|
|
if (pfVar24 != (game->_seedEffects)._seedEffects) {
|
|
(GHIDRA_CAST<std::string *>((acStackY_308 + 0x94)))->std::string::string(&pillName);
|
|
puVar11 = string_scramble_seeded
|
|
(&local_d8,in_stack_fffffd8c,in_stack_fffffd90,GHIDRA_INT(in_stack_fffffd94),iVar26
|
|
,GHIDRA_UINT(ppfVar22),GHIDRA_UINT(textCapacity));
|
|
if (&pillName != GHIDRA_CAST<std_string *>(puVar11)) {
|
|
if (0xf < pillName._capacity) {
|
|
textCapacity = GHIDRA_CAST<ItemPool **>((pillName._capacity + 1));
|
|
ppfVar22 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<float **>(pillName._buf))) + 0x0)));
|
|
if (GHIDRA_CAST<ItemPool **>(0xfff) < textCapacity) {
|
|
ppfVar22 = *GHIDRA_CAST<float ***>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) + -4));
|
|
textCapacity = GHIDRA_CAST<ItemPool **>((pillName._capacity + 0x24));
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) + (-4 - GHIDRA_INT(ppfVar22)))))
|
|
goto LAB_007c48c4;
|
|
}
|
|
iVar26 = 0x7c4852;
|
|
operator_delete(ppfVar22,GHIDRA_UINT(textCapacity));
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) = *puVar11;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x4))) = puVar11[1];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x8))) = puVar11[2];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0xc))) = puVar11[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(pillName)) + 0x10))) = *GHIDRA_CAST<undefined8 *>((puVar11 + 4));
|
|
puVar11[4] = 0;
|
|
puVar11[5] = 0xf;
|
|
*GHIDRA_CAST<undefined1 *>(puVar11) = 0;
|
|
}
|
|
if (&DAT_0000000f < local_c4) {
|
|
textCapacity = GHIDRA_CAST<ItemPool **>((local_c4 + 1));
|
|
ppfVar22 = local_d8;
|
|
if (GHIDRA_CAST<ItemPool **>(0xfff) < textCapacity) {
|
|
ppfVar22 = GHIDRA_CAST<float **>(local_d8[-1]);
|
|
textCapacity = GHIDRA_CAST<ItemPool **>((local_c4 + 0x24));
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(local_d8) + (-4 - GHIDRA_INT(ppfVar22))))) {
|
|
LAB_007c48c4:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
iVar26 = 0x7c48d1;
|
|
operator_delete(ppfVar22,GHIDRA_UINT(textCapacity));
|
|
}
|
|
(GHIDRA_CAST<std::string *>((acStackY_308 + 0x94)))->std::string::string(&pillDescription);
|
|
pillNameResult =
|
|
string_scramble_seeded
|
|
(CStack_150._colorize + 1,in_stack_fffffd8c,in_stack_fffffd90,
|
|
GHIDRA_INT(in_stack_fffffd94),iVar26,GHIDRA_UINT(ppfVar22),GHIDRA_UINT(textCapacity));
|
|
if (&pillDescription != pillNameResult) {
|
|
if (0xf < pillDescription._capacity) {
|
|
uVar9 = pillDescription._capacity + 1;
|
|
pvVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)pillDescription._buf)) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) + -4);
|
|
uVar9 = pillDescription._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) - GHIDRA_INT(pvVar7)) - 4U) goto LAB_007c49a4;
|
|
}
|
|
operator_delete(pvVar7,uVar9);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(pillNameResult->_buf);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((pillNameResult->_buf + 4));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((pillNameResult->_buf + 8));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((pillNameResult->_buf + 0xc));
|
|
pillDescription._size = pillNameResult->_size;
|
|
pillDescription._capacity = pillNameResult->_capacity;
|
|
pillNameResult->_size = 0;
|
|
pillNameResult->_capacity = 0xf;
|
|
pillNameResult->_buf[0] = '\0';
|
|
}
|
|
if (GHIDRA_CAST<char *>(0xf) < GHIDRA_UINT(CStack_150._offset[2])) {
|
|
size = GHIDRA_CAST<char *>((GHIDRA_INT(CStack_150._offset[2]) + 1));
|
|
pcVar10 = GHIDRA_CAST<char *>(CStack_150._colorize[1]);
|
|
if (GHIDRA_CAST<char *>(0xfff) < size) {
|
|
pcVar10 = *GHIDRA_CAST<char **>((GHIDRA_INT(CStack_150._colorize[1]) + -4));
|
|
size = GHIDRA_CAST<char *>((GHIDRA_INT(CStack_150._offset[2]) + 0x24));
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(CStack_150._colorize[1]) + (-4 - GHIDRA_INT(pcVar10))))) {
|
|
LAB_007c49a4:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar10,GHIDRA_UINT(size));
|
|
}
|
|
CStack_150._offset[1] = 0.0;
|
|
CStack_150._offset[2] = 2.10195e-44;
|
|
CStack_150._colorize[1] = (float)(GHIDRA_UINT(CStack_150._colorize[1]) & 0xffffff00);
|
|
}
|
|
local_230.y = (float)(useFlagsLocal & 0x800);
|
|
if (GHIDRA_CAST<EntityPtr *>(local_230.y) == GHIDRA_CAST<EntityPtr *>(0x0)) {
|
|
if (pillEffect != 0x31) {
|
|
PlayerHUD::show_pill_name();
|
|
goto LAB_007c4a29;
|
|
}
|
|
LAB_007c4a2e:
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) + pillEffect * 4));
|
|
*piVar14 = *piVar14 + 1;
|
|
if ((char)isHorsePill != '\0') {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) + pillEffect * 4));
|
|
*piVar14 = *piVar14 + 1;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007c4a29:
|
|
if (GHIDRA_UINT(pillEffect) < 0x32) goto LAB_007c4a2e;
|
|
}
|
|
FUN_00763290();
|
|
if (4 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) + 0xac))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x182);
|
|
}
|
|
iVar26 = 2;
|
|
local_20c = GHIDRA_CAST<Manager *>((g_manager->_optionsConfig)._announcerVoiceMode);
|
|
if (local_20c == (void *)0x0) {
|
|
iVar26 = 900;
|
|
}
|
|
if ((pillEffect < 0) ||
|
|
(GHIDRA_INT((this->_pillRNGs)._end) - GHIDRA_INT((this->_pillRNGs)._begin) >> 4 <= pillEffect)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Pill ID out of bounds!\n"));
|
|
}
|
|
pvVar7 = (this->_pillRNGs)._begin;
|
|
uVar9 = (GHIDRA_INT((this->_pillRNGs)._end) - GHIDRA_INT(pvVar7) >> 4) - 1;
|
|
uVar12 = -GHIDRA_UINT((pillEffect != 0)) & pillEffect;
|
|
if (uVar12 < uVar9) {
|
|
uVar9 = uVar12;
|
|
}
|
|
pillRng = GHIDRA_CAST<RNG *>((uVar9 * 0x10 + GHIDRA_INT(pvVar7)));
|
|
local_214 = (float)(useFlagsLocal >> 7 & 0xffffff01);
|
|
uVar9 = Random();
|
|
if (((((uVar9 & 1) == 0) && (local_20c == (void *)0x0)) || (local_20c == (void *)0x2)) &&
|
|
((useFlagsLocal & 0x100) == 0)) {
|
|
iVar13 = g_game->_stage;
|
|
if ((iVar13 < 1) || (6 < iVar13)) {
|
|
if (iVar13 != 0xd) goto LAB_007c4b4b;
|
|
goto LAB_007c4b59;
|
|
}
|
|
bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x30);
|
|
if (bVar6 != 0) goto LAB_007c4b59;
|
|
LAB_007c4b4b:
|
|
local_216 = 1;
|
|
}
|
|
else {
|
|
LAB_007c4b59:
|
|
local_216 = 0;
|
|
}
|
|
game = g_game;
|
|
cVar5 = (char)isHorsePill;
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x25c);
|
|
local_210 = GHIDRA_CAST<float *>(0x84);
|
|
if (cVar5 != '\0') {
|
|
local_210 = GHIDRA_CAST<float *>(0x25c);
|
|
}
|
|
switch(pillEffect) {
|
|
case 0:
|
|
pVVar17 = &this->_pos;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
if (extraout_DL != '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(pVVar17,170.0,GHIDRA_CAST<Entity *>(this),2.0,0,color);
|
|
Game::ButterBeanFart(g_game,pVVar17,200.0,GHIDRA_CAST<Entity *>(this),0,0);
|
|
pIVar23 = g_game->_room;
|
|
local_208 = pIVar23;
|
|
iVar13 = FUN_00456540();
|
|
if (0 < iVar13) {
|
|
cVar5 = '\0';
|
|
local_214 = (float)(GHIDRA_UINT(local_214) & 0xffffff);
|
|
local_20c = (void *)0x0;
|
|
if (pIVar23[2]._pools[0xf]._poolList._capacity != (void *)0x0) {
|
|
do {
|
|
tmpEntity = *(Entity **)
|
|
(GHIDRA_INT(pIVar23[2]._pools[0xf]._poolList._begin) + GHIDRA_INT(local_20c) * 4);
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (tmpEntity->_type == 1)) ||
|
|
(tmpEntity->_type - 10U < 0x3de)) {
|
|
local_ac = *(undefined1 (*) [4])(GHIDRA_INT(&tmpEntity->_flags) + 4);
|
|
if (((tmpEntity->_flags & 0x11) == 0) && ((tmpEntity->_flags & 0x20000011) == 0)) {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_ec + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::AddPoison(GHIDRA_CAST<EntityRef *>((local_ec + 4)),0x5a,0.0,0);
|
|
local_214 = (float)CONCAT13(1,(undefined3)local_214);
|
|
cVar5 = '\x01';
|
|
}
|
|
else {
|
|
cVar5 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3)));
|
|
}
|
|
}
|
|
local_20c = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_20c) + 1));
|
|
pIVar23 = local_208;
|
|
} while (local_20c < local_208[2]._pools[0xf]._poolList._capacity);
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 0.0;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3f800000);
|
|
fStack_d4 = 0.0;
|
|
fStack_d0 = 1.0;
|
|
(GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>((GHIDRA_INT(g_game->_room) + 0x1618)))))->Game::start_poop_cloud_screen_effect(color_00);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_007c5fcc;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(pVVar17,85.0,GHIDRA_CAST<Entity *>(this),1.0,0,color);
|
|
Game::ButterBeanFart(g_game,pVVar17,120.0,GHIDRA_CAST<Entity *>(this),0,0);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_00;
|
|
break;
|
|
case 1:
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(this) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_ec + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(*pcVar2)();
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_01;
|
|
break;
|
|
case 2:
|
|
AddSoulHearts(this,(isHorsePill & 0xff) * 4 + 4,0);
|
|
goto LAB_007c4df2;
|
|
case 3:
|
|
if (this->_playerType == 0x19) {
|
|
iVar13 = this->_numKeys;
|
|
this->_numKeys = this->_poopMana;
|
|
this->_poopMana = iVar13;
|
|
AddPoopMana(this,0);
|
|
if ((char)isHorsePill != '\0') {
|
|
AddPoopMana(this,(this->_poopMana + 1) / 2);
|
|
goto LAB_007c4eaa;
|
|
}
|
|
}
|
|
else {
|
|
iVar13 = this->_numKeys;
|
|
bVar6 = this->_hasGoldenBomb;
|
|
this->_numKeys = this->_numBombs;
|
|
this->_numBombs = iVar13;
|
|
this->_hasGoldenBomb = this->_hasGoldenKey;
|
|
this->_hasGoldenKey = bVar6;
|
|
if (cVar5 != '\0') {
|
|
AddBombs(this,(iVar13 + 1) / 2);
|
|
LAB_007c4eaa:
|
|
AddKeys(this,(this->_numKeys + 1) / 2);
|
|
}
|
|
}
|
|
ConsumableCountChanged(this,0x1e);
|
|
AnimateHappy(this);
|
|
game = g_game;
|
|
pMVar21 = extraout_ECX_03;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
break;
|
|
case 4:
|
|
play_sound_with_fart_seed(0x25,1.0,2,0,1.0);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0,-1);
|
|
puVar11 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(puVar11) & 0xfffffffcU)) < 1) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(*puVar11);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffect *>((tempEffect)))->TemporaryEffect::TemporaryEffect(itemConfig);
|
|
local_220.x = (float)&DAT_0000003c;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(Effect,1,1);
|
|
if ((char)isHorsePill != '\0') {
|
|
local_220.x = 4.2039e-44;
|
|
goto LAB_007c5476;
|
|
}
|
|
goto LAB_007c548c;
|
|
case 5:
|
|
if (cVar5 != '\0') {
|
|
AddSoulHearts(this,6,0);
|
|
}
|
|
SetFullHearts(this);
|
|
LAB_007c4df2:
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
pMVar21 = extraout_ECX_02;
|
|
break;
|
|
case 6:
|
|
AddMaxHearts(this,(isHorsePill & 0xff ^ 1) * 2 + -4,0);
|
|
TryPreventDeath(this);
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_05;
|
|
break;
|
|
case 7:
|
|
AddMaxHearts(this,(isHorsePill & 0xff) * 2 + 2,0);
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 1.0;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3f000000);
|
|
fStack_d4 = 0.0;
|
|
fStack_d0 = 0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))))))->Color::operator_assign(other);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color(0.3,0.3,0.3,0.5,0.25,0.25);
|
|
this->SetColor();
|
|
this->_cacheFlags = this->_cacheFlags | 0x1000;
|
|
pMVar21 = extraout_ECX_04;
|
|
break;
|
|
case 8:
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 9) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 8));
|
|
}
|
|
if (cVar5 != '\0') {
|
|
RemoveCostume(this,itemConfig);
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x1d9)
|
|
{
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x1d8));
|
|
}
|
|
}
|
|
AddCostume(this,itemConfig,0);
|
|
play_sound_with_fart_seed(0xc5,1.0,2,0,1.0);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_10;
|
|
break;
|
|
case 9:
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 5) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 4));
|
|
}
|
|
if (cVar5 != '\0') {
|
|
RemoveCostume(this,itemConfig);
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x1dd)
|
|
{
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x1dc));
|
|
}
|
|
}
|
|
AddCostume(this,itemConfig,0);
|
|
AnimateSad(this);
|
|
IncrementPlayerFormCounter(this,0xb,1);
|
|
pMVar21 = extraout_ECX_11;
|
|
break;
|
|
case 10:
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x6b,1,1);
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | 0x200;
|
|
AnimateHappy(this);
|
|
pMVar21 = extraout_ECX_08;
|
|
break;
|
|
case 0xb:
|
|
this->_cacheFlags = this->_cacheFlags | 8;
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_12;
|
|
break;
|
|
case 0xc:
|
|
this->_cacheFlags = this->_cacheFlags | 0x1008;
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 0.5;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3f800000);
|
|
fStack_d4 = 1.0;
|
|
fStack_d0 = 0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))))))->Color::operator_assign(other_00);
|
|
this_01 = &local_17c;
|
|
blueOffset = 0.5;
|
|
goto LAB_007c5622;
|
|
case 0xd:
|
|
this->_cacheFlags = this->_cacheFlags | 0x10;
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_14;
|
|
break;
|
|
case 0xe:
|
|
this->_cacheFlags = this->_cacheFlags | 0x1010;
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 1.0;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3f800000);
|
|
fStack_d4 = 0.0;
|
|
fStack_d0 = 0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))))))->Color::operator_assign(other_01);
|
|
this_01 = &CStack_150;
|
|
blueOffset = 0.25;
|
|
rngFloat = 0.5;
|
|
fVar27 = 0.5;
|
|
goto LAB_007c5631;
|
|
case 0xf:
|
|
this->_cacheFlags = this->_cacheFlags | 2;
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_15;
|
|
break;
|
|
case 0x10:
|
|
this->_cacheFlags = this->_cacheFlags | 0x1002;
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 0.5;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3f000000);
|
|
fStack_d4 = 1.0;
|
|
fStack_d0 = 0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))))))->Color::operator_assign(other_02);
|
|
this_01 = &tearsUpColor;
|
|
blueOffset = 0.5;
|
|
rngFloat = 0.4;
|
|
fVar27 = 0.4;
|
|
goto LAB_007c5631;
|
|
case 0x11:
|
|
this->_cacheFlags = this->_cacheFlags | 0x400;
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_16;
|
|
break;
|
|
case 0x12:
|
|
this->_cacheFlags = this->_cacheFlags | 0x1400;
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 0.0;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3f800000);
|
|
fStack_d4 = 0.0;
|
|
fStack_d0 = 0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))))))->Color::operator_assign(other_03);
|
|
this_01 = &luckUpColor;
|
|
blueOffset = 0.25;
|
|
LAB_007c5622:
|
|
rngFloat = 0.5;
|
|
fVar27 = 0.25;
|
|
goto LAB_007c5631;
|
|
case 0x13:
|
|
if (cVar5 == '\0') {
|
|
iVar13 = g_game->_stage;
|
|
uVar9 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurses();
|
|
if (((uVar9 & 2) != 0) && (bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode(), bVar6 == 0)) {
|
|
iVar13 = iVar13 + 1;
|
|
}
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0x226);
|
|
if ((((bVar6 == 0) || (bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode(), bVar6 != 0)) || (iVar13 != 6)) &&
|
|
((bVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasPhotoDoor(), bVar6 == 0 ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 8)) != g_game->_lastBossRoomListIdx)))) {
|
|
local_20c = GHIDRA_CAST<Manager *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_20c)) + 0x1))),1));
|
|
}
|
|
else {
|
|
local_20c = GHIDRA_CAST<Manager *>((GHIDRA_UINT(local_20c) & 0xffffff00));
|
|
}
|
|
uVar9 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_pillRNGs)._begin) + 0x130)))))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::MoveToRandomRoom((byte)local_20c,uVar9,this);
|
|
pMVar21 = extraout_ECX_07;
|
|
}
|
|
else {
|
|
local_224 = GHIDRA_CAST<float *>(0x0);
|
|
local_220.x = 0.0;
|
|
local_220.y = 0.0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x4);
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x2);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 2.8026e-45;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x7);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 9.80909e-45;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x8);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 1.12104e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x12);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 2.52234e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x14);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 2.8026e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x15);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 2.94273e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0xc);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 1.68156e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0xb);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 1.54143e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x18);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 3.36312e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x9);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 1.26117e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>(&DAT_0000000d);
|
|
if (local_220.x == local_220.y) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_220.x) = 1.82169e-44;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
teleport_to_random_room_of_types(this,&local_224,1);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
FID_conflict__Tidy(&local_224);
|
|
pMVar21 = extraout_ECX_06;
|
|
}
|
|
break;
|
|
case 0x14:
|
|
uVar12 = 0;
|
|
fVar27 = local_214;
|
|
uVar9 = isHorsePill;
|
|
do {
|
|
if (SUB41(fVar27,0) == '\0') {
|
|
LAB_007c5dc8:
|
|
force = 0;
|
|
bVar6 = 0;
|
|
if ((char)uVar9 == '\0') {
|
|
bVar6 = FullCharge(this,uVar12,0,0);
|
|
if (CONCAT31(extraout_var,bVar6) != 0) break;
|
|
}
|
|
else {
|
|
flashHUD = 1;
|
|
uVar9 = uVar12;
|
|
iVar13 = GetActiveMaxCharge(this,uVar12);
|
|
AddActiveCharge(this,iVar13 * 2,uVar9,flashHUD,bVar6,force);
|
|
}
|
|
fVar27 = local_214;
|
|
uVar9 = isHorsePill;
|
|
}
|
|
else if (uVar12 != 0) goto LAB_007c5dc8;
|
|
uVar12 = uVar12 + 1;
|
|
} while (uVar12 < 4);
|
|
uVar9 = (GHIDRA_CAST<RNG *>((pillRng)))->RNG::RandomInt(2);
|
|
local_208 = GHIDRA_CAST<ItemPool *>((uVar9 + 3));
|
|
if ((char)isHorsePill == '\0') {
|
|
local_208 = GHIDRA_CAST<ItemPool *>((uVar9 + 1));
|
|
}
|
|
fVar27 = 0.0;
|
|
if (0 < GHIDRA_INT(local_208)) {
|
|
do {
|
|
local_230.y = (float)Random();
|
|
if (((char)local_214 == '\0') || (local_20c = (void *)0x2, fVar27 == 0.0)) {
|
|
local_20c = (void *)0x1;
|
|
}
|
|
pVVar17 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((local_c0 + 0x10)),&this->_pos,40.0,0,0,0);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x5a,pVVar17,&g_vectorZero,GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(local_20c),
|
|
GHIDRA_UINT(local_230.y));
|
|
tmpEntity[1]._sprite._championColor._offset[2] = fVar27;
|
|
fVar27 = (float)(GHIDRA_INT(fVar27) + 1);
|
|
} while (GHIDRA_INT(fVar27) < GHIDRA_INT(local_208));
|
|
}
|
|
AnimateHappy(this);
|
|
pMVar21 = extraout_ECX_19;
|
|
break;
|
|
case 0x15:
|
|
iVar13 = GetEffectiveMaxHearts(this);
|
|
if (2 < iVar13) {
|
|
iVar13 = 2;
|
|
}
|
|
iVar13 = scale_for_hard_difficulty(iVar13);
|
|
pEVar15 = GHIDRA_CAST<Entity_Player *>(this->_subPlayer);
|
|
this->_redHearts = iVar13;
|
|
if (pEVar15 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar13 = GetEffectiveMaxHearts(pEVar15);
|
|
if (2 < iVar13) {
|
|
iVar13 = 2;
|
|
}
|
|
pEVar15->_redHearts = iVar13;
|
|
}
|
|
UpdateHeartDependentEffects(this);
|
|
iVar13 = GetHealthType(this);
|
|
local_230.y = (float)&DAT_00000014;
|
|
if (iVar13 != 3) {
|
|
local_230.y = 1.4013e-44;
|
|
}
|
|
uVar9 = (GHIDRA_CAST<RNG *>((pillRng)))->RNG::RandomInt(4);
|
|
local_20c = (void *)0x0;
|
|
local_208 = GHIDRA_CAST<ItemPool *>((uVar9 + 4));
|
|
if ((char)isHorsePill == '\0') {
|
|
local_208 = GHIDRA_CAST<ItemPool *>((uVar9 + 1));
|
|
}
|
|
if (0 < GHIDRA_INT(local_208)) {
|
|
do {
|
|
uVar9 = Random();
|
|
pVVar17 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((local_c0 + 0x10)),&this->_pos,40.0,0,0,0);
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(local_230.y),pVVar17,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,
|
|
uVar9);
|
|
tmpEntity[1]._sprite._championColor._offset[2] = (float)local_20c;
|
|
local_20c = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_20c) + 1));
|
|
} while (GHIDRA_INT(local_20c) < GHIDRA_INT(local_208));
|
|
}
|
|
LAB_007c5fcc:
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_20;
|
|
break;
|
|
case 0x16:
|
|
this->_controlsCooldown = 0x78;
|
|
if (cVar5 != '\0') {
|
|
this->_controlsCooldown = 0xf0;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&effectColor)))->Color::Color(0.6,0.6,0.6,0.4,0.4,0.4);
|
|
this->SetColor();
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_21;
|
|
break;
|
|
case 0x17:
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_game)) + 0x11))) = 1;
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::ApplyMapEffect();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyBlueMapEffect();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyCompassEffect(1);
|
|
game = g_game;
|
|
}
|
|
(GHIDRA_CAST<Game *>((game)))->Game::UpdateVisibility();
|
|
AnimateHappy(this);
|
|
pMVar21 = extraout_ECX_22;
|
|
break;
|
|
case 0x18:
|
|
uVar9 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x22,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar9);
|
|
piVar14 = GHIDRA_CAST<int *>(__RTDynamicCast());
|
|
(GHIDRA_CAST<Color *>((&effectColor)))->Color::Color();
|
|
(**(code **)(*piVar14 + 0x3c))();
|
|
if ((char)isHorsePill != '\0') {
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x25);
|
|
FUN_0092df00(0x25,extraout_ECX_23,0,0);
|
|
FUN_0092df00(0x25,extraout_ECX_24,0x14,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(3);
|
|
piVar14[0x39] = GHIDRA_INT(((float)piVar14[0x39] + (float)piVar14[0x39]));
|
|
piVar14[0x3a] = GHIDRA_INT(((float)piVar14[0x3a] + (float)piVar14[0x3a]));
|
|
}
|
|
(**(code **)(*piVar14 + 0xc))();
|
|
ShootCandle(this,direction_00);
|
|
local_20c = (void *)0x0;
|
|
local_208 = g_game->_room;
|
|
if (local_208[2]._pools[0xf]._poolList._capacity != (void *)0x0) {
|
|
do {
|
|
pEVar15 = *(Entity_Player **)
|
|
(GHIDRA_INT(local_208[2]._pools[0xf]._poolList._begin) + GHIDRA_INT(local_20c) * 4);
|
|
if ((pEVar15 != this) &&
|
|
(bVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar15))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar6 != 0)) {
|
|
if ((char)isHorsePill == '\0') {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_ec + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
iVar13 = 0x96;
|
|
}
|
|
else {
|
|
cVar5 = pEVar15->IsBoss();
|
|
if ((cVar5 == '\0') && ((pEVar15->_flags & 0x20000000) == 0)) {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_ec + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar15))))->Entity::AddCharmed(GHIDRA_CAST<EntityRef *>((local_ec + 4)),-1,0,1);
|
|
if (pEVar15->_type == 0x104) {
|
|
if (pEVar15->_parent != (EntityPtr)0x0) {
|
|
local_230.y = (float)&pEVar15->_parent;
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
pEVar15->_parent = (EntityPtr)0x0;
|
|
}
|
|
goto LAB_007c62d0;
|
|
}
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_ec + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
iVar13 = 300;
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar15))))->Entity::AddCharmed(GHIDRA_CAST<EntityRef *>((local_ec + 4)),iVar13,0,0);
|
|
}
|
|
LAB_007c62d0:
|
|
local_20c = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_20c) + 1));
|
|
} while (local_20c < local_208[2]._pools[0xf]._poolList._capacity);
|
|
}
|
|
if ((char)isHorsePill == '\0') {
|
|
LAB_007c7497:
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_48;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 2.0;
|
|
local_d8 = GHIDRA_CAST<float **>(0x0);
|
|
fStack_d4 = 1.0;
|
|
fStack_d0 = 1.0;
|
|
Game::start_poop_cloud_screen_effect
|
|
(GHIDRA_CAST<Game *>((*GHIDRA_CAST<int *>((extraout_EDX + 0x18300)) + 0x1618)),color_01);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_25;
|
|
}
|
|
break;
|
|
case 0x19:
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::AddCurse(4,0);
|
|
if ((char)isHorsePill != '\0') {
|
|
bVar6 = HasCollectible(this,0x28e,0);
|
|
local_214 = (float)CONCAT13(bVar6,(undefined3)local_214);
|
|
bVar6 = HasCollectible(this,0x4b,0);
|
|
if (((bVar6 == 0) && (bVar6 = HasCollectible(this,0x12f,0), bVar6 == 0)) &&
|
|
((bVar6 = HasCollectible(this,0x2e,0), bVar6 == 0 &&
|
|
(iVar13 = GetZodiacEffect(this), iVar13 != 0x12f)))) {
|
|
bVar25 = false;
|
|
}
|
|
else {
|
|
bVar25 = true;
|
|
}
|
|
game = g_game;
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) == '\0') && (!bVar25)) {
|
|
uVar9 = 0;
|
|
do {
|
|
uVar16 = -GHIDRA_UINT(((uVar9 & 0x7ff) != 0)) & uVar9 & 0x7ff;
|
|
uVar12 = 0xe;
|
|
if (uVar16 < 0xe) {
|
|
uVar12 = uVar16;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((&game->_itemPool + 1)) + uVar12 + 0x3c)) = 0;
|
|
} while (GHIDRA_INT(uVar9) < 0xe);
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_26;
|
|
break;
|
|
}
|
|
}
|
|
goto LAB_007c679f;
|
|
case 0x1a:
|
|
uVar9 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x4e,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
tmpEntity = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
if ((char)isHorsePill != '\0') {
|
|
pAVar3 = &tmpEntity[1]._sprite;
|
|
(pAVar3->_animDefaultName)._buf[8] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[9] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[10] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[0xb] = '@';
|
|
}
|
|
goto LAB_007c6454;
|
|
case 0x1b:
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x19) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x18));
|
|
}
|
|
AddCostume(this,itemConfig,0);
|
|
AnimateHappy(this);
|
|
pMVar21 = GHIDRA_CAST<Manager *>(0x708);
|
|
cVar5 = (char)isHorsePill;
|
|
iVar13 = 900;
|
|
if (cVar5 != '\0') {
|
|
iVar13 = 0x708;
|
|
}
|
|
this->_rUaWizardTimer = this->_rUaWizardTimer + iVar13;
|
|
goto LAB_007c7557;
|
|
case 0x1c:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x6c,1,1);
|
|
if ((char)isHorsePill != '\0') {
|
|
AddHearts(this,0x14,0,0);
|
|
}
|
|
AnimateHappy(this);
|
|
pMVar21 = extraout_ECX_29;
|
|
break;
|
|
case 0x1d:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddNullEffect(0x1d,1,1);
|
|
if ((char)isHorsePill == '\0') goto LAB_007c679f;
|
|
AddBrokenHearts(this,1);
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_28;
|
|
break;
|
|
case 0x1e:
|
|
play_sound_with_fart_seed(0x25,1.0,2,0,1.0);
|
|
pvVar7 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar7) & 0xfffffffcU)) < 0x71) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x70));
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffect *>((tempEffect)))->TemporaryEffect::TemporaryEffect(itemConfig);
|
|
local_220.x = 4.2039e-44;
|
|
if ((char)isHorsePill != '\0') {
|
|
local_220.x = 4.2039e-43;
|
|
}
|
|
LAB_007c5476:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(tempEffect,1,1);
|
|
LAB_007c548c:
|
|
AnimateSad(this);
|
|
ShootCandle(this,direction);
|
|
pMVar21 = extraout_ECX_09;
|
|
break;
|
|
case 0x1f:
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::AddCurse(0x20,0);
|
|
pvVar7 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar7) >> 2 < 0x157) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x558));
|
|
}
|
|
AddCostume(this,itemConfig,0);
|
|
if ((char)isHorsePill != '\0') {
|
|
local_224 = GHIDRA_CAST<float *>(0x0);
|
|
local_210 = GHIDRA_CAST<float *>(0x0);
|
|
local_220.x = 0.0;
|
|
local_220.y = 0.0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
uVar9 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(1);
|
|
pfVar24 = GHIDRA_CAST<float *>(0x0);
|
|
if (uVar9 == 0) {
|
|
local_230.y = 1.4013e-45;
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
local_210 = GHIDRA_CAST<float *>(local_220.y);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
uVar9 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(4);
|
|
if (uVar9 == 0) {
|
|
local_230.y = (float)&DAT_00000004;
|
|
if (pfVar24 == local_210) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
local_210 = GHIDRA_CAST<float *>(local_220.y);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
else {
|
|
*pfVar24 = 5.60519e-45;
|
|
local_220.x = (float)(pfVar24 + 1);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
}
|
|
uVar9 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(8);
|
|
if (uVar9 == 0) {
|
|
local_230.y = (float)&DAT_00000008;
|
|
if (pfVar24 == local_210) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
local_210 = GHIDRA_CAST<float *>(local_220.y);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
else {
|
|
*pfVar24 = 1.12104e-44;
|
|
local_220.x = (float)(pfVar24 + 1);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
}
|
|
uVar9 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(0x40);
|
|
if (uVar9 == 0) {
|
|
local_230.y = 8.96831e-44;
|
|
if (pfVar24 == local_210) {
|
|
std::vector<4byte>::_Emplace_reallocate();
|
|
local_210 = GHIDRA_CAST<float *>(local_220.y);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
else {
|
|
*pfVar24 = 8.96831e-44;
|
|
local_220.x = (float)(pfVar24 + 1);
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.x);
|
|
}
|
|
}
|
|
uVar9 = GHIDRA_INT(pfVar24) - GHIDRA_INT(local_224) >> 2;
|
|
if (uVar9 != 0) {
|
|
uVar9 = (GHIDRA_CAST<RNG *>((&g_game->_generationRNG)))->RNG::RandomInt(uVar9);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::AddCurse(GHIDRA_UINT(local_224[uVar9]),0);
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
if (local_224 != GHIDRA_CAST<float *>(0x0)) {
|
|
deallocate(local_224,GHIDRA_INT(local_210) - GHIDRA_INT(local_224) >> 2);
|
|
}
|
|
}
|
|
LAB_007c679f:
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_30;
|
|
break;
|
|
case 0x20:
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
this->_cacheFlags = this->_cacheFlags | 0x800;
|
|
IncrementPlayerFormCounter(this,0xd,(isHorsePill & 0xff) + 1);
|
|
pMVar21 = extraout_ECX_31;
|
|
break;
|
|
case 0x21:
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
this->_cacheFlags = this->_cacheFlags | 0x800;
|
|
pMVar21 = extraout_ECX_32;
|
|
break;
|
|
case 0x22:
|
|
pvVar7 = g_game->_room;
|
|
local_210 = GHIDRA_CAST<float *>(0x1);
|
|
local_214 = (float)(GHIDRA_UINT(local_214) & 0xffffff);
|
|
if (1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0xc)) + -1) {
|
|
do {
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x1);
|
|
pfVar24 = local_210;
|
|
if (1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x10)) + -1) {
|
|
do {
|
|
if (-1 < GHIDRA_INT(pfVar24)) {
|
|
local_20c = *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(pvVar7) + 0xc));
|
|
if (((GHIDRA_INT(pfVar24) < GHIDRA_INT(local_20c)) && (-1 < GHIDRA_INT(local_208))) &&
|
|
(GHIDRA_INT(local_208) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x10)))) {
|
|
pfVar24 = GHIDRA_CAST<float *>((GHIDRA_INT(local_208) * GHIDRA_INT(local_20c) + GHIDRA_INT(local_210)));
|
|
if (((-1 < GHIDRA_INT(pfVar24)) &&
|
|
(piVar14 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar7) + GHIDRA_INT(pfVar24) * 4 + 0x24)),
|
|
piVar14 != GHIDRA_CAST<int *>(0x0))) && (piVar14[1] == 0xe)) {
|
|
iVar13 = piVar14[9];
|
|
iVar1 = piVar14[9];
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
local_230.x = (float)(iVar13 % GHIDRA_INT(local_20c)) * 40.0 + 40.0;
|
|
local_230.y = (float)(iVar1 / GHIDRA_INT(local_20c)) * 40.0 + 120.0;
|
|
spawn_blue_spider(&local_230,GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
if ((char)isHorsePill != '\0') {
|
|
iVar13 = piVar14[9];
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x10))) = (float)(iVar13 % iVar1) * 40.0 + 40.0;
|
|
local_ac = (undefined1 [4])((float)(iVar13 / iVar1) * 40.0 + 120.0);
|
|
spawn_blue_spider(GHIDRA_CAST<Vector *>((local_c0 + 0x10)),GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
}
|
|
pcVar2 = *(code **)(*piVar14 + 0x14);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_ec + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(*pcVar2)();
|
|
local_214 = (float)CONCAT13(1,(undefined3)local_214);
|
|
}
|
|
pfVar24 = local_210;
|
|
}
|
|
}
|
|
local_208 = GHIDRA_CAST<ItemPool *>((GHIDRA_INT(&local_208->_seed) + 1));
|
|
pvVar7 = g_game->_room;
|
|
} while (GHIDRA_INT(local_208) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x10)) + -1);
|
|
}
|
|
local_210 = GHIDRA_CAST<float *>((GHIDRA_INT(pfVar24) + 1));
|
|
pvVar7 = g_game->_room;
|
|
} while (GHIDRA_INT(local_210) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0xc)) + -1);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) != '\0') goto LAB_007c7497;
|
|
}
|
|
uVar9 = (GHIDRA_CAST<RNG *>((pillRng)))->RNG::RandomInt(2);
|
|
iVar13 = uVar9 + 1;
|
|
if (iVar13 < 1) goto LAB_007c7497;
|
|
do {
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
spawn_blue_spider(&this->_pos,GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
if ((char)isHorsePill != '\0') {
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
spawn_blue_spider(&this->_pos,GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
}
|
|
iVar13 = iVar13 + -1;
|
|
} while (iVar13 != 0);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_33;
|
|
break;
|
|
case 0x23:
|
|
iVar13 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetAliveEnemiesCount();
|
|
bVar25 = false;
|
|
if (iVar13 == 0) {
|
|
uVar9 = (GHIDRA_CAST<RNG *>((pillRng)))->RNG::RandomInt(3);
|
|
iVar13 = uVar9 + 1;
|
|
bVar25 = iVar13 == 0;
|
|
}
|
|
if (bVar25 || iVar13 < 0) goto LAB_007c7497;
|
|
do {
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
spawn_blue_spider(&this->_pos,GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
if ((char)isHorsePill != '\0') {
|
|
this->_numBlueSpiders = this->_numBlueSpiders + 1;
|
|
spawn_blue_spider(&this->_pos,GHIDRA_CAST<Entity *>(this),&g_vectorZero);
|
|
}
|
|
iVar13 = iVar13 + -1;
|
|
} while (iVar13 != 0);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_34;
|
|
break;
|
|
case 0x24:
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x5d,1,1);
|
|
cVar5 = '\0';
|
|
pMVar21 = extraout_ECX_35;
|
|
if ((char)isHorsePill != '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0x1e);
|
|
local_230.y = (float)(g_manager->_itemConfig)._nullItems._begin;
|
|
iVar13 = GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(local_230.y) >> 2;
|
|
if (iVar13 < 0x2a) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(local_230.y) + 0xa4));
|
|
}
|
|
bVar6 = TemporaryEffects::has_item_effect(&this->_temporaryeffects,itemConfig);
|
|
pMVar21 = extraout_ECX_36;
|
|
if (bVar6 == 0) {
|
|
if (iVar13 < 0x2a) {
|
|
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
itemConfig = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(local_230.y) + 0xa4));
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffect *>((tempEffect)))->TemporaryEffect::TemporaryEffect(itemConfig);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(Effect_00,1,1);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x12e,0,1);
|
|
pMVar21 = extraout_ECX_37;
|
|
}
|
|
break;
|
|
}
|
|
goto LAB_007c7557;
|
|
case 0x25:
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
pEVar15 = GHIDRA_CAST<Entity_Player *>(FUN_0090b0e0());
|
|
if (pEVar15 != this) goto LAB_007c7497;
|
|
cVar5 = (char)isHorsePill;
|
|
}
|
|
iVar13 = 900;
|
|
if (cVar5 != '\0') {
|
|
iVar13 = 0xa8c;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::AddPixelation(iVar13);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_38;
|
|
break;
|
|
case 0x26:
|
|
iVar13 = 3;
|
|
if (cVar5 != '\0') {
|
|
iVar13 = 0xc;
|
|
}
|
|
AddBlueFlies(this,iVar13,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_39;
|
|
break;
|
|
case 0x27:
|
|
local_210 = GHIDRA_CAST<float *>(0x3);
|
|
if (cVar5 != '\0') {
|
|
local_210 = GHIDRA_CAST<float *>(&DAT_00000009);
|
|
}
|
|
iVar13 = 0;
|
|
do {
|
|
uVar9 = Random();
|
|
local_230.y = (((float)iVar13 * 360.0) / 3.0) * 0.017453292;
|
|
local_20c = GHIDRA_CAST<Manager *>(cos(local_230.y));
|
|
local_230.y = sin(local_230.y);
|
|
if ((char)isHorsePill == '\0') {
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x42200000);
|
|
}
|
|
else {
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x42a00000);
|
|
}
|
|
uVar12 = Random();
|
|
fVar27 = (float)((double)GHIDRA_INT(uVar12) + __uint_to_double_fixup[-(GHIDRA_INT(uVar12) >> 0x1f)]) *
|
|
2.3283064e-10 * (float)local_208 + 35.0;
|
|
local_ac = (undefined1 [4])(fVar27 * local_230.y + (this->_pos).y);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x10))) = fVar27 * (float)local_20c + (this->_pos).x;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x5e,GHIDRA_CAST<Vector *>((local_c0 + 0x10)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
*GHIDRA_CAST<uint *>(&tmpEntity->_flags) = GHIDRA_UINT(tmpEntity->_flags) | 0x20000000;
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tmpEntity->_flags) + 4));
|
|
(tmpEntity->_sprite)._scale.x = 5.0;
|
|
(tmpEntity->_sprite)._scale.y = 5.0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tmpEntity->_flags) + 4)) = flagsHigh;
|
|
if ((char)isHorsePill != '\0') {
|
|
pAVar3 = &tmpEntity[1]._sprite;
|
|
(pAVar3->_filename)._buf[4] = -0x7c;
|
|
(pAVar3->_filename)._buf[5] = '\x03';
|
|
(pAVar3->_filename)._buf[6] = '\0';
|
|
(pAVar3->_filename)._buf[7] = '\0';
|
|
pAVar3 = &tmpEntity[1]._sprite;
|
|
(pAVar3->_filename)._buf[8] = -0x7c;
|
|
(pAVar3->_filename)._buf[9] = '\x03';
|
|
(pAVar3->_filename)._buf[10] = '\0';
|
|
(pAVar3->_filename)._buf[0xb] = '\0';
|
|
}
|
|
tmpEntity->Update();
|
|
iVar13 = iVar13 + 1;
|
|
} while (iVar13 < GHIDRA_INT(local_210));
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_40;
|
|
break;
|
|
case 0x28:
|
|
local_210 = GHIDRA_CAST<float *>(0x3);
|
|
if (cVar5 != '\0') {
|
|
local_210 = GHIDRA_CAST<float *>(&DAT_00000009);
|
|
}
|
|
iVar13 = 0;
|
|
do {
|
|
uVar9 = Random();
|
|
local_230.y = (((float)iVar13 * 360.0) / 3.0) * 0.017453292;
|
|
local_20c = GHIDRA_CAST<Manager *>(cos(local_230.y));
|
|
local_230.y = sin(local_230.y);
|
|
if ((char)isHorsePill == '\0') {
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x42200000);
|
|
}
|
|
else {
|
|
local_208 = GHIDRA_CAST<ItemPool *>(0x42a00000);
|
|
}
|
|
uVar12 = Random();
|
|
fVar27 = (float)((double)GHIDRA_INT(uVar12) + __uint_to_double_fixup[-(GHIDRA_INT(uVar12) >> 0x1f)]) *
|
|
2.3283064e-10 * (float)local_208 + 35.0;
|
|
local_ac = (undefined1 [4])(fVar27 * local_230.y + (this->_pos).y);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x10))) = fVar27 * (float)local_20c + (this->_pos).x;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2d,GHIDRA_CAST<Vector *>((local_c0 + 0x10)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
*GHIDRA_CAST<uint *>(&tmpEntity->_flags) = GHIDRA_UINT(tmpEntity->_flags) | 0x20000000;
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tmpEntity->_flags) + 4));
|
|
(tmpEntity->_sprite)._scale.x = 5.0;
|
|
(tmpEntity->_sprite)._scale.y = 5.0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tmpEntity->_flags) + 4)) = flagsHigh;
|
|
if ((char)isHorsePill != '\0') {
|
|
pAVar3 = &tmpEntity[1]._sprite;
|
|
(pAVar3->_filename)._buf[4] = -0x7c;
|
|
(pAVar3->_filename)._buf[5] = '\x03';
|
|
(pAVar3->_filename)._buf[6] = '\0';
|
|
(pAVar3->_filename)._buf[7] = '\0';
|
|
pAVar3 = &tmpEntity[1]._sprite;
|
|
(pAVar3->_filename)._buf[8] = -0x7c;
|
|
(pAVar3->_filename)._buf[9] = '\x03';
|
|
(pAVar3->_filename)._buf[10] = '\0';
|
|
(pAVar3->_filename)._buf[0xb] = '\0';
|
|
}
|
|
tmpEntity->Update();
|
|
iVar13 = iVar13 + 1;
|
|
} while (iVar13 < GHIDRA_INT(local_210));
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_41;
|
|
break;
|
|
case 0x29:
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::SetStateFlag(0x18,1);
|
|
}
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::SetBrokenWatchState(1);
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::SetSlowDown(0x7fffffff);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_42;
|
|
break;
|
|
case 0x2a:
|
|
if (cVar5 != '\0') {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::SetStateFlag(0x19,1);
|
|
}
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::SetBrokenWatchState(2);
|
|
uVar9 = (GHIDRA_CAST<RNG *>((pillRng)))->RNG::RandomInt(2);
|
|
this->_imExcitedSpeedupCountdown = (uVar9 + 2) * 900;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1c,0,1);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_43;
|
|
break;
|
|
case 0x2b:
|
|
if (cVar5 != '\0') {
|
|
if (this->_trinketsID[0] != 0) {
|
|
this->_trinketsID[0] = this->_trinketsID[0] | 0x8000;
|
|
}
|
|
if (this->_trinketsID[1] != 0) {
|
|
this->_trinketsID[1] = this->_trinketsID[1] | 0x8000;
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
EvaluateItems(this);
|
|
}
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_214) + 2)),0x1df,1,-1,0);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_44;
|
|
break;
|
|
case 0x2c:
|
|
if (cVar5 == '\0') {
|
|
uVar9 = Random();
|
|
pVVar17 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_220,this->_headDirection);
|
|
local_ac = (undefined1 [4])(pVVar17->y * 10.0 * this->_shotspeed);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x10))) = pVVar17->x * 10.0 * this->_shotspeed;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,0,&this->_pos,GHIDRA_CAST<Vector *>((local_c0 + 0x10)),GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
tear->SetCollisionDamage();
|
|
tearFlags = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>((CStack_150._colorize + 2)),&g_tearFlagExplosive,
|
|
&g_tearFlagPoison);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*tearFlags);
|
|
tear->_fallingAccel = 0.6;
|
|
tear->_fallingSpeed = -13.0;
|
|
(GHIDRA_CAST<Color *>((&effectColor)))->Color::Color(0.5,0.9,0.4,1.0);
|
|
tear->SetColor();
|
|
tear->Update();
|
|
pMVar21 = extraout_ECX_46;
|
|
}
|
|
else {
|
|
local_20c = GHIDRA_CAST<Manager *>(0x6);
|
|
do {
|
|
pVVar17 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_220,this->_headDirection);
|
|
fVar27 = pVVar17->x;
|
|
local_214 = pVVar17->y;
|
|
local_210 = GHIDRA_CAST<float *>(this->_shotspeed);
|
|
uVar9 = Random();
|
|
rngFloat = (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_230.y = rngFloat + rngFloat;
|
|
local_208 = GHIDRA_CAST<ItemPool *>(cos(local_230.y));
|
|
local_230.y = sin(local_230.y);
|
|
uVar9 = Random();
|
|
rngFloat = (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x10))) =
|
|
((float)local_208 + (float)local_208) * rngFloat + fVar27 * 8.0 * (float)local_210;
|
|
local_ac = (undefined1 [4])
|
|
((local_230.y + local_230.y) * rngFloat + local_214 * 8.0 * (float)local_210);
|
|
uVar9 = Random();
|
|
local_208 = (ItemPool *)
|
|
((float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10 + 0.8);
|
|
uVar9 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,0,&this->_pos,GHIDRA_CAST<Vector *>((local_c0 + 0x10)),GHIDRA_CAST<Entity *>(this),0,uVar9);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
tear->SetCollisionDamage();
|
|
tearFlags = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>((CStack_150._colorize + 2)),&g_tearFlagExplosive,
|
|
&g_tearFlagPoison);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*tearFlags);
|
|
tear->_fallingAccel = 0.6;
|
|
uVar9 = Random();
|
|
tear->_fallingSpeed =
|
|
-9.0 - (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0;
|
|
pIVar23 = local_208;
|
|
if ((float)local_208 <= 0.01) {
|
|
pIVar23 = GHIDRA_CAST<ItemPool *>(0x3c23d70a);
|
|
}
|
|
tear->_baseScale = (float)pIVar23;
|
|
tear->_fScale = (float)pIVar23;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Reset();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_ec)) + 0x0))) = 0.5;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_ec)) + 0x4))) = 0.9;
|
|
fStack_e4 = 0.4;
|
|
fStack_e0 = 1.0;
|
|
tear->SetColor();
|
|
tear->Update();
|
|
local_20c = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_20c) + -1));
|
|
} while (local_20c != GHIDRA_CAST<Manager *>(0x0));
|
|
local_20c = (void *)0x0;
|
|
pMVar21 = extraout_ECX_45;
|
|
}
|
|
break;
|
|
case 0x2d:
|
|
if (cVar5 == '\0') {
|
|
UseActiveItem(this,GHIDRA_CAST<short *>((GHIDRA_INT(&local_214) + 2)),0x12a,1,-1,0);
|
|
goto LAB_007c7497;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x5d,1,1);
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_47;
|
|
break;
|
|
case 0x2e:
|
|
uVar9 = pillColor;
|
|
if (*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1738)))) != 0) {
|
|
uVar9 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1738))));
|
|
}
|
|
uVar16 = Random();
|
|
pVVar17 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_220,&this->_pos,40.0,0,0,0);
|
|
uVar12 = uVar9 | 0x800;
|
|
if ((char)isHorsePill == '\0') {
|
|
uVar12 = uVar9;
|
|
}
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x46,pVVar17,&g_vectorZero,GHIDRA_CAST<Entity *>(this),uVar12,uVar16);
|
|
LAB_007c6454:
|
|
tmpEntity->Update();
|
|
AnimatePill(this,pillColor,GHIDRA_CAST<byte *>("UseItem"));
|
|
pMVar21 = extraout_ECX_27;
|
|
break;
|
|
case 0x2f:
|
|
this->_cacheFlags = this->_cacheFlags | 4;
|
|
AnimateSad(this);
|
|
pMVar21 = extraout_ECX_17;
|
|
break;
|
|
case 0x30:
|
|
this->_cacheFlags = this->_cacheFlags | 0x1004;
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_ec))))->Color::Color();
|
|
fStack_dc = 1.3;
|
|
local_d8 = GHIDRA_CAST<float **>(0x3fa66666);
|
|
fStack_d4 = 1.3;
|
|
fStack_d0 = 0.5;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0)))))))->Color::operator_assign(other_04);
|
|
this_01 = &effectColor;
|
|
blueOffset = 0.5;
|
|
rngFloat = 0.5;
|
|
fVar27 = 0.5;
|
|
LAB_007c5631:
|
|
(GHIDRA_CAST<Color *>((this_01)))->Color::Color(0.3,0.3,0.3,fVar27,rngFloat,blueOffset);
|
|
this->SetColor();
|
|
pMVar21 = extraout_ECX_13;
|
|
break;
|
|
case 0x31:
|
|
local_17c._colorize[1] = 9.80909e-45;
|
|
local_17c._colorize[2] = 2.24208e-44;
|
|
local_17c._colorize[3] = 1.68156e-44;
|
|
local_17c._offset[0] = 1.96182e-44;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x0))) = (void *)0x0;
|
|
local_c0[4] = '\x02';
|
|
local_c0[5] = '\0';
|
|
local_c0[6] = '\0';
|
|
local_c0[7] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x8))) = 8;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0xc))) = 0x40000000010;
|
|
local_ac = (undefined1 [4])0x4;
|
|
local_17c._offset[1] = 2.52234e-44;
|
|
local_17c._offset[2] = 6.72623e-44;
|
|
local_d8 = GHIDRA_CAST<float **>(&DAT_00000006);
|
|
fStack_d4 = 2.10195e-44;
|
|
fStack_d0 = 1.54143e-44;
|
|
fStack_cc = 1.82169e-44;
|
|
local_c8 = 2.38221e-44;
|
|
local_c4 = &DAT_0000002f;
|
|
CStack_150._colorize[1] = 1.6778514e-38;
|
|
CStack_150._colorize[2] = 1.6778486e-38;
|
|
CStack_150._colorize[3] = 1.6778991e-38;
|
|
CStack_150._offset[0] = 1.6778963e-38;
|
|
CStack_150._offset[1] = 1.6779053e-38;
|
|
CStack_150._offset[2] = 1.6779019e-38;
|
|
bVar6 = HasCollectible(this,0x4b,0);
|
|
if (((bVar6 == 0) && (bVar6 = HasCollectible(this,0x12f,0), bVar6 == 0)) &&
|
|
((bVar6 = HasCollectible(this,0x2e,0), bVar6 == 0 &&
|
|
(iVar13 = GetZodiacEffect(this), iVar13 != 0x12f)))) {
|
|
isSkipStatDown = '\0';
|
|
bVar6 = HasCollectible(this,0x28e,0);
|
|
local_214 = (float)CONCAT13(bVar6,(undefined3)local_214);
|
|
}
|
|
else {
|
|
bVar6 = HasCollectible(this,0x28e,0);
|
|
fVar27 = local_214;
|
|
local_214 = (float)CONCAT13(bVar6,(undefined3)local_214);
|
|
isSkipStatDown = '\x01';
|
|
if (bVar6 != 0) {
|
|
local_214 = (float)(GHIDRA_UINT(fVar27) & 0xffffff);
|
|
isSkipStatDown = '\0';
|
|
}
|
|
}
|
|
local_224 = GHIDRA_CAST<float *>(0x0);
|
|
local_220.x = 0.0;
|
|
local_220.y = 0.0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
|
std::vector<unsigned_int>::_Reallocate();
|
|
local_20c = (void *)0x0;
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.y);
|
|
do {
|
|
if (GHIDRA_CAST<float *>(local_220.x) == pfVar24) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate();
|
|
pfVar24 = GHIDRA_CAST<float *>(local_220.y);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<Manager **>(local_220.x) = local_20c;
|
|
local_220.x = (float)(GHIDRA_INT(local_220.x) + 4);
|
|
}
|
|
fVar27 = local_220.x;
|
|
local_20c = GHIDRA_CAST<Manager *>((GHIDRA_INT(local_20c) + 1));
|
|
} while (local_20c < (void *)0x6);
|
|
RNG::Shuffle(GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_pillRNGs)._begin) + 0x310)),GHIDRA_CAST<int *>(local_224),GHIDRA_CAST<int *>(local_220.x))
|
|
;
|
|
if ((*local_224 == 0.0) && (bVar6 = CanUsePill(this,6), bVar6 == 0)) {
|
|
*local_224 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar27) + -4));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar27) + -4)) = 0.0;
|
|
}
|
|
pfVar24 = local_224;
|
|
bVar6 = (byte)isHorsePill;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) == '\0') {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) +
|
|
GHIDRA_INT(local_17c._colorize[GHIDRA_INT(local_224[1]) + 1]) * 4));
|
|
*piVar14 = *piVar14 + 1;
|
|
if (bVar6 != 0) {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) +
|
|
GHIDRA_INT(local_17c._colorize[GHIDRA_INT(local_224[1]) + 1]) * 4));
|
|
*piVar14 = *piVar14 + 1;
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | *GHIDRA_CAST<uint *>((local_c0 + GHIDRA_INT(local_224[1]) * 4));
|
|
if (local_224[1] == 0.0) {
|
|
AddMaxHearts(this,(isHorsePill & 0xff) * 2 + 2,0);
|
|
bVar6 = (byte)isHorsePill;
|
|
}
|
|
}
|
|
if (isSkipStatDown == '\0') {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) +
|
|
*GHIDRA_CAST<int *>((local_c0 + GHIDRA_INT(*pfVar24) * 4 + -0x18)) * 4));
|
|
*piVar14 = *piVar14 + 1;
|
|
if (bVar6 != 0) {
|
|
piVar14 = GHIDRA_CAST<int *>((GHIDRA_INT((this->_pillEffectUses)._begin) +
|
|
*GHIDRA_CAST<int *>((local_c0 + GHIDRA_INT(*pfVar24) * 4 + -0x18)) * 4));
|
|
*piVar14 = *piVar14 + 1;
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | *GHIDRA_CAST<uint *>((local_c0 + GHIDRA_INT(*pfVar24) * 4));
|
|
if (*pfVar24 == 0.0) {
|
|
AddMaxHearts(this,(bVar6 ^ 1) * 2 + -4,0);
|
|
TryPreventDeath(this);
|
|
}
|
|
}
|
|
if (GHIDRA_CAST<EntityPtr *>(local_230.y) == GHIDRA_CAST<EntityPtr *>(0x0)) {
|
|
if (isSkipStatDown == '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) == '\0') {
|
|
sprintf(GHIDRA_CAST<byte *>(&fStack_e0),GHIDRA_CAST<byte *>(CStack_150._colorize[GHIDRA_INT(pfVar24[1]) + 1]));
|
|
pbVar18 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>(&fStack_e0));
|
|
pbVar19 = pbVar18;
|
|
do {
|
|
bVar6 = *pbVar19;
|
|
pbVar19[GHIDRA_INT((experimentalText + -GHIDRA_INT(pbVar18)))] = bVar6;
|
|
pbVar19 = pbVar19 + 1;
|
|
} while (bVar6 != 0);
|
|
puVar4 = GHIDRA_CAST<undefined2 *>((local_ac + 3));
|
|
do {
|
|
puVar20 = puVar4;
|
|
puVar4 = GHIDRA_CAST<undefined2 *>((GHIDRA_INT(puVar20) + 1));
|
|
} while (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(puVar20) + 1)) != '\0');
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(puVar20) + 1)) = 0x202c;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(puVar20) + 3)) = 0;
|
|
sprintf(GHIDRA_CAST<byte *>(&fStack_e0),GHIDRA_CAST<byte *>(CStack_150._colorize[GHIDRA_INT(*pfVar24) + 1]));
|
|
pbVar18 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>(&fStack_e0));
|
|
pbVar19 = pbVar18;
|
|
do {
|
|
bVar6 = *pbVar19;
|
|
pbVar19 = pbVar19 + 1;
|
|
} while (bVar6 != 0);
|
|
copyDst = local_ac + 3;
|
|
do {
|
|
copySrc = copyDst + 1;
|
|
copyDst = copyDst + 1;
|
|
} while (*copySrc != 0);
|
|
copySrc = pbVar18;
|
|
for (uVar9 = GHIDRA_UINT((GHIDRA_INT(pbVar19) - GHIDRA_INT(pbVar18))) >> 2; uVar9 != 0; uVar9 = uVar9 - 1) {
|
|
*GHIDRA_CAST<undefined4 *>(copyDst) = *GHIDRA_CAST<undefined4 *>(copySrc);
|
|
copySrc = copySrc + 4;
|
|
copyDst = copyDst + 4;
|
|
}
|
|
for (uVar9 = GHIDRA_INT(pbVar19) - GHIDRA_INT(pbVar18) & 3; uVar9 != 0; uVar9 = uVar9 - 1) {
|
|
*copyDst = *copySrc;
|
|
copySrc = copySrc + 1;
|
|
copyDst = copyDst + 1;
|
|
}
|
|
pfVar24 = local_224;
|
|
}
|
|
else {
|
|
sprintf(GHIDRA_CAST<byte *>(&fStack_e0),GHIDRA_CAST<byte *>(CStack_150._colorize[GHIDRA_INT(*pfVar24) + 1]));
|
|
pbVar18 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>(&fStack_e0));
|
|
pbVar19 = pbVar18;
|
|
do {
|
|
bVar6 = *pbVar19;
|
|
pbVar19[GHIDRA_INT((experimentalText + -GHIDRA_INT(pbVar18)))] = bVar6;
|
|
pbVar19 = pbVar19 + 1;
|
|
} while (bVar6 != 0);
|
|
}
|
|
}
|
|
else {
|
|
sprintf(GHIDRA_CAST<byte *>(&fStack_e0),GHIDRA_CAST<byte *>(CStack_150._colorize[GHIDRA_INT(pfVar24[1]) + 1]));
|
|
pbVar18 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>(&fStack_e0));
|
|
pbVar19 = pbVar18;
|
|
do {
|
|
bVar6 = *pbVar19;
|
|
pbVar19[GHIDRA_INT((experimentalText + -GHIDRA_INT(pbVar18)))] = bVar6;
|
|
pbVar19 = pbVar19 + 1;
|
|
} while (bVar6 != 0);
|
|
}
|
|
iVar13 = toupper(GHIDRA_INT((char)experimentalText[0]));
|
|
experimentalText[0] = (byte)iVar13;
|
|
PlayerHUD::show_pill_name();
|
|
}
|
|
if (isSkipStatDown == '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_214)) + 0x3))) == '\0') {
|
|
AnimateHappy(this);
|
|
}
|
|
else {
|
|
AnimateSad(this);
|
|
}
|
|
}
|
|
else {
|
|
AnimateHappy(this);
|
|
play_sound_with_fart_seed(GHIDRA_INT(local_210),1.0,2,0,1.0);
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
deallocate(pfVar24,GHIDRA_INT(local_220.y) - GHIDRA_INT(pfVar24) >> 2);
|
|
pMVar21 = extraout_ECX_18;
|
|
break;
|
|
default:
|
|
pMVar21 = g_manager;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._pillEffects._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._pillEffects._begin) >> 2 <= pillEffect) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Pill %d Effect Not Implemented!\n"));
|
|
pMVar21 = extraout_ECX_49;
|
|
break;
|
|
}
|
|
goto LAB_007c7557;
|
|
}
|
|
cVar5 = (char)isHorsePill;
|
|
LAB_007c7557:
|
|
if (((local_216 != 0) && (pMVar21 = pillConfig, pillConfig != GHIDRA_CAST<Manager *>(0x0))) &&
|
|
(uVar9 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pillConfig->_persistentGameData))) + 0x28)))), uVar9 != 0)) {
|
|
if (cVar5 != '\0') {
|
|
uVar9 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pillConfig->_persistentGameData))) + 0x2c))));
|
|
}
|
|
PlayDelayedSFX(this,uVar9,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pillConfig->_persistentGameData))) + 0x30)))),iVar26,1.0);
|
|
pMVar21 = extraout_ECX_50;
|
|
}
|
|
(GHIDRA_CAST<LuaEngine *>((GHIDRA_CAST<LuaEngine *>(pMVar21))))->LuaEngine::UsePill(pillEffect,this,useFlagsLocal);
|
|
if ((char)isHorsePill != '\0') {
|
|
bVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<byte *>("Happy"));
|
|
if (bVar6 == 0) {
|
|
bVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(&DAT_00b1cdf8);
|
|
if (bVar6 == 0) goto LAB_007c7658;
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x10b);
|
|
iVar26 = 0x25b;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x10c);
|
|
iVar26 = 0x25a;
|
|
}
|
|
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(iVar26,1.0,2,0,1.0,0.0);
|
|
}
|
|
LAB_007c7658:
|
|
bVar6 = HasCollectible(this,0x28e,0);
|
|
if ((bVar6 != 0) &&
|
|
(((this->_cacheFlags = this->_cacheFlags | 1, pillEffect == 0x19 || (pillEffect == 1)) ||
|
|
((((pillEffect == 0x1b || ((pillEffect == 0x16 || (pillEffect == 0x1d)))) ||
|
|
(pillEffect == 0x1f)) || ((pillEffect == 0x25 || (pillEffect == 0x2a)))))))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0xc))) = 0x30000000d;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c0)) + 0x8))) = pillRng->_seed;
|
|
local_ac = (undefined1 [4])0x1b;
|
|
uVar9 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((local_c0 + 8)))))->RNG::Next();
|
|
pVVar17 = Room::FindFreePickupSpawnPosition(g_game->_room,&local_220,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,pVVar17,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),6,uVar9);
|
|
}
|
|
if ((pillColor != 0) && (uVar8 != 0xe)) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1738)))) = pillColor;
|
|
}
|
|
if (0xf < pillDescription._capacity) {
|
|
uVar8 = pillDescription._capacity + 1;
|
|
pvVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)pillDescription._buf)) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) + -4);
|
|
uVar8 = pillDescription._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) - GHIDRA_INT(pvVar7)) - 4U) goto LAB_007c77b1;
|
|
}
|
|
operator_delete(pvVar7,uVar8);
|
|
}
|
|
pillDescription._size = 0;
|
|
pillDescription._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillDescription._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < pillName._capacity) {
|
|
uVar8 = pillName._capacity + 1;
|
|
ppfVar22 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<float **>(pillName._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
ppfVar22 = *GHIDRA_CAST<float ***>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) + -4));
|
|
uVar8 = pillName._capacity + 0x24;
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pillName._buf)) + 0x0))) + (-4 - GHIDRA_INT(ppfVar22))))) {
|
|
LAB_007c77b1:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppfVar22,uVar8);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007c78b0
|
|
void Entity_Player::AddDeadEyeCharge()
|
|
{
|
|
if (this->_deadEyeCharges < 8) {
|
|
this->_cacheFlags = this->_cacheFlags | 1;
|
|
this->_deadEyeCharges = this->_deadEyeCharges + 1;
|
|
EvaluateItems(this);
|
|
}
|
|
this->_deadEyeMisses = 0;
|
|
return;
|
|
}
|
|
|
|
// 007c78e0
|
|
void Entity_Player::ClearDeadEyeCharge()
|
|
{
|
|
uint roll;
|
|
uint resetChance;
|
|
|
|
if (this->_deadEyeCharges != 0) {
|
|
this->_deadEyeMisses = this->_deadEyeMisses + 1;
|
|
resetChance = 0x32;
|
|
if (this->_deadEyeMisses == 1) {
|
|
resetChance = 0x14;
|
|
}
|
|
else if (this->_deadEyeMisses == 2) {
|
|
resetChance = 0x21;
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13fa))) != '\0') {
|
|
resetChance = 100;
|
|
}
|
|
roll = Random();
|
|
if (roll % 100 < resetChance) {
|
|
this->_cacheFlags = this->_cacheFlags | 1;
|
|
this->_deadEyeMisses = 0;
|
|
this->_deadEyeCharges = 0;
|
|
EvaluateItems(this);
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c7960
|
|
int Entity_Player::GetZodiacEffect()
|
|
{
|
|
code *pcVar1;
|
|
byte isHasZodiac;
|
|
int iVar2;
|
|
uint uVar3;
|
|
Game *game;
|
|
|
|
isHasZodiac = HasCollectible(this,0x188,0);
|
|
game = g_game;
|
|
if (isHasZodiac == 0) {
|
|
return 0;
|
|
}
|
|
uVar3 = g_game->_stage;
|
|
if ((g_game->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
if (uVar3 == 0) {
|
|
uVar3 = 0;
|
|
}
|
|
else if (0xc < uVar3) {
|
|
uVar3 = 0xd;
|
|
}
|
|
uVar3 = (game->_seedEffects)._stageSeeds[uVar3];
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
iVar2 = (*pcVar1)();
|
|
return iVar2;
|
|
}
|
|
uVar3 = uVar3 >> 2 ^ uVar3;
|
|
uVar3 = uVar3 << 7 ^ uVar3;
|
|
return *GHIDRA_CAST<int *>((&DAT_00b6bb10 + ((uVar3 >> 9 ^ uVar3) % 0xc) * 4));
|
|
}
|
|
|
|
// 007c7c60
|
|
void Entity_Player::update_purity_glow(Entity_Player *player)
|
|
{
|
|
byte *text;
|
|
int purityState;
|
|
ItemConfig_Item *glowNullItem;
|
|
byte *textEnd;
|
|
void *pvVar1;
|
|
uint size;
|
|
std_string costumePath;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
byte ch;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6ebd;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(&costumePath) + 0x28U;
|
|
ExceptionList = &local_10;
|
|
purityState = player->_purityState;
|
|
if (3 < purityState) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("[err] Purity has a wrong state!"));
|
|
purityState = player->_purityState;
|
|
}
|
|
text = (&PTR_s_gfx_characters_costumes_PurityGl_00b6bb40)[purityState];
|
|
costumePath._size = 0;
|
|
costumePath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(costumePath._buf)) + 0x0))) = (void *)0x0;
|
|
textEnd = text;
|
|
do {
|
|
ch = *textEnd;
|
|
textEnd = textEnd + 1;
|
|
} while (ch != 0);
|
|
(GHIDRA_CAST<std::string *>((costumePath._buf)))->std::string::assign(text,GHIDRA_INT(textEnd) - GHIDRA_INT((text + 1)));
|
|
local_8 = 0;
|
|
pvVar1 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)) < 0x45) {
|
|
glowNullItem = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
glowNullItem = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x44));
|
|
}
|
|
ReplaceCostumeSprite(player,glowNullItem,&costumePath,0);
|
|
if (0xf < costumePath._capacity) {
|
|
size = costumePath._capacity + 1;
|
|
pvVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)costumePath._buf)) + 0x0)));
|
|
if (0xfff < size) {
|
|
pvVar1 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(costumePath._buf)) + 0x0))) + -4);
|
|
size = costumePath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(costumePath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar1,size);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007c7d70
|
|
void Entity_Player::trigger_immaculate_conception(byte isCambion)
|
|
{
|
|
byte bVar1;
|
|
int playerType;
|
|
int iVar2;
|
|
ItemConfig_Item *pIVar3;
|
|
byte *costumePathEnd;
|
|
int iVar4;
|
|
void *freeBlock;
|
|
uint freeSize;
|
|
int iVar5;
|
|
std_string immaculateSkinPath;
|
|
std_string cambionSkinPath;
|
|
void *immaculatePath [4];
|
|
undefined4 immaculatePathSize;
|
|
uint immaculatePathCapacity;
|
|
void *cambionPath [4];
|
|
undefined4 cambionPathSize;
|
|
uint cambionPathCapacity;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
byte *costumePath;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00b00025;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((cambionPath + 0xb));
|
|
ExceptionList = &local_10;
|
|
if (isCambion == 0) {
|
|
iVar5 = 5;
|
|
iVar4 = this->_immaculateConceptionState;
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
iVar5 = 0x14;
|
|
}
|
|
iVar2 = 0xf;
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
iVar2 = 0x3c;
|
|
}
|
|
if (iVar2 <= iVar4) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("[err] Immaculate has a wrong state!"));
|
|
iVar4 = this->_immaculateConceptionState;
|
|
}
|
|
iVar2 = this->_bodyColor;
|
|
playerType = this->_playerType;
|
|
immaculatePathSize = 0;
|
|
immaculatePathCapacity = 0xf;
|
|
costumePath = (&PTR_s_gfx_characters_costumes_costume__00b6bb04)[iVar4 / iVar5];
|
|
immaculatePath[0] = (void *)0x0;
|
|
costumePathEnd = costumePath;
|
|
do {
|
|
bVar1 = *costumePathEnd;
|
|
costumePathEnd = costumePathEnd + 1;
|
|
} while (bVar1 != 0);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(immaculatePath))))->std::string::assign(costumePath,
|
|
GHIDRA_INT(costumePathEnd) - GHIDRA_INT((costumePath + 1)));
|
|
local_8 = (void *)0x3;
|
|
costume_path_apply_skin_color
|
|
(&immaculateSkinPath,immaculatePath,iVar2,playerType,GHIDRA_CAST<byte *>(0x0),GHIDRA_CAST<byte *>(0x0));
|
|
local_8 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),5);
|
|
if (0xf < immaculatePathCapacity) {
|
|
freeSize = immaculatePathCapacity + 1;
|
|
freeBlock = immaculatePath[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(immaculatePath[0]) + -4);
|
|
freeSize = immaculatePathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(immaculatePath[0]) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
immaculatePathSize = 0;
|
|
immaculatePathCapacity = 0xf;
|
|
immaculatePath[0] = (void *)(GHIDRA_UINT(immaculatePath[0]) & 0xffffff00);
|
|
freeBlock = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(freeBlock) & 0xfffffffcU)) <
|
|
0x675) {
|
|
pIVar3 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
pIVar3 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(freeBlock) + 0x674));
|
|
}
|
|
ReplaceCostumeSprite(this,pIVar3,&immaculateSkinPath,0);
|
|
if (immaculateSkinPath._capacity < 0x10) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
freeSize = immaculateSkinPath._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)immaculateSkinPath._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(immaculateSkinPath._buf)) + 0x0))) + -4);
|
|
freeSize = immaculateSkinPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(immaculateSkinPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = this->_playerType;
|
|
iVar5 = this->_bodyColor;
|
|
iVar2 = GetCambionPregnancyLevel(this);
|
|
cambionPathSize = 0;
|
|
cambionPathCapacity = 0xf;
|
|
costumePath = (&PTR_s_gfx_characters_costumes_costume__00b6baf8)[iVar2];
|
|
cambionPath[0] = (void *)0x0;
|
|
costumePathEnd = costumePath;
|
|
do {
|
|
bVar1 = *costumePathEnd;
|
|
costumePathEnd = costumePathEnd + 1;
|
|
} while (bVar1 != 0);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(cambionPath))))->std::string::assign(costumePath,GHIDRA_INT(costumePathEnd) - GHIDRA_INT((costumePath + 1)));
|
|
local_8 = (void *)0x0;
|
|
costume_path_apply_skin_color(&cambionSkinPath,cambionPath,iVar5,iVar4,GHIDRA_CAST<byte *>(0x0),GHIDRA_CAST<byte *>(0x0));
|
|
local_8 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
if (0xf < cambionPathCapacity) {
|
|
freeSize = cambionPathCapacity + 1;
|
|
freeBlock = cambionPath[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(cambionPath[0]) + -4);
|
|
freeSize = cambionPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(cambionPath[0]) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
cambionPathSize = 0;
|
|
cambionPathCapacity = 0xf;
|
|
cambionPath[0] = (void *)(GHIDRA_UINT(cambionPath[0]) & 0xffffff00);
|
|
freeBlock = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(freeBlock) & 0xfffffffcU)) <
|
|
0x671) {
|
|
pIVar3 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
pIVar3 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(freeBlock) + 0x670));
|
|
}
|
|
ReplaceCostumeSprite(this,pIVar3,&cambionSkinPath,0);
|
|
if (cambionSkinPath._capacity < 0x10) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
freeSize = cambionSkinPath._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)cambionSkinPath._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(cambionSkinPath._buf)) + 0x0))) + -4);
|
|
freeSize = cambionSkinPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(cambionSkinPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007c8050
|
|
void Entity_Player::AddImmaculateConceptionCounter(int param_1)
|
|
{
|
|
code *pcVar1;
|
|
byte isImmaculateConceptionOwned;
|
|
uint rngResult;
|
|
Vector *position;
|
|
Entity_Player *in_ECX;
|
|
int iVar2;
|
|
uint *rngSeed;
|
|
undefined1 auStack_34 [4];
|
|
int counterStep;
|
|
Vector local_2c;
|
|
int oldStage;
|
|
uint familiarFlagOptions [7];
|
|
void *collectibleRngs;
|
|
uint familiarFlag;
|
|
Manager *manager;
|
|
|
|
familiarFlagOptions[5] = __security_cookie ^ GHIDRA_UINT(auStack_34);
|
|
isImmaculateConceptionOwned = HasCollectible(in_ECX,0x19d,0);
|
|
if (isImmaculateConceptionOwned != 0) {
|
|
iVar2 = 0xf;
|
|
counterStep = 5;
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
counterStep = 0x14;
|
|
iVar2 = 0x3c;
|
|
}
|
|
oldStage = in_ECX->_immaculateConceptionState / counterStep;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
param_1 = 1;
|
|
}
|
|
else {
|
|
param_1 = param_1 << 3;
|
|
}
|
|
param_1 = in_ECX->_immaculateConceptionState + param_1;
|
|
in_ECX->_immaculateConceptionState = param_1;
|
|
if (iVar2 <= param_1) {
|
|
collectibleRngs = (in_ECX->_collectibleRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(collectibleRngs) + 0x19d0));
|
|
familiarFlagOptions[0] = 0x40;
|
|
familiarFlagOptions[1] = 0x80;
|
|
familiarFlagOptions[2] = 0x100;
|
|
familiarFlagOptions[3] = 0x200;
|
|
familiarFlagOptions[4] = 0x400;
|
|
rngResult = *rngSeed;
|
|
if (rngResult == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
rngResult = *rngSeed;
|
|
if (rngResult == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
rngResult = rngResult >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(collectibleRngs) + 0x19d4)) & 0x1f) ^
|
|
rngResult;
|
|
rngResult = rngResult << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(collectibleRngs) + 0x19d8)) & 0x1f) ^
|
|
rngResult;
|
|
rngResult = rngResult >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(collectibleRngs) + 0x19dc)) & 0x1f) ^
|
|
rngResult;
|
|
*rngSeed = rngResult;
|
|
manager = g_manager;
|
|
iVar2 = 0;
|
|
do {
|
|
familiarFlag = familiarFlagOptions[GHIDRA_INT((rngResult % 5 + iVar2)) % 5];
|
|
if ((in_ECX->_conceptionFamiliarFlags & familiarFlag) == 0) {
|
|
local_2c.x = 1.41531e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_2c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_2c.x),1.0,2,0,1.0,0.0);
|
|
in_ECX->_conceptionFamiliarFlags = in_ECX->_conceptionFamiliarFlags | familiarFlag;
|
|
in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0x200;
|
|
EvaluateItems(in_ECX);
|
|
break;
|
|
}
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < 5);
|
|
rngResult = Random();
|
|
position = Room::FindFreePickupSpawnPosition(g_game->_room,&local_2c,&in_ECX->_pos,40.0,0,0,0)
|
|
;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,10,position,&g_vectorZero,GHIDRA_CAST<Entity *>(in_ECX),3,rngResult,0);
|
|
in_ECX->_immaculateConceptionState = 0;
|
|
param_1 = 0;
|
|
}
|
|
if (oldStage != param_1 / counterStep) {
|
|
trigger_immaculate_conception(in_ECX,0);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c8240
|
|
void Entity_Player::dash_impact()
|
|
{
|
|
uint *puVar1;
|
|
float fVar2;
|
|
qword qVar3;
|
|
byte bVar4;
|
|
int *piVar5;
|
|
uint seed;
|
|
Entity *ringEffect;
|
|
Vector *pushDirection;
|
|
Entity *unused;
|
|
Entity *unused_00;
|
|
Game *game;
|
|
int iVar6;
|
|
float fVar7;
|
|
double dVar8;
|
|
float fVar9;
|
|
EntityRef sourceRef;
|
|
EntityList_EL nearbyEntities;
|
|
Vector pushResult;
|
|
Vector targetPos;
|
|
Vector local_40;
|
|
Vector local_38;
|
|
Vector reflectVelocity;
|
|
float local_28;
|
|
float local_24;
|
|
float local_20;
|
|
float local_1c;
|
|
float local_18;
|
|
float deltaX;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
int *damageCooldown;
|
|
undefined4 flagsHigh;
|
|
Entity_Projectile *target;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0005d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
qVar3 = this->_flags;
|
|
damageCooldown = &this->_damageCooldown;
|
|
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
*puVar1 = *puVar1 & 0xffffffef;
|
|
game = g_game;
|
|
*GHIDRA_CAST<int *>(&this->_flags) = GHIDRA_INT(qVar3);
|
|
this->_marsUnkBool = 1;
|
|
local_20 = 4.2039e-44;
|
|
piVar5 = GHIDRA_CAST<int *>(&local_20);
|
|
if (0x1d < *damageCooldown) {
|
|
piVar5 = damageCooldown;
|
|
}
|
|
iVar6 = 0;
|
|
*damageCooldown = *piVar5;
|
|
do {
|
|
local_20 = (float)iVar6 * 360.0 * 0.125 * 0.017453292;
|
|
local_18 = sin(local_20);
|
|
local_20 = cos(local_20);
|
|
local_20 = local_20 * 40.0;
|
|
local_18 = local_18 * 40.0;
|
|
local_40.x = local_20 + (this->_pos).x;
|
|
local_40.y = local_18 + (this->_pos).y;
|
|
bVar4 = (GHIDRA_CAST<Room *>((game->_room)))->Room::IsPositionInRoom(&local_40,0.0);
|
|
if (bVar4 != 0) {
|
|
seed = Random();
|
|
local_38.x = local_20 + (this->_pos).x;
|
|
local_38.y = local_18 + (this->_pos).y;
|
|
ringEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x93,&local_38,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,seed);
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&ringEffect->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&ringEffect->_flags) = GHIDRA_UINT(ringEffect->_flags) | 0x20000000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&ringEffect->_flags) + 4)) = flagsHigh;
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((ringEffect)))->Entity::AddBurn(&sourceRef,10,0.0,0);
|
|
ringEffect->Update();
|
|
game = g_game;
|
|
}
|
|
iVar6 = iVar6 + 1;
|
|
} while (iVar6 < 8);
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),&nearbyEntities,&this->_pos,80.0,0xffffffff);
|
|
local_8 = 0;
|
|
local_20 = 0.0;
|
|
if (nearbyEntities._size != 0) {
|
|
do {
|
|
fVar9 = local_20;
|
|
target = *GHIDRA_CAST<Entity_Projectile **>((GHIDRA_CAST<char *>(nearbyEntities._data) + GHIDRA_INT(local_20) * 4));
|
|
if (((target->_type != 1) &&
|
|
(((bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(target))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar4 != 0 ||
|
|
(target->_type == 4)) || (target->_type == 5)))) &&
|
|
((target->_mass != 0.0 && ((target->_flags & 0x4000000) == 0)))) {
|
|
local_28 = target->_size + 80.0;
|
|
deltaX = (target->_pos).x - (this->_pos).x;
|
|
local_18 = (target->_pos).y - (this->_pos).y;
|
|
local_24 = local_18 * local_18 + deltaX * deltaX;
|
|
local_1c = sqrtf(local_24);
|
|
if (0.0 < local_1c) {
|
|
if (target->_type == 9) {
|
|
fVar7 = (target->_velocity).x;
|
|
fVar2 = (target->_velocity).y;
|
|
if (local_1c <= 0.0) {
|
|
reflectVelocity.x = deltaX;
|
|
reflectVelocity.y = local_18;
|
|
(GHIDRA_CAST<Entity_Projectile *>((target)))->Entity_Projectile::Reflect(unused,&reflectVelocity);
|
|
}
|
|
else {
|
|
fVar7 = sqrtf(fVar7 * fVar7 + fVar2 * fVar2);
|
|
reflectVelocity.y = (fVar7 / local_1c) * local_18;
|
|
reflectVelocity.x = (fVar7 / local_1c) * deltaX;
|
|
(GHIDRA_CAST<Entity_Projectile *>((target)))->Entity_Projectile::Reflect(unused_00,&reflectVelocity);
|
|
}
|
|
}
|
|
else if ((target->_type == 2) &&
|
|
(iVar6 = __RTDynamicCast(target,0,&IsaacRepentancePlus::Entity::
|
|
RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0
|
|
), iVar6 != 0)) {
|
|
local_20 = (target->_velocity).x;
|
|
local_1c = (target->_velocity).y;
|
|
local_24 = sqrtf(local_24);
|
|
if (local_24 <= 0.0) {
|
|
local_38.y = local_18;
|
|
local_38.x = deltaX;
|
|
}
|
|
else {
|
|
fVar7 = sqrtf(local_20 * local_20 + local_1c * local_1c);
|
|
local_38.y = local_18 * (fVar7 / local_24);
|
|
local_38.x = deltaX * (fVar7 / local_24);
|
|
}
|
|
(GHIDRA_CAST<Entity_Projectile *>((target)))->Entity_Projectile::Deflect(GHIDRA_CAST<Entity *>(this),&local_38);
|
|
}
|
|
else {
|
|
fVar7 = 7.0;
|
|
if (local_28 - local_1c <= 7.0) {
|
|
fVar7 = local_28 - local_1c;
|
|
}
|
|
fVar2 = target->_mass;
|
|
fVar7 = fVar7 + fVar7;
|
|
if (fVar2 <= 20.0) {
|
|
if (fVar2 <= 30.0) {
|
|
if (50.0 < fVar2) {
|
|
fVar7 = fVar7 * 0.015;
|
|
}
|
|
}
|
|
else {
|
|
fVar7 = fVar7 * 0.2;
|
|
}
|
|
}
|
|
else {
|
|
fVar7 = fVar7 * 0.5;
|
|
}
|
|
(target->_velocity).x = (deltaX / local_1c) * fVar7 + (target->_velocity).x * 0.5;
|
|
(target->_velocity).y = (local_18 / local_1c) * fVar7 + (target->_velocity).y * 0.5;
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(target))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((((bVar4 != 0) && (0.0 < target->_mass)) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(target))))->Entity::HasEntityFlags(0x4000000), bVar4 == 0)) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(target))))->Entity::HasEntityFlags(0x20000000), bVar4 == 0)) {
|
|
targetPos.x = (target->_pos).x;
|
|
targetPos.y = (target->_pos).y;
|
|
(GHIDRA_CAST<Vector *>((&targetPos)))->Vector::__sub(&local_40,&this->_pos);
|
|
fVar9 = (GHIDRA_CAST<Vector *>((&local_40)))->Vector::Length();
|
|
local_28 = fVar9;
|
|
(GHIDRA_CAST<Vector *>((&local_40)))->Vector::__div_assign(&local_28);
|
|
local_24 = assert_lerp_range((fVar9 - (this->_size + target->_size)) + target->_mass,
|
|
10.0,80.0,20.0,1.0,1);
|
|
local_28 = 16.0;
|
|
pushDirection = (GHIDRA_CAST<Vector *>((&local_40)))->Vector::__mul(&pushResult,&local_28);
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
bVar4 = 1;
|
|
dVar8 = floor((double)local_24);
|
|
local_28 = (float)dVar8;
|
|
iVar6 = thunk_FUN_00af0780();
|
|
Entity::AddKnockback(GHIDRA_CAST<Entity *>(target),&sourceRef,pushDirection,iVar6,bVar4);
|
|
fVar9 = local_20;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_20 = (float)(GHIDRA_INT(fVar9) + 1);
|
|
} while (GHIDRA_UINT(local_20) < GHIDRA_UINT(nearbyEntities._size));
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((&nearbyEntities)))->EntityList_Query::~EntityList_Query();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007c8830
|
|
void Entity_Player::spawn_locusts()
|
|
{
|
|
code *pcVar1;
|
|
byte isFishTailHeld;
|
|
int iVar2;
|
|
int locustCount;
|
|
int iVar3;
|
|
uint uVar4;
|
|
Entity *pEVar5;
|
|
int fishTailMultiplier;
|
|
uint rngResult;
|
|
uint *conquestRngSeed;
|
|
bool bVar6;
|
|
bool bVar7;
|
|
void *trinketRngs;
|
|
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x71)) {
|
|
locustCount = GetTrinketMultiplier(this,0x71);
|
|
bVar7 = false;
|
|
bVar6 = locustCount == 0;
|
|
LAB_007c8868:
|
|
if (!bVar6 && bVar7 == locustCount < 0) goto LAB_007c8873;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x71);
|
|
bVar7 = SBORROW4(iVar2,1);
|
|
locustCount = iVar2 + -1;
|
|
bVar6 = iVar2 == 1;
|
|
goto LAB_007c8868;
|
|
}
|
|
LAB_007c8873:
|
|
locustCount = GetTrinketMultiplier(this,0x71);
|
|
iVar2 = 1;
|
|
isFishTailHeld = HasTrinket(this,0x5e,0);
|
|
if (isFishTailHeld != 0) {
|
|
iVar2 = 2;
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
if (iVar3 == 2) {
|
|
uVar4 = Random();
|
|
if (uVar4 % 5 == 0) {
|
|
iVar2 = 3;
|
|
}
|
|
}
|
|
else if ((iVar3 == 3) && (uVar4 = Random(), uVar4 % 5 == 0)) {
|
|
iVar2 = 4;
|
|
}
|
|
}
|
|
iVar2 = iVar2 * locustCount;
|
|
if (0 < iVar2) {
|
|
do {
|
|
uVar4 = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,uVar4,0);
|
|
*GHIDRA_CAST<uint *>(&pEVar5->_flags) = GHIDRA_UINT(pEVar5->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4));
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x72)) {
|
|
locustCount = GetTrinketMultiplier(this,0x72);
|
|
bVar7 = false;
|
|
bVar6 = locustCount == 0;
|
|
LAB_007c894d:
|
|
if (!bVar6 && bVar7 == locustCount < 0) goto LAB_007c8958;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x72);
|
|
bVar7 = SBORROW4(iVar2,1);
|
|
locustCount = iVar2 + -1;
|
|
bVar6 = iVar2 == 1;
|
|
goto LAB_007c894d;
|
|
}
|
|
LAB_007c8958:
|
|
locustCount = GetTrinketMultiplier(this,0x72);
|
|
iVar2 = 1;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x5e)) {
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = false;
|
|
bVar6 = iVar3 == 0;
|
|
LAB_007c8997:
|
|
if (!bVar6 && bVar7 == iVar3 < 0) goto LAB_007c899e;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
fishTailMultiplier = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = SBORROW4(fishTailMultiplier,1);
|
|
iVar3 = fishTailMultiplier + -1;
|
|
bVar6 = fishTailMultiplier == 1;
|
|
goto LAB_007c8997;
|
|
}
|
|
LAB_007c899e:
|
|
iVar2 = 2;
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
if (iVar3 == 2) {
|
|
uVar4 = Random();
|
|
if (uVar4 % 5 == 0) {
|
|
iVar2 = 3;
|
|
}
|
|
}
|
|
else if ((iVar3 == 3) && (uVar4 = Random(), uVar4 % 5 == 0)) {
|
|
iVar2 = 4;
|
|
}
|
|
}
|
|
iVar2 = iVar2 * locustCount;
|
|
if (0 < iVar2) {
|
|
do {
|
|
uVar4 = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),2,uVar4,0);
|
|
*GHIDRA_CAST<uint *>(&pEVar5->_flags) = GHIDRA_UINT(pEVar5->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4));
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x73)) {
|
|
locustCount = GetTrinketMultiplier(this,0x73);
|
|
bVar7 = false;
|
|
bVar6 = locustCount == 0;
|
|
LAB_007c8a59:
|
|
if (!bVar6 && bVar7 == locustCount < 0) goto LAB_007c8a64;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x73);
|
|
bVar7 = SBORROW4(iVar2,1);
|
|
locustCount = iVar2 + -1;
|
|
bVar6 = iVar2 == 1;
|
|
goto LAB_007c8a59;
|
|
}
|
|
LAB_007c8a64:
|
|
locustCount = GetTrinketMultiplier(this,0x73);
|
|
iVar2 = 1;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x5e)) {
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = false;
|
|
bVar6 = iVar3 == 0;
|
|
LAB_007c8aa3:
|
|
if (!bVar6 && bVar7 == iVar3 < 0) goto LAB_007c8aaa;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
fishTailMultiplier = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = SBORROW4(fishTailMultiplier,1);
|
|
iVar3 = fishTailMultiplier + -1;
|
|
bVar6 = fishTailMultiplier == 1;
|
|
goto LAB_007c8aa3;
|
|
}
|
|
LAB_007c8aaa:
|
|
iVar2 = 2;
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
if (iVar3 == 2) {
|
|
uVar4 = Random();
|
|
if (uVar4 % 5 == 0) {
|
|
iVar2 = 3;
|
|
}
|
|
}
|
|
else if ((iVar3 == 3) && (uVar4 = Random(), uVar4 % 5 == 0)) {
|
|
iVar2 = 4;
|
|
}
|
|
}
|
|
iVar2 = iVar2 * locustCount;
|
|
if (0 < iVar2) {
|
|
do {
|
|
uVar4 = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),3,uVar4,0);
|
|
*GHIDRA_CAST<uint *>(&pEVar5->_flags) = GHIDRA_UINT(pEVar5->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4));
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x74)) {
|
|
locustCount = GetTrinketMultiplier(this,0x74);
|
|
bVar7 = false;
|
|
bVar6 = locustCount == 0;
|
|
LAB_007c8b68:
|
|
if (!bVar6 && bVar7 == locustCount < 0) goto LAB_007c8b73;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x74);
|
|
bVar7 = SBORROW4(iVar2,1);
|
|
locustCount = iVar2 + -1;
|
|
bVar6 = iVar2 == 1;
|
|
goto LAB_007c8b68;
|
|
}
|
|
LAB_007c8b73:
|
|
locustCount = GetTrinketMultiplier(this,0x74);
|
|
iVar2 = 1;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x5e)) {
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = false;
|
|
bVar6 = iVar3 == 0;
|
|
LAB_007c8bb2:
|
|
if (!bVar6 && bVar7 == iVar3 < 0) goto LAB_007c8bb9;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
fishTailMultiplier = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = SBORROW4(fishTailMultiplier,1);
|
|
iVar3 = fishTailMultiplier + -1;
|
|
bVar6 = fishTailMultiplier == 1;
|
|
goto LAB_007c8bb2;
|
|
}
|
|
LAB_007c8bb9:
|
|
iVar2 = 2;
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
if (iVar3 == 2) {
|
|
uVar4 = Random();
|
|
if (uVar4 % 5 == 0) {
|
|
iVar2 = 3;
|
|
}
|
|
}
|
|
else if ((iVar3 == 3) && (uVar4 = Random(), uVar4 % 5 == 0)) {
|
|
iVar2 = 4;
|
|
}
|
|
}
|
|
iVar2 = iVar2 * locustCount;
|
|
if (0 < iVar2) {
|
|
do {
|
|
uVar4 = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),4,uVar4,0);
|
|
*GHIDRA_CAST<uint *>(&pEVar5->_flags) = GHIDRA_UINT(pEVar5->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4));
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x75)) {
|
|
locustCount = GetTrinketMultiplier(this,0x75);
|
|
bVar7 = false;
|
|
bVar6 = locustCount == 0;
|
|
LAB_007c8c78:
|
|
if (bVar6 || bVar7 != locustCount < 0) {
|
|
return;
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar2 = GetTrinketMultiplier(this,0x75);
|
|
bVar7 = SBORROW4(iVar2,1);
|
|
locustCount = iVar2 + -1;
|
|
bVar6 = iVar2 == 1;
|
|
goto LAB_007c8c78;
|
|
}
|
|
locustCount = GetTrinketMultiplier(this,0x75);
|
|
trinketRngs = (this->_trinketRNGs)._begin;
|
|
conquestRngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(trinketRngs) + 0x750));
|
|
iVar2 = GetTrinketMultiplier(this,0x75);
|
|
uVar4 = *conquestRngSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = *conquestRngSeed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(trinketRngs) + 0x754)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(trinketRngs) + 0x758)) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(trinketRngs) + 0x75c)) & 0x1f) ^ uVar4;
|
|
*conquestRngSeed = uVar4;
|
|
uVar4 = uVar4 % (5 - (iVar2 != 2));
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0x5e)) {
|
|
iVar2 = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = false;
|
|
bVar6 = iVar2 == 0;
|
|
LAB_007c8d1e:
|
|
if (bVar6 || bVar7 != iVar2 < 0) goto LAB_007c8d6e;
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) == '\0') {
|
|
iVar3 = GetTrinketMultiplier(this,0x5e);
|
|
bVar7 = SBORROW4(iVar3,1);
|
|
iVar2 = iVar3 + -1;
|
|
bVar6 = iVar3 == 1;
|
|
goto LAB_007c8d1e;
|
|
}
|
|
iVar3 = 2;
|
|
iVar2 = GetTrinketMultiplier(this,0x5e);
|
|
if (iVar2 == 2) {
|
|
rngResult = Random();
|
|
if (rngResult % 5 == 0) {
|
|
iVar3 = 3;
|
|
}
|
|
}
|
|
else if ((iVar2 == 3) && (rngResult = Random(), rngResult % 5 == 0)) {
|
|
iVar3 = 4;
|
|
}
|
|
uVar4 = uVar4 * iVar3;
|
|
LAB_007c8d6e:
|
|
locustCount = locustCount + uVar4;
|
|
if (0 < locustCount) {
|
|
do {
|
|
uVar4 = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),5,uVar4,0);
|
|
*GHIDRA_CAST<uint *>(&pEVar5->_flags) = GHIDRA_UINT(pEVar5->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar5->_flags) + 4));
|
|
locustCount = locustCount + -1;
|
|
} while (locustCount != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c8dc0
|
|
Entity_Laser * Entity_Player::SpawnMawOfVoid(int timeout)
|
|
{
|
|
uint uVar1;
|
|
Entity *spawned;
|
|
Entity_Laser *laser;
|
|
uint tearFlagsWord3;
|
|
uint tearFlagsWord2;
|
|
undefined4 local_c;
|
|
Manager *manager;
|
|
EntityPtr *parentRef;
|
|
|
|
manager = g_manager;
|
|
local_c = GHIDRA_CAST<EntityPtr *>(0x1aa);
|
|
seed_fart_sound_override(&local_c);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c),1.0,2,0,1.0,0.0);
|
|
uVar1 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(7,1,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),3,uVar1,0);
|
|
laser = (Entity_Laser *)
|
|
__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0);
|
|
parentRef = &laser->_parent;
|
|
(laser->_posOffset).x = 0.0;
|
|
(laser->_posOffset).y = -20.0;
|
|
if (*parentRef != (EntityPtr)0x0) {
|
|
local_c = parentRef;
|
|
std::multiset<unsigned_int>::erase(&local_c);
|
|
}
|
|
*parentRef = (EntityPtr)this;
|
|
if (this != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(parentRef);
|
|
}
|
|
laser->_renderDepthOffset = 3000.0;
|
|
uVar1 = ~((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGrow._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagShrink._l)) + 0x4)))) &
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPulse._l)) + 0x4)));
|
|
tearFlagsWord2 =
|
|
~(GHIDRA_UINT(g_tearFlagGrow._h) | GHIDRA_UINT(g_tearFlagShrink._h)) & GHIDRA_UINT((this->_tearFlags)._h) |
|
|
GHIDRA_UINT(g_tearFlagPulse._h);
|
|
tearFlagsWord3 =
|
|
~((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGrow._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagShrink._h)) + 0x4)))) &
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPulse._h)) + 0x4)));
|
|
*GHIDRA_CAST<uint *>(&(laser->_tearFlags)._l) =
|
|
~(GHIDRA_UINT(g_tearFlagGrow._l) | GHIDRA_UINT(g_tearFlagShrink._l)) & GHIDRA_UINT((this->_tearFlags)._l) |
|
|
GHIDRA_UINT(g_tearFlagPulse._l);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(laser->_tearFlags)._l) + 4)) = uVar1;
|
|
*GHIDRA_CAST<uint *>(&(laser->_tearFlags)._h) = tearFlagsWord2;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(laser->_tearFlags)._h) + 4)) = tearFlagsWord3;
|
|
laser->SetCollisionDamage(this->_damage);
|
|
laser->_timeout = timeout;
|
|
if (laser->_spawnerEntity != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase(GHIDRA_INT(register0x00000010) + -0x10);
|
|
}
|
|
laser->_spawnerEntity = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(&laser->_spawnerEntity);
|
|
return laser;
|
|
}
|
|
|
|
// 007c8f80
|
|
void Entity_Player::AddGoldenBomb()
|
|
{
|
|
Game *game;
|
|
|
|
this->_hasGoldenBomb = 1;
|
|
ConsumableCountChanged(this,0x10);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c8fc0
|
|
void Entity_Player::RemoveGoldenBomb()
|
|
{
|
|
Game *game;
|
|
|
|
this->_hasGoldenBomb = 0;
|
|
ConsumableCountChanged(this,0x10);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c9000
|
|
void Entity_Player::AddDollarBillEffect()
|
|
{
|
|
int id;
|
|
uint rngResult;
|
|
ItemConfig_Item *oldItem;
|
|
ItemConfig_Item *newItem;
|
|
Manager *manager;
|
|
|
|
rngResult = Random();
|
|
manager = g_manager;
|
|
id = *GHIDRA_CAST<int *>((&DAT_00b6bb50 + (rngResult % 0x26) * 4));
|
|
oldItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(this->_threeDollarBillItem);
|
|
newItem = (GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig::GetCollectible(id);
|
|
this->_threeDollarBillItem = id;
|
|
if (oldItem != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
this->_cacheFlags = this->_cacheFlags | oldItem->cacheFlags;
|
|
}
|
|
if (newItem != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
this->_cacheFlags = this->_cacheFlags | newItem->cacheFlags;
|
|
}
|
|
EvaluateItems(this);
|
|
return;
|
|
}
|
|
|
|
// 007c90b0
|
|
int Entity_Player::GetCambionPregnancyLevel()
|
|
{
|
|
int conceptionState;
|
|
|
|
conceptionState = this->_cambionConceptionState;
|
|
if (0xe < conceptionState) {
|
|
if (0x1d < conceptionState) {
|
|
if (conceptionState < 0x3c) {
|
|
return (conceptionState + -0x1e) / 10;
|
|
}
|
|
if (conceptionState < 0x5a) {
|
|
return (conceptionState + -0x3c) / 10;
|
|
}
|
|
if (conceptionState < 99) {
|
|
return (conceptionState + -0x5a) / 3;
|
|
}
|
|
return 0;
|
|
}
|
|
conceptionState = conceptionState + -0xf;
|
|
}
|
|
return conceptionState / 5;
|
|
}
|
|
|
|
// 007c9130
|
|
Entity * Entity_Player::ShootRedCandle(Vector *dir)
|
|
{
|
|
byte isLocalPlayer;
|
|
uint rngResult;
|
|
float *extraout_EAX;
|
|
Entity *flame;
|
|
NetplayManager *netplayManager;
|
|
float unaff_ESI;
|
|
float scaleY;
|
|
undefined4 local_c0;
|
|
float fStack_bc;
|
|
float fStack_b8;
|
|
Vector VStack_b4;
|
|
Vector VStack_ac;
|
|
float fStack_a4;
|
|
float fStack_a0;
|
|
float fStack_9c;
|
|
float fStack_98;
|
|
float fStack_94;
|
|
float fStack_90;
|
|
float fStack_8c;
|
|
undefined8 uStack_88;
|
|
float fStack_80;
|
|
TearParams hitParams;
|
|
uint local_c;
|
|
Manager *manager;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_c0);
|
|
flame = GHIDRA_CAST<Entity *>(0x0);
|
|
rngResult = Random();
|
|
local_c0 = 0x3f800000;
|
|
GetTearHitParams(this,&hitParams,1,1.0,(rngResult & 1) * 2 + -1,flame);
|
|
fStack_bc = dir->x;
|
|
fStack_b8 = dir->y;
|
|
GetTearMovementInheritance(this,&VStack_ac,dir,0);
|
|
VStack_b4.x = (fStack_bc * 10.0 + *extraout_EAX) * 1.4;
|
|
VStack_b4.y = (fStack_b8 * 10.0 + extraout_EAX[1]) * 1.4;
|
|
rngResult = Random();
|
|
flame = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x34,&this->_pos,&VStack_b4,GHIDRA_CAST<Entity *>(this),0,rngResult,0);
|
|
(**(code **)(*GHIDRA_CAST<int *>(flame) + 0x40))
|
|
((hitParams._tearDamage * 4.0 * this->_meleeDamage) / this->_damage);
|
|
manager = g_manager;
|
|
netplayManager = &g_manager->_netplayManager;
|
|
scaleY = hitParams._tearDamage * g_vectorOne.y;
|
|
(flame->_sprite)._scale.x = hitParams._tearDamage * g_vectorOne.x;
|
|
(flame->_sprite)._scale.y = scaleY;
|
|
if (*netplayManager != *GHIDRA_CAST<NetplayManager *>((manager + 1))) {
|
|
isLocalPlayer = (GHIDRA_CAST<NetplayManager *>((netplayManager)))->NetplayManager::IsIdxLocalPlayer(this->_controllerIndex);
|
|
if (isLocalPlayer == 0) {
|
|
VStack_ac.y = (flame->_sprite)._color._tint[0];
|
|
fStack_a4 = (flame->_sprite)._color._tint[1];
|
|
fStack_a0 = (flame->_sprite)._color._tint[2];
|
|
fStack_80 = (flame->_sprite)._color._offset[2];
|
|
fStack_98 = (flame->_sprite)._color._colorize[0];
|
|
fStack_94 = (flame->_sprite)._color._colorize[1];
|
|
fStack_90 = (flame->_sprite)._color._colorize[2];
|
|
fStack_8c = (flame->_sprite)._color._colorize[3];
|
|
uStack_88 = *GHIDRA_CAST<undefined8 *>((flame->_sprite)._color._offset);
|
|
if ((g_game == GHIDRA_CAST<Game *>(0x0)) || (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
|
|
unaff_ESI = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1;
|
|
}
|
|
fStack_9c = (flame->_sprite)._color._tint[3] * unaff_ESI;
|
|
flame->SetColor(&VStack_ac.y,0xffffffff,0xff,0,1);
|
|
}
|
|
}
|
|
flame->Update();
|
|
return flame;
|
|
}
|
|
|
|
// 007c9350
|
|
Entity * Entity_Player::ShootBlueCandle(Vector *dir)
|
|
{
|
|
ANM2 *pAVar1;
|
|
byte isLocalPlayer;
|
|
uint rngResult;
|
|
float *extraout_EAX;
|
|
Entity *flame;
|
|
NetplayManager *netplayManager;
|
|
float unaff_ESI;
|
|
float scaleY;
|
|
undefined4 local_c0;
|
|
float fStack_bc;
|
|
float fStack_b8;
|
|
Vector VStack_b4;
|
|
Vector VStack_ac;
|
|
float fStack_a4;
|
|
float fStack_a0;
|
|
float fStack_9c;
|
|
float fStack_98;
|
|
float fStack_94;
|
|
float fStack_90;
|
|
float fStack_8c;
|
|
undefined8 uStack_88;
|
|
float fStack_80;
|
|
TearParams hitParams;
|
|
uint local_c;
|
|
Manager *manager;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_c0);
|
|
flame = GHIDRA_CAST<Entity *>(0x0);
|
|
rngResult = Random();
|
|
local_c0 = 0x3f800000;
|
|
GetTearHitParams(this,&hitParams,1,1.0,(rngResult & 1) * 2 + -1,flame);
|
|
fStack_bc = dir->x;
|
|
fStack_b8 = dir->y;
|
|
GetTearMovementInheritance(this,&VStack_ac,dir,0);
|
|
VStack_b4.x = (fStack_bc * 10.0 + *extraout_EAX) * 1.4;
|
|
VStack_b4.y = (fStack_b8 * 10.0 + extraout_EAX[1]) * 1.4;
|
|
rngResult = Random();
|
|
flame = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,10,&this->_pos,&VStack_b4,GHIDRA_CAST<Entity *>(this),0,rngResult,0);
|
|
(**(code **)(*GHIDRA_CAST<int *>(flame) + 0x40))
|
|
((hitParams._tearDamage * 6.0 * this->_meleeDamage) / this->_damage);
|
|
manager = g_manager;
|
|
pAVar1 = &flame[1]._sprite;
|
|
(pAVar1->_filename)._buf[4] = '<';
|
|
(pAVar1->_filename)._buf[5] = '\0';
|
|
(pAVar1->_filename)._buf[6] = '\0';
|
|
(pAVar1->_filename)._buf[7] = '\0';
|
|
netplayManager = &manager->_netplayManager;
|
|
pAVar1 = &flame[1]._sprite;
|
|
(pAVar1->_filename)._buf[8] = '<';
|
|
(pAVar1->_filename)._buf[9] = '\0';
|
|
(pAVar1->_filename)._buf[10] = '\0';
|
|
(pAVar1->_filename)._buf[0xb] = '\0';
|
|
scaleY = hitParams._tearDamage * g_vectorOne.y;
|
|
hitParams._tearDamage = hitParams._tearDamage * g_vectorOne.x;
|
|
flame->_entityGridCollisionClass = 0;
|
|
(flame->_sprite)._scale.y = scaleY;
|
|
(flame->_sprite)._scale.x = hitParams._tearDamage;
|
|
if (*netplayManager != *GHIDRA_CAST<NetplayManager *>((manager + 1))) {
|
|
isLocalPlayer = (GHIDRA_CAST<NetplayManager *>((netplayManager)))->NetplayManager::IsIdxLocalPlayer(this->_controllerIndex);
|
|
if (isLocalPlayer == 0) {
|
|
VStack_ac.y = (flame->_sprite)._color._tint[0];
|
|
fStack_a4 = (flame->_sprite)._color._tint[1];
|
|
fStack_a0 = (flame->_sprite)._color._tint[2];
|
|
fStack_80 = (flame->_sprite)._color._offset[2];
|
|
fStack_98 = (flame->_sprite)._color._colorize[0];
|
|
fStack_94 = (flame->_sprite)._color._colorize[1];
|
|
fStack_90 = (flame->_sprite)._color._colorize[2];
|
|
fStack_8c = (flame->_sprite)._color._colorize[3];
|
|
uStack_88 = *GHIDRA_CAST<undefined8 *>((flame->_sprite)._color._offset);
|
|
if ((g_game == GHIDRA_CAST<Game *>(0x0)) || (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
|
|
unaff_ESI = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1;
|
|
}
|
|
fStack_9c = (flame->_sprite)._color._tint[3] * unaff_ESI;
|
|
flame->SetColor(&VStack_ac.y,0xffffffff,0xff,0,1);
|
|
}
|
|
}
|
|
flame->Update();
|
|
return flame;
|
|
}
|
|
|
|
// 007c9590
|
|
void Entity_Player::DoZitEffect(Vector *direction)
|
|
{
|
|
Entity_Player *zitTear = this;
|
|
uint rngResult;
|
|
float *extraout_EAX;
|
|
Entity *spawned;
|
|
Entity_Tear *zitTear;
|
|
int creepCount;
|
|
undefined1 auStack_54 [4];
|
|
float local_50;
|
|
float local_4c;
|
|
Vector scratchVec;
|
|
Vector inheritedVelocity;
|
|
undefined4 tearColor;
|
|
undefined4 uStack_34;
|
|
undefined4 uStack_30;
|
|
undefined4 uStack_2c;
|
|
undefined4 uStack_28;
|
|
undefined4 uStack_24;
|
|
undefined4 uStack_20;
|
|
undefined4 uStack_1c;
|
|
undefined4 uStack_18;
|
|
undefined4 uStack_14;
|
|
undefined4 uStack_10;
|
|
uint local_c;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(auStack_54);
|
|
rngResult = Random();
|
|
for (creepCount = rngResult % 3 + 1; creepCount != 0; creepCount = creepCount + -1) {
|
|
local_4c = (float)Random();
|
|
rngResult = Random();
|
|
local_50 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
scratchVec.x = sqrtf(direction->x * direction->x + direction->y * direction->y);
|
|
if (scratchVec.x <= 0.0) {
|
|
scratchVec.x = direction->x;
|
|
scratchVec.y = direction->y;
|
|
}
|
|
else {
|
|
scratchVec.x = (local_50 * 75.0 + 10.0) / scratchVec.x;
|
|
scratchVec.y = scratchVec.x * direction->y;
|
|
scratchVec.x = scratchVec.x * direction->x;
|
|
}
|
|
scratchVec.x = scratchVec.x + (zitTear->_pos).x;
|
|
scratchVec.y = scratchVec.y + (zitTear->_pos).y;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x2c,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(zitTear),0,GHIDRA_UINT(local_4c),0);
|
|
}
|
|
local_4c = direction->x;
|
|
local_50 = direction->y;
|
|
GetTearMovementInheritance(zitTear,&inheritedVelocity,direction,0);
|
|
scratchVec.x = (local_4c * 10.0 + *extraout_EAX) * zitTear->_shotspeed;
|
|
scratchVec.y = (local_50 * 10.0 + extraout_EAX[1]) * zitTear->_shotspeed;
|
|
rngResult = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,0,&zitTear->_pos,&scratchVec,GHIDRA_CAST<Entity *>(zitTear),0,rngResult,0);
|
|
zitTear = (Entity_Tear *)
|
|
__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0);
|
|
uStack_18 = 0x3f333333;
|
|
uStack_14 = 0x3f333333;
|
|
uStack_10 = 0x3f333333;
|
|
uStack_28 = 0;
|
|
uStack_24 = 0;
|
|
uStack_20 = 0;
|
|
uStack_1c = 0;
|
|
tearColor = 0x3e99999a;
|
|
uStack_34 = 0x3e99999a;
|
|
uStack_30 = 0x3e99999a;
|
|
uStack_2c = 0x3f800000;
|
|
zitTear->SetColor(&tearColor,0xffffffff,0xff,0,1);
|
|
zitTear->SetCollisionDamage(zitTear->_damage + zitTear->_damage);
|
|
(GHIDRA_CAST<Entity_Tear *>((zitTear)))->Entity_Tear::SetTearFlags(g_tearFlagSlow);
|
|
zitTear->_baseScale = 0.5;
|
|
zitTear->_fScale = 0.5;
|
|
(GHIDRA_CAST<Entity_Tear *>((zitTear)))->Entity_Tear::ResetSpriteScale();
|
|
zitTear->Update();
|
|
return;
|
|
}
|
|
|
|
// 007c97f0
|
|
void Entity_Player::apply_victory_lap_penalty(uint param_1)
|
|
{
|
|
code *pcVar1;
|
|
uint uVar2;
|
|
Entity_Player *in_ECX;
|
|
uint uVar3;
|
|
void *historyItem;
|
|
undefined4 *itemsEnd;
|
|
float removeFraction;
|
|
undefined4 *local_3c;
|
|
int shuffleIndex;
|
|
undefined4 *local_2c;
|
|
uint remaining;
|
|
uint swapIndex;
|
|
uint i;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
undefined4 swapTmp;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0008d;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
if (g_game->_victoryLap == 2) {
|
|
ExceptionList = &local_10;
|
|
if (6 < in_ECX->_maxHearts) {
|
|
AddMaxHearts(in_ECX,6 - in_ECX->_maxHearts,0);
|
|
}
|
|
removeFraction = 0.5;
|
|
}
|
|
else {
|
|
if (g_game->_victoryLap < 3) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
RemoveSkinCostume(in_ECX);
|
|
in_ECX->_cacheFlags = in_ECX->_cacheFlags | 0xffff;
|
|
in_ECX->_maxHearts = 0;
|
|
in_ECX->_redHearts = 0;
|
|
in_ECX->_soulHearts = 1;
|
|
in_ECX->_blackHearts = 0;
|
|
in_ECX->_boneHeartsMask = 0;
|
|
in_ECX->_boneHearts = 0;
|
|
in_ECX->_eternalHearts = 0;
|
|
in_ECX->_playerType = 10;
|
|
EvaluateItems(in_ECX);
|
|
update_player_skin(in_ECX);
|
|
UpdateCanShoot(in_ECX);
|
|
if (g_game->_victoryLap < 4) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
removeFraction = 0.75;
|
|
}
|
|
itemsEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_2c = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_3c = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_8 = 0;
|
|
historyItem = (in_ECX->_history)._historyItems._begin;
|
|
if (historyItem != (in_ECX->_history)._historyItems._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(historyItem) + 4)) == '\0') {
|
|
if (itemsEnd == GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(0,GHIDRA_CAST<undefined4 *>((GHIDRA_INT(historyItem) + 8)));
|
|
itemsEnd = local_3c;
|
|
}
|
|
else {
|
|
*itemsEnd = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(historyItem) + 8));
|
|
local_3c = itemsEnd + 1;
|
|
itemsEnd = local_3c;
|
|
}
|
|
}
|
|
historyItem = (void *)(GHIDRA_INT(historyItem) + 0x1c);
|
|
} while (historyItem != (in_ECX->_history)._historyItems._end);
|
|
local_2c = itemsEnd;
|
|
}
|
|
uVar3 = GHIDRA_INT(local_2c) >> 2;
|
|
shuffleIndex = uVar3 - 1;
|
|
if (0 < shuffleIndex) {
|
|
remaining = uVar3;
|
|
do {
|
|
if (param_1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
param_1 = param_1 >> 4 ^ param_1;
|
|
param_1 = param_1 << 5 ^ param_1;
|
|
param_1 = param_1 >> 0xf ^ param_1;
|
|
if (remaining == 0) {
|
|
swapIndex = 0;
|
|
}
|
|
else {
|
|
swapIndex = param_1 % remaining;
|
|
}
|
|
remaining = remaining - 1;
|
|
swapTmp = *GHIDRA_CAST<undefined4 *>((shuffleIndex * 4));
|
|
*GHIDRA_CAST<undefined4 *>((shuffleIndex * 4)) = *GHIDRA_CAST<undefined4 *>((swapIndex * 4));
|
|
shuffleIndex = shuffleIndex + -1;
|
|
*GHIDRA_CAST<undefined4 *>((swapIndex * 4)) = swapTmp;
|
|
} while (0 < shuffleIndex);
|
|
}
|
|
floor((double)((float)((double)GHIDRA_INT((uVar3 + 1)) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT((uVar3 + 1)) >> 0x1f)]) * removeFraction));
|
|
uVar2 = __ftoui3(uVar2);
|
|
if (uVar2 < uVar3) {
|
|
uVar3 = uVar2;
|
|
}
|
|
i = 0;
|
|
if (uVar3 != 0) {
|
|
do {
|
|
RemoveCollectible(in_ECX,*GHIDRA_CAST<uint *>((i * 4)),0,0,1);
|
|
i = i + 1;
|
|
} while (i < uVar3);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007c9ad0
|
|
float Entity_Player::get_voice_pitch()
|
|
{
|
|
byte isHasEffect;
|
|
float local_c;
|
|
void *pillEffectUses;
|
|
|
|
if (this->_variant == 0) {
|
|
local_c = 1.0;
|
|
}
|
|
else {
|
|
local_c = 1.5;
|
|
}
|
|
pillEffectUses = (this->_pillEffectUses)._begin;
|
|
local_c = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pillEffectUses) + 0x84)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pillEffectUses) + 0x80))) *
|
|
0.1 + local_c;
|
|
isHasEffect = HasCollectible(this,0x256,0);
|
|
if (isHasEffect == 0) {
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x2b0);
|
|
if (isHasEffect == 0) goto LAB_007c9b57;
|
|
}
|
|
local_c = local_c + 0.5;
|
|
LAB_007c9b57:
|
|
isHasEffect = HasCollectible(this,0x1b6,0);
|
|
if (isHasEffect != 0) {
|
|
local_c = local_c + 0.2;
|
|
}
|
|
if (((this->_hasCurseMistEffect == 0) && (this->_isCoopGhost == 0)) &&
|
|
(2 < this->_playerForms[0xb])) {
|
|
local_c = local_c - 0.2;
|
|
}
|
|
if (local_c <= 0.5) {
|
|
local_c = 0.5;
|
|
}
|
|
if (2.0 <= local_c) {
|
|
local_c = 2.0;
|
|
}
|
|
return local_c;
|
|
}
|
|
|
|
// 007c9bb0
|
|
void Entity_Player::AddJarFlies(int amount)
|
|
{
|
|
int clampedFlies;
|
|
int totalFlies;
|
|
Game *game;
|
|
|
|
totalFlies = this->_jarFlies + amount;
|
|
clampedFlies = 0x14;
|
|
if (totalFlies < 0x14) {
|
|
clampedFlies = totalFlies;
|
|
}
|
|
this->_jarFlies = clampedFlies;
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c9c00
|
|
byte Entity_Player::IsPosInSpotLight(Vector *position)
|
|
{
|
|
float dirX;
|
|
float dirX;
|
|
float fVar2;
|
|
float cosAngle;
|
|
float distance;
|
|
float distanceSq;
|
|
|
|
dirX = position->distanceSq - (this->_pos).distanceSq;
|
|
dirX = position->y - (this->_pos).y;
|
|
fVar2 = this->_bodyAngle * 0.017453292;
|
|
cosAngle = cos(fVar2);
|
|
fVar2 = sin(fVar2);
|
|
distanceSq = dirX * dirX + dirX * dirX;
|
|
distance = sqrtf(distanceSq);
|
|
if (0.0 < distance) {
|
|
dirX = dirX * (1.0 / distance);
|
|
dirX = dirX * (1.0 / distance);
|
|
}
|
|
if (distanceSq < 40000.0) {
|
|
dirX = dirX * cosAngle + fVar2 * dirX;
|
|
FUN_00652a70();
|
|
if (dirX * 57.295776 < 20.0) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007c9d10
|
|
void Entity_Player::AddGoldenHearts(int amount, byte retBool)
|
|
{
|
|
int iVar1;
|
|
EntityPtr *playerHud;
|
|
int iVar2;
|
|
uint hudIndex;
|
|
int newGoldenHearts;
|
|
EntityPtr twin;
|
|
|
|
iVar1 = this->_playerType;
|
|
while ((iVar1 == 0x28 && (twin = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)), twin != (EntityPtr)0x0))) {
|
|
retBool = 0;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x13c0));
|
|
this = GHIDRA_CAST<Entity_Player *>(twin);
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0));
|
|
if ((((iVar1 == 10) || (iVar1 == 0x1f)) || (iVar1 == 0xe)) || (iVar1 == 0x21)) {
|
|
BreakGoldenHearts(this,1);
|
|
}
|
|
else {
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
ClampHeartsToLimit(this,7,amount * 2);
|
|
return;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194c));
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
}
|
|
newGoldenHearts = amount + iVar1;
|
|
iVar2 = (iVar2 + 1) / 2 + (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + 1) / 2 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88));
|
|
if (iVar2 < newGoldenHearts) {
|
|
newGoldenHearts = iVar2;
|
|
}
|
|
iVar2 = 0;
|
|
if (0 < newGoldenHearts) {
|
|
iVar2 = newGoldenHearts;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194c)) = iVar2;
|
|
ClampGoldenHearts(this,retBool);
|
|
if (iVar1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194c))) {
|
|
playerHud = GHIDRA_CAST<EntityPtr *>(&g_game->_hud);
|
|
hudIndex = 0;
|
|
do {
|
|
if (*playerHud == (EntityPtr)this) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(playerHud[3])) + 0x2))) = 4;
|
|
return;
|
|
}
|
|
hudIndex = hudIndex + 1;
|
|
playerHud = playerHud + 0x1b7;
|
|
} while (hudIndex < 8);
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007c9e30
|
|
byte Entity_Player::CanPickGoldenHearts()
|
|
{
|
|
int cappedRedHearts;
|
|
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return this->_maxHearts < 0xa0;
|
|
}
|
|
while ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x28 &&
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) != (EntityPtr)0x0))) {
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
cappedRedHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344))) {
|
|
cappedRedHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340));
|
|
}
|
|
return *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194c)) <
|
|
(cappedRedHearts + 1) / 2 + (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + 1) / 2 +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88));
|
|
}
|
|
|
|
// 007c9ea0
|
|
void Entity_Player::UpdateHeartDependentEffects()
|
|
{
|
|
byte isOwned;
|
|
int iVar1;
|
|
int *entitySlot;
|
|
int iVar2;
|
|
int iVar3;
|
|
Game *game;
|
|
float redHeartRatio;
|
|
char *pcVar4;
|
|
int nullEffect [3];
|
|
undefined4 local_c;
|
|
void *nullItems;
|
|
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
iVar3 = this->_redHearts;
|
|
iVar1 = (iVar3 + 1) / 2;
|
|
iVar2 = this->_rottenHearts;
|
|
if (iVar1 < this->_rottenHearts) {
|
|
iVar2 = iVar1;
|
|
}
|
|
this->_rottenHearts = iVar2;
|
|
if (iVar3 < iVar2 * 2) {
|
|
iVar3 = iVar2 * 2;
|
|
}
|
|
this->_redHearts = iVar3;
|
|
}
|
|
update_greeds_gullet(this);
|
|
game = g_game;
|
|
if (((this->_dead == 0) && (this->_playerType == 0x1a)) &&
|
|
(this->_boneHearts + this->_goldenHearts + this->_soulHearts + this->_eternalHearts +
|
|
this->_redHearts == 1)) {
|
|
pcVar4 = g_game->_room;
|
|
if (((*pcVar4 != '\0') && (1 < g_game->_frameCount - *GHIDRA_CAST<int *>((pcVar4 + 0x11f0)))) &&
|
|
(isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x6e), isOwned == 0)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((pcVar4 + 0x1254));
|
|
iVar2 = 0;
|
|
if (iVar3 != 0) {
|
|
entitySlot = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(game->_room) + 0x124c));
|
|
do {
|
|
iVar1 = *entitySlot;
|
|
if (((iVar1 != 0) && (*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 3)) &&
|
|
((*GHIDRA_CAST<Entity_Player **>((iVar1 + 0x410)) == this &&
|
|
(((*GHIDRA_CAST<int *>((iVar1 + 0x2c)) == 0xee && (*GHIDRA_CAST<int *>((iVar1 + 0x30)) != 7)) &&
|
|
(*GHIDRA_CAST<char *>((iVar1 + 0x173)) == '\0')))))) {
|
|
iVar2 = iVar2 + 1;
|
|
}
|
|
entitySlot = entitySlot + 1;
|
|
iVar3 = iVar3 + -1;
|
|
} while (iVar3 != 0);
|
|
if (iVar2 != 0) goto LAB_007ca02e;
|
|
}
|
|
(GHIDRA_CAST<ItemOverlay *>((&game->_itemOverlay)))->ItemOverlay::Show(3,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
nullItems = (g_manager->_itemConfig)._nullItems._begin;
|
|
if ((0x1b8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) &
|
|
0xfffffffcU))) && (iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nullItems) + 0x1b8)), iVar3 != 0)) {
|
|
nullEffect[2] = *GHIDRA_CAST<undefined4 *>((iVar3 + 0x78));
|
|
nullEffect[1] = 0;
|
|
local_c = 0;
|
|
nullEffect[0] = iVar3;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(nullEffect,1,1);
|
|
}
|
|
goto LAB_007ca028;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007ca028:
|
|
game = g_game;
|
|
}
|
|
LAB_007ca02e:
|
|
iVar3 = *GHIDRA_CAST<int *>(&game->_deathmatchManager);
|
|
iVar2 = (1 < iVar3) + 1;
|
|
if (this->_dead == 0) {
|
|
if (1 < iVar3) {
|
|
iVar2 = iVar2 * 8;
|
|
}
|
|
if (iVar2 < this->_redHearts) {
|
|
if (this->_playerType == 5) {
|
|
iVar2 = 0x10;
|
|
if (iVar3 < 2) {
|
|
iVar2 = 2;
|
|
}
|
|
if (iVar2 < this->_redHearts) {
|
|
isOwned = HasCollectible(this,0x26b,0);
|
|
if (isOwned == 0) goto LAB_007ca100;
|
|
game = g_game;
|
|
}
|
|
if ((*GHIDRA_CAST<char *>(game->_room) != '\0') &&
|
|
(1 < game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x11f0)))) goto LAB_007ca0b0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007ca0b0:
|
|
isOwned = HasCollectible(this,0x7a,0);
|
|
if ((isOwned != 0) &&
|
|
(isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x7a),
|
|
isOwned == 0)) {
|
|
if (this->_postLevelInitFinished != 0) {
|
|
(GHIDRA_CAST<ItemOverlay *>((&g_game->_itemOverlay)))->ItemOverlay::Show(3,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x7a,1,1);
|
|
}
|
|
}
|
|
}
|
|
LAB_007ca100:
|
|
isOwned = HasCollectible(this,0x19f,0);
|
|
if (isOwned != 0) {
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13b5))) != '\0') || (isOwned = HasFullHearts(this), isOwned == 0))
|
|
goto LAB_007ca198;
|
|
LAB_007ca169:
|
|
isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x19f);
|
|
if (isOwned != 0) goto LAB_007ca1c8;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x19f,1,1);
|
|
pcVar4 = "FloatGlow";
|
|
}
|
|
else {
|
|
if (0.8 <= (float)this->_redHearts / (float)this->_maxHearts) goto LAB_007ca169;
|
|
LAB_007ca198:
|
|
isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x19f);
|
|
if (isOwned == 0) goto LAB_007ca1c8;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x19f,1);
|
|
pcVar4 = "FloatNoGlow";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_crownOfLightSprite)))->ANM2::Play(GHIDRA_CAST<byte *>(pcVar4),0);
|
|
}
|
|
LAB_007ca1c8:
|
|
isOwned = HasCollectible(this,0x1ba,0);
|
|
if (isOwned == 0) goto LAB_007ca260;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
if (this->_redHearts == 2) goto LAB_007ca2a6;
|
|
LAB_007ca230:
|
|
isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
if (isOwned == 0) goto LAB_007ca260;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x1ba,1);
|
|
pcVar4 = "FloatNoGlow";
|
|
}
|
|
else {
|
|
redHeartRatio = (float)this->_redHearts / (float)this->_maxHearts;
|
|
if ((redHeartRatio < 0.1) || (0.3 < redHeartRatio)) goto LAB_007ca230;
|
|
LAB_007ca2a6:
|
|
isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ba);
|
|
if (isOwned != 0) goto LAB_007ca260;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1ba,1,1);
|
|
pcVar4 = "FloatGlow";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_darkPrincesCrownSprite)))->ANM2::Play(GHIDRA_CAST<byte *>(pcVar4),0);
|
|
LAB_007ca260:
|
|
isOwned = HasCollectible(this,0x1ed,0);
|
|
if ((isOwned != 0) ||
|
|
(isOwned = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x1ed), isOwned != 0
|
|
)) {
|
|
this->_cacheFlags = this->_cacheFlags | 1;
|
|
EvaluateItems(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ca2d0
|
|
void Entity_Player::BreakGoldenHearts(int count)
|
|
{
|
|
Vector *position;
|
|
qword qVar1;
|
|
ANM2 *pAVar2;
|
|
byte bVar3;
|
|
uint uVar4;
|
|
Entity *effect;
|
|
byte *curAnimName;
|
|
char *pcVar5;
|
|
Entity_Player *self;
|
|
undefined1 *size;
|
|
int *piVar6;
|
|
qword *allocCounter;
|
|
bool isLess;
|
|
EntityList_EL nearbyEnemies;
|
|
Vector coinPos;
|
|
Vector randomVelocity;
|
|
Vector coinVelocity;
|
|
Entity *local_5c;
|
|
Entity_Player *player;
|
|
ANM2 *local_54;
|
|
undefined1 local_50 [8];
|
|
float fStack_48;
|
|
float fStack_44;
|
|
float local_40;
|
|
char *pcStack_3c;
|
|
float fStack_38;
|
|
float fStack_34;
|
|
float local_30;
|
|
float local_2c;
|
|
undefined1 *local_28;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
byte *animData;
|
|
Entity_Player *enemy;
|
|
Manager *manager;
|
|
int vtable;
|
|
|
|
manager = g_manager;
|
|
puStack_20 = local_50 + 0x4c;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b000d5;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((local_50 + 0x40));
|
|
if (count < 1) {
|
|
return;
|
|
}
|
|
local_54 = GHIDRA_CAST<ANM2 *>(0x1ab);
|
|
ExceptionList = &local_1c;
|
|
player = this;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_54),1.0,2,0,1.0,0.0);
|
|
uVar4 = Random();
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
local_2c = 0.0;
|
|
local_28 = &DAT_0000000f;
|
|
pcStack_3c = GHIDRA_CAST<char *>(0x0);
|
|
local_5c = effect;
|
|
local_54 = &effect->_sprite;
|
|
pcStack_3c = std::_Allocate(0x30);
|
|
local_2c = 4.48416e-44;
|
|
local_28 = &DAT_0000002f;
|
|
builtin_strncpy(pcStack_3c,"gfx/293.000_UltraGreedCoins.anm2",0x21);
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&effect->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>(&pcStack_3c),1);
|
|
local_14 = 0xffffffff;
|
|
if (&DAT_0000000f < local_28) {
|
|
size = local_28 + 1;
|
|
pcVar5 = pcStack_3c;
|
|
if (GHIDRA_CAST<undefined1 *>(0xfff) < size) {
|
|
pcVar5 = *GHIDRA_CAST<char **>((pcStack_3c + -4));
|
|
size = local_28 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < pcStack_3c + (-4 - GHIDRA_INT(pcVar5))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar5,GHIDRA_UINT(size));
|
|
}
|
|
pAVar2 = local_54;
|
|
animData = (effect->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
pcVar5 = "CrumbleNoDebris";
|
|
do {
|
|
bVar3 = *curAnimName;
|
|
isLess = bVar3 < (byte)*pcVar5;
|
|
if (bVar3 != *pcVar5) {
|
|
LAB_007ca463:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007ca468;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimName[1];
|
|
isLess = bVar3 < (byte)pcVar5[1];
|
|
if (bVar3 != pcVar5[1]) goto LAB_007ca463;
|
|
curAnimName = curAnimName + 2;
|
|
pcVar5 = pcVar5 + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_007ca468:
|
|
if ((uVar4 == 0) && ((animData[0x34] == 0 || ((local_54->_animState)._isPlaying != 0))))
|
|
goto LAB_007ca49c;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((local_54)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("CrumbleNoDebris"),1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&pAVar2->_animState)))->AnimationState::Rewind();
|
|
(pAVar2->_animState)._isPlaying = 1;
|
|
}
|
|
LAB_007ca49c:
|
|
local_5c->Update();
|
|
uVar4 = Random();
|
|
position = &this->_pos;
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x12,position,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
vtable = *GHIDRA_CAST<int *>(effect);
|
|
(effect->_sprite)._color._colorize[0] = 10.0;
|
|
(effect->_sprite)._color._colorize[1] = 7.5;
|
|
(effect->_sprite)._color._colorize[2] = 0.0;
|
|
(effect->_sprite)._color._colorize[3] = 1.0;
|
|
(**(code **)(vtable + 0xc))();
|
|
pAVar2 = local_54;
|
|
do {
|
|
local_54 = pAVar2;
|
|
local_5c = GHIDRA_CAST<Entity *>((this->_posOffset).y);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 1.0;
|
|
fStack_48 = 1.0;
|
|
fStack_44 = 1.0;
|
|
local_30 = 0.0;
|
|
local_2c = 0.0;
|
|
local_40 = 0.0;
|
|
pcStack_3c = GHIDRA_CAST<char *>(0x0);
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
local_28 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
uVar4 = Random();
|
|
Game::SpawnParticles
|
|
(g_game,position,0x5f,10,
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 12.0 + 8.0,GHIDRA_CAST<ColorMod *>(local_50),(float)local_5c,0);
|
|
uVar4 = Random();
|
|
piVar6 = GHIDRA_CAST<int *>((uVar4 % 6));
|
|
while (local_54 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(piVar6) + 3)), local_54 != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
Isaac::GetRandomPickupVelocity(&randomVelocity,position,0,GHIDRA_CAST<RNG *>(0x0));
|
|
uVar4 = Random();
|
|
coinVelocity.y =
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.66 + 0.33;
|
|
coinVelocity.x = randomVelocity.x * coinVelocity.y;
|
|
coinVelocity.y = randomVelocity.y * coinVelocity.y;
|
|
uVar4 = Random();
|
|
coinPos.x = coinVelocity.x + position->x;
|
|
coinPos.y = coinVelocity.y + (this->_pos).y;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,&coinPos,&coinVelocity,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
piVar6 = &local_54[-1]._bitflags;
|
|
}
|
|
count = count + -1;
|
|
pAVar2 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
} while (count != 0);
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&nearbyEnemies,position,80.0,8);
|
|
uVar4 = 0;
|
|
local_14 = 1;
|
|
if (nearbyEnemies._size != 0) {
|
|
self = player;
|
|
do {
|
|
enemy = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(nearbyEnemies._data) + uVar4 * 4));
|
|
if ((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (enemy->_type == 1)) ||
|
|
(enemy->_type - 10U < 0x3de)) && (enemy != self)) {
|
|
enemy->_bossStatusEffectCooldown = 0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(enemy))))->Entity::CopyStatusEffects();
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_50 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(enemy))))->Entity::AddMidasFreeze(GHIDRA_CAST<EntityRef *>((local_50 + 4)),0xb4,0);
|
|
if ((enemy->_flags & 0x400) != 0) {
|
|
local_30 = 1.0;
|
|
local_40 = 0.0;
|
|
pcStack_3c = GHIDRA_CAST<char *>(0x0);
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 1.0;
|
|
fStack_48 = 1.0;
|
|
fStack_44 = 1.0;
|
|
local_2c = 0.9;
|
|
local_28 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
enemy->SetColor(local_50,0xf,0xff,1,1);
|
|
}
|
|
self = player;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT(nearbyEnemies._size));
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (nearbyEnemies._data != (void *)0x0) {
|
|
uVar4 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(nearbyEnemies._data) + -4));
|
|
qVar1 = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar4;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar4));
|
|
free((void *)(GHIDRA_INT(nearbyEnemies._data) + -4));
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007ca7c0
|
|
void Entity_Player::ClampGoldenHearts(byte isSkipBreak)
|
|
{
|
|
int goldenHearts;
|
|
int goldenHearts;
|
|
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (this->_dead == 0)) &&
|
|
(goldenHearts = this->_goldenHearts, 0 < goldenHearts)) {
|
|
goldenHearts = this->_redHearts;
|
|
if (this->_maxHearts < this->_redHearts) {
|
|
goldenHearts = this->_maxHearts;
|
|
}
|
|
goldenHearts = (goldenHearts + 1) / 2 + (this->_soulHearts + 1) / 2 + this->_boneHearts;
|
|
if (goldenHearts < goldenHearts) {
|
|
if (isSkipBreak == 0) {
|
|
BreakGoldenHearts(this,goldenHearts - goldenHearts);
|
|
}
|
|
this->_goldenHearts = goldenHearts;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ca840
|
|
void Entity_Player::AddBoneHearts(int amount)
|
|
{
|
|
int iVar1;
|
|
Entity_Player *this_00;
|
|
int iVar2;
|
|
uint boneHeartMask;
|
|
int extraout_EDX;
|
|
uint heartBit;
|
|
|
|
while( true ) {
|
|
while ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) == 0x28 &&
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) != (EntityPtr)0x0))) {
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 == 2) {
|
|
return;
|
|
}
|
|
iVar1 = GetHealthType(this_00);
|
|
if (iVar1 == 3) {
|
|
if (amount < 1) {
|
|
return;
|
|
}
|
|
AddBlueFlies(this,amount * 4,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),GHIDRA_CAST<Entity *>(0x0));
|
|
return;
|
|
}
|
|
if (extraout_EDX != 0x11) break;
|
|
this = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x1d98));
|
|
if ((EntityPtr)this == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
}
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
ClampHeartsToLimit(this,0xb,amount * 2);
|
|
UpdateHeartDependentEffects(this);
|
|
return;
|
|
}
|
|
if (amount < 0) {
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 == 4) {
|
|
trigger_max_hearts_removed(this,amount * -2);
|
|
}
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) + amount;
|
|
iVar1 = 0;
|
|
if (0 < iVar2) {
|
|
iVar1 = iVar2;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) = iVar1;
|
|
iVar2 = GetEffectiveMaxHearts(this);
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344));
|
|
if (iVar2 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344))) {
|
|
iVar1 = iVar2;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) = iVar1;
|
|
update_bone_hearts(this);
|
|
UpdateHeartDependentEffects(this);
|
|
return;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c));
|
|
iVar2 = GetHeartLimit(this,0);
|
|
iVar2 = (iVar1 + (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) + amount) * 2 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340))) -
|
|
iVar2;
|
|
if (iVar2 < iVar1) {
|
|
iVar1 = iVar2;
|
|
}
|
|
if (0 < iVar1) {
|
|
AddSoulHearts(this,-iVar1,0);
|
|
}
|
|
iVar1 = GetHeartLimit(this,0);
|
|
iVar1 = iVar1 / 2 -
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) + 1 +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2 >> 1);
|
|
if (iVar1 < amount) {
|
|
amount = iVar1;
|
|
}
|
|
if (amount < 1) {
|
|
return;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88));
|
|
boneHeartMask = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1d8c));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) = iVar1 + amount;
|
|
iVar2 = 0;
|
|
do {
|
|
heartBit = iVar2 + (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x134c)) + 1 >> 1) + iVar1;
|
|
iVar2 = iVar2 + 1;
|
|
boneHeartMask = boneHeartMask | 1 << (heartBit & 0x1f);
|
|
} while (iVar2 < amount);
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1d8c)) = boneHeartMask;
|
|
UpdateHeartDependentEffects(this);
|
|
return;
|
|
}
|
|
|
|
// 007caa00
|
|
byte Entity_Player::CanPickBoneHearts()
|
|
{
|
|
int heartLimit;
|
|
Entity_Player *this_00;
|
|
int extraout_EDX;
|
|
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return this->_maxHearts < 0xa0;
|
|
}
|
|
while( true ) {
|
|
while (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x28) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x11) ||
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)) == (EntityPtr)0x0)) goto LAB_007caa4c;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)));
|
|
}
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) == (EntityPtr)0x0) break;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
LAB_007caa4c:
|
|
heartLimit = GetHealthType(this);
|
|
if (((heartLimit == 2) || (extraout_EDX == 0x11)) ||
|
|
(heartLimit = GetHeartLimit(this_00,0),
|
|
heartLimit / 2 <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2 >> 1)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007caaa0
|
|
byte Entity_Player::IsBoneHeart(int heart)
|
|
{
|
|
if ((this->_boneHearts < 1) || ((this->_boneHeartsMask & 1 << ((byte)heart & 0x1f)) == 0)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007caad0
|
|
byte Entity_Player::TryPreventDeath()
|
|
{
|
|
int iVar1;
|
|
Entity_Player *this_00;
|
|
byte unk;
|
|
byte unk2;
|
|
|
|
if (this->_boneHearts + this->_redHearts + this->_soulHearts != 0) {
|
|
return 0;
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
switch(iVar1) {
|
|
case 0:
|
|
if (this->_playerType == 0x12) {
|
|
if (this->_maxHearts < 2) {
|
|
AddMaxHearts(this_00,2,0);
|
|
}
|
|
AddHearts(this,1,1,0);
|
|
return 1;
|
|
}
|
|
if (0 < this->_maxHearts) {
|
|
unk2 = 0;
|
|
unk = 1;
|
|
iVar1 = scale_for_hard_difficulty(1);
|
|
AddHearts(this,iVar1,unk,unk2);
|
|
return 1;
|
|
}
|
|
break;
|
|
case 3:
|
|
if (this->_maxHearts < 2) {
|
|
AddMaxHearts(this_00,2,0);
|
|
}
|
|
AddHearts(this,2,1,0);
|
|
return 1;
|
|
case 4:
|
|
AddBoneHearts(this_00,1);
|
|
return 1;
|
|
}
|
|
this->_soulHearts = 1;
|
|
return 1;
|
|
}
|
|
|
|
// 007cabc0
|
|
void Entity_Player::update_bone_hearts()
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
uint uVar3;
|
|
uint bit;
|
|
uint uVar4;
|
|
byte topShift;
|
|
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
iVar1 = GetHeartLimit(this,0);
|
|
iVar2 = iVar1 / 2 - (this->_maxHearts + 1 + this->_soulHearts >> 1);
|
|
iVar1 = this->_boneHearts;
|
|
if (iVar2 < this->_boneHearts) {
|
|
iVar1 = iVar2;
|
|
}
|
|
this->_boneHearts = iVar1;
|
|
if (iVar1 < 1) {
|
|
this->_boneHearts = 0;
|
|
this->_boneHeartsMask = 0;
|
|
return;
|
|
}
|
|
iVar2 = (this->_soulHearts + 1) / 2 + iVar1;
|
|
this->_boneHeartsMask = this->_boneHeartsMask & 0xffffffffU >> (0x20U - (char)iVar2 & 0x1f);
|
|
uVar4 = 0;
|
|
uVar3 = this->_boneHeartsMask;
|
|
if (0 < iVar2) {
|
|
bit = 1;
|
|
do {
|
|
if (((bit & uVar3) != 0) && (iVar1 = iVar1 + -1, iVar1 < 0)) {
|
|
uVar3 = uVar3 & ~(1 << (uVar4 & 0x1f));
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
bit = bit << 1 | GHIDRA_UINT((GHIDRA_INT(bit) < 0));
|
|
} while (GHIDRA_INT(uVar4) < iVar2);
|
|
this->_boneHeartsMask = uVar3;
|
|
}
|
|
uVar3 = iVar2 - 1;
|
|
if (-1 < GHIDRA_INT(uVar3)) {
|
|
topShift = (byte)uVar3 & 0x1f;
|
|
uVar4 = 1 << topShift | 1U >> 0x20 - topShift;
|
|
do {
|
|
if (iVar1 < 1) {
|
|
return;
|
|
}
|
|
if ((uVar4 & this->_boneHeartsMask) == 0) {
|
|
iVar1 = iVar1 + -1;
|
|
this->_boneHeartsMask = this->_boneHeartsMask | 1 << (uVar3 & 0x1f);
|
|
}
|
|
uVar4 = uVar4 >> 1 | GHIDRA_UINT(((uVar4 & 1) != 0)) << 0x1f;
|
|
uVar3 = uVar3 - 1;
|
|
} while (-1 < GHIDRA_INT(uVar3));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007cacb0
|
|
void Entity_Player::ClampHeartsToLimit(int heartType, int amount)
|
|
{
|
|
int addedHearts;
|
|
int blackHearts;
|
|
int trimmed;
|
|
int addedHearts;
|
|
int totalHearts;
|
|
int soulHearts;
|
|
int blackHearts;
|
|
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
return;
|
|
}
|
|
addedHearts = amount * 8;
|
|
blackHearts = GetHeartLimit(this,0);
|
|
soulHearts = this->_soulHearts;
|
|
blackHearts = this->_blackHearts;
|
|
addedHearts = this->_rottenHearts;
|
|
totalHearts = this->_maxHearts + soulHearts + blackHearts + this->_goldenHearts +
|
|
this->_boneHearts + addedHearts + addedHearts;
|
|
if ((blackHearts < totalHearts) && (0 < soulHearts)) {
|
|
trimmed = totalHearts - blackHearts;
|
|
if (soulHearts < totalHearts - blackHearts) {
|
|
trimmed = soulHearts;
|
|
}
|
|
soulHearts = soulHearts - trimmed;
|
|
totalHearts = totalHearts - trimmed;
|
|
this->_soulHearts = soulHearts;
|
|
}
|
|
amount = this->_goldenHearts;
|
|
if (blackHearts < totalHearts) {
|
|
if (0 < amount) {
|
|
trimmed = totalHearts - blackHearts;
|
|
if (amount < totalHearts - blackHearts) {
|
|
trimmed = amount;
|
|
}
|
|
amount = amount - trimmed;
|
|
totalHearts = totalHearts - trimmed;
|
|
this->_goldenHearts = amount;
|
|
if (totalHearts <= blackHearts) goto LAB_007cadbc;
|
|
}
|
|
if (0 < addedHearts) {
|
|
trimmed = totalHearts - blackHearts;
|
|
if (addedHearts < totalHearts - blackHearts) {
|
|
trimmed = addedHearts;
|
|
}
|
|
totalHearts = totalHearts - trimmed;
|
|
this->_rottenHearts = addedHearts - trimmed;
|
|
}
|
|
if (blackHearts < totalHearts) {
|
|
addedHearts = this->_boneHearts;
|
|
if (0 < addedHearts) {
|
|
trimmed = totalHearts - blackHearts;
|
|
if (addedHearts < totalHearts - blackHearts) {
|
|
trimmed = addedHearts;
|
|
}
|
|
totalHearts = totalHearts - trimmed;
|
|
this->_boneHearts = addedHearts - trimmed;
|
|
if (totalHearts <= blackHearts) goto LAB_007cadbc;
|
|
}
|
|
if (0 < blackHearts) {
|
|
addedHearts = totalHearts - blackHearts;
|
|
if (blackHearts < totalHearts - blackHearts) {
|
|
addedHearts = blackHearts;
|
|
}
|
|
totalHearts = totalHearts - addedHearts;
|
|
this->_blackHearts = blackHearts - addedHearts;
|
|
}
|
|
}
|
|
}
|
|
LAB_007cadbc:
|
|
blackHearts = (addedHearts - totalHearts) + blackHearts;
|
|
if (addedHearts < blackHearts) {
|
|
blackHearts = addedHearts;
|
|
}
|
|
if (blackHearts < 0) {
|
|
blackHearts = 0;
|
|
}
|
|
switch(heartType) {
|
|
case 3:
|
|
this->_soulHearts = soulHearts + blackHearts;
|
|
return;
|
|
case 6:
|
|
this->_blackHearts = this->_blackHearts + blackHearts;
|
|
break;
|
|
case 7:
|
|
this->_goldenHearts = blackHearts + amount;
|
|
return;
|
|
case 0xb:
|
|
this->_boneHearts = this->_boneHearts + blackHearts;
|
|
return;
|
|
case 0xc:
|
|
this->_rottenHearts = this->_rottenHearts + blackHearts;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007cae60
|
|
int Entity_Player::GetHeartLimit(byte isKeeperBypass)
|
|
{
|
|
byte bVar1;
|
|
int iVar2;
|
|
int gulletHearts;
|
|
int gulletHearts;
|
|
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return 0xa0;
|
|
}
|
|
if (this->_variant == 0) {
|
|
iVar2 = this->_playerType;
|
|
if ((iVar2 == 0x10) &&
|
|
(bVar1 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x78), bVar1 != 0)) {
|
|
return 6;
|
|
}
|
|
if ((iVar2 == 0x14) &&
|
|
(bVar1 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x79), bVar1 != 0)) {
|
|
return 4;
|
|
}
|
|
LAB_007caedc:
|
|
iVar2 = this->_playerType;
|
|
if ((iVar2 != 0x10) && (iVar2 != 0x11)) {
|
|
gulletHearts = 0x18;
|
|
goto LAB_007caefe;
|
|
}
|
|
}
|
|
else if (this->_variant != 1) goto LAB_007caedc;
|
|
iVar2 = this->_playerType;
|
|
gulletHearts = 0xc;
|
|
LAB_007caefe:
|
|
if ((iVar2 == 1) && (bVar1 = HasCollectible(this,0x26b,0), bVar1 != 0)) {
|
|
gulletHearts = gulletHearts + 0xc;
|
|
}
|
|
iVar2 = this->_playerType;
|
|
if ((iVar2 == 0xe) || (iVar2 == 0x21)) {
|
|
if (isKeeperBypass != 0) {
|
|
return gulletHearts;
|
|
}
|
|
gulletHearts = GetGreedsGulletHearts(this);
|
|
iVar2 = GHIDRA_UINT((iVar2 != 0x21)) * 2 + 4 + gulletHearts * 2;
|
|
gulletHearts = 0x18;
|
|
if (iVar2 < 0x18) {
|
|
gulletHearts = iVar2;
|
|
}
|
|
if ((this->_playerType == 0xe) && (bVar1 = HasCollectible(this,0x26b,0), bVar1 != 0)) {
|
|
gulletHearts = gulletHearts + 2;
|
|
}
|
|
bVar1 = HasCollectible(this,0x1f5,0);
|
|
if (bVar1 != 0) {
|
|
iVar2 = this->_numCoins / 0x19;
|
|
gulletHearts = iVar2 + 1;
|
|
if (this->_numCoins != 99) {
|
|
gulletHearts = iVar2;
|
|
}
|
|
gulletHearts = gulletHearts + gulletHearts * 2;
|
|
}
|
|
}
|
|
else if (isKeeperBypass != 0) {
|
|
return gulletHearts;
|
|
}
|
|
gulletHearts = gulletHearts + this->_brokenHearts * -2;
|
|
iVar2 = 0;
|
|
if (0 < gulletHearts) {
|
|
iVar2 = gulletHearts;
|
|
}
|
|
return iVar2;
|
|
}
|
|
|
|
// 007cafe0
|
|
int Entity_Player::GetHealthType()
|
|
{
|
|
switch(this->_playerType) {
|
|
case 4:
|
|
case 0xc:
|
|
case 0x11:
|
|
case 0x18:
|
|
case 0x19:
|
|
case 0x23:
|
|
case 0x24:
|
|
return 1;
|
|
default:
|
|
return 0;
|
|
case 10:
|
|
case 0x1f:
|
|
case 0x28:
|
|
return 2;
|
|
case 0xe:
|
|
case 0x21:
|
|
return 3;
|
|
case 0x10:
|
|
return 4;
|
|
}
|
|
}
|
|
|
|
// 007cb060
|
|
int Entity_Player::GetEffectiveMaxHearts()
|
|
{
|
|
int healthType;
|
|
int extraout_EDX;
|
|
|
|
healthType = GetHealthType(this);
|
|
if ((healthType == 1) || (healthType == 2)) {
|
|
return *GHIDRA_CAST<int *>((extraout_EDX + 0x1340));
|
|
}
|
|
return *GHIDRA_CAST<int *>((extraout_EDX + 0x1340)) + *GHIDRA_CAST<int *>((extraout_EDX + 0x1d88)) * 2;
|
|
}
|
|
|
|
// 007cb090
|
|
void Entity_Player::apply_coop_baby_spawn_bonus()
|
|
{
|
|
ANM2 *pAVar1;
|
|
Entity_Player *mainPlayer;
|
|
EntityPtr linkedPlayer;
|
|
uint seed;
|
|
Entity *pEVar2;
|
|
Entity_Player *local_8;
|
|
EntityPtr *targetSlot;
|
|
int vtable;
|
|
|
|
local_8 = this;
|
|
switch(this->_babySkin) {
|
|
case 0x1b:
|
|
AddBlackHearts(this,2);
|
|
return;
|
|
case 0x1c:
|
|
AddMaxHearts(this,2,0);
|
|
AddHearts(this,2,0,0);
|
|
return;
|
|
case 0x1d:
|
|
mainPlayer = GetMainPlayer(this);
|
|
AddEternalHearts(mainPlayer,1);
|
|
return;
|
|
case 0x1e:
|
|
AddSoulHearts(this,2,0);
|
|
return;
|
|
case 0x2a:
|
|
mainPlayer = GetMainPlayer(this);
|
|
SetFullHearts(mainPlayer);
|
|
return;
|
|
case 0x3a:
|
|
linkedPlayer = (EntityPtr)GetMainPlayer(this);
|
|
seed = Random();
|
|
pEVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x72,GHIDRA_CAST<Vector *>((GHIDRA_INT(linkedPlayer) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),0,seed);
|
|
if (pEVar2->_child != (EntityPtr)0x0) {
|
|
local_8 = GHIDRA_CAST<Entity_Player *>(&pEVar2->_child);
|
|
std::multiset<unsigned_int>::erase(&local_8);
|
|
}
|
|
pEVar2->_child = linkedPlayer;
|
|
if (linkedPlayer != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::insert(&pEVar2->_child);
|
|
}
|
|
targetSlot = &pEVar2->_target;
|
|
if (pEVar2->_target != (EntityPtr)0x0) {
|
|
local_8 = GHIDRA_CAST<Entity_Player *>(targetSlot);
|
|
std::multiset<unsigned_int>::erase(&local_8);
|
|
}
|
|
*targetSlot = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(targetSlot);
|
|
vtable = *GHIDRA_CAST<int *>(pEVar2);
|
|
pAVar1 = &pEVar2[1]._sprite;
|
|
(pAVar1->_animDefaultName)._buf[8] = '\0';
|
|
(pAVar1->_animDefaultName)._buf[9] = '\0';
|
|
(pAVar1->_animDefaultName)._buf[10] = -0x10;
|
|
(pAVar1->_animDefaultName)._buf[0xb] = 'B';
|
|
(**(code **)(vtable + 0xc))();
|
|
return;
|
|
case 0x3b:
|
|
AddMaxHearts(this,-this->_maxHearts,0);
|
|
this->_soulHearts = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007cb580
|
|
byte Entity_Player::IsFullSpriteRendering()
|
|
{
|
|
byte isHeldItemVisible;
|
|
|
|
isHeldItemVisible = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x271);
|
|
if ((isHeldItemVisible != 0) ||
|
|
((this->_isPlayingExtraAnimation == 0 && (this->_isPlayingItemAnimation == 0)))) {
|
|
return 0;
|
|
}
|
|
isHeldItemVisible = IsHoldingItem(this);
|
|
if ((isHeldItemVisible == 0) ||
|
|
(isHeldItemVisible = IsHeldItemVisible(this), isHeldItemVisible != 0)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007cb6e0
|
|
int Entity_Player::GetTrinketMultiplier(uint type)
|
|
{
|
|
void *pvVar1;
|
|
byte isHasCollectible;
|
|
char cVar2;
|
|
EntityPtr parentPlayer;
|
|
uint uVar3;
|
|
int iVar4;
|
|
RoomDescriptor *roomDesc;
|
|
int *trinketSlot;
|
|
uint trinketId;
|
|
int multiplier;
|
|
Entity_Player *player;
|
|
int trinketSlotsLeft;
|
|
RNG roomRng;
|
|
undefined4 local_8;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
player = this;
|
|
if (this->_variant == 1) {
|
|
do {
|
|
parentPlayer = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc));
|
|
if (((parentPlayer == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parentPlayer) + 0x28)) != 1)) &&
|
|
((player = this, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) != 1 ||
|
|
(parentPlayer = (EntityPtr)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0), parentPlayer == (EntityPtr)0x0))))
|
|
break;
|
|
this = GHIDRA_CAST<Entity_Player *>(parentPlayer);
|
|
player = GHIDRA_CAST<Entity_Player *>(parentPlayer);
|
|
} while (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parentPlayer) + 0x2c)) == 1);
|
|
}
|
|
multiplier = 0;
|
|
if ((type == 0x56) && (player->_playerType == 4)) {
|
|
multiplier = 1;
|
|
}
|
|
if (player->_hasCurseMistEffect != 0) {
|
|
return multiplier;
|
|
}
|
|
if (player->_isCoopGhost != 0) {
|
|
return multiplier;
|
|
}
|
|
trinketId = type & 0x7fff;
|
|
if ((g_game->_dailyChallenge)._specialDailyId == 0x1c) {
|
|
uVar3 = 0;
|
|
do {
|
|
if (trinketId == *GHIDRA_CAST<uint *>((GHIDRA_INT(&DAT_00b6bad0) + uVar3))) {
|
|
multiplier = multiplier + 1;
|
|
break;
|
|
}
|
|
uVar3 = uVar3 + 4;
|
|
} while (uVar3 < 0x28);
|
|
}
|
|
if (((trinketId != 0x15) && (trinketId != 0x40)) && (trinketId != 0x4b)) {
|
|
iVar4 = GetTrinketMultiplier(player,0x15);
|
|
if (0 < iVar4) {
|
|
uVar3 = g_game->_frameCount & 0x80000003;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
if ((trinketId == 0x30) && ((uVar3 == 2 || ((1 < iVar4 && (uVar3 == 3)))))) {
|
|
return iVar4 + multiplier;
|
|
}
|
|
}
|
|
iVar4 = GetTrinketMultiplier(player,0x40);
|
|
if ((0 < iVar4) && (trinketId == (&DAT_00b6bad0)[GHIDRA_UINT((g_game->_frameCount / 0x5a)) % 10])) {
|
|
multiplier = multiplier + iVar4;
|
|
}
|
|
iVar4 = GetTrinketMultiplier(player,0x4b);
|
|
if (0 < iVar4) {
|
|
if ((trinketId == 0x7a) && (g_game->_challenge == 0x29)) goto LAB_007cb8d8;
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1);
|
|
if (roomDesc->SpawnSeed != 0) {
|
|
roomRng._shift1 = 2;
|
|
roomRng._shift2 = 7;
|
|
roomRng._shift3 = 0x19;
|
|
roomRng._seed = roomDesc->SpawnSeed;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&roomRng)))->RNG::RandomInt(0xbd);
|
|
if (trinketId == uVar3 + 1) {
|
|
multiplier = multiplier + iVar4;
|
|
}
|
|
}
|
|
}
|
|
if (trinketId == 0x17) {
|
|
iVar4 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::GetTrinketEffectNum(0x17);
|
|
multiplier = multiplier + iVar4;
|
|
}
|
|
else {
|
|
if (trinketId == 0x18) {
|
|
iVar4 = player->_coopBabyBuffTimers[7];
|
|
}
|
|
else {
|
|
if (trinketId != 0x13) goto LAB_007cb8d8;
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x18e0))));
|
|
}
|
|
if (0 < iVar4) {
|
|
multiplier = multiplier + 1;
|
|
}
|
|
}
|
|
}
|
|
LAB_007cb8d8:
|
|
trinketSlotsLeft = 1;
|
|
isHasCollectible = HasCollectible(player,0x8b,0);
|
|
if ((isHasCollectible != 0) ||
|
|
(isHasCollectible = HasCollectible(player,0x1ca,0), isHasCollectible != 0)) {
|
|
trinketSlotsLeft = 2;
|
|
}
|
|
trinketSlot = player->_trinketsID;
|
|
do {
|
|
iVar4 = multiplier;
|
|
if (((*trinketSlot & 0x7fffU) == trinketId) &&
|
|
(iVar4 = multiplier + 1, (*trinketSlot & 0x8000U) != 0)) {
|
|
iVar4 = multiplier + 2;
|
|
}
|
|
trinketSlot = trinketSlot + 1;
|
|
trinketSlotsLeft = trinketSlotsLeft + -1;
|
|
multiplier = iVar4;
|
|
} while (trinketSlotsLeft != 0);
|
|
trinketSlot = (player->_queuedItem)._item;
|
|
if (((((trinketSlot != GHIDRA_CAST<int *>(0x0)) && (*trinketSlot == 2)) && (trinketSlot[1] == trinketId)) &&
|
|
((*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) == 0 || (*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) == trinketId)))) &&
|
|
(multiplier = iVar4 + 1, ((player->_queuedItem)._flags & 2) != 0)) {
|
|
multiplier = iVar4 + 2;
|
|
}
|
|
pvVar1 = (player->_smeltedTrinkets)._begin;
|
|
if (trinketId < GHIDRA_UINT((GHIDRA_INT((player->_smeltedTrinkets)._end) - GHIDRA_INT(pvVar1) >> 2))) {
|
|
multiplier = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar1) + trinketId * 4)) + multiplier +
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar1) + trinketId * 4 + 2)) * 2;
|
|
}
|
|
pvVar1 = (player->_extraTrinketCounts)._begin;
|
|
if (GHIDRA_INT(trinketId) < GHIDRA_INT((player->_extraTrinketCounts)._end) - GHIDRA_INT(pvVar1)) {
|
|
cVar2 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + trinketId));
|
|
}
|
|
else {
|
|
cVar2 = '\0';
|
|
}
|
|
uVar3 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ef8))));
|
|
iVar4 = multiplier + 1;
|
|
if (cVar2 == '\0') {
|
|
iVar4 = multiplier;
|
|
}
|
|
if ((uVar3 != 0) && ((uVar3 & 0x7fff) == trinketId)) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ef0))) == '\0') {
|
|
multiplier = 0;
|
|
if (0 < iVar4 + -1) {
|
|
multiplier = iVar4 + -1;
|
|
}
|
|
iVar4 = multiplier;
|
|
if ((uVar3 & 0x8000) != 0) {
|
|
iVar4 = 0;
|
|
if (0 < multiplier + -1) {
|
|
iVar4 = multiplier + -1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = ((uVar3 & 0x8000) != 0) + 1 + iVar4;
|
|
}
|
|
}
|
|
if ((0 < iVar4) && (isHasCollectible = HasCollectible(player,0x1b7,0), isHasCollectible != 0)) {
|
|
iVar4 = iVar4 + 1;
|
|
}
|
|
return iVar4;
|
|
}
|
|
|
|
// 007cba30
|
|
void Entity_Player::UpdateCanShoot()
|
|
{
|
|
byte isCanShoot;
|
|
char isDeathmatchAllowed;
|
|
ChallengeParam *challengeParams;
|
|
void *playerConfig;
|
|
Game *game;
|
|
Game *pGVar1;
|
|
byte isChallengeCanShoot;
|
|
int variant;
|
|
|
|
game = g_game;
|
|
variant = this->_variant;
|
|
this->_canShoot = 1;
|
|
pGVar1 = g_game;
|
|
if (variant == 0) {
|
|
challengeParams = (GHIDRA_CAST<Game *>((game)))->Game::GetChallengeParams();
|
|
if (challengeParams->_canShoot != 0) goto LAB_007cba8b;
|
|
this->_canShoot = 0;
|
|
isChallengeCanShoot = 0;
|
|
}
|
|
else {
|
|
if ((variant == 1) && (this->_babySkin == 0x1a)) {
|
|
isCanShoot = 0;
|
|
this->_canShoot = 0;
|
|
goto LAB_007cbb1a;
|
|
}
|
|
LAB_007cba8b:
|
|
isCanShoot = 1;
|
|
isChallengeCanShoot = 1;
|
|
pGVar1 = game;
|
|
if (variant != 0) goto LAB_007cbb1a;
|
|
}
|
|
if (this->_playerType < 0) {
|
|
LAB_007cbaf2:
|
|
playerConfig = (void *)0x0;
|
|
LAB_007cbaf4:
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Could not load config for player type %d\n"));
|
|
isChallengeCanShoot = this->_canShoot;
|
|
game = g_game;
|
|
}
|
|
else {
|
|
playerConfig = (g_manager->_entityConfig)._players._begin;
|
|
if ((GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(playerConfig)) / 0x148 <=
|
|
this->_playerType) goto LAB_007cbaf2;
|
|
playerConfig = (void *)(this->_playerType * 0x148 + GHIDRA_INT(playerConfig));
|
|
if (playerConfig == (void *)0x0) goto LAB_007cbaf4;
|
|
}
|
|
if ((isChallengeCanShoot == 0) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(playerConfig) + 0xd0)) == '\0')) {
|
|
isCanShoot = 0;
|
|
}
|
|
else {
|
|
isCanShoot = 1;
|
|
}
|
|
this->_canShoot = isCanShoot;
|
|
pGVar1 = game;
|
|
LAB_007cbb1a:
|
|
if (1 < *GHIDRA_CAST<int *>(&pGVar1->_deathmatchManager)) {
|
|
if (isCanShoot != 0) {
|
|
isDeathmatchAllowed = (**(code **)(*GHIDRA_CAST<int *>((pGVar1->_deathmatchManager)._type) + 0x48))(this);
|
|
if (isDeathmatchAllowed != '\0') {
|
|
this->_canShoot = 1;
|
|
return;
|
|
}
|
|
}
|
|
this->_canShoot = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007cbb60
|
|
byte Entity_Player::WillPlayerRevive()
|
|
{
|
|
byte isReviving;
|
|
|
|
isReviving = TriggerDeath(this,1);
|
|
return isReviving;
|
|
}
|
|
|
|
// 007cbb70
|
|
float Entity_Player::GetGreedDonationBreakChance()
|
|
{
|
|
float jamChance;
|
|
|
|
jamChance = GetGreedDonationJamChance(this,GHIDRA_CAST<PersistentGameData *>(0x0));
|
|
return jamChance;
|
|
}
|
|
|
|
// 007cbb90
|
|
float Entity_Player::GetGreedDonationJamChance(PersistentGameData *data)
|
|
{
|
|
int iVar1;
|
|
float chance;
|
|
double dVar2;
|
|
float cappedChance;
|
|
|
|
if (0x28 < this->_playerType) {
|
|
return 99.9;
|
|
}
|
|
if (data == GHIDRA_CAST<PersistentGameData *>(0x0)) {
|
|
data = &g_manager->_persistentGameData;
|
|
}
|
|
iVar1 = this->_playerType * 0x90;
|
|
if (iVar1 == -0xc35ed0) {
|
|
iVar1 = 0;
|
|
}
|
|
else {
|
|
iVar1 = *GHIDRA_CAST<int *>((&DAT_00c35f10 + iVar1));
|
|
}
|
|
chance = (float)((double)data->_eventCounters[iVar1] +
|
|
__uint_to_double_fixup[-(data->_eventCounters[iVar1] >> 0x1f)]) * 0.023;
|
|
FUN_007df1e0(this);
|
|
chance = chance - 1.0;
|
|
if (100.0 <= chance) {
|
|
chance = 100.0;
|
|
}
|
|
dVar2 = floor((double)(chance * 0.2 + 0.5));
|
|
chance = (float)dVar2;
|
|
if (g_game->_difficulty == 3) {
|
|
cappedChance = 1.0;
|
|
if (chance <= 1.0) {
|
|
cappedChance = chance;
|
|
}
|
|
chance = cappedChance;
|
|
}
|
|
return chance;
|
|
}
|
|
|
|
// 007cbc60
|
|
void Entity_Player::hallowed_ground_add(int count)
|
|
{
|
|
int oldCountdown;
|
|
int oldCountdown;
|
|
|
|
oldCountdown = this->_hallowedGroundCountdown;
|
|
oldCountdown = count + oldCountdown;
|
|
if (4 < oldCountdown) {
|
|
oldCountdown = 4;
|
|
}
|
|
this->_hallowedGroundCountdown = oldCountdown;
|
|
if (0 < oldCountdown != 0 < oldCountdown) {
|
|
this->_cacheFlags = this->_cacheFlags | 99;
|
|
EvaluateItems(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007cbcb0
|
|
void Entity_Player::resolve_tainted_soul()
|
|
{
|
|
return;
|
|
}
|
|
|
|
// 007cbcd0
|
|
void Entity_Player::init_forgotten_twin()
|
|
{
|
|
byte isNullEffectActive;
|
|
uint seed;
|
|
undefined4 extraout_EAX;
|
|
int *extraout_EAX_00;
|
|
int *subPlayer;
|
|
code *extraout_EDX;
|
|
Vector darkEsauPos;
|
|
Vector local_48;
|
|
Color poofColor;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
int *local_8;
|
|
EntityPtr darkEsau;
|
|
Entity *forgottenBody;
|
|
|
|
local_8 = GHIDRA_CAST<int *>(0xffffffff);
|
|
puStack_c = &LAB_00b00117;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((&poofColor)[1]._colorize);
|
|
ExceptionList = &local_10;
|
|
if (-1 < this->_playerIndex) {
|
|
if ((this->_playerType == 0x10) || (this->_playerType == 0x11)) {
|
|
subPlayer = GHIDRA_CAST<int *>(this->_subPlayer);
|
|
isNullEffectActive = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x78);
|
|
if (isNullEffectActive == 0) {
|
|
if (subPlayer == GHIDRA_CAST<int *>(0x0)) {
|
|
local_48.y = (float)operator_new(0x2f00);
|
|
if (GHIDRA_CAST<Entity_Player *>(local_48.y) == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
subPlayer = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
local_8 = subPlayer;
|
|
constructor(GHIDRA_CAST<Entity_Player *>(local_48.y));
|
|
subPlayer = extraout_EAX_00;
|
|
}
|
|
local_8 = GHIDRA_CAST<int *>(0xffffffff);
|
|
this->_subPlayer = GHIDRA_INT(subPlayer);
|
|
(**(code **)(*subPlayer + 4))
|
|
(this->_type,this->_variant,(this->_playerType == 0x10) + '\x10',this->_initSeed
|
|
);
|
|
}
|
|
}
|
|
else if (subPlayer != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*subPlayer + 0x44))();
|
|
if (GHIDRA_CAST<undefined4 *>(this->_subPlayer) != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(this->_subPlayer))(1);
|
|
}
|
|
this->_subPlayer = 0;
|
|
}
|
|
}
|
|
else {
|
|
subPlayer = GHIDRA_CAST<int *>(this->_subPlayer);
|
|
if ((subPlayer != GHIDRA_CAST<int *>(0x0)) && ((char)subPlayer[0x5c] == '\0')) {
|
|
(**(code **)(*subPlayer + 0x44))(local_14);
|
|
if (GHIDRA_CAST<undefined4 *>(this->_subPlayer) != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(this->_subPlayer))(1);
|
|
}
|
|
this->_subPlayer = 0;
|
|
}
|
|
if (this->_forgottenBody != (void *)0x0) {
|
|
seed = Random();
|
|
forgottenBody = this->_forgottenBody;
|
|
local_48.x = (forgottenBody->_pos).x;
|
|
local_48.y = (forgottenBody->_pos).y;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&local_48,&g_vectorZero,forgottenBody,0,seed);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_forgottenBody) + 0x28))();
|
|
}
|
|
if (((this->_darkEsau != (EntityPtr)0x0) && (this->_playerType != 0x25)) &&
|
|
(this->_playerType != 0x27)) {
|
|
seed = Random();
|
|
darkEsau = this->_darkEsau;
|
|
darkEsauPos.x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(darkEsau) + 0x33c)))->x;
|
|
darkEsauPos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(darkEsau) + 0x340));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&darkEsauPos,&g_vectorZero,GHIDRA_CAST<Entity *>(darkEsau),0,seed);
|
|
(GHIDRA_CAST<Color *>((&poofColor)))->Color::Color();
|
|
(*extraout_EDX)(extraout_EAX,0xffffffff,0xff,0,1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_darkEsau) + 0x28))();
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007cbef0
|
|
Entity * Entity_Player::spawn_forgotten_body()
|
|
{
|
|
ColorMod *pCVar1;
|
|
int iVar2;
|
|
float fVar3;
|
|
float fVar4;
|
|
float fVar5;
|
|
ANM2 *pAVar6;
|
|
undefined4 uVar7;
|
|
byte bVar8;
|
|
RoomDescriptor *bodyRoom;
|
|
Entity_Familiar *body;
|
|
Entity *pEVar9;
|
|
uint bodyDimension;
|
|
uint uVar10;
|
|
EntityPtr *pEStack_14;
|
|
Vector spawnPos;
|
|
void **bodySlot;
|
|
Game *game;
|
|
bool isBirthrightBody;
|
|
int *roomConfig;
|
|
|
|
pEVar9 = this->_forgottenBody;
|
|
bodySlot = &this->_forgottenBody;
|
|
if (pEVar9 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
if (this->_replacedPlayer != (void *)0x0) {
|
|
return pEVar9;
|
|
}
|
|
pEVar9->Remove();
|
|
}
|
|
bVar8 = HasCollectible(this,0x26b,0);
|
|
if ((bVar8 == 0) || (this->_playerType != 0x11)) {
|
|
isBirthrightBody = false;
|
|
}
|
|
else {
|
|
isBirthrightBody = true;
|
|
}
|
|
uVar10 = this->_forgottenBodyRoomIdx;
|
|
bodyDimension = 0;
|
|
if (-1 < GHIDRA_INT(uVar10)) {
|
|
bodyDimension = uVar10 / 0xa9;
|
|
uVar10 = uVar10 % 0xa9;
|
|
}
|
|
if (((((isBirthrightBody) && (uVar10 != 0xfffe7961)) &&
|
|
((roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10)), roomConfig == GHIDRA_CAST<int *>(0x0)
|
|
|| ((roomConfig[2] != 0x10 || (*roomConfig != 0x23)))))) &&
|
|
(bodyDimension == g_game->_currentDimensionIdx)) &&
|
|
(bodyRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(uVar10,bodyDimension),
|
|
bodyRoom != *GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(g_game->_room) + 4)))) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
spawnPos.x = (this->_pos).x;
|
|
spawnPos.y = (this->_pos).y;
|
|
if ((isBirthrightBody) && (this->_forgottenBodyRoomIdx != -99999)) {
|
|
spawnPos.x = (this->_forgottenBodyPos).x;
|
|
spawnPos.y = (this->_forgottenBodyPos).y;
|
|
}
|
|
uVar10 = Random();
|
|
body = (Entity_Familiar *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,900,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar10,0);
|
|
(body->_pos).x = spawnPos.x;
|
|
(body->_pos).y = spawnPos.y;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(body))))->Entity::SetSize(this->_size,this->_sizeMulti,-1);
|
|
pCVar1 = &(body->_sprite)._color;
|
|
(body->_sprite)._scale.x = (this->_playerSpriteScale).x;
|
|
(body->_sprite)._scale.y = (this->_playerSpriteScale).y;
|
|
if (pCVar1 != GHIDRA_CAST<ColorMod *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0))))) {
|
|
fVar3 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e4))));
|
|
fVar4 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e8))));
|
|
fVar5 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16ec))));
|
|
pCVar1->_tint[0] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16e0))));
|
|
(body->_sprite)._color._tint[1] = fVar3;
|
|
(body->_sprite)._color._tint[2] = fVar4;
|
|
(body->_sprite)._color._tint[3] = fVar5;
|
|
fVar3 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16f4))));
|
|
fVar4 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16f8))));
|
|
fVar5 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16fc))));
|
|
(body->_sprite)._color._colorize[0] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x16f0))));
|
|
(body->_sprite)._color._colorize[1] = fVar3;
|
|
(body->_sprite)._color._colorize[2] = fVar4;
|
|
(body->_sprite)._color._colorize[3] = fVar5;
|
|
uVar7 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1704))));
|
|
(body->_sprite)._color._offset[0] = (float)*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1700))));
|
|
(body->_sprite)._color._offset[1] = (float)uVar7;
|
|
(body->_sprite)._color._offset[2] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1708))));
|
|
}
|
|
*GHIDRA_CAST<uint *>(&body->_flags) = GHIDRA_UINT(body->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&body->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&body->_flags) + 4));
|
|
if (*bodySlot != (void *)0x0) {
|
|
pEStack_14 = GHIDRA_CAST<EntityPtr *>(bodySlot);
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
*bodySlot = body;
|
|
std::multiset<unsigned_int>::insert(bodySlot);
|
|
game = g_game;
|
|
iVar2 = g_game->_currentRoomIdx;
|
|
if (iVar2 != -0x10) {
|
|
this->_forgottenBodyRoomIdx = iVar2;
|
|
if (-1 < iVar2) {
|
|
this->_forgottenBodyRoomIdx = game->_currentDimensionIdx * 0xa9 + iVar2;
|
|
}
|
|
(this->_forgottenBodyPos).x = spawnPos.x;
|
|
(this->_forgottenBodyPos).y = spawnPos.y;
|
|
}
|
|
if (!isBirthrightBody) {
|
|
uVar10 = Random();
|
|
pEVar9 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x72,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar10,0);
|
|
if (pEVar9->_child != (EntityPtr)0x0) {
|
|
pEStack_14 = &pEVar9->_child;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
pEVar9->_child = (EntityPtr)body;
|
|
std::multiset<unsigned_int>::insert(&pEVar9->_child);
|
|
if (pEVar9->_target != (EntityPtr)0x0) {
|
|
pEStack_14 = &pEVar9->_target;
|
|
std::multiset<unsigned_int>::erase(&pEStack_14);
|
|
}
|
|
pEVar9->_target = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(&pEVar9->_target);
|
|
iVar2 = *GHIDRA_CAST<int *>(pEVar9);
|
|
pAVar6 = &pEVar9[1]._sprite;
|
|
(pAVar6->_animDefaultName)._buf[8] = '\0';
|
|
(pAVar6->_animDefaultName)._buf[9] = '\0';
|
|
(pAVar6->_animDefaultName)._buf[10] = -0x10;
|
|
(pAVar6->_animDefaultName)._buf[0xb] = 'B';
|
|
(**(code **)(iVar2 + 0xc))();
|
|
}
|
|
return GHIDRA_CAST<Entity *>(body);
|
|
}
|
|
|
|
// 007cc200
|
|
byte Entity_Player::SwapForgottenForm(byte isForce, byte isNoEffects)
|
|
{
|
|
void *pvVar1;
|
|
byte bVar2;
|
|
uint swapDwordTmp;
|
|
RoomDescriptor *bodyRoom;
|
|
ItemConfig_Item **trailCountPtr;
|
|
Entity *spawnedEffect;
|
|
ItemConfig_Item *pIVar4;
|
|
int *piVar5;
|
|
byte *pbVar6;
|
|
undefined4 *effect;
|
|
byte *animNameChar;
|
|
Entity_Player *effectsOwner;
|
|
ItemConfig_Item **minTrailCountPtr;
|
|
char *expectedChar;
|
|
undefined1 *swapByte;
|
|
void **ppvVar8;
|
|
int iVar9;
|
|
uint uVar10;
|
|
TemporaryEffects *tempEffects;
|
|
bool isLess;
|
|
float fVar11;
|
|
double dVar12;
|
|
Color spriteColor;
|
|
ItemConfig_Item *trailCount;
|
|
int trailIndex;
|
|
float trailX;
|
|
float angleSin;
|
|
undefined1 local_a0 [12];
|
|
float local_94;
|
|
Vector poofVelocity;
|
|
float local_88;
|
|
ItemConfig_Item *local_84;
|
|
int crownEffectKey [2];
|
|
float local_78;
|
|
ItemConfig_Item *local_74;
|
|
Entity_Player *local_70;
|
|
ItemConfig_Item *effectEntryItem;
|
|
undefined4 effectEntryCount;
|
|
Vector VStack_64;
|
|
ItemConfig_Item *local_5c;
|
|
byte local_55;
|
|
ItemConfig_Item *local_54;
|
|
ColorMod colorMod;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *savedExceptionList;
|
|
undefined1 *puStack_18;
|
|
float ehState;
|
|
undefined8 crownAnim;
|
|
int *effectsEnd;
|
|
Entity_Player *effectsOwner;
|
|
Game *game;
|
|
int playerType;
|
|
float posOffsetY;
|
|
undefined1 swapByteTmp;
|
|
undefined4 swapDwordTmp;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((&colorMod)[1]._offset);
|
|
ehState = -NAN;
|
|
puStack_18 = &LAB_00b00140;
|
|
savedExceptionList = ExceptionList;
|
|
swapDwordTmp = __security_cookie ^ GHIDRA_UINT(((&colorMod)[1]._colorize + 1));
|
|
iVar9 = this->_subPlayer;
|
|
if (iVar9 == 0) {
|
|
return 0;
|
|
}
|
|
playerType = this->_playerType;
|
|
if ((playerType == 0x10) || (playerType == 0x11)) {
|
|
if (isForce == 0) {
|
|
if (0 < this->_forgottenSwapFormCooldown) goto LAB_007cc270;
|
|
if (((*GHIDRA_CAST<int *>((iVar9 + 0x1344)) < 1) && (*GHIDRA_CAST<int *>((iVar9 + 0x134c)) < 1)) &&
|
|
(*GHIDRA_CAST<int *>((iVar9 + 0x1d88)) < 1)) {
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&g_game->_roomTransition) != 0) {
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&g_game->_stageTransition) != 0) {
|
|
return 0;
|
|
}
|
|
if (0 < g_game->_deathCertificateExitTimer) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LAB_007cc270:
|
|
if (((playerType != 0x25) && (playerType != 0x27)) || (isForce == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
ExceptionList = &savedExceptionList;
|
|
if (((playerType == 0x10) || (playerType == 0x11)) && (isNoEffects == 0)) {
|
|
this->_forgottenSwapFormCooldown = 0xf;
|
|
}
|
|
local_70 = this;
|
|
local_24 = swapDwordTmp;
|
|
RemoveSkinCostume(this);
|
|
bVar2 = HasCollectible(this,0x7a,0);
|
|
if ((bVar2 == 0) || (local_55 = 1, 1 < this->_redHearts)) {
|
|
local_55 = 0;
|
|
}
|
|
ppvVar8 = this->_weapons;
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(&DAT_00000004);
|
|
do {
|
|
ppvVar8 = ppvVar8 + 1;
|
|
if (*ppvVar8 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*ppvVar8) + 0x14))(swapDwordTmp);
|
|
}
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&local_5c[-1]._initCharge) + 3));
|
|
} while (local_5c != GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
iVar9 = this->_redHearts;
|
|
this->_redHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1344));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1344)) = iVar9;
|
|
iVar9 = this->_maxHearts;
|
|
this->_maxHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1340));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1340)) = iVar9;
|
|
iVar9 = this->_soulHearts;
|
|
this->_soulHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x134c));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x134c)) = iVar9;
|
|
iVar9 = this->_blackHearts;
|
|
this->_blackHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1350));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1350)) = iVar9;
|
|
iVar9 = this->_eternalHearts;
|
|
this->_eternalHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1348));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1348)) = iVar9;
|
|
iVar9 = this->_boneHearts;
|
|
this->_boneHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1d88));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1d88)) = iVar9;
|
|
iVar9 = this->_boneHeartsMask;
|
|
this->_boneHeartsMask = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1d8c));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1d8c)) = iVar9;
|
|
iVar9 = this->_brokenHearts;
|
|
this->_brokenHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1da0));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1da0)) = iVar9;
|
|
iVar9 = this->_rottenHearts;
|
|
this->_rottenHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1da4));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1da4)) = iVar9;
|
|
iVar9 = this->_reverseEmpressMaxHearts;
|
|
this->_reverseEmpressMaxHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x1ecc));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1ecc)) = iVar9;
|
|
iVar9 = this->_goldenHearts;
|
|
this->_goldenHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x194c));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x194c)) = iVar9;
|
|
iVar9 = this->_playerType;
|
|
this->_playerType = *GHIDRA_CAST<int *>((this->_subPlayer + 0x13c0));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x13c0)) = iVar9;
|
|
bVar2 = this->_tearDisplacement;
|
|
this->_tearDisplacement = *GHIDRA_CAST<byte *>((this->_subPlayer + 0x1578));
|
|
*GHIDRA_CAST<byte *>((this->_subPlayer + 0x1578)) = bVar2;
|
|
iVar9 = this->_strengthMaxHearts;
|
|
this->_strengthMaxHearts = *GHIDRA_CAST<int *>((this->_subPlayer + 0x18a0));
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x18a0)) = iVar9;
|
|
swapDwordTmp = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1950))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1950)))) = *GHIDRA_CAST<undefined4 *>((this->_subPlayer + 0x1950));
|
|
*GHIDRA_CAST<undefined4 *>((this->_subPlayer + 0x1950)) = swapDwordTmp;
|
|
swapByte = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f0)));
|
|
effectsOwner = GHIDRA_CAST<Entity_Player *>(this->_subPlayer);
|
|
if ((this != effectsOwner) && (swapByte != &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1401))))) {
|
|
do {
|
|
swapByteTmp = *swapByte;
|
|
*swapByte = swapByte[GHIDRA_INT(effectsOwner) - GHIDRA_INT(this)];
|
|
swapByte[GHIDRA_INT(effectsOwner) - GHIDRA_INT(this)] = swapByteTmp;
|
|
swapByte = swapByte + 1;
|
|
} while (swapByte != &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1401))));
|
|
effectsOwner = GHIDRA_CAST<Entity_Player *>(local_70->_subPlayer);
|
|
this = local_70;
|
|
}
|
|
ppvVar8 = this->_weapons + 1;
|
|
if ((ppvVar8 != effectsOwner->_weapons + 1) &&
|
|
(local_54 = GHIDRA_CAST<ItemConfig_Item *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x13f0)))), GHIDRA_CAST<ItemConfig_Item *>(ppvVar8) != local_54)) {
|
|
iVar9 = GHIDRA_INT((effectsOwner->_weapons + 1)) - GHIDRA_INT(ppvVar8);
|
|
do {
|
|
pvVar1 = *ppvVar8;
|
|
*ppvVar8 = *(void **)(GHIDRA_CAST<char *>(ppvVar8) + iVar9);
|
|
*(void **)(GHIDRA_CAST<char *>(ppvVar8) + iVar9) = pvVar1;
|
|
ppvVar8 = ppvVar8 + 1;
|
|
} while (GHIDRA_CAST<ItemConfig_Item *>(ppvVar8) != local_54);
|
|
}
|
|
if (this->_weapons[1] != (void *)0x0) {
|
|
*GHIDRA_CAST<Entity_Player **>((GHIDRA_INT(this->_weapons[1]) + 4)) = this;
|
|
}
|
|
if (this->_weapons[2] != (void *)0x0) {
|
|
*GHIDRA_CAST<Entity_Player **>((GHIDRA_INT(this->_weapons[2]) + 4)) = this;
|
|
}
|
|
if (this->_weapons[3] != (void *)0x0) {
|
|
*GHIDRA_CAST<Entity_Player **>((GHIDRA_INT(this->_weapons[3]) + 4)) = this;
|
|
}
|
|
if (this->_weapons[4] != (void *)0x0) {
|
|
*GHIDRA_CAST<Entity_Player **>((GHIDRA_INT(this->_weapons[4]) + 4)) = this;
|
|
}
|
|
if (this->_playerType == 0x11) {
|
|
if ((isNoEffects == 0) || (this->_forgottenBody == (void *)0x0)) {
|
|
spawn_forgotten_body(this);
|
|
}
|
|
this->ResetColor();
|
|
if (isNoEffects == 0) {
|
|
spriteColor._offset[2] = (this->_sprite)._color._offset[2];
|
|
colorMod._colorize[0] = 0.0;
|
|
colorMod._colorize[1] = 0.0;
|
|
colorMod._colorize[2] = 0.0;
|
|
colorMod._colorize[3] = 0.0;
|
|
colorMod._tint[0] = 1.0;
|
|
colorMod._tint[1] = 1.0;
|
|
colorMod._tint[2] = 1.0;
|
|
colorMod._tint[3] = 1.0;
|
|
spriteColor._tint[0] = (this->_sprite)._color._tint[0];
|
|
spriteColor._tint[1] = (this->_sprite)._color._tint[1];
|
|
spriteColor._tint[2] = (this->_sprite)._color._tint[2];
|
|
spriteColor._tint[3] = (this->_sprite)._color._tint[3];
|
|
colorMod._offset[0] = 1.0;
|
|
colorMod._offset[1] = 1.0;
|
|
colorMod._offset[2] = 1.0;
|
|
spriteColor._colorize[0] = (this->_sprite)._color._colorize[0];
|
|
spriteColor._colorize[1] = (this->_sprite)._color._colorize[1];
|
|
spriteColor._colorize[2] = (this->_sprite)._color._colorize[2];
|
|
spriteColor._colorize[3] = (this->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(spriteColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset);
|
|
(GHIDRA_CAST<Color *>((&spriteColor)))->Color::__mul(&colorMod);
|
|
colorMod._tint[0] = spriteColor._tint[0];
|
|
colorMod._tint[1] = spriteColor._tint[1];
|
|
colorMod._tint[2] = spriteColor._tint[2];
|
|
colorMod._tint[3] = spriteColor._tint[3];
|
|
colorMod._offset[2] = spriteColor._offset[2];
|
|
colorMod._colorize[0] = spriteColor._colorize[0];
|
|
colorMod._colorize[1] = spriteColor._colorize[1];
|
|
colorMod._colorize[2] = spriteColor._colorize[2];
|
|
colorMod._colorize[3] = spriteColor._colorize[3];
|
|
colorMod._offset[0] = spriteColor._offset[0];
|
|
colorMod._offset[1] = spriteColor._offset[1];
|
|
this->SetColor(&colorMod,8,0xff,1);
|
|
}
|
|
}
|
|
else if (this->_playerType == 0x10) {
|
|
swapDwordTmp = this->_forgottenBodyRoomIdx;
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
uVar10 = swapDwordTmp;
|
|
if (-1 < GHIDRA_INT(swapDwordTmp)) {
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>((swapDwordTmp / 0xa9));
|
|
uVar10 = swapDwordTmp % 0xa9;
|
|
swapDwordTmp = this->_forgottenBodyRoomIdx;
|
|
}
|
|
if (((this->_forgottenBody == (void *)0x0) && (swapDwordTmp != 0xfffe7961)) &&
|
|
(bodyRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(uVar10,GHIDRA_INT(local_5c)),
|
|
bodyRoom != *GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(g_game->_room) + 4)))) {
|
|
bVar2 = HasCollectible(this,0x26b,0);
|
|
game = g_game;
|
|
if (bVar2 == 0) goto LAB_007cc74d;
|
|
g_game->_leaveDoor = -1;
|
|
Game::StartRoomTransition(game,uVar10,-1,0x11,this,GHIDRA_INT(local_5c));
|
|
this->_forgottenBodyRoomIdx = -99999;
|
|
}
|
|
else {
|
|
LAB_007cc74d:
|
|
pvVar1 = this->_forgottenBody;
|
|
if (pvVar1 == (void *)0x0) {
|
|
local_78 = g_vectorZero.x;
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(g_vectorZero.y);
|
|
}
|
|
else {
|
|
local_78 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x33c)) - (this->_pos).x;
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x340)) - (this->_pos).y));
|
|
}
|
|
poofVelocity.x = local_78 * 0.1;
|
|
poofVelocity.y = (float)local_74 * 0.1;
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(poofVelocity.y);
|
|
local_54 = GHIDRA_CAST<ItemConfig_Item *>(poofVelocity.x);
|
|
if (isNoEffects == 0) {
|
|
if (pvVar1 != (void *)0x0) {
|
|
fVar11 = sqrtf(poofVelocity.y * poofVelocity.y + poofVelocity.x * poofVelocity.x);
|
|
if ((4.0 < fVar11) && (0.0 < fVar11)) {
|
|
poofVelocity.y = (4.0 / fVar11) * (float)local_5c;
|
|
poofVelocity.x = (4.0 / fVar11) * (float)local_54;
|
|
}
|
|
local_84 = GHIDRA_CAST<ItemConfig_Item *>(0xc);
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(&DAT_00000004);
|
|
fVar11 = sqrtf(local_78 * local_78 + (float)local_74 * (float)local_74);
|
|
local_54 = GHIDRA_CAST<ItemConfig_Item *>((fVar11 / 20.0));
|
|
dVar12 = floor((double)(float)local_54);
|
|
local_54 = GHIDRA_CAST<ItemConfig_Item *>(GHIDRA_INT(dVar12));
|
|
minTrailCountPtr = &local_5c;
|
|
if (3 < GHIDRA_INT(dVar12)) {
|
|
minTrailCountPtr = &local_54;
|
|
}
|
|
trailCountPtr = &local_84;
|
|
if (GHIDRA_INT(*minTrailCountPtr) < 0xd) {
|
|
trailCountPtr = minTrailCountPtr;
|
|
}
|
|
trailCount = *trailCountPtr;
|
|
if (0 < GHIDRA_INT(trailCount)) {
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>((float)GHIDRA_INT((GHIDRA_INT(&trailCount->type) + 1)));
|
|
trailIndex = 0;
|
|
do {
|
|
trailIndex = trailIndex + 1;
|
|
trailX = (this->_pos).x;
|
|
local_88 = (this->_pos).y;
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(((float)trailIndex / (float)local_74));
|
|
trailX = trailX + (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_forgottenBody) + 0x33c)) - trailX) *
|
|
(float)local_5c;
|
|
local_88 = local_88 +
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_forgottenBody) + 0x340)) - local_88) *
|
|
(float)local_5c;
|
|
swapDwordTmp = Random();
|
|
fVar11 = (float)((double)GHIDRA_INT(swapDwordTmp) + __uint_to_double_fixup[-(GHIDRA_INT(swapDwordTmp) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_84 = GHIDRA_CAST<ItemConfig_Item *>((fVar11 + fVar11));
|
|
angleSin = sin((float)local_84);
|
|
swapDwordTmp = Random();
|
|
local_54 = (ItemConfig_Item *)
|
|
((float)((double)GHIDRA_INT(swapDwordTmp) + __uint_to_double_fixup[-(GHIDRA_INT(swapDwordTmp) >> 0x1f)]
|
|
) * 2.3283064e-10);
|
|
fVar11 = cos((float)local_84);
|
|
VStack_64.x = fVar11 * (float)local_54 * 15.0 + trailX;
|
|
VStack_64.y = local_88 + (float)local_54 * angleSin * 15.0;
|
|
swapDwordTmp = Random();
|
|
uVar10 = Random();
|
|
local_94 = (float)((double)GHIDRA_INT(uVar10) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]) * 2.3283064e-10 *
|
|
0.5 + 0.5;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x8))) = poofVelocity.x * local_94;
|
|
local_94 = poofVelocity.y * local_94;
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x6f,&VStack_64,GHIDRA_CAST<Vector *>((local_a0 + 8)),GHIDRA_CAST<Entity *>(0x0),
|
|
0,swapDwordTmp,0);
|
|
colorMod._colorize[0] = 0.0;
|
|
colorMod._colorize[1] = 0.0;
|
|
colorMod._colorize[2] = 0.0;
|
|
colorMod._colorize[3] = 0.0;
|
|
colorMod._tint[0] = 1.0;
|
|
colorMod._tint[1] = 1.0;
|
|
colorMod._tint[2] = 1.0;
|
|
colorMod._tint[3] = 1.0;
|
|
colorMod._offset[0] = 1.0;
|
|
colorMod._offset[1] = 1.0;
|
|
colorMod._offset[2] = 1.0;
|
|
spawnedEffect->SetColor(&colorMod,0xffffffff,0xff,0);
|
|
local_88 = (float)local_5c * g_vectorOne.x;
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(((float)local_5c * g_vectorOne.y));
|
|
swapDwordTmp = Random();
|
|
fVar11 = (float)((double)GHIDRA_INT(swapDwordTmp) + __uint_to_double_fixup[-(GHIDRA_INT(swapDwordTmp) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.3 + 0.3;
|
|
(spawnedEffect->_sprite)._scale.y = fVar11 * (float)local_5c;
|
|
(spawnedEffect->_sprite)._scale.x = fVar11 * local_88;
|
|
fVar11 = (this->_sprite)._scale.y;
|
|
posOffsetY = (this->_posOffset).y;
|
|
(spawnedEffect->_posOffset).x = (this->_posOffset).x + 0.0;
|
|
(spawnedEffect->_posOffset).y = fVar11 * -16.0 + posOffsetY;
|
|
} while (trailIndex < GHIDRA_INT(trailCount));
|
|
}
|
|
}
|
|
swapDwordTmp = Random();
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x10,&this->_pos,&poofVelocity,GHIDRA_CAST<Entity *>(0x0),10,swapDwordTmp,0);
|
|
(spawnedEffect->_posOffset).x = (this->_posOffset).x;
|
|
(spawnedEffect->_posOffset).y = (this->_posOffset).y;
|
|
(spawnedEffect->_sprite)._scale.x = (this->_sprite)._scale.x;
|
|
(spawnedEffect->_sprite)._scale.y = (this->_sprite)._scale.y;
|
|
pvVar1 = this->_forgottenBody;
|
|
if ((pvVar1 != (void *)0x0) && (10 < g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x328)))) {
|
|
VStack_64.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x33c));
|
|
VStack_64.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x340));
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_a0),
|
|
&VStack_64,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x370)) + 25.0,2);
|
|
fVar11 = 0.0;
|
|
if (local_94 != 0.0) {
|
|
do {
|
|
iVar9 = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x4))) + GHIDRA_INT(fVar11) * 4));
|
|
if ((*GHIDRA_CAST<char *>((iVar9 + 0x173)) == '\0') && (-50.0 < *GHIDRA_CAST<float *>((iVar9 + 0x410)))) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x438)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x43c)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((iVar9 + 0x173)) = 1;
|
|
}
|
|
fVar11 = (float)(GHIDRA_INT(fVar11) + 1);
|
|
} while (GHIDRA_UINT(fVar11) < GHIDRA_UINT(local_94));
|
|
}
|
|
if (local_a0[0] == '\0') {
|
|
ehState = 0.0;
|
|
tracked_alloc(1,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_a0)) + 0x4))),0);
|
|
ehState = -NAN;
|
|
}
|
|
}
|
|
}
|
|
pvVar1 = this->_forgottenBody;
|
|
if (pvVar1 != (void *)0x0) {
|
|
VStack_64.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x33c));
|
|
VStack_64.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x340));
|
|
Teleport(this,&VStack_64,0,0);
|
|
piVar5 = this->_forgottenBody;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
iVar9 = *piVar5;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
(**(code **)(iVar9 + 0x28))();
|
|
}
|
|
}
|
|
this->ResetColor();
|
|
if (isNoEffects == 0) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(spriteColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset);
|
|
colorMod._tint[0] = (this->_sprite)._color._tint[0] * 1.0;
|
|
colorMod._tint[1] = (this->_sprite)._color._tint[1] * 1.0;
|
|
colorMod._tint[2] = (this->_sprite)._color._tint[2] * 1.0;
|
|
colorMod._tint[3] = (this->_sprite)._color._tint[3] * 1.0;
|
|
spriteColor._offset[2] = (this->_sprite)._color._offset[2] + 1.0;
|
|
colorMod._colorize[0] = (this->_sprite)._color._colorize[0];
|
|
colorMod._colorize[1] = (this->_sprite)._color._colorize[1];
|
|
colorMod._colorize[2] = (this->_sprite)._color._colorize[2];
|
|
colorMod._colorize[3] = (this->_sprite)._color._colorize[3];
|
|
colorMod._offset[1] = spriteColor._offset[1] + 1.0;
|
|
colorMod._offset[0] = spriteColor._offset[0] + 1.0;
|
|
colorMod._offset[2] = spriteColor._offset[2];
|
|
this->SetColor(&colorMod,8,0xff,1);
|
|
}
|
|
this->_forgottenBodyRoomIdx = -99999;
|
|
}
|
|
tempEffects = &this->_temporaryeffects;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
piVar5 != (this->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && (*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x7a)) {
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(piVar5[1]);
|
|
pIVar4 = local_74;
|
|
if (0 < GHIDRA_INT(local_74)) {
|
|
local_5c = local_74;
|
|
do {
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x1e8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) &
|
|
0xfffffffcU))) &&
|
|
(pIVar4 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x1e8)),
|
|
pIVar4 != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
VStack_64.x = (float)pIVar4->maxCooldown;
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = pIVar4;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveEffect(&effectEntryItem,1);
|
|
}
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&local_5c[-1]._initCharge) + 3));
|
|
} while (local_5c != GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
pIVar4 = local_74;
|
|
}
|
|
goto LAB_007ccdf8;
|
|
}
|
|
}
|
|
}
|
|
pIVar4 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
LAB_007ccdf8:
|
|
local_54 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&pIVar4[-1]._initCharge) + 3));
|
|
if (local_55 == 0) {
|
|
local_54 = pIVar4;
|
|
}
|
|
bVar2 = HasCollectible(this,0x7a,0);
|
|
if (bVar2 != 0) {
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
effectsEnd = (this->_temporaryeffects)._effects._end;
|
|
if (piVar5 != effectsEnd) {
|
|
do {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && (*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x7a))
|
|
goto LAB_007ccfa0;
|
|
piVar5 = piVar5 + 4;
|
|
} while (piVar5 != effectsEnd);
|
|
piVar5 = (this->_temporaryeffects)._effects._begin;
|
|
do {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && (*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x7a))
|
|
goto LAB_007ccf4a;
|
|
piVar5 = piVar5 + 4;
|
|
} while (piVar5 != (this->_temporaryeffects)._effects._end);
|
|
}
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)) < 0x1e9)
|
|
{
|
|
local_5c = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
local_5c = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x1e8));
|
|
}
|
|
if ((local_5c->addCostumeOnPickup == 0) || (bVar2 = HasCollectible(this,0x7a,0), bVar2 == 0)) {
|
|
RemoveCostume(this,local_5c);
|
|
}
|
|
LAB_007ccf4a:
|
|
if (((this->_redHearts < 2) &&
|
|
(pvVar1 = (g_manager->_itemConfig)._collectibles._begin,
|
|
0x1e8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)))
|
|
) && (pIVar4 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x1e8)), pIVar4 != GHIDRA_CAST<ItemConfig_Item *>(0x0))
|
|
) {
|
|
VStack_64.x = (float)pIVar4->maxCooldown;
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = pIVar4;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::AddEffect(&effectEntryItem,1,1);
|
|
}
|
|
}
|
|
LAB_007ccfa0:
|
|
effectsOwner = this;
|
|
if (0 < GHIDRA_INT(local_54)) {
|
|
pIVar4 = local_54;
|
|
do {
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x1e8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU
|
|
))) {
|
|
local_5c = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x1e8));
|
|
if (local_5c != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(local_5c->maxCooldown);
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = local_5c;
|
|
VStack_64.x = (float)local_74;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
effect = (this->_temporaryeffects)._effects._begin;
|
|
if (effect != (this->_temporaryeffects)._effects._end) {
|
|
do {
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(*effect) == local_5c) {
|
|
if (effect != (this->_temporaryeffects)._effects._end) {
|
|
effect[1] = effect[1] + 1;
|
|
effect[2] = (local_74->name)._buf + effect[2] + -8;
|
|
goto LAB_007cd080;
|
|
}
|
|
break;
|
|
}
|
|
effect = effect + 4;
|
|
} while (effect != (this->_temporaryeffects)._effects._end);
|
|
}
|
|
effect = (this->_temporaryeffects)._effects._end;
|
|
if (effect == (this->_temporaryeffects)._effects._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(effect,&effectEntryItem);
|
|
local_5c = effectEntryItem;
|
|
}
|
|
else {
|
|
*effect = local_5c;
|
|
effect[1] = 0;
|
|
effect[2] = local_74;
|
|
effect[3] = 0;
|
|
ppvVar8 = &(this->_temporaryeffects)._effects._end;
|
|
*ppvVar8 = (void *)(GHIDRA_INT(*ppvVar8) + 0x10);
|
|
}
|
|
local_54 = (this->_temporaryeffects)._effects._end;
|
|
pvVar1 = (this->_temporaryeffects)._effects._begin;
|
|
*GHIDRA_CAST<undefined4 *>((((GHIDRA_INT(local_54) - GHIDRA_INT(pvVar1) & 0xfffffff0U) - 0xc) + GHIDRA_INT(pvVar1))) = 1;
|
|
effectsOwner = (this->_temporaryeffects)._player;
|
|
effectEntryItem = local_5c;
|
|
if (effectsOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
effectEntryItem = local_5c;
|
|
AddCostume(effectsOwner,local_5c,0);
|
|
}
|
|
LAB_007cd080:
|
|
tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_5c->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
}
|
|
pIVar4 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&pIVar4[-1]._initCharge) + 3));
|
|
} while (pIVar4 != GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
effectsOwner = local_70;
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x664 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)))
|
|
&& (pIVar4 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x664)), pIVar4 != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
VStack_64.x = (float)pIVar4->maxCooldown;
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = pIVar4;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveEffect(&effectEntryItem,1);
|
|
}
|
|
bVar2 = HasCollectible(effectsOwner,0x199,0);
|
|
if (bVar2 != 0) {
|
|
if ((effectsOwner->_temporaryeffects)._disabled == 0) {
|
|
for (piVar5 = (effectsOwner->_temporaryeffects)._effects._begin;
|
|
piVar5 != (effectsOwner->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && (*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x199))
|
|
goto LAB_007cd27a;
|
|
}
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)) < 0x49) {
|
|
pIVar4 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
pIVar4 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x48));
|
|
}
|
|
RemoveCostume(effectsOwner,pIVar4);
|
|
if (effectsOwner->_redHearts < 1) {
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x664 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU
|
|
))) {
|
|
local_54 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x664));
|
|
if (local_54 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(local_54->maxCooldown);
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = local_54;
|
|
VStack_64.x = (float)local_74;
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
effect = (this->_temporaryeffects)._effects._begin;
|
|
if (effect != (this->_temporaryeffects)._effects._end) {
|
|
do {
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(*effect) == local_54) {
|
|
if (effect != (this->_temporaryeffects)._effects._end) {
|
|
effect[1] = effect[1] + 1;
|
|
effect[2] = (local_74->name)._buf + effect[2] + -8;
|
|
goto LAB_007cd242;
|
|
}
|
|
break;
|
|
}
|
|
effect = effect + 4;
|
|
} while (effect != (this->_temporaryeffects)._effects._end);
|
|
}
|
|
effect = (this->_temporaryeffects)._effects._end;
|
|
if (effect == (this->_temporaryeffects)._effects._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(effect,&effectEntryItem);
|
|
local_54 = effectEntryItem;
|
|
}
|
|
else {
|
|
*effect = local_54;
|
|
effect[1] = 0;
|
|
effect[2] = local_74;
|
|
effect[3] = 0;
|
|
ppvVar8 = &(this->_temporaryeffects)._effects._end;
|
|
*ppvVar8 = (void *)(GHIDRA_INT(*ppvVar8) + 0x10);
|
|
}
|
|
local_70 = (this->_temporaryeffects)._effects._end;
|
|
pvVar1 = (this->_temporaryeffects)._effects._begin;
|
|
*GHIDRA_CAST<undefined4 *>((((GHIDRA_INT(local_70) - GHIDRA_INT(pvVar1) & 0xfffffff0U) - 0xc) + GHIDRA_INT(pvVar1))) = 1;
|
|
effectsOwner = (this->_temporaryeffects)._player;
|
|
effectEntryItem = local_54;
|
|
if (effectsOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
effectEntryItem = local_54;
|
|
AddCostume(effectsOwner,local_54,0);
|
|
}
|
|
LAB_007cd242:
|
|
tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_54->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)) < 0x49) {
|
|
pIVar4 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
pIVar4 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x48));
|
|
}
|
|
AddCostume(effectsOwner,pIVar4,0);
|
|
}
|
|
}
|
|
LAB_007cd27a:
|
|
bVar2 = HasCollectible(effectsOwner,0x19f,0);
|
|
if (bVar2 != 0) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((effectsOwner)) + 0x13b5))) == '\0') {
|
|
iVar9 = GetHealthType(effectsOwner);
|
|
if ((iVar9 == 1) || (iVar9 == 2)) {
|
|
iVar9 = effectsOwner->_maxHearts;
|
|
}
|
|
else {
|
|
iVar9 = effectsOwner->_maxHearts + effectsOwner->_boneHearts * 2;
|
|
}
|
|
if (iVar9 <= effectsOwner->_redHearts) {
|
|
bVar2 = (effectsOwner->_temporaryeffects)._disabled;
|
|
if (bVar2 == 0) {
|
|
piVar5 = (effectsOwner->_temporaryeffects)._effects._begin;
|
|
effectsEnd = (effectsOwner->_temporaryeffects)._effects._end;
|
|
if (piVar5 != effectsEnd) {
|
|
do {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) &&
|
|
(*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x19f)) goto LAB_007cd59e;
|
|
piVar5 = piVar5 + 4;
|
|
} while (piVar5 != effectsEnd);
|
|
bVar2 = (effectsOwner->_temporaryeffects)._disabled;
|
|
}
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x67c < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) &
|
|
0xfffffffcU))) {
|
|
local_54 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x67c));
|
|
if (local_54 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(local_54->maxCooldown);
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = local_54;
|
|
VStack_64.x = (float)local_74;
|
|
if (bVar2 == 0) {
|
|
effect = (this->_temporaryeffects)._effects._begin;
|
|
if (effect != (this->_temporaryeffects)._effects._end) {
|
|
do {
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(*effect) == local_54) {
|
|
if (effect != (this->_temporaryeffects)._effects._end) {
|
|
effect[1] = effect[1] + 1;
|
|
effect[2] = (local_74->name)._buf + effect[2] + -8;
|
|
goto LAB_007cd3ef;
|
|
}
|
|
break;
|
|
}
|
|
effect = effect + 4;
|
|
} while (effect != (this->_temporaryeffects)._effects._end);
|
|
}
|
|
effect = (this->_temporaryeffects)._effects._end;
|
|
if (effect == (this->_temporaryeffects)._effects._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(effect,&effectEntryItem);
|
|
local_54 = effectEntryItem;
|
|
}
|
|
else {
|
|
*effect = local_54;
|
|
effect[1] = 0;
|
|
effect[2] = local_74;
|
|
effect[3] = 0;
|
|
ppvVar8 = &(this->_temporaryeffects)._effects._end;
|
|
*ppvVar8 = (void *)(GHIDRA_INT(*ppvVar8) + 0x10);
|
|
}
|
|
local_70 = (this->_temporaryeffects)._effects._end;
|
|
pvVar1 = (this->_temporaryeffects)._effects._begin;
|
|
*GHIDRA_CAST<undefined4 *>((((GHIDRA_INT(local_70) - GHIDRA_INT(pvVar1) & 0xfffffff0U) - 0xc) + GHIDRA_INT(pvVar1))) = 1
|
|
;
|
|
effectsOwner = (this->_temporaryeffects)._player;
|
|
effectEntryItem = local_54;
|
|
if (effectsOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
effectEntryItem = local_54;
|
|
AddCostume(effectsOwner,local_54,0);
|
|
}
|
|
LAB_007cd3ef:
|
|
tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_54->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
}
|
|
pbVar6 = (effectsOwner->_crownOfLightSprite)._animState._animData;
|
|
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar6 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<byte **>(pbVar6);
|
|
}
|
|
expectedChar = "FloatGlow";
|
|
do {
|
|
bVar2 = *pbVar6;
|
|
isLess = bVar2 < (byte)*expectedChar;
|
|
if (bVar2 != *expectedChar) {
|
|
LAB_007cd434:
|
|
swapDwordTmp = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007cd439;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar6[1];
|
|
isLess = bVar2 < (byte)expectedChar[1];
|
|
if (bVar2 != expectedChar[1]) goto LAB_007cd434;
|
|
pbVar6 = pbVar6 + 2;
|
|
expectedChar = expectedChar + 2;
|
|
} while (bVar2 != 0);
|
|
swapDwordTmp = 0;
|
|
LAB_007cd439:
|
|
if (swapDwordTmp == 0) {
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_INT((effectsOwner->_crownOfLightSprite)._animState._animData) + 0x34)) != '\0')
|
|
&& ((effectsOwner->_crownOfLightSprite)._animState._isPlaying == 0)) {
|
|
crownAnim = 0x100b6ae50;
|
|
goto LAB_007cd57d;
|
|
}
|
|
goto LAB_007cd59e;
|
|
}
|
|
}
|
|
crownAnim = 0x100b6ae50;
|
|
goto LAB_007cd57d;
|
|
}
|
|
}
|
|
if ((effectsOwner->_temporaryeffects)._disabled == 0) {
|
|
for (piVar5 = (effectsOwner->_temporaryeffects)._effects._begin;
|
|
piVar5 != (effectsOwner->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && (*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x19f)) {
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x67c < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) &
|
|
0xfffffffcU))) &&
|
|
(pIVar4 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x67c)), pIVar4 != GHIDRA_CAST<ItemConfig_Item *>(0x0))
|
|
) {
|
|
VStack_64.x = (float)pIVar4->maxCooldown;
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = pIVar4;
|
|
(GHIDRA_CAST<TemporaryEffects *>((tempEffects)))->TemporaryEffects::RemoveEffect(&effectEntryItem,1);
|
|
}
|
|
pbVar6 = (effectsOwner->_crownOfLightSprite)._animState._animData;
|
|
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) goto LAB_007cd576;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar6 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<byte **>(pbVar6);
|
|
}
|
|
expectedChar = "FloatNoGlow";
|
|
goto LAB_007cd530;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
goto LAB_007cd59e;
|
|
while( true ) {
|
|
bVar2 = animNameChar[1];
|
|
isLess = bVar2 < (byte)expectedChar[1];
|
|
if (bVar2 != expectedChar[1]) goto LAB_007cd880;
|
|
animNameChar = animNameChar + 2;
|
|
expectedChar = expectedChar + 2;
|
|
if (bVar2 == 0) break;
|
|
LAB_007cd860:
|
|
bVar2 = *animNameChar;
|
|
isLess = bVar2 < (byte)*expectedChar;
|
|
if (bVar2 != *expectedChar) {
|
|
LAB_007cd880:
|
|
swapDwordTmp = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007cd885;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
}
|
|
swapDwordTmp = 0;
|
|
LAB_007cd885:
|
|
if ((swapDwordTmp != 0) ||
|
|
((pbVar6[0x34] != 0 && ((effectsOwner->_darkPrincesCrownSprite)._animState._isPlaying == 0)))) {
|
|
LAB_007cd8a4:
|
|
crownAnim = 0x100b6ae44;
|
|
goto LAB_007cd8ab;
|
|
}
|
|
goto LAB_007cd8c2;
|
|
while( true ) {
|
|
bVar2 = pbVar6[1];
|
|
isLess = bVar2 < (byte)expectedChar[1];
|
|
if (bVar2 != expectedChar[1]) goto LAB_007cd550;
|
|
pbVar6 = pbVar6 + 2;
|
|
expectedChar = expectedChar + 2;
|
|
if (bVar2 == 0) break;
|
|
LAB_007cd530:
|
|
bVar2 = *pbVar6;
|
|
isLess = bVar2 < (byte)*expectedChar;
|
|
if (bVar2 != *expectedChar) {
|
|
LAB_007cd550:
|
|
swapDwordTmp = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007cd555;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
}
|
|
swapDwordTmp = 0;
|
|
LAB_007cd555:
|
|
if ((swapDwordTmp != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((effectsOwner->_crownOfLightSprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((effectsOwner->_crownOfLightSprite)._animState._isPlaying == 0)))) {
|
|
LAB_007cd576:
|
|
crownAnim = 0x100b6ae44;
|
|
LAB_007cd57d:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&effectsOwner->_crownOfLightSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(crownAnim),
|
|
(byte)((ulonglong)crownAnim >> 0x20));
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(effectsOwner->_crownOfLightSprite)._animState)))->AnimationState::Rewind();
|
|
tempEffects = &effectsOwner->_temporaryeffects;
|
|
(effectsOwner->_crownOfLightSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_007cd59e:
|
|
bVar2 = HasCollectible(effectsOwner,0x1ba,0);
|
|
if (bVar2 == 0) goto LAB_007cd90a;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
if (effectsOwner->_redHearts != 2) goto LAB_007cd606;
|
|
LAB_007cd657:
|
|
local_55 = (effectsOwner->_temporaryeffects)._disabled;
|
|
if (local_55 == 0) {
|
|
for (piVar5 = (effectsOwner->_temporaryeffects)._effects._begin;
|
|
piVar5 != (effectsOwner->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && (*GHIDRA_CAST<int *>((*piVar5 + 4)) == 0x1ba))
|
|
goto LAB_007cd8c2;
|
|
}
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (0x6e8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)))
|
|
{
|
|
local_54 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar1) + 0x6e8));
|
|
if (local_54 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(local_54->maxCooldown);
|
|
effectEntryCount = 0;
|
|
VStack_64.y = 0.0;
|
|
effectEntryItem = local_54;
|
|
VStack_64.x = (float)local_74;
|
|
if (local_55 == 0) {
|
|
effect = (tempEffects->_effects)._begin;
|
|
if (effect != (tempEffects->_effects)._end) {
|
|
do {
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(*effect) == local_54) {
|
|
if (effect != (tempEffects->_effects)._end) {
|
|
effect[1] = effect[1] + 1;
|
|
effect[2] = (local_74->name)._buf + effect[2] + -8;
|
|
goto LAB_007cd76f;
|
|
}
|
|
break;
|
|
}
|
|
effect = effect + 4;
|
|
} while (effect != (tempEffects->_effects)._end);
|
|
}
|
|
effect = (tempEffects->_effects)._end;
|
|
if (effect == (tempEffects->_effects)._capacity) {
|
|
std::vector<Vec16>::_Emplace_reallocate(effect,&effectEntryItem);
|
|
local_54 = effectEntryItem;
|
|
}
|
|
else {
|
|
*effect = local_54;
|
|
effect[1] = 0;
|
|
effect[2] = local_74;
|
|
effect[3] = 0;
|
|
ppvVar8 = &(tempEffects->_effects)._end;
|
|
*ppvVar8 = (void *)(GHIDRA_INT(*ppvVar8) + 0x10);
|
|
}
|
|
local_70 = (tempEffects->_effects)._end;
|
|
pvVar1 = (tempEffects->_effects)._begin;
|
|
*GHIDRA_CAST<undefined4 *>((((GHIDRA_INT(local_70) - GHIDRA_INT(pvVar1) & 0xfffffff0U) - 0xc) + GHIDRA_INT(pvVar1))) = 1;
|
|
effectEntryItem = local_54;
|
|
if (tempEffects->_player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
effectEntryItem = local_54;
|
|
AddCostume(tempEffects->_player,local_54,0);
|
|
}
|
|
LAB_007cd76f:
|
|
tempEffects->_cacheFlags = tempEffects->_cacheFlags | local_54->cacheFlags;
|
|
tempEffects->_shouldEvaluateCache = 1;
|
|
}
|
|
}
|
|
}
|
|
pbVar6 = (effectsOwner->_darkPrincesCrownSprite)._animState._animData;
|
|
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007cd7e4:
|
|
crownAnim = 0x100b6ae50;
|
|
}
|
|
else {
|
|
animNameChar = pbVar6;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar6 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar6);
|
|
}
|
|
expectedChar = "FloatGlow";
|
|
do {
|
|
bVar2 = *animNameChar;
|
|
isLess = bVar2 < (byte)*expectedChar;
|
|
if (bVar2 != *expectedChar) {
|
|
LAB_007cd7b4:
|
|
swapDwordTmp = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007cd7b9;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameChar[1];
|
|
isLess = bVar2 < (byte)expectedChar[1];
|
|
if (bVar2 != expectedChar[1]) goto LAB_007cd7b4;
|
|
animNameChar = animNameChar + 2;
|
|
expectedChar = expectedChar + 2;
|
|
} while (bVar2 != 0);
|
|
swapDwordTmp = 0;
|
|
LAB_007cd7b9:
|
|
if (swapDwordTmp != 0) goto LAB_007cd7e4;
|
|
if ((pbVar6[0x34] == 0) || ((effectsOwner->_darkPrincesCrownSprite)._animState._isPlaying != 0))
|
|
goto LAB_007cd8c2;
|
|
crownAnim = 0x100b6ae50;
|
|
}
|
|
LAB_007cd8ab:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&effectsOwner->_darkPrincesCrownSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(crownAnim),
|
|
(byte)((ulonglong)crownAnim >> 0x20));
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(effectsOwner->_darkPrincesCrownSprite)._animState)))->AnimationState::Rewind();
|
|
(effectsOwner->_darkPrincesCrownSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
fVar11 = (float)effectsOwner->_redHearts / (float)effectsOwner->_maxHearts;
|
|
if ((0.1 <= fVar11) && (fVar11 <= 0.3)) goto LAB_007cd657;
|
|
LAB_007cd606:
|
|
if ((effectsOwner->_temporaryeffects)._disabled == 0) {
|
|
for (piVar5 = (effectsOwner->_temporaryeffects)._effects._begin;
|
|
piVar5 != (effectsOwner->_temporaryeffects)._effects._end; piVar5 = piVar5 + 4) {
|
|
iVar9 = *GHIDRA_CAST<int *>(*piVar5);
|
|
if ((((iVar9 == 1) || (iVar9 == 3)) || (iVar9 == 4)) && ((GHIDRA_CAST<int *>(*piVar5))[1] == 0x1ba)) {
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x6e8 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) &
|
|
0xfffffffcU))) && (iVar9 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x6e8)), iVar9 != 0)) {
|
|
local_78 = *GHIDRA_CAST<float *>((iVar9 + 0x78));
|
|
crownEffectKey[1] = 0;
|
|
local_74 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
crownEffectKey[0] = iVar9;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&effectsOwner->_temporaryeffects)))->TemporaryEffects::RemoveEffect(crownEffectKey,1);
|
|
}
|
|
pbVar6 = (effectsOwner->_darkPrincesCrownSprite)._animState._animData;
|
|
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) goto LAB_007cd8a4;
|
|
animNameChar = pbVar6;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar6 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar6);
|
|
}
|
|
expectedChar = "FloatNoGlow";
|
|
goto LAB_007cd860;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007cd8c2:
|
|
bVar2 = HasCollectible(effectsOwner,0x19f,0);
|
|
if (bVar2 == 0) {
|
|
(effectsOwner->_darkPrincesCrownSprite)._offset.x = g_vectorZero.x;
|
|
(effectsOwner->_darkPrincesCrownSprite)._offset.y = g_vectorZero.y;
|
|
}
|
|
else {
|
|
(effectsOwner->_darkPrincesCrownSprite)._offset.x = 0.0;
|
|
(effectsOwner->_darkPrincesCrownSprite)._offset.y = -7.0;
|
|
}
|
|
LAB_007cd90a:
|
|
effectsOwner->_cacheFlags = effectsOwner->_cacheFlags | 0xffff;
|
|
effectsOwner->_itemHoldCooldown = 10;
|
|
EvaluateItems(effectsOwner);
|
|
stop_costume_item_anims(effectsOwner);
|
|
update_player_skin(effectsOwner);
|
|
update_purity_glow(effectsOwner);
|
|
ExceptionList = savedExceptionList;
|
|
return 1;
|
|
}
|
|
|
|
// 007ce270
|
|
Entity_Player * Entity_Player::GetMainPlayer()
|
|
{
|
|
Entity_Player *firstPlayer;
|
|
EntityPtr EVar1;
|
|
|
|
EVar1 = this->_parent;
|
|
if ((EVar1 == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0x28)) != 1)) {
|
|
if (this->_variant == 1) {
|
|
firstPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
return firstPlayer;
|
|
}
|
|
EVar1 = (EntityPtr)0x0;
|
|
}
|
|
return GHIDRA_CAST<Entity_Player *>(EVar1);
|
|
}
|
|
|
|
// 007ce2a0
|
|
byte Entity_Player::CanRerollCollectible(int id, byte unk)
|
|
{
|
|
byte isQuestItem;
|
|
ChallengeParam *challengeParams;
|
|
int challengeItem;
|
|
Manager *manager;
|
|
int *challengeItemIter;
|
|
bool isBlocked;
|
|
int challengeItem;
|
|
|
|
if (id == 0x102) {
|
|
return 0;
|
|
}
|
|
if (id == 0x290) {
|
|
return 0;
|
|
}
|
|
isQuestItem = ItemConfig::IsQuestItem(id);
|
|
if (isQuestItem != 0) {
|
|
return 0;
|
|
}
|
|
if (g_game->_challenge != 0) {
|
|
isBlocked = false;
|
|
challengeParams = (GHIDRA_CAST<Manager *>((manager)))->Manager::GetChallengeParams(g_game->_challenge);
|
|
challengeItemIter = (challengeParams->_collectibleList)._begin;
|
|
challengeItem = GHIDRA_INT((challengeParams->_collectibleList)._end) - GHIDRA_INT(challengeItemIter) >> 2;
|
|
if (challengeItem != 0) {
|
|
do {
|
|
challengeItem = *challengeItemIter;
|
|
challengeItemIter = challengeItemIter + 1;
|
|
if (challengeItem == id) {
|
|
isBlocked = true;
|
|
}
|
|
challengeItem = challengeItem + -1;
|
|
} while (challengeItem != 0);
|
|
if (isBlocked) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
if (unk == 0) {
|
|
challengeItem = this->_playerType;
|
|
if (challengeItem == 2) {
|
|
isBlocked = id == 0x2e;
|
|
}
|
|
else if (challengeItem == 5) {
|
|
if (id == 0x75) {
|
|
return 0;
|
|
}
|
|
isBlocked = id == 0x7a;
|
|
}
|
|
else if (challengeItem == 6) {
|
|
isBlocked = id == 0x9d;
|
|
}
|
|
else if (challengeItem == 8) {
|
|
isBlocked = id == 0xd6;
|
|
}
|
|
else if (challengeItem == 10) {
|
|
isBlocked = id == 0x139;
|
|
}
|
|
else {
|
|
if (challengeItem != 0xd) {
|
|
if (challengeItem != 0x12) {
|
|
return 1;
|
|
}
|
|
if (id == 0x248) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
if (id == 0x168) {
|
|
return 0;
|
|
}
|
|
isBlocked = id == 0x19c;
|
|
}
|
|
if (isBlocked) {
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007ce390
|
|
int Entity_Player::GetGreedsGulletHearts()
|
|
{
|
|
byte isGreedsGullet;
|
|
int iVar1;
|
|
int hearts;
|
|
|
|
hearts = 0;
|
|
isGreedsGullet = HasCollectible(this,0x1f5,0);
|
|
if (isGreedsGullet != 0) {
|
|
iVar1 = this->_numCoins;
|
|
if (99 < iVar1) {
|
|
hearts = GetTrinketMultiplier(this,0x9c);
|
|
return hearts + iVar1 / 100 + 3;
|
|
}
|
|
if (iVar1 == 99) {
|
|
hearts = GetTrinketMultiplier(this,0x9c);
|
|
return hearts + 4;
|
|
}
|
|
hearts = 0;
|
|
if (0 < iVar1) {
|
|
hearts = iVar1;
|
|
}
|
|
hearts = hearts / 0x19;
|
|
}
|
|
iVar1 = GetTrinketMultiplier(this,0x9c);
|
|
return iVar1 + hearts;
|
|
}
|
|
|
|
// 007ce420
|
|
void Entity_Player::update_greeds_gullet()
|
|
{
|
|
byte isHeld;
|
|
int iVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
short cappedHearts;
|
|
short sVar4;
|
|
int amount;
|
|
short extraout_DX;
|
|
int extraout_EDX;
|
|
int extraout_EDX_00;
|
|
Entity_Player *healthPlayer;
|
|
|
|
if (g_game->_isRestoringGlowingHourglassState != 0) {
|
|
return;
|
|
}
|
|
if (g_game->_isStartingFromState != 0) {
|
|
return;
|
|
}
|
|
healthPlayer = this;
|
|
if ((this->_playerType == 0x11) && (GHIDRA_CAST<Entity_Player *>(this->_subPlayer) != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
healthPlayer = GHIDRA_CAST<Entity_Player *>(this->_subPlayer);
|
|
}
|
|
if (healthPlayer->_isUpdatingGreedsGullet != 0) {
|
|
return;
|
|
}
|
|
healthPlayer->_isUpdatingGreedsGullet = 1;
|
|
sVar4 = this->_greedsGulletHearts;
|
|
iVar1 = GHIDRA_INT(sVar4);
|
|
this->_isUpdatingGreedsGullet = 1;
|
|
iVar2 = GetHealthType(healthPlayer);
|
|
switch(iVar2) {
|
|
case 0:
|
|
case 3:
|
|
iVar2 = healthPlayer->_maxHearts;
|
|
break;
|
|
case 1:
|
|
iVar2 = healthPlayer->_soulHearts + 1;
|
|
break;
|
|
default:
|
|
goto switchD_007ce498_caseD_2;
|
|
case 4:
|
|
cappedHearts = (short)healthPlayer->_boneHearts + this->_greedsGulletOverflow;
|
|
if (cappedHearts < sVar4) {
|
|
sVar4 = cappedHearts;
|
|
}
|
|
goto LAB_007ce4e1;
|
|
}
|
|
cappedHearts = (short)(iVar2 >> 1) + this->_greedsGulletOverflow;
|
|
if (cappedHearts < sVar4) {
|
|
sVar4 = cappedHearts;
|
|
}
|
|
LAB_007ce4e1:
|
|
this->_greedsGulletHearts = sVar4;
|
|
switchD_007ce498_caseD_2:
|
|
if (sVar4 < iVar1) {
|
|
isHeld = HasTrinket(this,0x9c,0);
|
|
if (isHeld != 0) {
|
|
TryRemoveTrinket(this,0x9c);
|
|
iVar1 = iVar1 + -1;
|
|
}
|
|
if (this->_greedsGulletHearts < iVar1) {
|
|
do {
|
|
iVar1 = iVar1 + -1;
|
|
if (iVar1 < 3) {
|
|
iVar2 = -0x19;
|
|
}
|
|
else if (iVar1 == 3) {
|
|
iVar2 = -0x18;
|
|
}
|
|
else {
|
|
iVar2 = (iVar1 != 4) - 0x65;
|
|
}
|
|
AddCoins(this,iVar2);
|
|
} while (this->_greedsGulletHearts < iVar1);
|
|
}
|
|
}
|
|
iVar1 = GetGreedsGulletHearts(this);
|
|
iVar2 = GHIDRA_INT(this->_greedsGulletHearts);
|
|
if ((iVar1 != iVar2) || (0 < this->_greedsGulletOverflow)) {
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) &&
|
|
((iVar2 < iVar1 && (this->_greedsGulletRedHearts < iVar1)))) {
|
|
iVar3 = scale_for_hard_difficulty((iVar1 - iVar2) * 2);
|
|
this->_redHearts = this->_redHearts + iVar3;
|
|
this->_greedsGulletRedHearts = extraout_DX;
|
|
}
|
|
iVar3 = GetHealthType(healthPlayer);
|
|
sVar4 = (short)iVar1;
|
|
switch(iVar3) {
|
|
case 0:
|
|
case 3:
|
|
iVar3 = (this->_greedsGulletOverflow - iVar2) + extraout_EDX;
|
|
iVar1 = healthPlayer->_maxHearts;
|
|
iVar2 = iVar3 * 8;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
iVar2 = iVar3;
|
|
}
|
|
AddMaxHearts(healthPlayer,iVar3 * 2,0);
|
|
this->_greedsGulletHearts = sVar4;
|
|
iVar1 = (iVar2 + (iVar1 >> 1)) - (healthPlayer->_maxHearts >> 1);
|
|
break;
|
|
case 1:
|
|
iVar2 = scale_for_hard_difficulty(extraout_EDX + (this->_greedsGulletOverflow - iVar2));
|
|
iVar1 = healthPlayer->_soulHearts;
|
|
AddSoulHearts(healthPlayer,extraout_EDX_00 * 2,0);
|
|
this->_greedsGulletHearts = sVar4;
|
|
iVar1 = ((iVar1 + 1 >> 1) + iVar2) - (healthPlayer->_soulHearts + 1 >> 1);
|
|
break;
|
|
default:
|
|
goto switchD_007ce5c5_caseD_2;
|
|
case 4:
|
|
iVar2 = scale_for_hard_difficulty((this->_greedsGulletOverflow - iVar2) + extraout_EDX);
|
|
iVar1 = healthPlayer->_boneHearts;
|
|
AddBoneHearts(healthPlayer,amount);
|
|
this->_greedsGulletHearts = sVar4;
|
|
iVar1 = (iVar2 + iVar1) - healthPlayer->_boneHearts;
|
|
}
|
|
sVar4 = 0;
|
|
if (0 < iVar1) {
|
|
sVar4 = (short)iVar1;
|
|
}
|
|
this->_greedsGulletOverflow = sVar4;
|
|
}
|
|
switchD_007ce5c5_caseD_2:
|
|
healthPlayer->_isUpdatingGreedsGullet = 0;
|
|
this->_isUpdatingGreedsGullet = 0;
|
|
return;
|
|
}
|
|
|
|
// 007ce6e0
|
|
void Entity_Player::ChangePlayerType(int playerType, byte unk)
|
|
{
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
Entity_Player *pEVar3;
|
|
ItemConfig_Item *Item;
|
|
float *pfVar4;
|
|
int iVar5;
|
|
void *pvVar6;
|
|
Vector *pos;
|
|
byte *nameCursor;
|
|
int *extraout_EAX;
|
|
Entity_Player *subPlayer;
|
|
undefined4 extraout_ECX;
|
|
int *piVar7;
|
|
uint uVar8;
|
|
uint uVar9;
|
|
void *pvVar10;
|
|
int iVar11;
|
|
bool isLess;
|
|
RNG heartRng;
|
|
int twinRedHearts;
|
|
int local_50;
|
|
int twinRottenHearts;
|
|
int oldPlayerType;
|
|
float local_44;
|
|
uint local_40;
|
|
Entity_Player *local_3c;
|
|
Vector local_38;
|
|
byte local_2d;
|
|
Entity_Player *animName [4];
|
|
void *animNameSize;
|
|
float animNameCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
Entity_Player *local_8;
|
|
byte *curAnim;
|
|
uint *flagsHigh;
|
|
Game *game;
|
|
qword oldFlags;
|
|
short *smeltedCount;
|
|
EntityPtr twinPlayer;
|
|
|
|
local_8 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
puStack_c = &LAB_00b001ff;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((animName + 10));
|
|
if (playerType < 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
local_3c = this;
|
|
if (unk != 0) {
|
|
if (playerType == 0x10) {
|
|
if (this->_playerType == 0x11) {
|
|
LAB_007cea0f:
|
|
SwapForgottenForm(this,1,1);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
else if ((playerType == 0x11) && (this->_playerType == 0x10)) goto LAB_007cea0f;
|
|
}
|
|
uVar8 = 0;
|
|
if (((this->_playerType == 0x12) &&
|
|
(local_38.y = (float)this->_effectiveSoulCharge, 0 < GHIDRA_INT(local_38.y))) && (unk == 0)) {
|
|
iVar11 = 0;
|
|
iVar5 = iVar11;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
pEVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar8);
|
|
iVar11 = iVar5 + 1;
|
|
if (pEVar3->_playerType != 0x12) {
|
|
iVar11 = iVar5;
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
iVar5 = iVar11;
|
|
} while (uVar8 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
uVar8 = GHIDRA_INT(local_38.y) / iVar11;
|
|
if (uVar8 == 0) {
|
|
uVar8 = 1;
|
|
}
|
|
}
|
|
RemoveSkinCostume(this);
|
|
oldPlayerType = this->_playerType;
|
|
if (oldPlayerType == 0xb) {
|
|
oldPlayerType = 0xb;
|
|
local_38.y = (float)(g_manager->_entityConfig)._players._begin;
|
|
if ((8 < (GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(local_38.y)) / 0x148) &&
|
|
((void *)local_38.y != (void *)0xfffff5c0)) {
|
|
oldPlayerType = 0xb;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38.y) + 0xaec)) != -1) {
|
|
Item = (GHIDRA_CAST<Config *>((&g_manager->_itemConfig)))->Config::GetNullItem(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38.y) + 0xaec)));
|
|
RemoveCostume(this,Item);
|
|
oldPlayerType = this->_playerType;
|
|
}
|
|
}
|
|
}
|
|
this->_playerType = playerType;
|
|
if (0 < GHIDRA_INT(uVar8)) {
|
|
AddSoulCharge(this,-uVar8);
|
|
AddSoulHearts(this,uVar8,0);
|
|
}
|
|
if (oldPlayerType == 0x23) {
|
|
twinPlayer = this->_twinPlayer;
|
|
if (twinPlayer != (EntityPtr)0x0) {
|
|
local_38.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(twinPlayer) + 0x33c));
|
|
local_38.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(twinPlayer) + 0x340));
|
|
Teleport(this,&local_38,0,0);
|
|
}
|
|
oldFlags = this->_flags;
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
*flagsHigh = *flagsHigh & 0xfbffffff;
|
|
(this->_posOffset).y = 0.0;
|
|
this->_heightVelocity = 0.0;
|
|
*GHIDRA_CAST<int *>(&this->_flags) = GHIDRA_INT(oldFlags);
|
|
}
|
|
pEVar3 = GHIDRA_CAST<Entity_Player *>(GetHealthType(this));
|
|
local_40 = this->_subPlayer;
|
|
if (local_40 != 0) {
|
|
iVar11 = this->_soulHearts;
|
|
iVar5 = this->_boneHearts;
|
|
bVar2 = (byte)((iVar11 + 1) / 2);
|
|
local_3c->_maxHearts = local_3c->_maxHearts + *GHIDRA_CAST<int *>((local_40 + 0x1340));
|
|
local_3c->_redHearts = local_3c->_redHearts + *GHIDRA_CAST<int *>((local_40 + 0x1344));
|
|
local_3c->_soulHearts = *GHIDRA_CAST<int *>((local_40 + 0x134c)) + iVar11;
|
|
iVar11 = local_3c->_subPlayer;
|
|
local_3c->_boneHearts = *GHIDRA_CAST<int *>((local_40 + 0x1d88)) + iVar5;
|
|
local_3c->_blackHearts = local_3c->_blackHearts | *GHIDRA_CAST<int *>((iVar11 + 0x1350)) << (bVar2 & 0x1f);
|
|
local_3c->_boneHeartsMask =
|
|
local_3c->_boneHeartsMask | *GHIDRA_CAST<int *>((iVar11 + 0x1d8c)) << ((char)iVar5 + bVar2 & 0x1f);
|
|
local_3c->_eternalHearts = local_3c->_eternalHearts + *GHIDRA_CAST<int *>((iVar11 + 0x1348));
|
|
local_3c->_rottenHearts = local_3c->_rottenHearts + *GHIDRA_CAST<int *>((iVar11 + 0x1da4));
|
|
local_3c->_goldenHearts = local_3c->_goldenHearts + *GHIDRA_CAST<int *>((iVar11 + 0x194c));
|
|
this = local_3c;
|
|
}
|
|
local_38.y = (float)pEVar3;
|
|
init_forgotten_twin(this);
|
|
if (GHIDRA_CAST<Entity_Player *>(this->_subPlayer) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar11 = GetHealthType(GHIDRA_CAST<Entity_Player *>(this->_subPlayer));
|
|
if (iVar11 == 1) {
|
|
subPlayer->_soulHearts = this->_soulHearts;
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1350)) = this->_blackHearts;
|
|
this->_soulHearts = 0;
|
|
this->_blackHearts = 0;
|
|
}
|
|
else if (iVar11 == 4) {
|
|
AddBoneHearts(subPlayer,this->_boneHearts);
|
|
*GHIDRA_CAST<int *>((this->_subPlayer + 0x1344)) = this->_redHearts;
|
|
this->_redHearts = 0;
|
|
this->_boneHearts = 0;
|
|
this->_boneHeartsMask = 0;
|
|
}
|
|
if (1 < this->_eternalHearts) {
|
|
this->_eternalHearts = this->_eternalHearts + -1;
|
|
piVar7 = GHIDRA_CAST<int *>((this->_subPlayer + 0x1348));
|
|
*piVar7 = *piVar7 + 1;
|
|
}
|
|
update_bone_hearts(GHIDRA_CAST<Entity_Player *>(this->_subPlayer));
|
|
}
|
|
if (pEVar3 == GHIDRA_CAST<Entity_Player *>(0x2)) {
|
|
this->_rottenHearts = 0;
|
|
this->_boneHeartsMask = 0;
|
|
this->_boneHearts = 0;
|
|
this->_eternalHearts = 0;
|
|
this->_maxHearts = 0;
|
|
this->_redHearts = 0;
|
|
this->_soulHearts = 1;
|
|
LAB_007ceb8b:
|
|
this->_blackHearts = 0;
|
|
}
|
|
else {
|
|
if (pEVar3 == GHIDRA_CAST<Entity_Player *>(0x3)) {
|
|
local_38.y = 1.4013e-45;
|
|
pfVar4 = &local_38.y;
|
|
if (this->_brokenHearts < 2) {
|
|
pfVar4 = GHIDRA_CAST<float *>(&this->_brokenHearts);
|
|
}
|
|
this->_brokenHearts = GHIDRA_INT(*pfVar4);
|
|
AddMaxHearts(this,4,0);
|
|
this->_rottenHearts = 0;
|
|
this->_boneHeartsMask = 0;
|
|
this->_boneHearts = 0;
|
|
LAB_007ceb81:
|
|
this->_soulHearts = 0;
|
|
goto LAB_007ceb8b;
|
|
}
|
|
if (pEVar3 == GHIDRA_CAST<Entity_Player *>(0x1)) {
|
|
this->_rottenHearts = 0;
|
|
this->_maxHearts = 0;
|
|
this->_redHearts = 0;
|
|
}
|
|
else if (pEVar3 == GHIDRA_CAST<Entity_Player *>(&DAT_00000004)) {
|
|
iVar11 = this->_maxHearts;
|
|
this->_maxHearts = 0;
|
|
iVar11 = iVar11 / 2;
|
|
if (0 < iVar11) {
|
|
AddBoneHearts(this,iVar11);
|
|
}
|
|
local_38.y = (float)GetEffectiveMaxHearts(this);
|
|
piVar7 = &this->_redHearts;
|
|
pfVar4 = &local_38.y;
|
|
if (*piVar7 <= GHIDRA_INT(local_38.y)) {
|
|
pfVar4 = GHIDRA_CAST<float *>(piVar7);
|
|
}
|
|
*piVar7 = GHIDRA_INT(*pfVar4);
|
|
goto LAB_007ceb81;
|
|
}
|
|
}
|
|
if (this->_isCoopGhost == 0) {
|
|
TryPreventDeath(this);
|
|
}
|
|
update_bone_hearts(this);
|
|
UpdateHeartDependentEffects(this);
|
|
UpdateCanShoot(this);
|
|
AddEternalHearts(this,0);
|
|
twinPlayer = this->_twinPlayer;
|
|
if (twinPlayer == (EntityPtr)0x0) {
|
|
LAB_007ceccc:
|
|
if (this->_playerType == 0x13) {
|
|
LAB_007cecd9:
|
|
if (unk == 0) {
|
|
local_3c = InitTwin(this,0x14);
|
|
InitPostLevelInitStats(local_3c);
|
|
heartRng._shift3 = 0x17;
|
|
heartRng._seed = *GHIDRA_CAST<uint *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0x1e20));
|
|
heartRng._shift1 = 8;
|
|
heartRng._shift2 = 9;
|
|
uVar9 = (this->_maxHearts + 1) / 2;
|
|
uVar8 = uVar9 & 0x80000001;
|
|
if (GHIDRA_INT(uVar8) < 0) {
|
|
uVar8 = (uVar8 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&heartRng)))->RNG::RandomInt(uVar8 + 1);
|
|
uVar8 = (uVar8 + GHIDRA_INT(uVar9) / 2) * 2;
|
|
uVar9 = this->_boneHearts & 0x80000001;
|
|
if (GHIDRA_INT(uVar9) < 0) {
|
|
uVar9 = (uVar9 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
local_40 = uVar8;
|
|
uVar9 = (GHIDRA_CAST<RNG *>((&heartRng)))->RNG::RandomInt(uVar9 + 1);
|
|
local_50 = uVar9 + this->_boneHearts / 2;
|
|
iVar11 = uVar8 + local_50 * 2;
|
|
uVar8 = this->_redHearts;
|
|
uVar9 = uVar8 & 0x80000001;
|
|
if (GHIDRA_INT(uVar9) < 0) {
|
|
uVar9 = (uVar9 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
uVar9 = (GHIDRA_CAST<RNG *>((&heartRng)))->RNG::RandomInt(uVar9 + 1);
|
|
twinRedHearts = uVar9 + GHIDRA_INT(uVar8) / 2;
|
|
if (iVar11 < twinRedHearts) {
|
|
twinRedHearts = iVar11;
|
|
}
|
|
uVar9 = this->_rottenHearts;
|
|
iVar5 = local_40 +
|
|
(((local_50 - this->_boneHearts) * 2 - this->_maxHearts) - twinRedHearts) + uVar8;
|
|
iVar11 = 0;
|
|
if (0 < iVar5) {
|
|
iVar11 = iVar5;
|
|
}
|
|
twinRedHearts = twinRedHearts + iVar11;
|
|
uVar8 = uVar9 & 0x80000001;
|
|
if (GHIDRA_INT(uVar8) < 0) {
|
|
uVar8 = (uVar8 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&heartRng)))->RNG::RandomInt(uVar8 + 1);
|
|
iVar11 = uVar8 + GHIDRA_INT(uVar9) / 2;
|
|
twinRottenHearts = (twinRedHearts + 1) / 2;
|
|
if (iVar11 < twinRottenHearts) {
|
|
twinRottenHearts = iVar11;
|
|
}
|
|
iVar5 = (uVar9 - (this->_redHearts - twinRedHearts) / 2) - twinRottenHearts;
|
|
iVar11 = 0;
|
|
if (0 < iVar5) {
|
|
iVar11 = iVar5;
|
|
}
|
|
twinRottenHearts = twinRottenHearts + iVar11;
|
|
uVar8 = this->_soulHearts & 0x80000001;
|
|
if (GHIDRA_INT(uVar8) < 0) {
|
|
uVar8 = (uVar8 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&heartRng)))->RNG::RandomInt(uVar8 + 1);
|
|
local_44 = (float)(uVar8 + this->_soulHearts / 2);
|
|
uVar8 = this->_goldenHearts & 0x80000001;
|
|
if (GHIDRA_INT(uVar8) < 0) {
|
|
uVar8 = (uVar8 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&heartRng)))->RNG::RandomInt(uVar8 + 1);
|
|
pEVar3 = local_3c;
|
|
local_38.y = (float)(uVar8 + this->_goldenHearts / 2);
|
|
local_3c->_maxHearts = local_40;
|
|
AddBoneHearts(local_3c,local_50);
|
|
iVar11 = twinRedHearts;
|
|
pEVar3->_soulHearts = GHIDRA_INT(local_44);
|
|
pEVar3->_redHearts = twinRedHearts;
|
|
pEVar3->_blackHearts =
|
|
pEVar3->_blackHearts |
|
|
this->_blackHearts << ((byte)((this->_soulHearts - GHIDRA_INT(local_44)) / 2) & 0x1f);
|
|
pEVar3->_goldenHearts = GHIDRA_INT(local_38.y);
|
|
pEVar3->_rottenHearts = twinRottenHearts;
|
|
pEVar3->_brokenHearts = this->_brokenHearts;
|
|
if (0 < GHIDRA_INT(local_44)) {
|
|
AddSoulHearts(this,-GHIDRA_INT(local_44),0);
|
|
}
|
|
if (0 < iVar11) {
|
|
AddHearts(this,-iVar11,0,0);
|
|
}
|
|
if (0 < local_50) {
|
|
AddBoneHearts(this,-local_50);
|
|
}
|
|
if (0 < GHIDRA_INT(local_40)) {
|
|
AddMaxHearts(this,-local_40,0);
|
|
}
|
|
this->_goldenHearts = this->_goldenHearts - GHIDRA_INT(local_38.y);
|
|
this->_rottenHearts = this->_rottenHearts - twinRottenHearts;
|
|
if (this->_soulHearts + this->_redHearts + this->_boneHearts < 1) {
|
|
AddSoulHearts(this,1,0);
|
|
}
|
|
if (pEVar3->_boneHearts + pEVar3->_redHearts + pEVar3->_soulHearts < 1) {
|
|
AddSoulHearts(pEVar3,1,0);
|
|
}
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) && (this->_dead == 0)) &&
|
|
(0 < this->_goldenHearts)) {
|
|
iVar11 = (this->_soulHearts + 1) / 2 +
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT((&this->_headAnim + 1)) +
|
|
((this->_redHearts <= this->_maxHearts) + 2) * 4)) + 1) / 2 +
|
|
this->_boneHearts;
|
|
if (iVar11 < this->_goldenHearts) {
|
|
BreakGoldenHearts(this,this->_goldenHearts - iVar11);
|
|
this->_goldenHearts = iVar11;
|
|
}
|
|
}
|
|
update_bone_hearts(this);
|
|
UpdateHeartDependentEffects(this);
|
|
ClampGoldenHearts(pEVar3,0);
|
|
update_bone_hearts(pEVar3);
|
|
UpdateHeartDependentEffects(pEVar3);
|
|
(this->_history)._isLocked = 1;
|
|
pvVar10 = (this->_history)._historyItems._begin;
|
|
if (pvVar10 != (this->_history)._historyItems._end) {
|
|
uVar8 = heartRng._seed;
|
|
do {
|
|
local_40 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar10) + 8));
|
|
local_2d = '\0';
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar10) + 4)) == '\0') {
|
|
local_38.y = (float)(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(local_40);
|
|
bVar2 = CanRerollCollectible(this,local_40,0);
|
|
if (((bVar2 != 0) && (*GHIDRA_CAST<int *>(local_38.y) != 3)) &&
|
|
(local_44 = (float)(local_40 * 4),
|
|
0 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_collectibleCounts)._begin) + GHIDRA_INT(local_44))))) {
|
|
if (uVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar8 = uVar8 >> ((byte)heartRng._shift1 & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 << ((byte)heartRng._shift2 & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 >> ((byte)heartRng._shift3 & 0x1f) ^ uVar8;
|
|
if ((uVar8 & 1) == 0) {
|
|
piVar7 = GHIDRA_CAST<int *>((GHIDRA_INT(local_44) + GHIDRA_INT((local_3c->_collectibleCounts)._begin)));
|
|
*piVar7 = *piVar7 + 1;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_38.y) + 0x48)))->_overlayAnimState)).
|
|
_currentlyTriggeredEvents + 2)) != '\0') {
|
|
AddCostume(local_3c,GHIDRA_CAST<ItemConfig_Item *>(local_38.y),0);
|
|
}
|
|
(GHIDRA_CAST<History *>((&local_3c->_history)))->History::AddHistoryItem(pvVar10);
|
|
piVar7 = GHIDRA_CAST<int *>(std)::vector<HistoryItem>::erase(&local_50,pvVar10);
|
|
pvVar10 = (void *)*piVar7;
|
|
History::remove_index_refs
|
|
(&this->_history,
|
|
(GHIDRA_INT(pvVar10) - GHIDRA_INT((this->_history)._historyItems._begin)) / 0x1c);
|
|
local_2d = '\x01';
|
|
RemoveCollectible(this,local_40,1,0,1);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar9 = local_40 & 0x7fff;
|
|
pvVar6 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (GHIDRA_INT(uVar9) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar6) >> 2) {
|
|
local_38.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + uVar9 * 4));
|
|
}
|
|
else {
|
|
local_38.y = 0.0;
|
|
}
|
|
pvVar6 = (this->_smeltedTrinkets)._begin;
|
|
local_44 = (float)(uVar9 * 4);
|
|
if ((0 < *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar6) + GHIDRA_INT(local_44)))) ||
|
|
(0 < *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar6) + GHIDRA_INT(local_44) + 2)))) {
|
|
if (uVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar8 = uVar8 >> ((byte)heartRng._shift1 & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 << ((byte)heartRng._shift2 & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 >> ((byte)heartRng._shift3 & 0x1f) ^ uVar8;
|
|
if ((uVar8 & 1) == 0) {
|
|
pvVar6 = (local_3c->_smeltedTrinkets)._begin;
|
|
if ((*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar6) + GHIDRA_INT(local_44))) < 1) &&
|
|
(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar6) + GHIDRA_INT(local_44) + 2)) < 1)) {
|
|
AddCostume(local_3c,GHIDRA_CAST<ItemConfig_Item *>(local_38.y),0);
|
|
pvVar6 = (local_3c->_smeltedTrinkets)._begin;
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar10) + 8)) & 0x8000) == 0) {
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(local_44) + GHIDRA_INT(pvVar6))) =
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(local_44) + GHIDRA_INT(pvVar6))) + 1;
|
|
}
|
|
else {
|
|
smeltedCount = GHIDRA_CAST<short *>((GHIDRA_INT(local_44) + 2 + GHIDRA_INT(pvVar6)));
|
|
*smeltedCount = *smeltedCount + 1;
|
|
}
|
|
(GHIDRA_CAST<History *>((&local_3c->_history)))->History::AddHistoryItem(pvVar10);
|
|
TryRemoveSmeltedTrinket(this,*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar10) + 8)));
|
|
piVar7 = GHIDRA_CAST<int *>(std)::vector<HistoryItem>::erase(&twinRedHearts,pvVar10);
|
|
pvVar10 = (void *)*piVar7;
|
|
History::remove_index_refs
|
|
(&this->_history,
|
|
(GHIDRA_INT(pvVar10) - GHIDRA_INT((this->_history)._historyItems._begin)) / 0x1c);
|
|
local_2d = '\x01';
|
|
}
|
|
}
|
|
}
|
|
pvVar6 = (void *)(GHIDRA_INT(pvVar10) + 0x1c);
|
|
if (local_2d != '\0') {
|
|
pvVar6 = pvVar10;
|
|
}
|
|
pvVar10 = pvVar6;
|
|
} while (pvVar6 != (this->_history)._historyItems._end);
|
|
pEVar3 = local_3c;
|
|
}
|
|
(this->_history)._isLocked = 0;
|
|
pEVar3->_cacheFlags = 0xffff;
|
|
EvaluateItems(pEVar3);
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
uVar9 = 0;
|
|
uVar8 = GetMaxPocketItems(this);
|
|
if (uVar8 != 0) {
|
|
do {
|
|
pos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_38,&this->_pos,0.0,0,0,0);
|
|
DropPocketItem(this,uVar9,pos);
|
|
uVar9 = uVar9 + 1;
|
|
uVar8 = GetMaxPocketItems(this);
|
|
} while (uVar9 < uVar8);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (this->_playerType == 0x13) goto LAB_007cecd9;
|
|
if (unk != 0) goto LAB_007ceccc;
|
|
iVar11 = this->_soulHearts;
|
|
local_38.y = (float)*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(twinPlayer) + 0x1da0));
|
|
piVar7 = &this->_brokenHearts;
|
|
pfVar4 = &local_38.y;
|
|
if (GHIDRA_INT(*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(twinPlayer) + 0x1da0))) <= *piVar7) {
|
|
pfVar4 = GHIDRA_CAST<float *>(piVar7);
|
|
}
|
|
*piVar7 = GHIDRA_INT(*pfVar4);
|
|
AddMaxHearts(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twinPlayer) + 0x1340)),0);
|
|
AddBoneHearts(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x1d88)));
|
|
AddEternalHearts(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x1348)));
|
|
AddHearts(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x1344)),1,0);
|
|
AddSoulHearts(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x134c)),0);
|
|
AddGoldenHearts(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x194c)),0);
|
|
this->_blackHearts =
|
|
this->_blackHearts |
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x1350)) << ((byte)(iVar11 / 2) & 0x1f);
|
|
iVar11 = this->_rottenHearts + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x1da4));
|
|
iVar5 = (this->_redHearts + 1) / 2;
|
|
if (iVar5 < iVar11) {
|
|
iVar11 = iVar5;
|
|
}
|
|
this->_rottenHearts = iVar11;
|
|
UpdateBlackHeartMask(this);
|
|
}
|
|
if ((this->_playerType == 0x12) && (0 < this->_soulHearts)) {
|
|
AddSoulCharge(this,this->_soulHearts);
|
|
game = g_game;
|
|
this->_soulHearts = 0;
|
|
if (*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) {
|
|
this->_blackHearts = 0;
|
|
}
|
|
iVar11 = GetHealthType(this);
|
|
if ((iVar11 == 1) || (iVar11 == 2)) {
|
|
iVar11 = this->_maxHearts;
|
|
}
|
|
else {
|
|
iVar11 = this->_maxHearts + this->_boneHearts * 2;
|
|
}
|
|
if (iVar11 < 1) {
|
|
this->_maxHearts = 2;
|
|
this->_redHearts = 2;
|
|
}
|
|
}
|
|
if (this->_playerType == 0x19) {
|
|
poop_spell_roll(this);
|
|
}
|
|
if (this->_config == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Player Config invalid!\n"));
|
|
}
|
|
pvVar10 = (this->_sprite)._animState._animData;
|
|
if (pvVar10 == (void *)0x0) {
|
|
animNameCapacity = 2.10195e-44;
|
|
animNameSize = (void *)0x0;
|
|
animName[0] = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(animName))))->std::string::string(pvVar10);
|
|
}
|
|
local_8 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_2d = (this->_sprite)._animState._isPlaying;
|
|
local_44 = (this->_sprite)._animState._animFrame;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),0);
|
|
update_player_skin(this);
|
|
this->ResetColor();
|
|
RemoveCollectible(this,oldPlayerType,extraout_ECX);
|
|
if (animNameSize == (void *)0x0) goto LAB_007cf515;
|
|
if (local_2d == 0) {
|
|
pEVar3 = GHIDRA_CAST<Entity_Player *>(animName);
|
|
if (0xf < GHIDRA_UINT(animNameCapacity)) {
|
|
pEVar3 = animName[0];
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(pEVar3),1);
|
|
if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_44)),
|
|
(this->_sprite)._animState._animData != (void *)0x0)) {
|
|
(this->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
goto LAB_007cf515;
|
|
}
|
|
curAnim = (this->_sprite)._animState._animData;
|
|
local_38.y = (float)animName;
|
|
if (0xf < GHIDRA_UINT(animNameCapacity)) {
|
|
local_38.y = (float)animName[0];
|
|
}
|
|
if (curAnim == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007cf49f:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(local_38.y),1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
nameCursor = curAnim;
|
|
pEVar3 = GHIDRA_CAST<Entity_Player *>(local_38.y);
|
|
if (0xf < *GHIDRA_CAST<uint *>((curAnim + 0x14))) {
|
|
nameCursor = *GHIDRA_CAST<byte **>(curAnim);
|
|
}
|
|
do {
|
|
bVar2 = *nameCursor;
|
|
isLess = bVar2 < *GHIDRA_CAST<byte *>(pEVar3);
|
|
if (bVar2 != *GHIDRA_CAST<byte *>(pEVar3)) {
|
|
LAB_007cf486:
|
|
uVar8 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007cf48b;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = nameCursor[1];
|
|
isLess = bVar2 < (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((byte)pEVar3)) + 0x1)));
|
|
if (bVar2 != (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar3)) + 0x1)))) goto LAB_007cf486;
|
|
nameCursor = nameCursor + 2;
|
|
pEVar3 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar3)) + 0x2))));
|
|
} while (bVar2 != 0);
|
|
uVar8 = 0;
|
|
LAB_007cf48b:
|
|
if ((uVar8 != 0) || ((curAnim[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_007cf49f;
|
|
}
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(local_44);
|
|
}
|
|
LAB_007cf515:
|
|
if (unk == 0) {
|
|
if (this->_playerType == 0x23) {
|
|
pEVar3 = InitTwin(this,0x28);
|
|
InitPostLevelInitStats(pEVar3);
|
|
}
|
|
else if ((this->_playerType == 0x1d) && (this->_backupPlayer == (void *)0x0)) {
|
|
local_38.y = (float)operator_new(0x2f00);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
if (GHIDRA_CAST<Entity_Player *>(local_38.y) == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
piVar7 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
constructor(GHIDRA_CAST<Entity_Player *>(local_38.y));
|
|
piVar7 = extraout_EAX;
|
|
}
|
|
local_8 = GHIDRA_CAST<Entity_Player *>(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8));
|
|
this->_backupPlayer = piVar7;
|
|
(**(code **)(*piVar7 + 4))(this->_type,this->_variant,0x26,this->_initSeed);
|
|
*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this->_backupPlayer) + 0x1e6c)) = this;
|
|
}
|
|
}
|
|
this->_cacheFlags = 0xffff;
|
|
EvaluateItems(this);
|
|
apply_innate_collectibles(this);
|
|
UpdateCostumes(this);
|
|
if (0xf < GHIDRA_UINT(animNameCapacity)) {
|
|
uVar8 = GHIDRA_INT(animNameCapacity) + 1;
|
|
pEVar3 = animName[0];
|
|
if (0xfff < uVar8) {
|
|
pEVar3 = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(animName[0][-1])) + 0x2efc))));
|
|
uVar8 = GHIDRA_INT(animNameCapacity) + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(animName[0]) + (-4 - GHIDRA_INT(pEVar3))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pEVar3,uVar8);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007cf610
|
|
void Entity_Player::RemoveCollectible(int param_2)
|
|
{
|
|
code *pcVar1;
|
|
byte bVar2;
|
|
int playerType;
|
|
undefined4 *eraseResult;
|
|
uint uVar3;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *this_00;
|
|
Entity_Player *extraout_ECX_00;
|
|
void *pvVar4;
|
|
bool isPairedType;
|
|
undefined1 eraseOut [4];
|
|
undefined4 tempEffect;
|
|
undefined4 local_28;
|
|
int effectCooldown;
|
|
undefined4 local_20;
|
|
Entity_Player *local_1c;
|
|
undefined8 local_14;
|
|
undefined4 local_8;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((eraseOut + 0x2c));
|
|
playerType = this->_playerType;
|
|
if (param_2 == playerType) {
|
|
return;
|
|
}
|
|
if (playerType == 0x25) {
|
|
isPairedType = param_2 == 0x27;
|
|
LAB_007cf648:
|
|
if (isPairedType) {
|
|
return;
|
|
}
|
|
}
|
|
else if (playerType == 0x27) {
|
|
isPairedType = param_2 == 0x25;
|
|
goto LAB_007cf648;
|
|
}
|
|
if (this->_twinPlayer != (EntityPtr)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_twinPlayer) + 0x13c0)) == param_2) {
|
|
return;
|
|
}
|
|
if (param_2 == 0x13) {
|
|
if (playerType == 0x13) goto LAB_007cf690;
|
|
}
|
|
else {
|
|
if (param_2 != 0x23) goto LAB_007cf67f;
|
|
if (playerType == 0x23) goto LAB_007cf690;
|
|
}
|
|
remove_twin();
|
|
}
|
|
LAB_007cf67f:
|
|
if ((param_2 == 0x1d) || (param_2 == 0x26)) {
|
|
remove_twin();
|
|
}
|
|
LAB_007cf690:
|
|
playerType = this->_playerType;
|
|
if (playerType == 0x15) {
|
|
bVar2 = HasCollectible(this,0x26b,0);
|
|
(this->_history)._isLocked = 1;
|
|
pvVar4 = (this->_history)._historyItems._begin;
|
|
this_00 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT((bVar2 != 0)) * 4 + 8));
|
|
local_1c = this_00;
|
|
if (pvVar4 != (this->_history)._historyItems._end) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar4) + 4)) == '\0') {
|
|
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar4) + 8));
|
|
bVar2 = CanAddCollectibleToInventory(this_00,uVar3);
|
|
this_00 = extraout_ECX;
|
|
if (bVar2 == 0) goto LAB_007cf6f6;
|
|
if (0 < GHIDRA_INT(local_1c)) {
|
|
this_00 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_1c[-1])) + 0x2eff))));
|
|
local_1c = this_00;
|
|
goto LAB_007cf6f6;
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_collectibleCounts)._begin) + uVar3 * 4))) {
|
|
RemoveCollectible(this,uVar3,1,0,1);
|
|
}
|
|
eraseResult = GHIDRA_CAST<undefined4 *>(std)::vector<HistoryItem>::erase(eraseOut,pvVar4);
|
|
pvVar4 = (void *)*eraseResult;
|
|
this_00 = extraout_ECX_00;
|
|
}
|
|
else {
|
|
LAB_007cf6f6:
|
|
pvVar4 = (void *)(GHIDRA_INT(pvVar4) + 0x1c);
|
|
}
|
|
} while (pvVar4 != (this->_history)._historyItems._end);
|
|
}
|
|
(this->_history)._isLocked = 0;
|
|
FUN_00721eb0();
|
|
playerType = this->_playerType;
|
|
}
|
|
if (((playerType == 0x25) || (playerType == 0x27)) &&
|
|
(bVar2 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x6d), bVar2 == 0)) {
|
|
pvVar4 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar4) & 0xfffffffcU)) < 0x1b5) {
|
|
tempEffect = 0;
|
|
}
|
|
else {
|
|
tempEffect = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar4) + 0x1b4));
|
|
}
|
|
local_28 = 0;
|
|
local_20 = 0;
|
|
local_14 = 0x70000000b;
|
|
uVar3 = (g_game->_devilAngelRoomRNG)._seed;
|
|
local_1c = GHIDRA_CAST<Entity_Player *>(0xc);
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = uVar3 >> 0xb ^ uVar3;
|
|
uVar3 = uVar3 << 7 ^ uVar3;
|
|
effectCooldown = ((uVar3 >> 0xc ^ uVar3) % 3) * 0x1e + 100;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&tempEffect,1,1);
|
|
}
|
|
if (param_2 == 0x23) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x80;
|
|
this->_canFly = 1;
|
|
EvaluateItems(this);
|
|
}
|
|
playerType = this->_playerType;
|
|
if ((playerType < 0) ||
|
|
(pvVar4 = (g_manager->_entityConfig)._players._begin,
|
|
(GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(pvVar4)) / 0x148 <= playerType)) {
|
|
pvVar4 = (void *)0x0;
|
|
}
|
|
else {
|
|
pvVar4 = (void *)(playerType * 0x148 + GHIDRA_INT(pvVar4));
|
|
}
|
|
SetPocketActiveItem(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0xf0)),2,0);
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,1,1);
|
|
return;
|
|
}
|
|
|
|
// 007cf8c0
|
|
byte Entity_Player::IsLocalPlayer()
|
|
{
|
|
byte isLocal;
|
|
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
return 1;
|
|
}
|
|
isLocal = (GHIDRA_CAST<NetplayManager *>((&g_manager->_netplayManager)))->NetplayManager::IsIdxLocalPlayer(this->_controllerIndex);
|
|
return isLocal;
|
|
}
|
|
|
|
// 007d12c0
|
|
void Entity_Player::GetGlyphOfBalanceDrop(int *variant, int *subtype)
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
uint bombsOrMana;
|
|
EntityList_EL *trinketList;
|
|
int effectiveMaxHearts;
|
|
bool isQueryMade;
|
|
Entity_Player *this_00;
|
|
Entity_Player *this_01;
|
|
EntityList_EL trinketQuery;
|
|
bool isDropTrinket;
|
|
bool isSoulHealth;
|
|
|
|
isQueryMade = false;
|
|
iVar1 = GetHealthType(this);
|
|
if (((iVar1 == 0) || (iVar1 = GetHealthType(this_00), iVar1 == 4)) && (this->_playerType != 0x12))
|
|
{
|
|
isSoulHealth = true;
|
|
}
|
|
else {
|
|
isSoulHealth = false;
|
|
}
|
|
if (this->_redHearts < 2) {
|
|
iVar1 = GetHealthType(this);
|
|
if ((iVar1 == 1) || (iVar1 == 2)) {
|
|
iVar1 = this->_maxHearts;
|
|
}
|
|
else {
|
|
iVar1 = this->_maxHearts + this->_boneHearts * 2;
|
|
}
|
|
if ((1 < iVar1) &&
|
|
((iVar1 = GetHealthType(this), iVar1 == 0 || (iVar1 = GetHealthType(this_01), iVar1 == 4))))
|
|
goto LAB_007d15d3;
|
|
}
|
|
iVar1 = GetHealthType(this);
|
|
if ((iVar1 == 1) || (iVar1 == 2)) {
|
|
iVar1 = this->_maxHearts;
|
|
}
|
|
else {
|
|
iVar1 = this->_maxHearts + this->_boneHearts * 2;
|
|
}
|
|
if (((iVar1 == 0) && (this->_soulHearts < 4)) && (isSoulHealth)) goto LAB_007d1599;
|
|
if (this->_numKeys < 1) {
|
|
LAB_007d1505:
|
|
if (*variant != 0x1e) {
|
|
*variant = 0x1e;
|
|
*subtype = 0;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
iVar1 = this->_playerType;
|
|
if (iVar1 == 0x19) {
|
|
if (this->_poopMana < 1) {
|
|
if (*variant == 0x2a) {
|
|
return;
|
|
}
|
|
*variant = 0x2a;
|
|
*subtype = 1;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (this->_numBombs < 1) goto LAB_007d1541;
|
|
if (iVar1 == 0x12) {
|
|
if (this->_effectiveSoulCharge < 1) goto LAB_007d1599;
|
|
}
|
|
else if ((iVar1 == 0x24) && (this->_effectiveBloodCharge < 1)) goto LAB_007d15d3;
|
|
}
|
|
iVar2 = GetEffectiveMaxHearts(this);
|
|
if (((this->_redHearts < iVar2) && (iVar2 = GetEffectiveMaxHearts(this), -1 < iVar2)) &&
|
|
(iVar2 = GetHealthType(this), iVar2 != 3)) goto LAB_007d15d3;
|
|
if (4 < this->_numCoins) {
|
|
if (iVar1 == 0x19) {
|
|
bombsOrMana = this->_poopMana;
|
|
}
|
|
else {
|
|
bombsOrMana = GHIDRA_UINT((4 < this->_numBombs));
|
|
}
|
|
if (((bombsOrMana == 0) || (this->_numKeys < 5)) || (this->_trinketsID[0] != 0)) {
|
|
LAB_007d14a0:
|
|
isDropTrinket = false;
|
|
}
|
|
else {
|
|
trinketList = EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&trinketQuery,5,0x15e,
|
|
-1,0,0);
|
|
isQueryMade = true;
|
|
if (trinketList->_size != 0) goto LAB_007d14a0;
|
|
isDropTrinket = true;
|
|
}
|
|
if (isQueryMade) {
|
|
(GHIDRA_CAST<EntityList_Query *>((&trinketQuery)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
if (isDropTrinket) {
|
|
*variant = 0x15e;
|
|
*subtype = 0;
|
|
return;
|
|
}
|
|
if (0xe < this->_numCoins) {
|
|
if (4 < this->_numKeys) {
|
|
iVar1 = this->_playerType;
|
|
if (iVar1 == 0x19) {
|
|
if (this->_poopMana < 5) {
|
|
if (*variant == 0x2a) {
|
|
return;
|
|
}
|
|
*variant = 0x2a;
|
|
*subtype = 1;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (this->_numBombs < 5) {
|
|
LAB_007d1541:
|
|
if (*variant == 0x28) {
|
|
return;
|
|
}
|
|
*variant = 0x28;
|
|
*subtype = 0;
|
|
return;
|
|
}
|
|
if (iVar1 == 0x12) {
|
|
if (this->_effectiveSoulCharge < 0xc) goto LAB_007d1599;
|
|
}
|
|
else if ((iVar1 == 0x24) && (this->_effectiveBloodCharge < 0xc)) {
|
|
LAB_007d15d3:
|
|
if (*variant == 10) {
|
|
return;
|
|
}
|
|
*variant = 10;
|
|
*subtype = 1;
|
|
return;
|
|
}
|
|
}
|
|
iVar2 = GetHeartLimit(this,0);
|
|
effectiveMaxHearts = GetEffectiveMaxHearts(this);
|
|
iVar1 = 0xc;
|
|
if (iVar2 < 0xc) {
|
|
iVar1 = iVar2;
|
|
}
|
|
if (iVar1 <= effectiveMaxHearts + this->_soulHearts) {
|
|
return;
|
|
}
|
|
if (!isSoulHealth) {
|
|
return;
|
|
}
|
|
LAB_007d1599:
|
|
if (*variant == 10) {
|
|
if (*subtype == 3) {
|
|
return;
|
|
}
|
|
if (*subtype == 6) {
|
|
return;
|
|
}
|
|
}
|
|
*variant = 10;
|
|
*subtype = 3;
|
|
return;
|
|
}
|
|
goto LAB_007d1505;
|
|
}
|
|
}
|
|
if (*variant != 0x14) {
|
|
*variant = 0x14;
|
|
*subtype = 0;
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d1620
|
|
void Entity_Player::GetEnterPosition(Vector *buffer)
|
|
{
|
|
uint enterDoor;
|
|
Vector *levelEnterPos;
|
|
uint attempt;
|
|
float doorY;
|
|
float doorX;
|
|
Vector enterPosBuf;
|
|
Vector enterPosBuf2;
|
|
int doorGridIndex;
|
|
Game *game;
|
|
int gridWidth;
|
|
|
|
enterDoor = g_game->_enterDoor;
|
|
if (enterDoor == 0xffffffff) {
|
|
enterDoor = Random();
|
|
enterDoor = enterDoor & 7;
|
|
attempt = 0;
|
|
do {
|
|
if ((enterDoor < 8) &&
|
|
((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10)) + 0x38 + (enterDoor >> 5) * 4
|
|
)) & 1 << ((byte)enterDoor & 0x1f)) != 0)) break;
|
|
enterDoor = enterDoor + 1 & 0x80000007;
|
|
if (GHIDRA_INT(enterDoor) < 0) {
|
|
enterDoor = (enterDoor - 1 | 0xfffffff8) + 1;
|
|
}
|
|
attempt = attempt + 1;
|
|
} while (attempt < 8);
|
|
}
|
|
game = g_game;
|
|
buffer->y = 0.0;
|
|
buffer->x = 0.0;
|
|
levelEnterPos = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetEnterPosition(&enterPosBuf);
|
|
if ((levelEnterPos->x == g_vectorZero.x) && (levelEnterPos->y == g_vectorZero.y)) {
|
|
doorY = g_vectorZero.y;
|
|
doorX = g_vectorZero.x;
|
|
if (enterDoor < 8) {
|
|
doorGridIndex = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + enterDoor * 4 + 0x744));
|
|
gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
doorX = (float)(doorGridIndex % gridWidth) * 40.0 + 40.0;
|
|
doorY = (float)(doorGridIndex / gridWidth) * 40.0 + 120.0;
|
|
}
|
|
buffer->x = doorX;
|
|
buffer->y = doorY;
|
|
enterDoor = enterDoor & 0x80000003;
|
|
if (GHIDRA_INT(enterDoor) < 0) {
|
|
enterDoor = (enterDoor - 1 | 0xfffffffc) + 1;
|
|
}
|
|
switch(enterDoor) {
|
|
case 0:
|
|
buffer->x = doorX + 40.0;
|
|
buffer->y = doorY + 0.0;
|
|
return;
|
|
case 1:
|
|
buffer->y = doorY + 40.0;
|
|
buffer->x = doorX + 0.0;
|
|
return;
|
|
case 2:
|
|
buffer->x = doorX - 40.0;
|
|
buffer->y = doorY - 0.0;
|
|
return;
|
|
case 3:
|
|
buffer->y = doorY - 40.0;
|
|
buffer->x = doorX - 0.0;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
levelEnterPos = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetEnterPosition(&enterPosBuf2);
|
|
buffer->x = levelEnterPos->x;
|
|
buffer->y = levelEnterPos->y;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d1860
|
|
Entity_Familiar * Entity_Player::AddMinisaac(Vector *position, byte isPlayAnim)
|
|
{
|
|
byte bVar1;
|
|
uint uVar2;
|
|
uint seed;
|
|
Entity_Familiar *minisaac;
|
|
byte *curAnimName;
|
|
Entity *bloodSplat;
|
|
char *appearName;
|
|
byte *splatAnimName;
|
|
bool bVar3;
|
|
float fVar4;
|
|
float fVar5;
|
|
float fVar6;
|
|
Vector local_24;
|
|
Vector local_1c;
|
|
Entity_Player *player;
|
|
Vector launchVelocity;
|
|
byte *animData;
|
|
Manager *manager;
|
|
|
|
player = this;
|
|
if (isPlayAnim == 0) {
|
|
launchVelocity.x = g_vectorZero.x;
|
|
launchVelocity.y = g_vectorZero.y;
|
|
}
|
|
else {
|
|
uVar2 = Random();
|
|
local_24.x = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_24.x = local_24.x + local_24.x;
|
|
uVar2 = Random();
|
|
local_1c.x = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0;
|
|
fVar4 = cos(local_24.x);
|
|
launchVelocity.x = fVar4 * local_1c.x;
|
|
fVar4 = sin(local_24.x);
|
|
launchVelocity.y = fVar4 * local_1c.x;
|
|
}
|
|
local_1c.x = (float)&launchVelocity;
|
|
local_24.x = launchVelocity.x;
|
|
local_24.y = launchVelocity.y;
|
|
uVar2 = this->_headColor + 1;
|
|
if (this->_headColor < 0) {
|
|
uVar2 = 0;
|
|
}
|
|
if (this->_playerType == 0x10) {
|
|
uVar2 = 99;
|
|
}
|
|
seed = Random();
|
|
minisaac = (Entity_Familiar *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0xe4,position,&local_24,GHIDRA_CAST<Entity *>(this),uVar2,seed,0);
|
|
if (isPlayAnim == 0) goto LAB_007d1be2;
|
|
*GHIDRA_CAST<uint *>(&minisaac->_flags) = GHIDRA_UINT(minisaac->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&minisaac->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&minisaac->_flags) + 4));
|
|
animData = (minisaac->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007d19f9:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&minisaac->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Appear"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(minisaac->_sprite)._animState)))->AnimationState::Rewind();
|
|
(minisaac->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
appearName = "Appear";
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
bVar3 = bVar1 < (byte)*appearName;
|
|
if (bVar1 != *appearName) {
|
|
LAB_007d19e3:
|
|
uVar2 = -GHIDRA_UINT(bVar3) | 1;
|
|
goto LAB_007d19e8;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
bVar3 = bVar1 < (byte)appearName[1];
|
|
if (bVar1 != appearName[1]) goto LAB_007d19e3;
|
|
curAnimName = curAnimName + 2;
|
|
appearName = appearName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_007d19e8:
|
|
if ((uVar2 != 0) || ((animData[0x34] != 0 && ((minisaac->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_007d19f9;
|
|
}
|
|
(GHIDRA_CAST<AnimationState *>((&(minisaac->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
minisaac->_state = 1;
|
|
minisaac->_entityCollisionClass = 0;
|
|
uVar2 = Random();
|
|
local_1c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_1c.x) + 4)) * 0.4;
|
|
local_1c.x = *GHIDRA_CAST<float *>(local_1c.x) * 0.4;
|
|
bloodSplat = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,position,&local_1c,GHIDRA_CAST<Entity *>(0x0),1,uVar2,0);
|
|
local_1c.x = (float)bloodSplat;
|
|
uVar2 = Random();
|
|
(bloodSplat->_sprite)._rotation =
|
|
(float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) * 2.3283064e-10 *
|
|
360.0;
|
|
animData = (bloodSplat->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007d1b16:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&bloodSplat->_sprite)))->ANM2::SetAnimation(&DAT_00b1d534,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(bloodSplat->_sprite)._animState)))->AnimationState::Rewind();
|
|
(bloodSplat->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
splatAnimName = &DAT_00b1d534;
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
bVar3 = bVar1 < *splatAnimName;
|
|
if (bVar1 != *splatAnimName) {
|
|
LAB_007d1b00:
|
|
uVar2 = -GHIDRA_UINT(bVar3) | 1;
|
|
goto LAB_007d1b05;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
bVar3 = bVar1 < splatAnimName[1];
|
|
if (bVar1 != splatAnimName[1]) goto LAB_007d1b00;
|
|
curAnimName = curAnimName + 2;
|
|
splatAnimName = splatAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_007d1b05:
|
|
if ((uVar2 != 0) ||
|
|
((animData[0x34] != 0 && ((bloodSplat->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_007d1b16;
|
|
}
|
|
uVar2 = Random();
|
|
fVar4 = local_1c.x;
|
|
manager = g_manager;
|
|
local_1c.x = 4.2039e-44;
|
|
fVar6 = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.4 + 0.8;
|
|
fVar5 = fVar6 * g_vectorOne.y;
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar4) + 0x48)))->_scale).x = fVar6 * g_vectorOne.x;
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar4) + 0x48)))->_scale).y = fVar5;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar4) + 0x354)) = 2000;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1c.x),1.0,2,0,1.0,0.0);
|
|
LAB_007d1be2:
|
|
minisaac->_entityGridCollisionClass = GHIDRA_UINT((player->_canFly == 0)) * 2 + 3;
|
|
return minisaac;
|
|
}
|
|
|
|
// 007d1c10
|
|
undefined4 Entity_Player::play_hurt_effects()
|
|
{
|
|
qword qVar1;
|
|
byte isOwned;
|
|
void *pvVar2;
|
|
int iVar3;
|
|
Entity_Laser *laser;
|
|
Entity_Player *in_ECX;
|
|
uint wispIdx;
|
|
qword *heapCounter;
|
|
uint uVar4;
|
|
int wispCount;
|
|
short local_52;
|
|
undefined1 local_50 [12];
|
|
float local_44 [12];
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
float local_8;
|
|
void *collectibleConfigs;
|
|
Manager *manager;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00b002bd;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((local_44 + 0x10));
|
|
ExceptionList = &local_10;
|
|
pvVar2 = (GHIDRA_CAST<TemporaryEffects *>((&in_ECX->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x146);
|
|
if ((((0 < in_ECX->_damageCooldown) && ((in_ECX->_flags & 0x1000000000) == 0)) ||
|
|
(pvVar2 == (void *)0x0)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 4)) != 2)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
collectibleConfigs = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibleConfigs) >> 2 < 0x147) {
|
|
iVar3 = 0;
|
|
}
|
|
else {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibleConfigs) + 0x518));
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 8)) < *GHIDRA_CAST<int *>((iVar3 + 0x78)) + -5) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&in_ECX->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x146,1);
|
|
isOwned = HasCollectible(in_ECX,0x3b,0);
|
|
if (isOwned == 0) {
|
|
uVar4 = 0;
|
|
do {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 0;
|
|
local_44[0] = -12.0;
|
|
laser = Entity_Laser::ShootAngle
|
|
(5,&in_ECX->_pos,
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)])
|
|
* 90.0,0x1e,GHIDRA_CAST<Vector *>((local_50 + 8)),GHIDRA_CAST<Entity *>(in_ECX),0);
|
|
laser->SetCollisionDamage(0x41400000);
|
|
local_44[1] = 1.0;
|
|
local_44[2] = 1.0;
|
|
local_44[3] = 1.0;
|
|
local_44[4] = 1.0;
|
|
local_44[5] = 1.0;
|
|
local_44[6] = 1.0;
|
|
local_44[7] = 1.0;
|
|
local_44[8] = 1.0;
|
|
local_44[9] = 0.0;
|
|
local_44[10] = 0.0;
|
|
local_44[0xb] = 0.0;
|
|
laser->SetColor(local_44 + 1,0xffffffff,0xff,0,1);
|
|
laser->_disableFollowParent = 1;
|
|
if (uVar4 == 3) {
|
|
laser->_renderDepthOffset = -10.0;
|
|
break;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
laser->_renderDepthOffset = 3000.0;
|
|
} while (uVar4 < 4);
|
|
pvVar2 = (GHIDRA_CAST<TemporaryEffects *>((&in_ECX->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x3a);
|
|
if ((pvVar2 != (void *)0x0) && (0x95 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 8)))) goto LAB_007d1f00;
|
|
pvVar2 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar2) >> 2 < 0x3b) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar2) + 0xe8));
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 0x1e;
|
|
iVar3 = 1;
|
|
}
|
|
else {
|
|
UseActiveItem(in_ECX,&local_52,0x23,9,-1,0);
|
|
manager = g_manager;
|
|
local_44[0] = 1.12104e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_44));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_44[0]),1.0,2,0,1.0,0.0);
|
|
manager = g_manager;
|
|
local_44[0] = 4.76441e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_44));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_44[0]),1.0,2,0,1.0,0.0);
|
|
pvVar2 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar2) >> 2 < 0x70) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 0x96;
|
|
iVar3 = 0x14;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar2) + 0x1bc));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 0x96;
|
|
iVar3 = 0x14;
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = (void *)0x0;
|
|
local_44[0] = 0.0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&in_ECX->_temporaryeffects)))->TemporaryEffects::AddEffect(local_50,1,iVar3);
|
|
LAB_007d1f00:
|
|
isOwned = HasCollectible(in_ECX,0x248,0);
|
|
if (isOwned != 0) {
|
|
iVar3 = 0;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_50),3,0xce,0x146,0,
|
|
0);
|
|
wispIdx = 0;
|
|
local_8 = 0.0;
|
|
wispCount = iVar3;
|
|
if (local_44[0] != 0.0) {
|
|
do {
|
|
iVar3 = wispCount + 1;
|
|
if (*GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) + wispIdx * 4)) + 0x410)) != in_ECX) {
|
|
iVar3 = wispCount;
|
|
}
|
|
wispIdx = wispIdx + 1;
|
|
wispCount = iVar3;
|
|
} while (wispIdx < GHIDRA_UINT(local_44[0]));
|
|
}
|
|
iVar3 = 4 - iVar3;
|
|
if (0 < iVar3) {
|
|
do {
|
|
AddWisp(in_ECX,0x146,&in_ECX->_pos,1,0);
|
|
iVar3 = iVar3 + -1;
|
|
} while (iVar3 != 0);
|
|
}
|
|
if (local_50[0] == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_50)) + 0x4))) != (void *)0x0) {
|
|
uVar4 = *GHIDRA_CAST<uint *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) + -4));
|
|
qVar1 = *heapCounter;
|
|
*GHIDRA_CAST<uint *>(heapCounter) = GHIDRA_UINT(*heapCounter) - uVar4;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar4));
|
|
free(GHIDRA_CAST<uint *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) + -4)));
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
|
|
// 007d2000
|
|
Entity_Player * Entity_Player::InitTwin(int playerType)
|
|
{
|
|
Entity_Player *twin;
|
|
Vector *safePos;
|
|
Vector VStack_10;
|
|
Game *game;
|
|
float playerX;
|
|
float playerY;
|
|
|
|
twin = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::SpawnCoPlayer2(playerType);
|
|
if (twin->_twinPlayer != (EntityPtr)this) {
|
|
if (twin->_twinPlayer != (EntityPtr)0x0) {
|
|
VStack_10.x = (float)&twin->_twinPlayer;
|
|
std::multiset<unsigned_int>::erase(&VStack_10);
|
|
}
|
|
twin->_twinPlayer = (EntityPtr)this;
|
|
if (this != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(&twin->_twinPlayer);
|
|
}
|
|
}
|
|
if (this->_twinPlayer != (EntityPtr)twin) {
|
|
if (this->_twinPlayer != (EntityPtr)0x0) {
|
|
VStack_10.x = (float)&this->_twinPlayer;
|
|
std::multiset<unsigned_int>::erase(&VStack_10);
|
|
}
|
|
this->_twinPlayer = (EntityPtr)twin;
|
|
if (twin != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(&this->_twinPlayer);
|
|
}
|
|
}
|
|
SetControllerIndex(twin,this->_controllerIndex,0);
|
|
VStack_10.x = (this->_pos).x;
|
|
VStack_10.y = (this->_pos).y;
|
|
safePos = PlayerManager::find_safe_spawn_position(&VStack_10,this->_pos);
|
|
(twin->_pos).x = safePos->x;
|
|
game = g_game;
|
|
(twin->_pos).y = safePos->y;
|
|
playerY = (this->_pos).y;
|
|
playerX = (this->_pos).x;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((twin)) + 0x1e50)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1e50))));
|
|
(twin->_pos).y = playerY + 0.0;
|
|
(twin->_pos).x = playerX + 20.0;
|
|
(this->_pos).x = (this->_pos).x - 20.0;
|
|
(this->_pos).y = (this->_pos).y + 0.0;
|
|
(GHIDRA_CAST<HUD *>((&game->_hud)))->HUD::AssignPlayerHUDs();
|
|
return twin;
|
|
}
|
|
|
|
// 007d2170
|
|
byte Entity_Player::TryHoldEntity(Entity *entity)
|
|
{
|
|
int iVar1;
|
|
byte bVar2;
|
|
Entity_Player *local_c [2];
|
|
qword flags;
|
|
uint *flagsHigh;
|
|
void **heldSlot;
|
|
Manager *manager;
|
|
|
|
if (this->_heldEntity != (void *)0x0) {
|
|
return 0;
|
|
}
|
|
if (entity == GHIDRA_CAST<Entity *>(0x0)) {
|
|
return 0;
|
|
}
|
|
this->_isHeldEntityVisible = entity->_visible;
|
|
this->_heldEntityGridCollisionClass = entity->_entityGridCollisionClass;
|
|
this->_heldEntityCollisionClass = entity->_entityCollisionClass;
|
|
iVar1 = entity->_type;
|
|
local_c[0] = this;
|
|
if (iVar1 == 4) {
|
|
if (entity->_entityCollisionClass == 0) {
|
|
return 0;
|
|
}
|
|
if (entity->_dead != 0) {
|
|
return 0;
|
|
}
|
|
iVar1 = this->_type;
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x2000020;
|
|
entity->_spawnerType = iVar1;
|
|
*GHIDRA_CAST<int *>(&entity->_flags) = GHIDRA_INT(entity->_flags);
|
|
(entity->_posOffset).x = g_vectorZero.x;
|
|
(entity->_posOffset).y = g_vectorZero.y;
|
|
bVar2 = (GHIDRA_CAST<Entity_Bomb *>((GHIDRA_CAST<Entity_Bomb *>(entity))))->Entity_Bomb::IsRocket();
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&entity->_sprite)))->ANM2::Play(s_Idle,0);
|
|
(entity->_sprite)._rotation = 0.0;
|
|
}
|
|
goto LAB_007d23e6;
|
|
}
|
|
if (iVar1 == 1000) {
|
|
if (entity->_variant == 0x88) {
|
|
iVar1 = this->_type;
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x20;
|
|
entity->_spawnerType = iVar1;
|
|
*GHIDRA_CAST<int *>(&entity->_flags) = GHIDRA_INT(entity->_flags);
|
|
(entity->_posOffset).x = 0.0;
|
|
(entity->_posOffset).y = -10.0;
|
|
goto LAB_007d23e6;
|
|
}
|
|
LAB_007d23a4:
|
|
bVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsEnemy();
|
|
if ((bVar2 == 0) || (this->_suplexState != 1)) {
|
|
if (iVar1 != 0xf5) {
|
|
return 0;
|
|
}
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x2000020;
|
|
}
|
|
else {
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x2000000;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar1 != 3) {
|
|
if ((((iVar1 == 1) && (GHIDRA_CAST<Entity_Player *>(entity) != this)) && (entity[4]._health == 4.90454e-44)
|
|
) && ((bVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::HasEntityFlags(0x200000000000000), bVar2 == 0 &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::HasEntityFlags(0x400000000000000), bVar2 == 0)))) {
|
|
(entity->_velocity).x = g_vectorZero.x;
|
|
(entity->_velocity).y = g_vectorZero.y;
|
|
flags = entity->_flags;
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x2000000;
|
|
*GHIDRA_CAST<int *>(&entity->_flags) = GHIDRA_INT(flags);
|
|
bVar2 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>(&entity[5]._sprite._overlayRenderFirst),0x2ca);
|
|
manager = g_manager;
|
|
if (bVar2 != 0) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Player *>(0x248);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c[0]),1.0,2,0,1.0,0.0);
|
|
}
|
|
TemporaryEffects::RemoveCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>(&entity[5]._sprite._overlayRenderFirst),0x2ca,-1);
|
|
goto LAB_007d23e6;
|
|
}
|
|
goto LAB_007d23a4;
|
|
}
|
|
if ((entity->_variant != 0xc9) && (entity->_variant != 0xef)) goto LAB_007d23a4;
|
|
flagsHigh = GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x2000000;
|
|
}
|
|
*GHIDRA_CAST<int *>(&entity->_flags) = GHIDRA_INT(entity->_flags);
|
|
LAB_007d23e6:
|
|
heldSlot = &this->_heldEntity;
|
|
entity->_visible = 0;
|
|
entity->_entityCollisionClass = 0;
|
|
if (*heldSlot != (void *)0x0) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Player *>(heldSlot);
|
|
std::multiset<unsigned_int>::erase(local_c);
|
|
}
|
|
*heldSlot = entity;
|
|
std::multiset<unsigned_int>::insert(heldSlot);
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("LiftItem"));
|
|
(GHIDRA_CAST<ANM2 *>((&this->_heldSprite)))->ANM2::Reset();
|
|
FlushQueueItem(this);
|
|
this->_itemState = 0x25c;
|
|
this->_itemStateCooldown = 0;
|
|
return 1;
|
|
}
|
|
|
|
// 007d2470
|
|
Entity * Entity_Player::ThrowHeldEntity(Vector *Velocity)
|
|
{
|
|
ANM2 other;
|
|
char cVar1;
|
|
Entity_Tear *thrownEntity;
|
|
LayerState *layer;
|
|
Entity *unaff_EBX;
|
|
int *heldEntity;
|
|
byte *layerIndex;
|
|
float fVar2;
|
|
ANM2 aAStackY_8c88 [128];
|
|
undefined1 in_stack_fffffe8c [244];
|
|
float fVar3;
|
|
float fVar4;
|
|
int iVar5;
|
|
int iVar6;
|
|
Vector *local_44;
|
|
undefined4 flagsHigh;
|
|
void **heldEntitySlot;
|
|
Manager *manager;
|
|
|
|
heldEntitySlot = &this->_heldEntity;
|
|
thrownEntity = *heldEntitySlot;
|
|
if (thrownEntity == GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
thrownEntity->_visible = this->_isHeldEntityVisible;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(*heldEntitySlot) + 0x188)) = this->_heldEntityCollisionClass;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(*heldEntitySlot) + 0x184)) = this->_heldEntityGridCollisionClass;
|
|
local_44 = GHIDRA_CAST<Vector *>(GHIDRA_UINT(((this->_flags & 0x100) != 0)));
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>(*heldEntitySlot) + 0x54))();
|
|
heldEntity = *heldEntitySlot;
|
|
iVar5 = heldEntity[10];
|
|
if (cVar1 == '\0') {
|
|
if (iVar5 == 4) {
|
|
if ((heldEntity[0xb] == 0x13) || (heldEntity[0xb] == 0x14)) {
|
|
fVar2 = atan2f(Velocity->y,Velocity->x);
|
|
heldEntity[0x10a] = GHIDRA_INT((fVar2 * 57.295776));
|
|
iVar5 = -0x3ea00000;
|
|
}
|
|
else {
|
|
iVar5 = -0x3e400000;
|
|
heldEntity[0x107] = -0x3f800000;
|
|
}
|
|
heldEntity[0xd3] = 0;
|
|
heldEntity[0xd4] = iVar5;
|
|
heldEntity[0xd8] = GHIDRA_INT(Velocity->x);
|
|
fVar2 = Velocity->y;
|
|
heldEntity[0x5b] = heldEntity[0x5b] & 0xfdffffdf;
|
|
heldEntity[0xd9] = GHIDRA_INT(fVar2);
|
|
heldEntity[0x5a] = heldEntity[0x5a];
|
|
heldEntity[0x10b] = 0x41700000;
|
|
}
|
|
else if (iVar5 == 1000) {
|
|
if (heldEntity[0xb] == 0x88) {
|
|
fVar4 = 5.60519e-44;
|
|
fVar3 = 2.8026e-45;
|
|
fVar2 = 1.1493498e-38;
|
|
thrownEntity = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,0x28,local_44,Velocity,unaff_EBX,
|
|
GHIDRA_UINT(*GHIDRA_CAST<ushort *>((heldEntity + 0x109))) |
|
|
heldEntity[0x108] << 0x10,heldEntity[0x10c],0);
|
|
thrownEntity->SetCollisionDamage();
|
|
if (heldEntity[0x108] == 0xe) {
|
|
thrownEntity->_health = (float)heldEntity[0x10a];
|
|
if (heldEntity[0x109] - 7U < 4) {
|
|
thrownEntity->_baseScale = 3.0;
|
|
thrownEntity->_fScale = 3.0;
|
|
(GHIDRA_CAST<Entity_Tear *>((thrownEntity)))->Entity_Tear::ResetSpriteScale();
|
|
}
|
|
thrownEntity->SetCollisionDamage();
|
|
if (heldEntity[0x10d] == 1) {
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&thrownEntity->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&thrownEntity->_flags) = GHIDRA_UINT(thrownEntity->_flags) | 0x40000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&thrownEntity->_flags) + 4)) = flagsHigh;
|
|
}
|
|
}
|
|
if ((heldEntity[0x108] == 0x19) && (heldEntity[0x10a] == 4)) {
|
|
thrownEntity->SetCollisionDamage();
|
|
}
|
|
thrownEntity->_tearIdx = heldEntity[0x114];
|
|
iVar6 = -0x3e100000;
|
|
iVar5 = 0x7d284a;
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(thrownEntity))))->Entity_Projectile::SetHeight(-30.0);
|
|
thrownEntity->_fallingAccel = 0.8;
|
|
thrownEntity->_fallingSpeed = -5.0;
|
|
thrownEntity->_prismTouched = 1;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(register0x00000010) + -0x174)))))->ANM2::ANM2(GHIDRA_CAST<ANM2 *>((heldEntity + 0x12)));
|
|
other._championColor._offset[0] = fVar2;
|
|
other._filename._buf[0] = in_stack_fffffe8c[0];
|
|
other._filename._buf[1] = in_stack_fffffe8c[1];
|
|
other._filename._buf[2] = in_stack_fffffe8c[2];
|
|
other._filename._buf[3] = in_stack_fffffe8c[3];
|
|
other._filename._buf[4] = in_stack_fffffe8c[4];
|
|
other._filename._buf[5] = in_stack_fffffe8c[5];
|
|
other._filename._buf[6] = in_stack_fffffe8c[6];
|
|
other._filename._buf[7] = in_stack_fffffe8c[7];
|
|
other._filename._buf[8] = in_stack_fffffe8c[8];
|
|
other._filename._buf[9] = in_stack_fffffe8c[9];
|
|
other._filename._buf[10] = in_stack_fffffe8c[10];
|
|
other._filename._buf[0xb] = in_stack_fffffe8c[0xb];
|
|
other._filename._buf[0xc] = in_stack_fffffe8c[0xc];
|
|
other._filename._buf[0xd] = in_stack_fffffe8c[0xd];
|
|
other._filename._buf[0xe] = in_stack_fffffe8c[0xe];
|
|
other._filename._buf[0xf] = in_stack_fffffe8c[0xf];
|
|
other._filename._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x10)));
|
|
other._filename._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x14)));
|
|
other._animDefaultName._buf[0] = in_stack_fffffe8c[0x18];
|
|
other._animDefaultName._buf[1] = in_stack_fffffe8c[0x19];
|
|
other._animDefaultName._buf[2] = in_stack_fffffe8c[0x1a];
|
|
other._animDefaultName._buf[3] = in_stack_fffffe8c[0x1b];
|
|
other._animDefaultName._buf[4] = in_stack_fffffe8c[0x1c];
|
|
other._animDefaultName._buf[5] = in_stack_fffffe8c[0x1d];
|
|
other._animDefaultName._buf[6] = in_stack_fffffe8c[0x1e];
|
|
other._animDefaultName._buf[7] = in_stack_fffffe8c[0x1f];
|
|
other._animDefaultName._buf[8] = in_stack_fffffe8c[0x20];
|
|
other._animDefaultName._buf[9] = in_stack_fffffe8c[0x21];
|
|
other._animDefaultName._buf[10] = in_stack_fffffe8c[0x22];
|
|
other._animDefaultName._buf[0xb] = in_stack_fffffe8c[0x23];
|
|
other._animDefaultName._buf[0xc] = in_stack_fffffe8c[0x24];
|
|
other._animDefaultName._buf[0xd] = in_stack_fffffe8c[0x25];
|
|
other._animDefaultName._buf[0xe] = in_stack_fffffe8c[0x26];
|
|
other._animDefaultName._buf[0xf] = in_stack_fffffe8c[0x27];
|
|
other._animDefaultName._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x28)));
|
|
other._animDefaultName._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x2c)));
|
|
other._animState._animation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x30)));
|
|
other._animState._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x34)));
|
|
other._animState._layerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x38)));
|
|
other._animState._nullLayerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x3c)));
|
|
other._animState._animFrame = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0x40)));
|
|
other._animState._isPlaying = in_stack_fffffe8c[0x44];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other._animState)) + 0x15))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x45)));
|
|
other._animState._currentlyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x48)));
|
|
other._animState._previouslyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x4c)));
|
|
other._overlayAnimState._animation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x50)));
|
|
other._overlayAnimState._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x54)));
|
|
other._overlayAnimState._layerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x58)));
|
|
other._overlayAnimState._nullLayerFrames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x5c)));
|
|
other._overlayAnimState._animFrame = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0x60)));
|
|
other._overlayAnimState._isPlaying = in_stack_fffffe8c[100];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other._overlayAnimState)) + 0x15))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x65)));
|
|
other._overlayAnimState._currentlyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x68)));
|
|
other._overlayAnimState._previouslyTriggeredEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x6c)));
|
|
other._overlayRenderFirst = in_stack_fffffe8c[0x70];
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(other)) + 0x71))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x71)));
|
|
other._animData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x74)));
|
|
other._animCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x78)));
|
|
other._layerState = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x7c)));
|
|
other._layerCount = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x80)));
|
|
other._nullLayerNames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x84)));
|
|
other._numNullLayers = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x88)));
|
|
other._eventNames = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe8c)) + 0x8c)));
|
|
other._numEvents = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_fffffe8c)) + 0x90)));
|
|
other._offset.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0x94)));
|
|
other._offset.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0x98)));
|
|
other._scale.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0x9c)));
|
|
other._scale.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xa0)));
|
|
other._rotation = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xa4)));
|
|
other._color._tint[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xa8)));
|
|
other._color._tint[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xac)));
|
|
other._color._tint[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xb0)));
|
|
other._color._tint[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xb4)));
|
|
other._color._colorize[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xb8)));
|
|
other._color._colorize[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xbc)));
|
|
other._color._colorize[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xc0)));
|
|
other._color._colorize[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xc4)));
|
|
other._color._offset[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xc8)));
|
|
other._color._offset[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xcc)));
|
|
other._color._offset[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xd0)));
|
|
other._championColor._tint[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xd4)));
|
|
other._championColor._tint[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xd8)));
|
|
other._championColor._tint[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xdc)));
|
|
other._championColor._tint[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xe0)));
|
|
other._championColor._colorize[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xe4)));
|
|
other._championColor._colorize[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xe8)));
|
|
other._championColor._colorize[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xec)));
|
|
other._championColor._colorize[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe8c)) + 0xf0)));
|
|
other._championColor._offset[1] = fVar3;
|
|
other._championColor._offset[2] = fVar4;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(other)) + 0x100))) = local_44;
|
|
other._playbackSpeed = (float)Velocity;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(other)) + 0x108))) = unaff_EBX;
|
|
other._shadowLayerIndex = iVar5;
|
|
other._bitflags = iVar6;
|
|
(GHIDRA_CAST<ANM2 *>((&thrownEntity->_sprite)))->ANM2::operator_assign(other);
|
|
layerIndex = GHIDRA_CAST<byte *>(0x0);
|
|
if ((thrownEntity->_sprite)._layerCount != 0) {
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&thrownEntity->_sprite)))->ANM2::GetLayer(layerIndex);
|
|
(layer->_pos).x = g_vectorZero.x;
|
|
(layer->_pos).y = g_vectorZero.y;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&thrownEntity->_sprite)))->ANM2::GetLayer(layerIndex);
|
|
layerIndex = layerIndex + 1;
|
|
(layer->_size).x = g_vectorOne.x;
|
|
(layer->_size).y = g_vectorOne.y;
|
|
} while (layerIndex < GHIDRA_CAST<byte *>((thrownEntity->_sprite)._layerCount));
|
|
}
|
|
thrownEntity->Update();
|
|
iVar5 = *GHIDRA_CAST<int *>(*heldEntitySlot);
|
|
}
|
|
else {
|
|
if (heldEntity[0xb] != 0x76) goto LAB_007d28f9;
|
|
iVar5 = *heldEntity;
|
|
}
|
|
(**(code **)(iVar5 + 0x28))();
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 == 1) {
|
|
heldEntity[0x5b] = heldEntity[0x5b] | 0x4000000;
|
|
*GHIDRA_CAST<undefined1 *>((heldEntity + 0x104)) = 1;
|
|
heldEntity[0x5a] = heldEntity[0x5a];
|
|
heldEntity[0x61] = 3;
|
|
heldEntity = *heldEntitySlot;
|
|
}
|
|
manager = g_manager;
|
|
if (heldEntity[10] == 0xf5) {
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>((GHIDRA_INT(register0x00000010) + -0x50)));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(0x361,1.0,2,0,1.0,0.0);
|
|
heldEntity = *heldEntitySlot;
|
|
}
|
|
heldEntity[0x5b] = heldEntity[0x5b] & 0xfdffffff;
|
|
heldEntity[0x5a] = heldEntity[0x5a];
|
|
}
|
|
LAB_007d28f9:
|
|
if (*heldEntitySlot != (void *)0x0) {
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
*heldEntitySlot = (void *)0x0;
|
|
return GHIDRA_CAST<Entity *>(thrownEntity);
|
|
}
|
|
|
|
// 007d2a00
|
|
void Entity_Player::AddFriendlyDip(int subtype, Vector *position)
|
|
{
|
|
Entity_Familiar::ThrowDip(subtype,position,GHIDRA_CAST<Entity *>(this));
|
|
return;
|
|
}
|
|
|
|
// 007d2a20
|
|
void Entity_Player::ThrowFriendlyDip(int subtype, Vector *position, Vector *target)
|
|
{
|
|
spawn_dip_at(subtype,position,GHIDRA_CAST<Entity *>(this),target);
|
|
return;
|
|
}
|
|
|
|
// 007d2a40
|
|
void Entity_Player::AddBrokenHearts(int amount)
|
|
{
|
|
byte isHasHeartbreak;
|
|
int heartLimit;
|
|
int iVar1;
|
|
int brokenHearts;
|
|
EntityPtr twin;
|
|
|
|
iVar1 = this->_playerType;
|
|
while ((iVar1 == 0x28 && (twin = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)), twin != (EntityPtr)0x0))) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x13c0));
|
|
this = GHIDRA_CAST<Entity_Player *>(twin);
|
|
}
|
|
brokenHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da0)) + amount;
|
|
heartLimit = GetHeartLimit(this,1);
|
|
iVar1 = 0;
|
|
if (0 < brokenHearts) {
|
|
iVar1 = brokenHearts;
|
|
}
|
|
brokenHearts = heartLimit / 2;
|
|
if (iVar1 < heartLimit / 2) {
|
|
brokenHearts = iVar1;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da0)) = brokenHearts;
|
|
AddMaxHearts(this,0,0);
|
|
isHasHeartbreak = HasCollectible(this,0x2b6,0);
|
|
if (isHasHeartbreak != 0) {
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 1;
|
|
EvaluateItems(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d2ad0
|
|
void Entity_Player::AddSoulCharge(int count)
|
|
{
|
|
int oldSoulCharge;
|
|
int *clamped;
|
|
int *capped;
|
|
int chargeBounds [2];
|
|
Game *game;
|
|
|
|
chargeBounds[1] = 99;
|
|
chargeBounds[0] = 0;
|
|
oldSoulCharge = this->_effectiveSoulCharge;
|
|
count = count + oldSoulCharge;
|
|
capped = chargeBounds + 1;
|
|
if (count < 100) {
|
|
capped = &count;
|
|
}
|
|
clamped = chargeBounds;
|
|
if (-1 < *capped) {
|
|
clamped = capped;
|
|
}
|
|
this->_effectiveSoulCharge = *clamped;
|
|
apply_soul_charge_to_actives(this,oldSoulCharge);
|
|
ConsumableCountChanged(this,0x20);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d2b50
|
|
int Entity_Player::GetEffectiveSoulCharge()
|
|
{
|
|
if (this->_playerType == 0x12) {
|
|
return this->_effectiveSoulCharge;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007d2b70
|
|
void Entity_Player::apply_soul_charge_to_actives(int oldSoulCharge)
|
|
{
|
|
byte isHasBulb;
|
|
int iVar1;
|
|
uint proceduralIdx;
|
|
uint itemId;
|
|
int maxCharge;
|
|
uint slot;
|
|
bool isNotProcedural;
|
|
int local_8;
|
|
void *itemList;
|
|
Manager *manager;
|
|
|
|
if (this->_playerType == 0x12) {
|
|
slot = 0;
|
|
do {
|
|
itemId = this->_activeDesc[slot]._item;
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(itemId)) goto LAB_007d2bd3;
|
|
LAB_007d2bf5:
|
|
local_8 = 0;
|
|
}
|
|
else if (GHIDRA_INT(itemId) < 0) {
|
|
proceduralIdx = ~itemId;
|
|
isNotProcedural = -1 < GHIDRA_INT(itemId);
|
|
itemId = proceduralIdx;
|
|
if ((isNotProcedural) ||
|
|
(itemList = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(itemList) >> 2 <=
|
|
GHIDRA_INT(proceduralIdx))) goto LAB_007d2bf5;
|
|
local_8 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(itemList) + proceduralIdx * 4));
|
|
}
|
|
else {
|
|
LAB_007d2bd3:
|
|
itemList = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(itemList) >> 2 <= GHIDRA_INT(itemId))
|
|
goto LAB_007d2bf5;
|
|
local_8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(itemList) + itemId * 4));
|
|
}
|
|
if (slot == 3) {
|
|
maxCharge = 0;
|
|
}
|
|
else if (((slot == 2) && (this->_activeDesc[2]._item == 0x244)) &&
|
|
(g_game->_challenge == 0x2c)) {
|
|
maxCharge = 0;
|
|
}
|
|
else {
|
|
maxCharge = GetCollectibleMaxCharge
|
|
(this,this->_activeDesc[slot]._item,this->_activeDesc[slot]._varData,
|
|
itemId);
|
|
}
|
|
iVar1 = GetActiveMaxCharge(this,slot);
|
|
if (((local_8 != 0) && (iVar1 != 1)) && (0 < maxCharge)) {
|
|
local_8 = GetTotalActiveCharge(this,slot);
|
|
if (this->_playerType == 0x12) {
|
|
iVar1 = this->_effectiveSoulCharge;
|
|
}
|
|
else {
|
|
iVar1 = 0;
|
|
}
|
|
iVar1 = (local_8 - iVar1) + oldSoulCharge;
|
|
if ((iVar1 < local_8) && (iVar1 < maxCharge)) {
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::FlashChargeBar(this,slot);
|
|
iVar1 = local_8;
|
|
manager = g_manager;
|
|
local_8 = 0xda;
|
|
if (iVar1 < maxCharge) {
|
|
local_8 = 0xab;
|
|
}
|
|
seed_fart_sound_override(&local_8);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_8,1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
slot = slot + 1;
|
|
} while (slot < 4);
|
|
isHasBulb = HasTrinket(this,0x65,0);
|
|
if ((isHasBulb == 0) && (isHasBulb = HasTrinket(this,100,0), isHasBulb == 0)) {
|
|
return;
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | 0x40f;
|
|
EvaluateItems(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d2d40
|
|
void Entity_Player::AddBloodCharge(int amount)
|
|
{
|
|
int oldBloodCharge;
|
|
int *clampedPtr;
|
|
int *cappedPtr;
|
|
int bounds [2];
|
|
Game *game;
|
|
|
|
bounds[1] = 99;
|
|
bounds[0] = 0;
|
|
oldBloodCharge = this->_effectiveBloodCharge;
|
|
amount = amount + oldBloodCharge;
|
|
cappedPtr = bounds + 1;
|
|
if (amount < 100) {
|
|
cappedPtr = &amount;
|
|
}
|
|
clampedPtr = bounds;
|
|
if (-1 < *cappedPtr) {
|
|
clampedPtr = cappedPtr;
|
|
}
|
|
this->_effectiveBloodCharge = *clampedPtr;
|
|
blood_charge_changed(this,oldBloodCharge);
|
|
ConsumableCountChanged(this,0x100);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d2dd0
|
|
int Entity_Player::GetEffectiveBloodCharge()
|
|
{
|
|
if (this->_playerType == 0x24) {
|
|
return this->_effectiveBloodCharge;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007d2df0
|
|
void Entity_Player::blood_charge_changed(int oldBloodCharge)
|
|
{
|
|
byte isHasBulb;
|
|
int iVar1;
|
|
uint proceduralIdx;
|
|
uint itemId;
|
|
int maxCharge;
|
|
uint slot;
|
|
bool isNotProcedural;
|
|
int local_8;
|
|
void *itemList;
|
|
Manager *manager;
|
|
|
|
if (this->_playerType == 0x24) {
|
|
slot = 0;
|
|
do {
|
|
itemId = this->_activeDesc[slot]._item;
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(itemId)) goto LAB_007d2e53;
|
|
LAB_007d2e75:
|
|
local_8 = 0;
|
|
}
|
|
else if (GHIDRA_INT(itemId) < 0) {
|
|
proceduralIdx = ~itemId;
|
|
isNotProcedural = -1 < GHIDRA_INT(itemId);
|
|
itemId = proceduralIdx;
|
|
if ((isNotProcedural) ||
|
|
(itemList = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(itemList) >> 2 <=
|
|
GHIDRA_INT(proceduralIdx))) goto LAB_007d2e75;
|
|
local_8 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(itemList) + proceduralIdx * 4));
|
|
}
|
|
else {
|
|
LAB_007d2e53:
|
|
itemList = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(itemList) >> 2 <= GHIDRA_INT(itemId))
|
|
goto LAB_007d2e75;
|
|
local_8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(itemList) + itemId * 4));
|
|
}
|
|
if (slot == 3) {
|
|
maxCharge = 0;
|
|
}
|
|
else if (((slot == 2) && (this->_activeDesc[2]._item == 0x244)) &&
|
|
(g_game->_challenge == 0x2c)) {
|
|
maxCharge = 0;
|
|
}
|
|
else {
|
|
maxCharge = GetCollectibleMaxCharge
|
|
(this,this->_activeDesc[slot]._item,this->_activeDesc[slot]._varData,
|
|
itemId);
|
|
}
|
|
iVar1 = GetActiveMaxCharge(this,slot);
|
|
if (((local_8 != 0) && (iVar1 != 1)) && (0 < maxCharge)) {
|
|
local_8 = GetTotalActiveCharge(this,slot);
|
|
if (this->_playerType == 0x24) {
|
|
iVar1 = this->_effectiveBloodCharge;
|
|
}
|
|
else {
|
|
iVar1 = 0;
|
|
}
|
|
iVar1 = (local_8 - iVar1) + oldBloodCharge;
|
|
if ((iVar1 < local_8) && (iVar1 < maxCharge)) {
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::FlashChargeBar(this,slot);
|
|
iVar1 = local_8;
|
|
manager = g_manager;
|
|
local_8 = 0xda;
|
|
if (iVar1 < maxCharge) {
|
|
local_8 = 0xab;
|
|
}
|
|
seed_fart_sound_override(&local_8);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_8,1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
slot = slot + 1;
|
|
} while (slot < 4);
|
|
isHasBulb = HasTrinket(this,0x65,0);
|
|
if ((isHasBulb == 0) && (isHasBulb = HasTrinket(this,100,0), isHasBulb == 0)) {
|
|
return;
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | 0x40f;
|
|
EvaluateItems(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d2fc0
|
|
void Entity_Player::AddRottenHearts(int amount, byte unk)
|
|
{
|
|
int prevRottenHearts;
|
|
int newRedHearts;
|
|
Entity_Player *this_00;
|
|
Entity_Player *this_01;
|
|
Entity_Player *this_02;
|
|
int iVar2;
|
|
int amount_00;
|
|
int prevRottenHearts;
|
|
|
|
while( true ) {
|
|
while ((iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)), iVar2 == 0x28 &&
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) != (EntityPtr)0x0))) {
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
if (((0 < amount) && (unk == 0)) && (g_game->_challenge == 0x19)) break;
|
|
if ((iVar2 != 0x11) || (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)) == (EntityPtr)0x0)) {
|
|
prevRottenHearts = GetHealthType(this);
|
|
if ((prevRottenHearts != 1) && (prevRottenHearts = GetHealthType(this_00), prevRottenHearts != 2)) {
|
|
prevRottenHearts = GetHealthType(this_01);
|
|
if (prevRottenHearts == 3) {
|
|
if (0 < amount_00) {
|
|
AddBlueFlies(this_02,(amount_00 * 3 + 1) / 2,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),GHIDRA_CAST<Entity *>(0x0)
|
|
);
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
ClampHeartsToLimit(this,0xc,amount_00);
|
|
return;
|
|
}
|
|
prevRottenHearts = amount_00;
|
|
if (((iVar2 == 0x16) && (unk == 0)) && (0 < amount_00)) {
|
|
prevRottenHearts = amount_00 * 2;
|
|
}
|
|
prevRottenHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da4));
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1340)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1d88)) * 2;
|
|
newRedHearts = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) + prevRottenHearts;
|
|
if (newRedHearts < iVar2) {
|
|
iVar2 = newRedHearts;
|
|
}
|
|
if (iVar2 < 0) {
|
|
iVar2 = 0;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1344)) = iVar2;
|
|
if (prevRottenHearts < 1) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da4)) = (prevRottenHearts + -1) / 2 + prevRottenHearts;
|
|
UpdateHeartDependentEffects(this);
|
|
ClampGoldenHearts(this,0);
|
|
update_bone_hearts(this);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x16c)) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x138c)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da4)) = (prevRottenHearts + 1) / 2 + prevRottenHearts;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x168)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x168));
|
|
UpdateHeartDependentEffects(this);
|
|
ClampGoldenHearts(this,0);
|
|
update_bone_hearts(this);
|
|
if (prevRottenHearts < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da4))) {
|
|
_player_hud_set_heart_anim_state(this);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
unk = 0;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)));
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d3180
|
|
bool Entity_Player::CanPickRottenHearts()
|
|
{
|
|
byte isFullHearts;
|
|
int iVar1;
|
|
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
return this->_maxHearts < 0xa0;
|
|
}
|
|
while( true ) {
|
|
while (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x28) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13c0)) != 0x11) ||
|
|
(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)) == (EntityPtr)0x0)) goto LAB_007d31bd;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1d98)));
|
|
}
|
|
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)) == (EntityPtr)0x0) break;
|
|
this = GHIDRA_CAST<Entity_Player *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x1e68)));
|
|
}
|
|
LAB_007d31bd:
|
|
iVar1 = GetHealthType(this);
|
|
if (iVar1 == 3) {
|
|
return false;
|
|
}
|
|
isFullHearts = HasFullHearts(this);
|
|
if ((isFullHearts == 0) ||
|
|
(iVar1 = GetEffectiveMaxHearts(this), *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1da4)) * 2 < iVar1)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// 007d3200
|
|
void Entity_Player::UpdateBookOfVirtues(byte addedBookOfVirtues)
|
|
{
|
|
byte isHasItem;
|
|
int currentActive;
|
|
Game *extraout_ECX;
|
|
Game *unused;
|
|
int iVar1;
|
|
void *removedCollectibles;
|
|
|
|
iVar1 = 0;
|
|
isHasItem = HasCollectible(this,0x248,0);
|
|
if (isHasItem != 0) {
|
|
iVar1 = 0x248;
|
|
}
|
|
isHasItem = HasCollectible(this,0x3b,0);
|
|
unused = extraout_ECX;
|
|
if (isHasItem != 0) {
|
|
iVar1 = 0x3b;
|
|
removedCollectibles = (g_game->_itemPool)._removedCollectibles._begin;
|
|
unused = g_game;
|
|
if ((((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(removedCollectibles) + 4)) & 4) == 0) && (g_game->_challenge != 0x2b)) &&
|
|
(0x22 < (g_game->_itemPool)._removedCollectibles._size)) {
|
|
unused = GHIDRA_CAST<Game *>((GHIDRA_INT(removedCollectibles) + 4));
|
|
unused->_stage = unused->_stage | 4;
|
|
currentActive = this->_activeDesc[0]._item;
|
|
goto LAB_007d327a;
|
|
}
|
|
}
|
|
currentActive = this->_activeDesc[0]._item;
|
|
if (iVar1 == 0) {
|
|
if ((currentActive == 0x248) || (currentActive == 0x3b)) {
|
|
this->_activeDesc[0]._item = 0;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
LAB_007d327a:
|
|
if ((iVar1 == currentActive) ||
|
|
(((currentActive != 0 && (currentActive != 0x248)) && (currentActive != 0x3b)))) {
|
|
return;
|
|
}
|
|
this->_activeDesc[0]._item = iVar1;
|
|
if ((addedBookOfVirtues == 0) && ((this->_playerType != 0x12 || (iVar1 != 0x248)))) {
|
|
iVar1 = 0;
|
|
}
|
|
else {
|
|
iVar1 = GetCollectibleMaxCharge(this,iVar1,this->_activeDesc[0]._varData,GHIDRA_INT(unused));
|
|
}
|
|
this->_activeDesc[0]._charge = iVar1;
|
|
this->_activeDesc[0]._batteryCharge = 0;
|
|
this->_activeDesc[0]._subCharge = 0;
|
|
this->_activeDesc[0]._partialCharge = 0;
|
|
this->_activeDesc[0]._timeRechargeCooldown = 0;
|
|
this->_activeDesc[0]._varData = 0;
|
|
return;
|
|
}
|
|
|
|
// 007d3350
|
|
void Entity_Player::trigger_vampire_charm_kill()
|
|
{
|
|
byte isHasVampireCharm;
|
|
uint seed;
|
|
Entity *heartEffect;
|
|
int iVar1;
|
|
Entity_Player *soundId [2];
|
|
Manager *manager;
|
|
|
|
iVar1 = 0xd;
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
iVar1 = 8;
|
|
}
|
|
soundId[0] = this;
|
|
isHasVampireCharm = HasCollectible(this,0x3e,0);
|
|
if (((isHasVampireCharm != 0) &&
|
|
(this->_vampireCharmKills = this->_vampireCharmKills + 1, manager = g_manager,
|
|
iVar1 <= this->_vampireCharmKills)) && (this->_dead == 0)) {
|
|
soundId[0] = GHIDRA_CAST<Entity_Player *>(0x9d);
|
|
if (this->_playerType == 0x16) {
|
|
soundId[0] = GHIDRA_CAST<Entity_Player *>(0x266);
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(soundId));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(soundId[0]),1.0,2,0,1.0,0.0);
|
|
AddHearts(this,1,1,0);
|
|
this->_vampireCharmKills = this->_vampireCharmKills - iVar1;
|
|
seed = Random();
|
|
heartEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x31,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed,0);
|
|
iVar1 = __RTDynamicCast(heartEffect,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0);
|
|
*GHIDRA_CAST<undefined4 *>((iVar1 + 0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar1 + 0xe0)) = 0xc1c00000;
|
|
*GHIDRA_CAST<undefined4 *>((iVar1 + 0x358)) = 0x3f800000;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d3480
|
|
void Entity_Player::AddUrnSouls(uint amount)
|
|
{
|
|
uint *clamped;
|
|
uint *upperClamped;
|
|
uint local_c [2];
|
|
Game *game;
|
|
|
|
amount = amount + this->_urnSouls;
|
|
local_c[1] = 0x14;
|
|
upperClamped = &amount;
|
|
if (0x13 < GHIDRA_INT(amount)) {
|
|
upperClamped = local_c + 1;
|
|
}
|
|
clamped = local_c;
|
|
if (0 < GHIDRA_INT(*upperClamped)) {
|
|
clamped = upperClamped;
|
|
}
|
|
this->_urnSouls = *clamped;
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d34f0
|
|
void Entity_Player::AddGigaBombs(int amount)
|
|
{
|
|
int *clamped;
|
|
int *upperClamped;
|
|
int minCount;
|
|
Game *game;
|
|
|
|
amount = this->_numGigaBombs + amount;
|
|
upperClamped = &amount;
|
|
if (this->_numBombs <= amount) {
|
|
upperClamped = &this->_numBombs;
|
|
}
|
|
minCount = 0;
|
|
clamped = &minCount;
|
|
if (0 < *upperClamped) {
|
|
clamped = upperClamped;
|
|
}
|
|
this->_numGigaBombs = *clamped;
|
|
ConsumableCountChanged(this,0x40);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d35b0
|
|
byte Entity_Player::try_end_astral_projection()
|
|
{
|
|
float fVar1;
|
|
byte bVar2;
|
|
float fVar3;
|
|
Manager *pMVar4;
|
|
void *pvVar5;
|
|
ItemConfig_Item *Item;
|
|
uint uVar6;
|
|
uint rngResult;
|
|
Entity *effect;
|
|
float *roomColorMod;
|
|
byte *deathAnimChar;
|
|
int iVar7;
|
|
char *expectedAnimChar;
|
|
bool isCharLess;
|
|
float fVar8;
|
|
double dVar9;
|
|
undefined1 auStack_f4 [20];
|
|
int soundId [3];
|
|
float local_d4;
|
|
float local_d0;
|
|
float local_cc;
|
|
float local_c8;
|
|
float local_c4;
|
|
float trailStepDivisor;
|
|
Vector local_bc;
|
|
float bodyX;
|
|
float playerY;
|
|
int trailStep;
|
|
Color local_a8;
|
|
Vector trailVelocity;
|
|
ColorMod effectColor;
|
|
uint local_44;
|
|
EntityPtr astralBody;
|
|
Game *game;
|
|
|
|
local_44 = __security_cookie ^ GHIDRA_UINT(auStack_f4);
|
|
if ((((this->_temporaryeffects)._disabled != 0) ||
|
|
(pvVar5 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x2a5),
|
|
pvVar5 == (void *)0x0)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 4)) != 1)) {
|
|
return 0;
|
|
}
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0xa94 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)))
|
|
&& (fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0xa94)), fVar8 != 0.0)) {
|
|
local_a8._tint[2] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar8) + 0x78));
|
|
local_a8._tint[1] = 0.0;
|
|
local_a8._tint[3] = 0.0;
|
|
local_a8._tint[0] = fVar8;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&local_a8,1,1);
|
|
}
|
|
pvVar5 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU)) < 0xa95) {
|
|
Item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
Item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 0xa94));
|
|
}
|
|
RemoveCostume(this,Item);
|
|
astralBody = this->_astralProjectionBody;
|
|
if (astralBody != (EntityPtr)0x0) {
|
|
local_d4 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(astralBody) + 0x33c)) - (this->_pos).x;
|
|
local_d0 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(astralBody) + 0x340)) - (this->_pos).y;
|
|
local_cc = local_d4 * 0.1;
|
|
local_c8 = local_d0 * 0.1;
|
|
local_bc.x = local_cc;
|
|
local_bc.y = local_c8;
|
|
fVar8 = sqrtf(local_cc * local_cc + local_c8 * local_c8);
|
|
if ((4.0 < fVar8) && (0.0 < fVar8)) {
|
|
local_bc.y = (4.0 / fVar8) * local_c8;
|
|
local_bc.x = (4.0 / fVar8) * local_cc;
|
|
}
|
|
local_d4 = sqrtf(local_d0 * local_d0 + local_d4 * local_d4);
|
|
local_d4 = local_d4 / 20.0;
|
|
dVar9 = floor((double)local_d4);
|
|
local_d4 = (float)dVar9;
|
|
iVar7 = GHIDRA_INT(dVar9);
|
|
if (iVar7 < 4) {
|
|
iVar7 = 4;
|
|
}
|
|
if (0xc < iVar7) {
|
|
iVar7 = 0xc;
|
|
}
|
|
if (0 < iVar7) {
|
|
trailStepDivisor = (float)(iVar7 + 1);
|
|
trailStep = 0;
|
|
do {
|
|
trailStep = trailStep + 1;
|
|
local_d0 = (float)trailStep / trailStepDivisor;
|
|
bodyX = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_astralProjectionBody) + 0x33c));
|
|
local_c4 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_astralProjectionBody) + 0x340));
|
|
local_d4 = (this->_pos).x;
|
|
playerY = (this->_pos).y;
|
|
uVar6 = Random();
|
|
local_c8 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_c8 = local_c8 + local_c8;
|
|
uVar6 = Random();
|
|
local_cc = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar8 = cos(local_c8);
|
|
local_a8._tint[0] = fVar8 * local_cc * 15.0 + (bodyX - local_d4) * local_d0 + local_d4;
|
|
fVar8 = sin(local_c8);
|
|
local_a8._tint[1] = fVar8 * local_cc * 15.0 + (local_c4 - playerY) * local_d0 + playerY;
|
|
uVar6 = Random();
|
|
rngResult = Random();
|
|
trailVelocity.x =
|
|
(float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.5;
|
|
trailVelocity.y = trailVelocity.x * local_bc.y;
|
|
trailVelocity.x = trailVelocity.x * local_bc.x;
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x6f,GHIDRA_CAST<Vector *>(&local_a8),&trailVelocity,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar6,0);
|
|
effectColor._offset[0] = 1.0;
|
|
effectColor._offset[1] = 1.0;
|
|
effectColor._colorize[0] = 0.0;
|
|
effectColor._colorize[1] = 0.0;
|
|
effectColor._colorize[2] = 0.0;
|
|
effectColor._colorize[3] = 0.0;
|
|
effectColor._tint[0] = 1.0;
|
|
effectColor._tint[1] = 1.0;
|
|
effectColor._tint[2] = 1.0;
|
|
effectColor._tint[3] = 1.0;
|
|
effectColor._offset[2] = 1.0;
|
|
effect->SetColor(&effectColor,0xffffffff,0xff,0);
|
|
local_c4 = local_d0 * g_vectorOne.x;
|
|
local_d0 = local_d0 * g_vectorOne.y;
|
|
uVar6 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.3 + 0.3;
|
|
(effect->_sprite)._scale.y = local_d0 * fVar8;
|
|
(effect->_sprite)._scale.x = fVar8 * local_c4;
|
|
fVar8 = (this->_posOffset).y;
|
|
fVar1 = (this->_sprite)._scale.y;
|
|
(effect->_posOffset).x = (this->_posOffset).x + 0.0;
|
|
(effect->_posOffset).y = fVar8 - fVar1 * 16.0;
|
|
} while (trailStep < iVar7);
|
|
}
|
|
uVar6 = Random();
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x10,&this->_pos,&local_bc,GHIDRA_CAST<Entity *>(0x0),10,uVar6,0);
|
|
effectColor._tint[0] = 1.0;
|
|
effectColor._tint[1] = 1.0;
|
|
effectColor._tint[2] = 1.0;
|
|
effectColor._tint[3] = 1.0;
|
|
effectColor._colorize[0] = 1.0;
|
|
effectColor._colorize[1] = 1.0;
|
|
effectColor._colorize[2] = 1.0;
|
|
effectColor._colorize[3] = 1.0;
|
|
effectColor._offset[0] = 0.0;
|
|
effectColor._offset[1] = 0.0;
|
|
effectColor._offset[2] = 0.0;
|
|
effect->SetColor(&effectColor,0xffffffff,0xff,0);
|
|
(effect->_posOffset).x = (this->_posOffset).x;
|
|
(effect->_posOffset).y = (this->_posOffset).y;
|
|
(effect->_sprite)._scale.x = (this->_sprite)._scale.x;
|
|
(effect->_sprite)._scale.y = (this->_sprite)._scale.y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
local_bc.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_astralProjectionBody) + 0x33c));
|
|
local_bc.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_astralProjectionBody) + 0x340));
|
|
Teleport(this,&local_bc,0,0);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_astralProjectionBody) + 0x28))();
|
|
}
|
|
this->ResetColor();
|
|
local_a8._offset[2] = (this->_sprite)._color._offset[2];
|
|
effectColor._colorize[0] = 0.0;
|
|
effectColor._colorize[1] = 0.0;
|
|
effectColor._colorize[2] = 0.0;
|
|
effectColor._colorize[3] = 0.0;
|
|
effectColor._tint[0] = 1.0;
|
|
effectColor._tint[1] = 1.0;
|
|
effectColor._tint[2] = 1.0;
|
|
effectColor._tint[3] = 1.0;
|
|
local_a8._tint[0] = (this->_sprite)._color._tint[0];
|
|
local_a8._tint[1] = (this->_sprite)._color._tint[1];
|
|
local_a8._tint[2] = (this->_sprite)._color._tint[2];
|
|
local_a8._tint[3] = (this->_sprite)._color._tint[3];
|
|
effectColor._offset[0] = 1.0;
|
|
effectColor._offset[1] = 1.0;
|
|
effectColor._offset[2] = 1.0;
|
|
local_a8._colorize[0] = (this->_sprite)._color._colorize[0];
|
|
local_a8._colorize[1] = (this->_sprite)._color._colorize[1];
|
|
local_a8._colorize[2] = (this->_sprite)._color._colorize[2];
|
|
local_a8._colorize[3] = (this->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_a8._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset);
|
|
(GHIDRA_CAST<Color *>((&local_a8)))->Color::__mul(&effectColor);
|
|
effectColor._tint[0] = local_a8._tint[0];
|
|
effectColor._tint[1] = local_a8._tint[1];
|
|
effectColor._tint[2] = local_a8._tint[2];
|
|
effectColor._tint[3] = local_a8._tint[3];
|
|
effectColor._offset[2] = local_a8._offset[2];
|
|
effectColor._colorize[0] = local_a8._colorize[0];
|
|
effectColor._colorize[1] = local_a8._colorize[1];
|
|
effectColor._colorize[2] = local_a8._colorize[2];
|
|
effectColor._colorize[3] = local_a8._colorize[3];
|
|
effectColor._offset[0] = local_a8._offset[0];
|
|
effectColor._offset[1] = local_a8._offset[1];
|
|
this->SetColor(&effectColor,8,0xff,1,1);
|
|
game = g_game;
|
|
g_game->_bloomDuration = 10;
|
|
game->_bloomTimer = 10;
|
|
game->_bloomStrength = 0.6;
|
|
roomColorMod = (GHIDRA_CAST<Room *>((game->_room)))->Room::get_color_modifier(&local_bc.x);
|
|
game = g_game;
|
|
fVar8 = roomColorMod[1];
|
|
fVar1 = roomColorMod[2];
|
|
fVar3 = roomColorMod[3];
|
|
(g_game->_targetColorModifier)._red = *roomColorMod;
|
|
(game->_targetColorModifier)._green = fVar8;
|
|
(game->_targetColorModifier)._blue = fVar1;
|
|
(game->_targetColorModifier)._amount = fVar3;
|
|
fVar8 = roomColorMod[5];
|
|
(game->_targetColorModifier)._brightness = roomColorMod[4];
|
|
(game->_targetColorModifier)._contrast = fVar8;
|
|
fVar8 = (game->_targetColorModifier)._green;
|
|
fVar1 = (game->_targetColorModifier)._blue;
|
|
fVar3 = (game->_targetColorModifier)._amount;
|
|
(game->_currentColorModifier)._red = (game->_targetColorModifier)._red;
|
|
(game->_currentColorModifier)._green = fVar8;
|
|
(game->_currentColorModifier)._blue = fVar1;
|
|
(game->_currentColorModifier)._amount = fVar3;
|
|
fVar8 = (game->_targetColorModifier)._contrast;
|
|
(game->_currentColorModifier)._brightness = (game->_targetColorModifier)._brightness;
|
|
(game->_currentColorModifier)._contrast = fVar8;
|
|
game->_shouldLerpColorModState = 0;
|
|
try_trigger_astral_projection(this);
|
|
if (this->_dead == 0) {
|
|
iVar7 = this->_damageCooldown;
|
|
if (iVar7 < 0x78) {
|
|
iVar7 = 0x78;
|
|
}
|
|
this->_damageCooldown = iVar7;
|
|
}
|
|
else {
|
|
expectedAnimChar = "Death";
|
|
deathAnimChar = GetDeathAnimName(this);
|
|
do {
|
|
bVar2 = *deathAnimChar;
|
|
isCharLess = bVar2 < (byte)*expectedAnimChar;
|
|
if (bVar2 != *expectedAnimChar) {
|
|
LAB_007d3d20:
|
|
uVar6 = -GHIDRA_UINT(isCharLess) | 1;
|
|
goto LAB_007d3d25;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = deathAnimChar[1];
|
|
isCharLess = bVar2 < (byte)expectedAnimChar[1];
|
|
if (bVar2 != expectedAnimChar[1]) goto LAB_007d3d20;
|
|
deathAnimChar = deathAnimChar + 2;
|
|
expectedAnimChar = expectedAnimChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar6 = 0;
|
|
LAB_007d3d25:
|
|
if (uVar6 == 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Death"));
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(24.0);
|
|
}
|
|
local_d4 = get_voice_pitch(this);
|
|
pMVar4 = g_manager;
|
|
soundId[0] = 0xd9;
|
|
seed_fart_sound_override(soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar4->_sfxManager)))->SoundEffects::Play(soundId[0],1.0,2,0,local_d4,0.0);
|
|
return 1;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007d3e40
|
|
void Entity_Player::fire_saturnus_tears()
|
|
{
|
|
uint uVar1;
|
|
uint uVar2;
|
|
Vector velocity;
|
|
BitSet128 flags;
|
|
uint rngResult;
|
|
Entity_Tear *tear;
|
|
float fVar3;
|
|
float fVar4;
|
|
float fVar5;
|
|
int i;
|
|
Vector tearPos;
|
|
uint uStack_20;
|
|
uint uStack_1c;
|
|
uint uStack_18;
|
|
uint uStack_14;
|
|
qword flagsHigh;
|
|
qword flagsLow;
|
|
Game *game;
|
|
double uintFixup;
|
|
|
|
rngResult = Random();
|
|
uintFixup = __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
|
|
i = 0;
|
|
do {
|
|
fVar5 = (float)((double)GHIDRA_INT(rngResult) + uintFixup) * 2.3283064e-10 * 360.0 -
|
|
(float)i * 51.42857;
|
|
fVar3 = fVar5 * 0.017453292;
|
|
fVar4 = cos(fVar3);
|
|
tearPos.x = fVar4 * 4.0 + (this->_pos).x;
|
|
fVar3 = sin(fVar3);
|
|
tearPos.y = fVar3 * 4.0 + (this->_pos).y;
|
|
fVar5 = (fVar5 + 90.0) * 0.017453292;
|
|
fVar3 = this->_shotspeed * 10.0;
|
|
fVar4 = cos(fVar5);
|
|
fVar5 = sin(fVar5);
|
|
velocity.y = fVar5 * fVar3;
|
|
velocity.x = fVar4 * fVar3;
|
|
tear = FireTear(this,&tearPos,velocity,0x47,GHIDRA_CAST<Entity *>(0x0),1.5);
|
|
tear->SetCollisionDamage(tear->_collisionDamage + 5.0);
|
|
flagsLow = (tear->_tearFlags)._l;
|
|
uVar1 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4));
|
|
flagsHigh = (tear->_tearFlags)._h;
|
|
uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4));
|
|
tear->_tearIdx = 1;
|
|
uStack_20 = ~(GHIDRA_UINT(g_tearFlagHoming._l) | GHIDRA_UINT(g_tearFlagBounce._l) |
|
|
GHIDRA_UINT(g_tearFlagBoomerang._l) | GHIDRA_UINT(g_tearFlagOrbit._l) |
|
|
GHIDRA_UINT(g_tearFlagLudovico._l) | GHIDRA_UINT(g_tearFlagOccult._l)) &
|
|
(GHIDRA_UINT(flagsLow) | GHIDRA_UINT(g_tearFlagNoGridDamage._l) | GHIDRA_UINT(g_tearFlagSpectral._l) |
|
|
GHIDRA_UINT(g_tearFlagOrbitAdvanced._l));
|
|
uStack_1c = ~((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBounce._l)) + 0x4))) |
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBoomerang._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._l)) + 0x4))) |
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOccult._l)) + 0x4)))) &
|
|
(uVar1 | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagNoGridDamage._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4))) |
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbitAdvanced._l)) + 0x4))));
|
|
uStack_18 = ~(GHIDRA_UINT(g_tearFlagHoming._h) | GHIDRA_UINT(g_tearFlagBounce._h) |
|
|
GHIDRA_UINT(g_tearFlagBoomerang._h) | GHIDRA_UINT(g_tearFlagOrbit._h) |
|
|
GHIDRA_UINT(g_tearFlagLudovico._h) | GHIDRA_UINT(g_tearFlagOccult._h)) &
|
|
(GHIDRA_UINT(flagsHigh) | GHIDRA_UINT(g_tearFlagNoGridDamage._h) | GHIDRA_UINT(g_tearFlagSpectral._h) |
|
|
GHIDRA_UINT(g_tearFlagOrbitAdvanced._h));
|
|
uStack_14 = ~((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBounce._h)) + 0x4))) |
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBoomerang._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._h)) + 0x4))) |
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOccult._h)) + 0x4)))) &
|
|
(uVar2 | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagNoGridDamage._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4))) |
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbitAdvanced._h)) + 0x4))));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = uStack_1c;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = uStack_20;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = uStack_18;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = uStack_14;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
|
tear->_height = -20.0;
|
|
fVar3 = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::get_height_offset_y(-20.0);
|
|
game = g_game;
|
|
(tear->_posOffset).y = fVar3;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
|
|
(tear->_posOffset).y = -18.0;
|
|
}
|
|
i = i + 1;
|
|
tear->_fallingSpeed = 0.0;
|
|
tear->_fallingAccel = -0.096;
|
|
} while (i < 7);
|
|
return;
|
|
}
|
|
|
|
// 007d4150
|
|
int Entity_Player::GetMaxInventorySize()
|
|
{
|
|
byte isBirthright;
|
|
|
|
isBirthright = HasCollectible(this,0x26b,0);
|
|
return GHIDRA_UINT((isBirthright != 0)) * 4 + 8;
|
|
}
|
|
|
|
// 007d4170
|
|
byte Entity_Player::CanAddCollectibleToInventory(int id)
|
|
{
|
|
byte isQuestItem;
|
|
ItemConfig_Item *item;
|
|
|
|
item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(id);
|
|
if ((((item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (item->type != 3)) && (id != 0x290)) && (id != 0x26b)) {
|
|
isQuestItem = (GHIDRA_CAST<Item *>((item)))->Item::HasTags(0x8000);
|
|
if (isQuestItem == 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007d41d0
|
|
void Entity_Player::SetPocketActiveItem(int collectible, int slot, byte keepInPools)
|
|
{
|
|
ItemConfig_Item *item;
|
|
uint uVar1;
|
|
int *pocketSlot;
|
|
int *srcSlot;
|
|
int *dstSlot;
|
|
uint pocketIdx;
|
|
Game *game;
|
|
uint *removedWord;
|
|
|
|
if (slot - 2U < 2) {
|
|
pocketSlot = this->_pocketSlots;
|
|
pocketIdx = 0;
|
|
do {
|
|
if ((pocketSlot[1] == 2) && (*pocketSlot == slot + 1)) {
|
|
uVar1 = this->_activeDesc[*pocketSlot + -1]._item;
|
|
if (uVar1 != 0) {
|
|
RemoveCollectible(this,uVar1,1,slot,1);
|
|
}
|
|
if (pocketIdx < 3) {
|
|
srcSlot = pocketSlot + 2;
|
|
dstSlot = pocketSlot;
|
|
for (uVar1 = (3 - pocketIdx) * 2 & 0x3ffffffe; uVar1 != 0; uVar1 = uVar1 - 1) {
|
|
*dstSlot = *srcSlot;
|
|
srcSlot = srcSlot + 1;
|
|
dstSlot = dstSlot + 1;
|
|
}
|
|
}
|
|
this->_pocketSlots[6] = 0;
|
|
this->_pocketSlots[7] = 1;
|
|
}
|
|
pocketIdx = pocketIdx + 1;
|
|
pocketSlot = pocketSlot + 2;
|
|
} while (pocketIdx < 4);
|
|
if ((collectible != 0) &&
|
|
(item = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectible),
|
|
item != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
AddPocketItem(this,slot + 1,2);
|
|
AddCollectible(this,collectible,-1,1,slot,0,0);
|
|
game = g_game;
|
|
if ((keepInPools == 0) && ((-1 < collectible && (g_game->_challenge != 0x2b)))) {
|
|
if (collectible == 0x1e4) {
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,0x126,0,0);
|
|
}
|
|
if (GHIDRA_UINT(collectible) < (game->_itemPool)._removedCollectibles._size) {
|
|
removedWord = GHIDRA_CAST<uint *>((GHIDRA_INT((game->_itemPool)._removedCollectibles._begin) +
|
|
(GHIDRA_UINT(collectible) >> 5) * 4));
|
|
*removedWord = *removedWord | 1 << (collectible & 0x1fU);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d4340
|
|
void Entity_Player::get_salvation_scale()
|
|
{
|
|
int in_ECX;
|
|
|
|
if (*GHIDRA_CAST<char *>((in_ECX + 0x1519)) == '\0') {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((in_ECX + 0x1508)))))->TemporaryEffects::GetCollectibleEffect(0x2b8);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d4390
|
|
void Entity_Player::update_suplex()
|
|
{
|
|
EntityPtr EVar1;
|
|
byte bVar2;
|
|
char *animName;
|
|
undefined1 **ppuVar3;
|
|
std_string *curAnimChars;
|
|
uint uVar4;
|
|
Entity *effect;
|
|
uint rngResult;
|
|
int iVar5;
|
|
Entity_Familiar *wisp;
|
|
float *targetPos;
|
|
void *pvVar6;
|
|
int iVar7;
|
|
int *piVar8;
|
|
AnimationState *animState;
|
|
float fVar9;
|
|
float fVar10;
|
|
float markedPosX;
|
|
Entity *local_7c8;
|
|
undefined1 *local_7c4;
|
|
undefined1 *bombRadius;
|
|
EntityPtr local_7bc;
|
|
undefined1 *local_7b8;
|
|
undefined1 *local_7b4;
|
|
byte isSuperLeap;
|
|
Entity_Player *local_7ac;
|
|
NPCAI_Pathfinder pathfinder;
|
|
void *local_60 [2];
|
|
undefined4 local_58;
|
|
EntityRef EStack_54;
|
|
void *curAnim [2];
|
|
undefined1 local_24 [12];
|
|
int *local_18;
|
|
uint stackCookie;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
uint *animNameSize;
|
|
Manager *manager;
|
|
Vector *playerPos;
|
|
Room *room;
|
|
int *suplexWisp;
|
|
code *takeDamageFn;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00308;
|
|
local_10 = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((local_24 + 0x20));
|
|
ExceptionList = &local_10;
|
|
local_7bc = (EntityPtr)this;
|
|
iVar5 = this->_suplexState;
|
|
if (((iVar5 != 0) && (1 < iVar5)) && (this->_entityCollisionClass = 0, 2 < iVar5)) {
|
|
this->_entityGridCollisionClass = 0;
|
|
}
|
|
pvVar6 = this->_heldEntity;
|
|
if ((((pvVar6 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x28)) == 4)) &&
|
|
((iVar5 == 2 || ((iVar5 == 3 || (iVar5 == 4)))))) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x410)) < 2)) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x410)) = 10;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x414)) = 10;
|
|
iVar5 = this->_suplexState;
|
|
}
|
|
if (0 < this->_suplexAimCountdown) {
|
|
iVar7 = this->_suplexAimCountdown + (GHIDRA_INT(this->_updateTime) - GHIDRA_INT(this->_prevUpdateTime)) * -2;
|
|
this->_suplexAimCountdown = iVar7;
|
|
if (iVar5 == 5) {
|
|
this->_suplexAimCountdown = 0;
|
|
LAB_007d44b8:
|
|
if (this->_heldEntity == (void *)0x0) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x80;
|
|
this->_suplexState = 0;
|
|
this->_entityCollisionClass = 4;
|
|
EvaluateItems(this);
|
|
this->_blinkTime = 1;
|
|
this->_itemStateCooldown = 5;
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("HideItem"));
|
|
}
|
|
else {
|
|
pvVar6 = this->_markedTarget;
|
|
targetPos = &markedPosX;
|
|
if (pvVar6 == (void *)0x0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x8))) = (this->_pos).x;
|
|
local_18 = GHIDRA_CAST<int *>((this->_pos).y);
|
|
targetPos = GHIDRA_CAST<float *>((local_24 + 8));
|
|
}
|
|
else {
|
|
markedPosX = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x33c));
|
|
local_7c8 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(pvVar6) + 0x340));
|
|
}
|
|
(this->_suplexTargetPos).x = *targetPos;
|
|
(this->_suplexTargetPos).y = targetPos[1];
|
|
(this->_suplexLandPos).x = (this->_pos).x;
|
|
(this->_suplexLandPos).y = (this->_pos).y;
|
|
animName = "SuperLeapUp";
|
|
if (this->_suplexState != 5) {
|
|
animName = "LeapUp";
|
|
}
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>(animName));
|
|
manager = g_manager;
|
|
this->_suplexState = 3;
|
|
local_7ac = GHIDRA_CAST<Entity_Player *>(0x408);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_7ac));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_7ac),1.0,2,0,1.0,0.0);
|
|
bVar2 = HasCollectible(this,0x248,0);
|
|
if (bVar2 != 0) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_24),3,0xce,
|
|
0x2c5,0,0);
|
|
piVar8 = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
if (local_18 != GHIDRA_CAST<int *>(0x0)) {
|
|
pvVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_24)) + 0x4)));
|
|
do {
|
|
suplexWisp = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar6) + GHIDRA_INT(piVar8) * 4));
|
|
if (GHIDRA_CAST<Entity_Player *>(suplexWisp[0x104]) == this) {
|
|
EStack_54._position.x = g_vectorZero.x;
|
|
EStack_54._velocity.x = g_vectorZero.x;
|
|
EStack_54._position.y = g_vectorZero.y;
|
|
EStack_54._velocity.y = g_vectorZero.y;
|
|
EStack_54._type = 0;
|
|
EStack_54._variant = 0;
|
|
EStack_54._spawnerType = 0;
|
|
EStack_54._spawnerVariant = 0;
|
|
EStack_54._flags = 0;
|
|
EStack_54._entity = (void *)0x0;
|
|
(**(code **)(*suplexWisp + 0x24))(&EStack_54);
|
|
pvVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_24)) + 0x4)));
|
|
}
|
|
piVar8 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar8) + 1));
|
|
} while (piVar8 < local_18);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (local_24[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_24)) + 0x4))),0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (iVar7 < 1) {
|
|
this->_suplexAimCountdown = 0;
|
|
if (iVar5 == 1) {
|
|
this->_cacheFlags = this->_cacheFlags | 0x80;
|
|
this->_suplexState = 0;
|
|
this->_entityCollisionClass = 4;
|
|
EvaluateItems(this);
|
|
}
|
|
else if (iVar5 == 2) goto LAB_007d44b8;
|
|
}
|
|
}
|
|
if (this->_suplexState == 3) {
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_suplexState = 4;
|
|
Teleport(this,&this->_suplexTargetPos,0,0);
|
|
pvVar6 = this->_heldEntity;
|
|
if (pvVar6 != (void *)0x0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x33c)) = (this->_suplexTargetPos).x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x340)) = (this->_suplexTargetPos).y;
|
|
}
|
|
curAnimChars = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>(curAnim));
|
|
animNameSize = &curAnimChars->_size;
|
|
if (0xf < curAnimChars->_capacity) {
|
|
curAnimChars = *GHIDRA_CAST<std_string **>(curAnimChars->_buf);
|
|
}
|
|
isSuperLeap = str_eq(GHIDRA_CAST<byte *>(curAnimChars),*animNameSize,GHIDRA_CAST<byte *>("SuperLeapUp"),0xb);
|
|
if (&DAT_0000000f < local_18) {
|
|
piVar8 = GHIDRA_CAST<int *>((GHIDRA_INT(local_18) + 1));
|
|
pvVar6 = curAnim[0];
|
|
if (GHIDRA_CAST<int *>(0xfff) < piVar8) {
|
|
pvVar6 = *(void **)(GHIDRA_INT(curAnim[0]) + -4);
|
|
piVar8 = local_18 + 9;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(curAnim[0]) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,GHIDRA_UINT(piVar8));
|
|
}
|
|
if (isSuperLeap == 0) {
|
|
animName = "LeapDown";
|
|
}
|
|
else {
|
|
animName = "SuperLeapDown";
|
|
}
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>(animName));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (this->_suplexState != 4) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
bVar2 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b1d534);
|
|
manager = g_manager;
|
|
if (bVar2 != 0) {
|
|
fVar9 = (this->_playerSpriteScale).x;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
local_7b4 = GHIDRA_CAST<undefined1 *>(0x42200000);
|
|
local_7b8 = GHIDRA_CAST<undefined1 *>((fVar9 * 50.0));
|
|
ppuVar3 = &local_7b8;
|
|
if ((float)local_7b8 <= 40.0) {
|
|
ppuVar3 = &local_7b4;
|
|
}
|
|
bombRadius = *ppuVar3;
|
|
}
|
|
else {
|
|
bombRadius = GHIDRA_CAST<undefined1 *>(0x41c80000);
|
|
}
|
|
local_7b4 = GHIDRA_CAST<undefined1 *>((fVar9 * 25.0));
|
|
local_7c4 = GHIDRA_CAST<undefined1 *>(0x41a00000);
|
|
local_7ac = GHIDRA_CAST<Entity_Player *>(0x409);
|
|
ppuVar3 = &local_7b4;
|
|
if ((float)local_7b4 <= 20.0) {
|
|
ppuVar3 = &local_7c4;
|
|
}
|
|
local_7b8 = *ppuVar3;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_7ac));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_7ac),1.0,2,0,1.0,0.0);
|
|
curAnimChars = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_7bc) + 0x78)))))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>(curAnim));
|
|
animNameSize = &curAnimChars->_size;
|
|
if (0xf < curAnimChars->_capacity) {
|
|
curAnimChars = *GHIDRA_CAST<std_string **>(curAnimChars->_buf);
|
|
}
|
|
isSuperLeap = str_eq(GHIDRA_CAST<byte *>(curAnimChars),*animNameSize,GHIDRA_CAST<byte *>("SuperLeapDown"),0xd);
|
|
if (&DAT_0000000f < local_18) {
|
|
piVar8 = GHIDRA_CAST<int *>((GHIDRA_INT(local_18) + 1));
|
|
pvVar6 = curAnim[0];
|
|
if (GHIDRA_CAST<int *>(0xfff) < piVar8) {
|
|
pvVar6 = *(void **)(GHIDRA_INT(curAnim[0]) + -4);
|
|
piVar8 = local_18 + 9;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(curAnim[0]) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,GHIDRA_UINT(piVar8));
|
|
}
|
|
manager = g_manager;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x8))) = 0.0;
|
|
local_18 = GHIDRA_CAST<int *>(0xf);
|
|
curAnim[0] = (void *)(GHIDRA_UINT(curAnim[0]) & 0xffffff00);
|
|
if (isSuperLeap == 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0xe);
|
|
manager = g_manager;
|
|
local_7b4 = GHIDRA_CAST<undefined1 *>(0x34);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_7b4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_7b4),1.0,2,0,1.0,0.0);
|
|
this = GHIDRA_CAST<Entity_Player *>(local_7bc);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::MakeShockwave(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_7bc) + 0x33c)),0.04,0.025,0xd);
|
|
local_7b4 = GHIDRA_CAST<undefined1 *>(0x428c0000);
|
|
local_7c4 = GHIDRA_CAST<undefined1 *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14f0)) * 40.0 + 50.0));
|
|
ppuVar3 = &local_7c4;
|
|
if ((float)local_7c4 <= 70.0) {
|
|
ppuVar3 = &local_7b4;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(((float)*ppuVar3 / 9.0));
|
|
uVar4 = Random();
|
|
local_7c8 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3d,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
local_7bc = (EntityPtr)&local_7c8->_parent;
|
|
if (local_7c8->_parent != (EntityPtr)0x0) {
|
|
local_7ac = GHIDRA_CAST<Entity_Player *>(local_7bc);
|
|
std::multiset<unsigned_int>::erase(&local_7ac);
|
|
}
|
|
*GHIDRA_CAST<Entity_Player **>(local_7bc) = this;
|
|
std::multiset<unsigned_int>::insert(local_7bc);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_7c8[1])) + 0x44)))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x370));
|
|
*GHIDRA_CAST<undefined1 **>(local_7c8[1]._sprite._filename._buf) = *ppuVar3;
|
|
*GHIDRA_CAST<int *>((local_7c8[1]._sprite._filename._buf + 4)) = GHIDRA_INT((float)local_18);
|
|
*GHIDRA_CAST<int *>((local_7c8[1]._sprite._filename._buf + 8)) = GHIDRA_INT((float)local_18);
|
|
}
|
|
else {
|
|
bombRadius = GHIDRA_CAST<undefined1 *>(((float)bombRadius * 6.0));
|
|
local_7ac = GHIDRA_CAST<Entity_Player *>(0x34);
|
|
local_7b8 = GHIDRA_CAST<undefined1 *>(((float)*ppuVar3 + (float)*ppuVar3));
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_7ac));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_7ac),1.0,2,0,1.0,0.0);
|
|
uVar4 = Random();
|
|
EVar1 = local_7bc;
|
|
playerPos = GHIDRA_CAST<Vector *>((GHIDRA_INT(local_7bc) + 0x33c));
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x7f,playerPos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_7bc),0,uVar4);
|
|
fVar9 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar1) + 0x340));
|
|
iVar5 = *GHIDRA_CAST<int *>(effect);
|
|
(effect->_targetPosition).x = playerPos->x;
|
|
(effect->_targetPosition).y = fVar9;
|
|
(**(code **)(iVar5 + 0xc))();
|
|
uVar4 = Random();
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x12,playerPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
fVar9 = g_vectorOne.y * 2.0;
|
|
iVar5 = *GHIDRA_CAST<int *>(effect);
|
|
(effect->_sprite)._scale.x = g_vectorOne.x * 2.0;
|
|
(effect->_sprite)._scale.y = fVar9;
|
|
(**(code **)(iVar5 + 0xc))();
|
|
uVar4 = 0;
|
|
do {
|
|
rngResult = Random();
|
|
local_7c4 = (undefined1 *)
|
|
((((((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) +
|
|
(float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10)
|
|
- 0.5) * 360.0) / 15.0) * 0.017453292);
|
|
local_7ac = GHIDRA_CAST<Entity_Player *>(sin((float)local_7c4));
|
|
rngResult = Random();
|
|
local_7b4 = (undefined1 *)
|
|
((float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 *
|
|
5.0 + 15.0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x8))) = cos((float)local_7c4);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x8))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_24)) + 0x8))) * (float)local_7b4;
|
|
local_18 = GHIDRA_CAST<int *>(((float)local_7b4 * (float)local_7ac * 0.85));
|
|
rngResult = Random();
|
|
local_7ac = (Entity_Player *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,playerPos,GHIDRA_CAST<Vector *>((local_24 + 8)),GHIDRA_CAST<Entity *>(0x0),
|
|
0,rngResult);
|
|
rngResult = Random();
|
|
if ((rngResult & 1) == 0) {
|
|
local_7b4 = &DAT_bf800000;
|
|
}
|
|
else {
|
|
local_7b4 = GHIDRA_CAST<undefined1 *>(0x3f800000);
|
|
}
|
|
rngResult = Random();
|
|
(local_7ac->_bodySprite)._overlayAnimState._layerFrames =
|
|
(void *)(((float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 *
|
|
10.0 + 2.0) * (float)local_7b4);
|
|
rngResult = Random();
|
|
fVar10 = (float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 * 0.6 +
|
|
1.0;
|
|
fVar9 = fVar10 * g_vectorOne.x;
|
|
(local_7ac->_sprite)._scale.y = fVar10 * g_vectorOne.y;
|
|
(local_7ac->_sprite)._scale.x = fVar9;
|
|
rngResult = Random();
|
|
EStack_54._velocity.y = 0.0;
|
|
EStack_54._flags = 0;
|
|
fVar9 = (float)(rngResult % 0x28 + 0x28);
|
|
EStack_54._entity = (void *)0x0;
|
|
EStack_54._spawnerVariant = 0;
|
|
EStack_54._position.x = 0.0;
|
|
EStack_54._position.y = 0.0;
|
|
EStack_54._velocity.x = 0.0;
|
|
iVar5 = *GHIDRA_CAST<int *>(local_7ac);
|
|
(local_7ac->_bodySprite)._animState._animFrame = fVar9;
|
|
*GHIDRA_CAST<float *>(&(local_7ac->_bodySprite)._animState._isPlaying) = fVar9;
|
|
local_58 = 0x3ee66666;
|
|
EStack_54._type = 0x3ee66666;
|
|
EStack_54._variant = 0x3eeb851f;
|
|
EStack_54._spawnerType = 0x3f400000;
|
|
(**(code **)(iVar5 + 0x3c))();
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < 0xf);
|
|
uVar4 = Random();
|
|
this = GHIDRA_CAST<Entity_Player *>(local_7bc);
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x10,playerPos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_7bc),1,uVar4);
|
|
fVar9 = g_vectorOne.y * 2.0;
|
|
(effect->_sprite)._scale.x = g_vectorOne.x * 2.0;
|
|
(effect->_sprite)._scale.y = fVar9;
|
|
uVar4 = Random();
|
|
(effect->_sprite)._flipX = ((byte)uVar4 ^ 0xff) & 1;
|
|
effect->Update();
|
|
}
|
|
local_18 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x1410));
|
|
if (local_18 != GHIDRA_CAST<int *>(0x0)) {
|
|
takeDamageFn = *(code **)(*local_18 + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&EStack_54)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(*takeDamageFn)();
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1410));
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 4) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x410)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((iVar5 + 0x414)) = 0;
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x1410)) + 0xc))();
|
|
}
|
|
}
|
|
playerPos = GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::BombDamage(playerPos,(float)bombRadius,(float)local_7b8,0,GHIDRA_CAST<Entity *>(this),
|
|
g_tearFlagsNone,0x1000000,0);
|
|
room = g_game->_room;
|
|
iVar7 = GHIDRA_INT(((playerPos->x - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar5 < 0)) ||
|
|
(room->_gridHeight <= iVar5)) {
|
|
iVar7 = -1;
|
|
}
|
|
else {
|
|
iVar7 = iVar5 * room->_gridWidth + iVar7;
|
|
}
|
|
uVar4 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(iVar7);
|
|
if ((uVar4 == 0) || ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x1570)) != '\0' && (GHIDRA_INT(uVar4) < 4)))) {
|
|
(GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(&pathfinder))))->PathFinder::Init(GHIDRA_CAST<Entity *>(this));
|
|
local_8 = 2;
|
|
bVar2 = (GHIDRA_CAST<NPCAI_Pathfinder *>((&pathfinder)))->NPCAI_Pathfinder::HasPathToPos(GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x1f3c)),0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f3c)) = playerPos->x;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 8000)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x340));
|
|
}
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(local_60,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)local_60,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(local_60[0]) + 4));
|
|
operator_delete(local_60[0],0x14);
|
|
}
|
|
bVar2 = HasCollectible(this,0x248,0);
|
|
if (bVar2 != 0) {
|
|
local_7b8 = GHIDRA_CAST<undefined1 *>(0x3);
|
|
do {
|
|
wisp = AddWisp(this,0x2c5,playerPos,0,1);
|
|
if (wisp != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
fVar9 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340));
|
|
(wisp->_targetPosition).x = playerPos->x;
|
|
(wisp->_targetPosition).y = fVar9;
|
|
}
|
|
local_7b8 = local_7b8 + -1;
|
|
} while (local_7b8 != GHIDRA_CAST<undefined1 *>(0x0));
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x7c)) != 0) {
|
|
animState = GHIDRA_CAST<AnimationState *>((GHIDRA_INT(this) + 0x78));
|
|
bVar2 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0);
|
|
if (bVar2 != 0) {
|
|
ThrowHeldEntity(this,&g_vectorZero);
|
|
}
|
|
goto LAB_007d4fc6;
|
|
}
|
|
}
|
|
animState = GHIDRA_CAST<AnimationState *>((GHIDRA_INT(this) + 0x78));
|
|
LAB_007d4fc6:
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x7c)) != 0) {
|
|
bVar2 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::WasEventTriggered(&DAT_00b1d3b0);
|
|
if (bVar2 != 0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x360)) =
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1f3c)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c))) * 0.3;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x364)) =
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 8000)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340))) * 0.3;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x7c)) != 0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + 0x8c)) != '\0')) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1f2c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1338)) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x1604)) = 5;
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13bc));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x188)) = 4;
|
|
if (iVar5 < 0xf) {
|
|
iVar5 = 0xf;
|
|
}
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1574)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x1574)) | 0x80;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x13bc)) = iVar5;
|
|
EvaluateItems(this);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007d5170
|
|
uint Entity_Player::bag_of_crafting_collect(Entity_Pickup *param_1)
|
|
{
|
|
int iVar1;
|
|
float fVar2;
|
|
Entity *pEVar3;
|
|
byte bVar4;
|
|
uint uVar5;
|
|
undefined3 extraout_var;
|
|
byte *animName;
|
|
uint *craftingOutput;
|
|
HUD *playerHud;
|
|
Entity_Player *in_ECX;
|
|
char *collectAnimName;
|
|
Entity_Pickup *extraout_ECX;
|
|
Entity_Pickup *pickup;
|
|
uint uVar6;
|
|
int iVar7;
|
|
bool isLess;
|
|
Entity *local_50;
|
|
Entity_Pickup *collectedPickup;
|
|
ColorMod poofColor;
|
|
undefined1 local_1c [12];
|
|
float local_10;
|
|
uint local_c;
|
|
undefined1 auStack_8 [4];
|
|
bool isCoinUpgraded;
|
|
Manager *manager;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
|
|
collectedPickup = param_1;
|
|
uVar5 = param_1->_variant;
|
|
if ((((uVar5 == 10) || (uVar5 == 0x14)) || (uVar5 == 0x5a)) ||
|
|
(((uVar5 == 0x28 || (uVar5 == 0x1e)) || ((uVar5 == 0x46 || (uVar5 == 300)))))) {
|
|
if ((uVar5 == 0x45) || (uVar5 == 0x29)) goto switchD_007d5299_caseD_4;
|
|
}
|
|
else if ((uVar5 == 0x15e) || (((uVar5 == 0x45 || (uVar5 == 0x29)) || (uVar5 != 0x2a))))
|
|
goto switchD_007d5299_caseD_4;
|
|
if ((param_1->_price != 0) &&
|
|
(uVar5 = (GHIDRA_CAST<Entity_Pickup *>((param_1)))->Entity_Pickup::can_player_buy(in_ECX), (char)uVar5 == '\0'))
|
|
goto switchD_007d5299_caseD_4;
|
|
iVar1 = param_1->_variant;
|
|
iVar7 = param_1->_subtype;
|
|
local_50 = GHIDRA_CAST<Entity *>(0x0);
|
|
isCoinUpgraded = false;
|
|
bVar4 = HasCollectible(in_ECX,0x3b,0);
|
|
pickup = collectedPickup;
|
|
uVar5 = CONCAT31(extraout_var,bVar4);
|
|
if ((bVar4 == 0) || (iVar1 != 10)) {
|
|
if (iVar1 < 0x2b) {
|
|
if (iVar1 != 0x2a) goto LAB_007d5282;
|
|
}
|
|
else if (iVar1 != 0x46) {
|
|
if (iVar1 == 0x5a) {
|
|
if ((iVar7 == 1) || (iVar7 == 3)) goto LAB_007d54dd;
|
|
}
|
|
else {
|
|
if (iVar1 != 300) goto switchD_007d5299_caseD_4;
|
|
if (iVar7 == 0x31) goto LAB_007d54dd;
|
|
if (iVar7 != 0x4e) {
|
|
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCard(collectedPickup->_subtype);
|
|
}
|
|
}
|
|
goto LAB_007d54e0;
|
|
}
|
|
goto LAB_007d54dd;
|
|
}
|
|
if (((iVar7 == 2) || (iVar7 == 1)) || (iVar7 == 5)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) = 1;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x8))) = 0x13;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x0))) = collectedPickup->_initSeed;
|
|
local_10 = 4.2039e-45;
|
|
uVar5 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_1c))))->RNG::RandomInt(8);
|
|
if (uVar5 != 0) goto LAB_007d5282;
|
|
iVar7 = 6;
|
|
isCoinUpgraded = true;
|
|
}
|
|
else {
|
|
LAB_007d5282:
|
|
isCoinUpgraded = false;
|
|
if (0x1e < iVar1 - 10U) goto switchD_007d5299_caseD_4;
|
|
}
|
|
uVar5 = 0;
|
|
pickup = collectedPickup;
|
|
/* WARNING (jumptable): Sanity check requires truncation of jumptable */
|
|
/* WARNING: Could not find normalized switch variable to match jumptable */
|
|
switch(*GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&PTR_caseD_2_007d587c) + iVar1 + 2))) {
|
|
case 0:
|
|
switch(iVar7) {
|
|
case 3:
|
|
case 8:
|
|
break;
|
|
case 4:
|
|
break;
|
|
case 5:
|
|
local_50 = GHIDRA_CAST<Entity *>(0x1);
|
|
break;
|
|
case 6:
|
|
break;
|
|
case 7:
|
|
break;
|
|
default:
|
|
break;
|
|
case 10:
|
|
local_50 = GHIDRA_CAST<Entity *>(0x1);
|
|
break;
|
|
case 0xb:
|
|
break;
|
|
case 0xc:
|
|
}
|
|
break;
|
|
case 1:
|
|
switch(iVar7) {
|
|
case 2:
|
|
break;
|
|
case 3:
|
|
break;
|
|
case 4:
|
|
local_50 = GHIDRA_CAST<Entity *>(0x8);
|
|
break;
|
|
case 5:
|
|
break;
|
|
case 6:
|
|
goto switchD_007d5299_caseD_4;
|
|
case 7:
|
|
break;
|
|
default:
|
|
}
|
|
break;
|
|
case 2:
|
|
if (iVar7 == 2) break;
|
|
if (iVar7 == 3) {
|
|
local_50 = GHIDRA_CAST<Entity *>(0xc);
|
|
break;
|
|
}
|
|
goto LAB_007d54e0;
|
|
case 3:
|
|
if (iVar7 == 2) {
|
|
local_50 = GHIDRA_CAST<Entity *>(0xf);
|
|
}
|
|
else if (iVar7 != 4) goto LAB_007d54e0;
|
|
break;
|
|
case 4:
|
|
switchD_007d5299_caseD_4:
|
|
return uVar5 & 0xffffff00;
|
|
}
|
|
LAB_007d54dd:
|
|
pickup = collectedPickup;
|
|
LAB_007d54e0:
|
|
uVar6 = 0;
|
|
uVar5 = 0;
|
|
do {
|
|
if (in_ECX->_bagOfCraftingContent[uVar5] == 0) break;
|
|
uVar5 = uVar5 + 1;
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar5 < 8);
|
|
uVar5 = 0;
|
|
do {
|
|
fVar2 = poofColor._tint[uVar5 - 3];
|
|
if (fVar2 != 0.0) {
|
|
if (7 < uVar6) {
|
|
uVar6 = 7;
|
|
in_ECX->_bagOfCraftingContent[0] = in_ECX->_bagOfCraftingContent[1];
|
|
in_ECX->_bagOfCraftingContent[1] = in_ECX->_bagOfCraftingContent[2];
|
|
in_ECX->_bagOfCraftingContent[2] = in_ECX->_bagOfCraftingContent[3];
|
|
in_ECX->_bagOfCraftingContent[3] = in_ECX->_bagOfCraftingContent[4];
|
|
in_ECX->_bagOfCraftingContent[4] = in_ECX->_bagOfCraftingContent[5];
|
|
in_ECX->_bagOfCraftingContent[5] = in_ECX->_bagOfCraftingContent[6];
|
|
in_ECX->_bagOfCraftingContent[6] = in_ECX->_bagOfCraftingContent[7];
|
|
in_ECX->_bagOfCraftingContent[7] = 0;
|
|
}
|
|
in_ECX->_bagOfCraftingContent[uVar6] = SUB41(fVar2,0);
|
|
uVar6 = uVar6 + 1;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < 2);
|
|
uVar5 = Random();
|
|
local_10 = (pickup->_pos).y;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x8))) = (pickup->_pos).x;
|
|
local_50 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,GHIDRA_CAST<Vector *>((local_1c + 8)),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,
|
|
uVar5);
|
|
if (isCoinUpgraded) {
|
|
poofColor._offset[0] = 0.0;
|
|
poofColor._colorize[0] = 0.0;
|
|
poofColor._colorize[1] = 0.0;
|
|
poofColor._colorize[2] = 0.0;
|
|
poofColor._colorize[3] = 0.0;
|
|
poofColor._offset[1] = 0.0;
|
|
poofColor._offset[2] = 0.0;
|
|
poofColor._tint[0] = 0.12;
|
|
poofColor._tint[1] = 0.12;
|
|
poofColor._tint[2] = 0.12;
|
|
poofColor._tint[3] = 1.0;
|
|
local_50->SetColor(&poofColor,0xffffffff,0xff,0,1);
|
|
}
|
|
local_50->Update();
|
|
Entity_Pickup::RemoveOtherOptions();
|
|
local_50 = GHIDRA_CAST<Entity *>(&pickup->_sprite);
|
|
(pickup->_velocity).x = g_vectorZero.x;
|
|
(pickup->_velocity).y = g_vectorZero.y;
|
|
pickup->_entityCollisionClass = 0;
|
|
pickup->_entityGridCollisionClass = 3;
|
|
animName = (pickup->_sprite)._animState._animData;
|
|
if (animName == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_007d5690:
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((&pickup->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Collect"),1);
|
|
pEVar3 = local_50;
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&local_50->_subtype))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar3)) + 0x44))) = 1;
|
|
pickup = collectedPickup;
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint *>((animName + 0x14))) {
|
|
animName = *GHIDRA_CAST<byte **>(animName);
|
|
}
|
|
collectAnimName = "Collect";
|
|
do {
|
|
bVar4 = *animName;
|
|
isLess = bVar4 < (byte)*collectAnimName;
|
|
if (bVar4 != *collectAnimName) {
|
|
LAB_007d5670:
|
|
uVar5 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007d5675;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = animName[1];
|
|
isLess = bVar4 < (byte)collectAnimName[1];
|
|
if (bVar4 != collectAnimName[1]) goto LAB_007d5670;
|
|
animName = animName + 2;
|
|
collectAnimName = collectAnimName + 2;
|
|
} while (bVar4 != 0);
|
|
uVar5 = 0;
|
|
LAB_007d5675:
|
|
if ((uVar5 != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((pickup->_sprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((pickup->_sprite)._animState._isPlaying == 0)))) goto LAB_007d5690;
|
|
}
|
|
local_50 = GHIDRA_CAST<Entity *>(0xf9);
|
|
pickup->_dead = 1;
|
|
manager = g_manager;
|
|
if (isCoinUpgraded) {
|
|
local_50 = GHIDRA_CAST<Entity *>(0x13c);
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_50));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_50),1.0,2,0,1.0,0.0);
|
|
pickup = collectedPickup;
|
|
if (collectedPickup->_price != 0) {
|
|
(GHIDRA_CAST<Entity_Pickup *>((collectedPickup)))->Entity_Pickup::CollectTrinket(in_ECX,0);
|
|
pickup = extraout_ECX;
|
|
}
|
|
if (uVar6 < 8) {
|
|
playerHud = &g_game->_hud;
|
|
in_ECX->_bagOfCraftingOutput = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1f50)))) = 0xffffffff;
|
|
if (in_ECX == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_007d57e0;
|
|
uVar5 = 0;
|
|
while (*GHIDRA_CAST<Entity_Player **>(playerHud->_playerHUD) != in_ECX) {
|
|
uVar5 = uVar5 + 1;
|
|
playerHud = GHIDRA_CAST<HUD *>((playerHud->_playerHUD + 0x6dc));
|
|
if (7 < uVar5) {
|
|
return CONCAT31((int3)(GHIDRA_UINT(playerHud) >> 8),1);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
craftingOutput =
|
|
CalculateBagOfCraftingOutput
|
|
(GHIDRA_CAST<uint *>((local_1c + 8)),in_ECX->_bagOfCraftingContent,(byte)pickup);
|
|
uVar5 = *craftingOutput;
|
|
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1f50)))) = craftingOutput[1];
|
|
playerHud = &g_game->_hud;
|
|
in_ECX->_bagOfCraftingOutput = uVar5;
|
|
if (in_ECX == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_007d57e0:
|
|
if (*GHIDRA_CAST<int *>(playerHud->_playerHUD) != 0) {
|
|
playerHud->_playerHUD[0x6ad] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0x6dc)) != 0) {
|
|
playerHud->_playerHUD[0xd89] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0xdb8)) != 0) {
|
|
playerHud->_playerHUD[0x1465] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0x1494)) != 0) {
|
|
playerHud->_playerHUD[0x1b41] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0x1b70)) != 0) {
|
|
playerHud->_playerHUD[0x221d] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0x224c)) != 0) {
|
|
playerHud->_playerHUD[0x28f9] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0x2928)) != 0) {
|
|
playerHud->_playerHUD[0x2fd5] = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((playerHud->_playerHUD + 0x3004)) != 0) {
|
|
playerHud->_playerHUD[0x36b1] = 1;
|
|
}
|
|
return CONCAT31((int3)(GHIDRA_UINT(playerHud) >> 8),1);
|
|
}
|
|
uVar5 = 0;
|
|
while (*GHIDRA_CAST<Entity_Player **>(playerHud->_playerHUD) != in_ECX) {
|
|
uVar5 = uVar5 + 1;
|
|
playerHud = GHIDRA_CAST<HUD *>((playerHud->_playerHUD + 0x6dc));
|
|
if (7 < uVar5) {
|
|
return CONCAT31((int3)(GHIDRA_UINT(playerHud) >> 8),1);
|
|
}
|
|
}
|
|
}
|
|
playerHud->_playerHUD[0x6ad] = 1;
|
|
return CONCAT31((int3)(GHIDRA_UINT(playerHud) >> 8),1);
|
|
}
|
|
|
|
// 007d65c0
|
|
int Entity_Player::GetMaxPoopMana()
|
|
{
|
|
Entity_Player *birthrightOwner;
|
|
|
|
birthrightOwner = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstBirthrightOwner(0x19);
|
|
return (-GHIDRA_UINT((birthrightOwner != GHIDRA_CAST<Entity_Player *>(0x0))) & 0x14) + 9;
|
|
}
|
|
|
|
// 007d65e0
|
|
void Entity_Player::AddPoopMana(int amount)
|
|
{
|
|
Entity_Player *birthrightOwner;
|
|
int *clampedPtr;
|
|
int *cappedPtr;
|
|
int newMana;
|
|
int minMana;
|
|
int maxMana;
|
|
Game *game;
|
|
|
|
newMana = amount + this->_poopMana;
|
|
amount = newMana;
|
|
birthrightOwner = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstBirthrightOwner(0x19);
|
|
minMana = 0;
|
|
maxMana = (-GHIDRA_UINT((birthrightOwner != GHIDRA_CAST<Entity_Player *>(0x0))) & 0x14) + 9;
|
|
cappedPtr = &amount;
|
|
if (maxMana <= newMana) {
|
|
cappedPtr = &maxMana;
|
|
}
|
|
clampedPtr = &minMana;
|
|
if (0 < *cappedPtr) {
|
|
clampedPtr = cappedPtr;
|
|
}
|
|
this->_poopMana = *clampedPtr;
|
|
ConsumableCountChanged(this,0x80);
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d6670
|
|
void Entity_Player::poop_spell_roll()
|
|
{
|
|
code *pcVar1;
|
|
uint uVar2;
|
|
int *weightPtr;
|
|
int cumulativeWeight;
|
|
byte bVar3;
|
|
uint uVar4;
|
|
uint uVar5;
|
|
void *freeBlock;
|
|
uint weightRoll;
|
|
undefined4 earlyDiarrheaEntry;
|
|
undefined4 earlyDiarrheaWeight;
|
|
undefined4 earlyHolyEntry;
|
|
undefined4 earlyHolyWeight;
|
|
undefined4 earlyBlackEntry;
|
|
undefined4 earlyBlackWeight;
|
|
undefined4 midBombEntry;
|
|
undefined4 midBombWeight;
|
|
undefined4 midStinkyEntry;
|
|
undefined4 midStinkyWeight;
|
|
undefined4 midStoneEntry;
|
|
undefined4 midStoneWeight;
|
|
undefined4 midBurningEntry;
|
|
undefined4 midBurningWeight;
|
|
undefined4 midCornyEntry;
|
|
undefined4 midCornyWeight;
|
|
undefined4 lateBombEntry;
|
|
undefined4 lateBombWeight;
|
|
undefined4 lateStinkyEntry;
|
|
undefined4 lateStinkyWeight;
|
|
undefined4 lateStoneEntry;
|
|
undefined4 lateStoneWeight;
|
|
undefined4 lateBurningEntry;
|
|
undefined4 lateBurningWeight;
|
|
undefined4 lateCornyEntry;
|
|
undefined4 lateCornyWeight;
|
|
undefined4 lateLiquidEntry;
|
|
undefined4 lateLiquidWeight;
|
|
undefined4 lateFartEntry;
|
|
undefined4 lateFartWeight;
|
|
undefined4 latePoopEntry;
|
|
undefined4 latePoopWeight;
|
|
undefined4 local_54;
|
|
uint slot;
|
|
uint local_4c;
|
|
Entity_Player *player;
|
|
void *earlyPoolData;
|
|
void *earlyPoolBegin;
|
|
undefined4 *earlyPoolEnd;
|
|
undefined4 *earlyPoolCapacity;
|
|
RNG *spellRng;
|
|
void *midPoolData;
|
|
void *latePoolData;
|
|
void *midPoolBegin;
|
|
undefined4 *midPoolEnd;
|
|
undefined4 *midPoolCapacity;
|
|
void *latePoolBegin;
|
|
undefined4 *latePoolEnd;
|
|
undefined4 *latePoolCapacity;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
RNG *rng;
|
|
void *latePoolDataCopy;
|
|
undefined4 *latePoolEndCopy;
|
|
Entity_Player *playerCopy;
|
|
RNG *spellRngCopy;
|
|
|
|
puStack_c = &LAB_00b0039d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
spellRng = GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0x17a0));
|
|
slot = 0;
|
|
player = this;
|
|
do {
|
|
if (this->_poopSpellQueue[slot] == 0) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) == '\0') {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f5e))) = 10;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) = 1;
|
|
latePoolBegin = (void *)0x0;
|
|
latePoolEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
latePoolCapacity = GHIDRA_CAST<undefined4 *>(0x0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f5f))) = 9;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) + '\x01';
|
|
this->_poopSpellQueue[(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((byte)this)) + 0x1f72))) + 6] = 8;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) + '\x01';
|
|
local_8 = 0;
|
|
latePoopEntry = 1;
|
|
latePoopWeight = 5;
|
|
std::vector<8byte>::_Emplace_reallocate(0,&latePoopEntry);
|
|
uVar2 = 0;
|
|
latePoolData = latePoolBegin;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 9) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 5;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d67ba;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateFartEntry = 9;
|
|
lateFartWeight = 5;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateFartEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 9;
|
|
latePoolEnd[1] = 5;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d67ba:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 8) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 3;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6821;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateLiquidEntry = 8;
|
|
lateLiquidWeight = 3;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateLiquidEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 8;
|
|
latePoolEnd[1] = 3;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d6821:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 2) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d688a;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateCornyEntry = 2;
|
|
lateCornyWeight = 1;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateCornyEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 2;
|
|
latePoolEnd[1] = 1;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d688a:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 3) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d68f1;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateBurningEntry = 3;
|
|
lateBurningWeight = 1;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateBurningEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 3;
|
|
latePoolEnd[1] = 1;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d68f1:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 4) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d695a;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateStoneEntry = 4;
|
|
lateStoneWeight = 1;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateStoneEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 4;
|
|
latePoolEnd[1] = 1;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d695a:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 5) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d69ca;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateStinkyEntry = 5;
|
|
lateStinkyWeight = 1;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateStinkyEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 5;
|
|
latePoolEnd[1] = 1;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d69ca:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8)) == 10) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6a3a;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
lateBombEntry = 10;
|
|
lateBombWeight = 1;
|
|
if (latePoolEnd == latePoolCapacity) {
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(latePoolEnd,&lateBombEntry);
|
|
}
|
|
else {
|
|
*latePoolEnd = 10;
|
|
latePoolEnd[1] = 1;
|
|
latePoolEnd = latePoolEnd + 2;
|
|
}
|
|
LAB_007d6a3a:
|
|
latePoolEndCopy = latePoolEnd;
|
|
latePoolDataCopy = latePoolBegin;
|
|
midPoolBegin = (void *)0x0;
|
|
midPoolEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
midPoolCapacity = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
midCornyEntry = 2;
|
|
midCornyWeight = 1;
|
|
latePoolData = latePoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(0,&midCornyEntry);
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(midPoolEnd) - GHIDRA_INT(midPoolBegin) >> 3;
|
|
midPoolData = midPoolBegin;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8)) == 3) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(midPoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6af3;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
midBurningEntry = 3;
|
|
midBurningWeight = 1;
|
|
if (midPoolEnd == midPoolCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&midBurningEntry);
|
|
}
|
|
else {
|
|
*midPoolEnd = 3;
|
|
midPoolEnd[1] = 1;
|
|
midPoolEnd = midPoolEnd + 2;
|
|
}
|
|
LAB_007d6af3:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(midPoolEnd) - GHIDRA_INT(midPoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8)) == 4) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(midPoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6b64;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
midStoneEntry = 4;
|
|
midStoneWeight = 1;
|
|
if (midPoolEnd == midPoolCapacity) {
|
|
midPoolData = midPoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&midStoneEntry);
|
|
}
|
|
else {
|
|
*midPoolEnd = 4;
|
|
midPoolEnd[1] = 1;
|
|
midPoolEnd = midPoolEnd + 2;
|
|
}
|
|
LAB_007d6b64:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(midPoolEnd) - GHIDRA_INT(midPoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8)) == 5) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(midPoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6bd5;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
midStinkyEntry = 5;
|
|
midStinkyWeight = 1;
|
|
if (midPoolEnd == midPoolCapacity) {
|
|
midPoolData = midPoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&midStinkyEntry);
|
|
}
|
|
else {
|
|
*midPoolEnd = 5;
|
|
midPoolEnd[1] = 1;
|
|
midPoolEnd = midPoolEnd + 2;
|
|
}
|
|
LAB_007d6bd5:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(midPoolEnd) - GHIDRA_INT(midPoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8)) == 10) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(midPoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(midPoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6c46;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
midBombEntry = 10;
|
|
midBombWeight = 1;
|
|
if (midPoolEnd == midPoolCapacity) {
|
|
midPoolData = midPoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(midPoolEnd,&midBombEntry);
|
|
}
|
|
else {
|
|
*midPoolEnd = 10;
|
|
midPoolEnd[1] = 1;
|
|
midPoolEnd = midPoolEnd + 2;
|
|
}
|
|
LAB_007d6c46:
|
|
earlyPoolBegin = (void *)0x0;
|
|
earlyPoolEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
earlyPoolCapacity = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
earlyBlackEntry = 6;
|
|
earlyBlackWeight = 1;
|
|
midPoolData = midPoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(0,&earlyBlackEntry);
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(earlyPoolEnd) - GHIDRA_INT(earlyPoolBegin) >> 3;
|
|
earlyPoolData = earlyPoolBegin;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(earlyPoolBegin) + uVar2 * 8)) == 7) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(earlyPoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(earlyPoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6cfb;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
earlyHolyEntry = 7;
|
|
earlyHolyWeight = 1;
|
|
if (earlyPoolEnd == earlyPoolCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(earlyPoolEnd,&earlyHolyEntry);
|
|
}
|
|
else {
|
|
*earlyPoolEnd = 7;
|
|
earlyPoolEnd[1] = 1;
|
|
earlyPoolEnd = earlyPoolEnd + 2;
|
|
}
|
|
LAB_007d6cfb:
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(earlyPoolEnd) - GHIDRA_INT(earlyPoolBegin) >> 3;
|
|
if (uVar4 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(earlyPoolBegin) + uVar2 * 8)) == 0xb) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(earlyPoolBegin) + uVar2 * 8 + 4));
|
|
*weightPtr = *weightPtr + 1;
|
|
if (*weightPtr < 0) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(earlyPoolBegin) + uVar2 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_007d6d73;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar4);
|
|
}
|
|
earlyDiarrheaEntry = 0xb;
|
|
earlyDiarrheaWeight = 1;
|
|
if (earlyPoolEnd == earlyPoolCapacity) {
|
|
earlyPoolData = earlyPoolBegin;
|
|
std::vector<8byte>::_Emplace_reallocate(earlyPoolEnd,&earlyDiarrheaEntry);
|
|
}
|
|
else {
|
|
*earlyPoolEnd = 0xb;
|
|
earlyPoolEnd[1] = 1;
|
|
earlyPoolEnd = earlyPoolEnd + 2;
|
|
}
|
|
LAB_007d6d73:
|
|
bVar3 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72)));
|
|
playerCopy = player;
|
|
earlyPoolData = earlyPoolBegin;
|
|
spellRngCopy = spellRng;
|
|
while (player = playerCopy, spellRng = spellRngCopy, bVar3 < 0x14) {
|
|
uVar2 = spellRngCopy->_seed;
|
|
if (bVar3 < 4) {
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar2 = spellRngCopy->_seed;
|
|
if (uVar2 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar2 = uVar2 >> ((byte)spellRngCopy->_shift1 & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 << ((byte)spellRngCopy->_shift2 & 0x1f) ^ uVar2;
|
|
uVar4 = 0;
|
|
uVar2 = uVar2 >> ((byte)spellRngCopy->_shift3 & 0x1f) ^ uVar2;
|
|
local_4c = 7;
|
|
spellRngCopy->_seed = uVar2;
|
|
weightRoll = 0;
|
|
uVar5 = GHIDRA_INT(earlyPoolEnd) - GHIDRA_INT(earlyPoolData) >> 3;
|
|
if (uVar5 != 0) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(earlyPoolData) + 4));
|
|
do {
|
|
weightRoll = weightRoll + *weightPtr;
|
|
weightPtr = weightPtr + 2;
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < uVar5);
|
|
}
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar2 = uVar2 >> 5 ^ uVar2;
|
|
uVar2 = uVar2 << 9 ^ uVar2;
|
|
if (weightRoll == 0) {
|
|
weightRoll = 0;
|
|
}
|
|
else {
|
|
weightRoll = (uVar2 >> 7 ^ uVar2) % weightRoll;
|
|
}
|
|
cumulativeWeight = 0;
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(earlyPoolEnd) - GHIDRA_INT(earlyPoolData) >> 3;
|
|
if (uVar4 == 0) {
|
|
LAB_007d6e6a:
|
|
KAGE_LogMessage(0x10,(byte *)
|
|
"No weights were added. At least one outcome needs weight.");
|
|
}
|
|
else {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(earlyPoolData) + 4));
|
|
do {
|
|
cumulativeWeight = cumulativeWeight + *weightPtr;
|
|
if (GHIDRA_INT(weightRoll) < cumulativeWeight) {
|
|
bVar3 = (byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(earlyPoolData) + uVar2 * 8));
|
|
goto LAB_007d6e7b;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
weightPtr = weightPtr + 2;
|
|
} while (uVar2 < uVar4);
|
|
if (cumulativeWeight < 1) goto LAB_007d6e6a;
|
|
}
|
|
bVar3 = 0;
|
|
LAB_007d6e7b:
|
|
player->_poopSpellQueue[(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((byte)player)) + 0x1f72))) + 6] = bVar3;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1f72))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1f72))) + '\x01';
|
|
bVar3 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1f72)));
|
|
playerCopy = player;
|
|
spellRngCopy = spellRng;
|
|
latePoolEndCopy = latePoolEnd;
|
|
}
|
|
else {
|
|
if (bVar3 < 0xf) {
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar2 = spellRngCopy->_seed;
|
|
if (uVar2 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar2 = uVar2 >> ((byte)spellRngCopy->_shift1 & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 << ((byte)spellRngCopy->_shift2 & 0x1f) ^ uVar2;
|
|
uVar4 = 0;
|
|
uVar2 = uVar2 >> ((byte)spellRngCopy->_shift3 & 0x1f) ^ uVar2;
|
|
local_4c = 7;
|
|
spellRngCopy->_seed = uVar2;
|
|
weightRoll = 0;
|
|
uVar5 = GHIDRA_INT(midPoolEnd) - GHIDRA_INT(midPoolData) >> 3;
|
|
if (uVar5 != 0) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(midPoolData) + 4));
|
|
do {
|
|
weightRoll = weightRoll + *weightPtr;
|
|
weightPtr = weightPtr + 2;
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < uVar5);
|
|
}
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar2 = uVar2 >> 5 ^ uVar2;
|
|
uVar2 = uVar2 << 9 ^ uVar2;
|
|
if (weightRoll == 0) {
|
|
weightRoll = 0;
|
|
}
|
|
else {
|
|
weightRoll = (uVar2 >> 7 ^ uVar2) % weightRoll;
|
|
}
|
|
cumulativeWeight = 0;
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(midPoolEnd) - GHIDRA_INT(midPoolData) >> 3;
|
|
if (uVar4 == 0) goto LAB_007d6f8c;
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(midPoolData) + 4));
|
|
do {
|
|
cumulativeWeight = cumulativeWeight + *weightPtr;
|
|
if (GHIDRA_INT(weightRoll) < cumulativeWeight) {
|
|
bVar3 = (byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(midPoolData) + uVar2 * 8));
|
|
goto LAB_007d6f9d;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
weightPtr = weightPtr + 2;
|
|
} while (uVar2 < uVar4);
|
|
LAB_007d6f88:
|
|
if (cumulativeWeight < 1) goto LAB_007d6f8c;
|
|
}
|
|
else {
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar2 = spellRngCopy->_seed;
|
|
if (uVar2 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar2 = uVar2 >> ((byte)spellRngCopy->_shift1 & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 << ((byte)spellRngCopy->_shift2 & 0x1f) ^ uVar2;
|
|
uVar4 = 0;
|
|
local_4c = uVar2 >> ((byte)spellRngCopy->_shift3 & 0x1f) ^ uVar2;
|
|
spellRngCopy->_seed = local_4c;
|
|
uVar5 = 0;
|
|
local_54 = 7;
|
|
uVar2 = GHIDRA_INT(latePoolEndCopy) - GHIDRA_INT(latePoolDataCopy) >> 3;
|
|
if (uVar2 != 0) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolDataCopy) + 4));
|
|
do {
|
|
uVar5 = uVar5 + *weightPtr;
|
|
weightPtr = weightPtr + 2;
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < uVar2);
|
|
}
|
|
if (local_4c == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar2 = local_4c >> 5 ^ local_4c;
|
|
uVar2 = uVar2 << 9 ^ uVar2;
|
|
if (uVar5 == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = (uVar2 >> 7 ^ uVar2) % uVar5;
|
|
}
|
|
cumulativeWeight = 0;
|
|
uVar2 = 0;
|
|
uVar4 = GHIDRA_INT(latePoolEnd) - GHIDRA_INT(latePoolDataCopy) >> 3;
|
|
if (uVar4 != 0) {
|
|
weightPtr = GHIDRA_CAST<int *>((GHIDRA_INT(latePoolDataCopy) + 4));
|
|
do {
|
|
cumulativeWeight = cumulativeWeight + *weightPtr;
|
|
if (GHIDRA_INT(uVar5) < cumulativeWeight) {
|
|
bVar3 = (byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(latePoolDataCopy) + uVar2 * 8));
|
|
goto LAB_007d6f9d;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
weightPtr = weightPtr + 2;
|
|
} while (uVar2 < uVar4);
|
|
goto LAB_007d6f88;
|
|
}
|
|
LAB_007d6f8c:
|
|
KAGE_LogMessage(0x10,(byte *)
|
|
"No weights were added. At least one outcome needs weight.");
|
|
}
|
|
bVar3 = 0;
|
|
LAB_007d6f9d:
|
|
player->_poopSpellQueue[(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((byte)player)) + 0x1f72))) + 6] = bVar3;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1f72))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1f72))) + '\x01';
|
|
bVar3 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1f72)));
|
|
playerCopy = player;
|
|
spellRngCopy = spellRng;
|
|
latePoolEndCopy = latePoolEnd;
|
|
}
|
|
}
|
|
uVar2 = 0;
|
|
do {
|
|
uVar4 = spellRng->_seed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar4 = spellRng->_seed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
latePoolDataCopy = latePoolData;
|
|
uVar4 = uVar4 >> ((byte)spellRng->_shift1 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((byte)spellRng->_shift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((byte)spellRng->_shift3 & 0x1f) ^ uVar4;
|
|
uVar5 = 0;
|
|
spellRng->_seed = uVar4;
|
|
if (0x14 - uVar2 != 0) {
|
|
uVar5 = uVar4 % (0x14 - uVar2);
|
|
}
|
|
uVar5 = uVar5 + uVar2;
|
|
if (uVar5 != uVar2) {
|
|
bVar3 = playerCopy->_poopSpellQueue[uVar2 + 6];
|
|
playerCopy->_poopSpellQueue[uVar2 + 6] = playerCopy->_poopSpellQueue[uVar5 + 6];
|
|
playerCopy->_poopSpellQueue[uVar5 + 6] = bVar3;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < 0x13);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
if (earlyPoolData != (void *)0x0) {
|
|
uVar2 = (GHIDRA_INT(earlyPoolCapacity) - GHIDRA_INT(earlyPoolData) >> 3) * 8;
|
|
freeBlock = earlyPoolData;
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)(GHIDRA_CAST<char *>(earlyPoolData) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(earlyPoolData) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_007d7282;
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
earlyPoolBegin = (void *)0x0;
|
|
earlyPoolEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
earlyPoolCapacity = GHIDRA_CAST<undefined4 *>(0x0);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
if (midPoolData != (void *)0x0) {
|
|
uVar2 = (GHIDRA_INT(midPoolCapacity) - GHIDRA_INT(midPoolData) >> 3) * 8;
|
|
freeBlock = midPoolData;
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)(GHIDRA_CAST<char *>(midPoolData) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(midPoolData) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_007d7282;
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
midPoolBegin = (void *)0x0;
|
|
midPoolEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
midPoolCapacity = GHIDRA_CAST<undefined4 *>(0x0);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
|
|
if (latePoolDataCopy != (void *)0x0) {
|
|
uVar2 = GHIDRA_INT(latePoolCapacity) - GHIDRA_INT(latePoolDataCopy) & 0xfffffff8;
|
|
freeBlock = latePoolDataCopy;
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)(GHIDRA_CAST<char *>(latePoolDataCopy) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(latePoolDataCopy) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
LAB_007d7282:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
}
|
|
this = player;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1f72))) + -1;
|
|
this->_poopSpellQueue[slot] = this->_poopSpellQueue[(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((byte)this)) + 0x1f72))) + 6];
|
|
}
|
|
slot = slot + 1;
|
|
if (5 < slot) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 007d7290
|
|
void Entity_Player::UsePoopSpell(uint param_2)
|
|
{
|
|
Vector *pos;
|
|
int iVar1;
|
|
code *pcVar2;
|
|
ANM2 *pAVar3;
|
|
uint rngResult;
|
|
Entity *spawned;
|
|
ColorMod *color;
|
|
Vector *direction;
|
|
uint *poopRngSeed;
|
|
undefined1 auStack_68 [4];
|
|
EntityPtr *local_64;
|
|
Vector local_60;
|
|
undefined4 local_58;
|
|
undefined4 local_54;
|
|
BitSet128 bombFlags;
|
|
Color fartColor;
|
|
uint securityCookie;
|
|
void *collectibleRngs;
|
|
Game *game;
|
|
Manager *manager;
|
|
float *nullItems;
|
|
EntityPtr oldParent;
|
|
EntityPtr *parentRef;
|
|
|
|
manager = g_manager;
|
|
securityCookie = __security_cookie ^ GHIDRA_UINT(auStack_68);
|
|
collectibleRngs = (this->_collectibleRNGs)._begin;
|
|
poopRngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(collectibleRngs) + 0x17a0));
|
|
if (((-1 < GHIDRA_INT(param_2)) && (param_2 < 0xc)) &&
|
|
(local_64 = GHIDRA_CAST<EntityPtr *>((&PTR_00b6ba00)[param_2]), 0 < GHIDRA_INT(local_64))) {
|
|
rngResult = *poopRngSeed;
|
|
if (rngResult == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
rngResult = *poopRngSeed;
|
|
if (rngResult == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
game = g_game;
|
|
rngResult = rngResult >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(collectibleRngs) + 0x17a4)) & 0x1f) ^
|
|
rngResult;
|
|
rngResult = rngResult << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(collectibleRngs) + 0x17a8)) & 0x1f) ^
|
|
rngResult;
|
|
rngResult = rngResult >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(collectibleRngs) + 0x17ac)) & 0x1f) ^
|
|
rngResult;
|
|
*poopRngSeed = rngResult;
|
|
spawned = (GHIDRA_CAST<Game *>((game)))->Game::SpawnEx(0xf5,GHIDRA_UINT(local_64),&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,
|
|
rngResult,0);
|
|
spawned->Update();
|
|
if ((spawned->_sprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::AdvancePosition
|
|
(&(spawned->_sprite)._animState,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((spawned->_sprite)._animState._animData) + 0x30)) + -1);
|
|
}
|
|
TryHoldEntity(this,spawned);
|
|
manager = g_manager;
|
|
local_64 = GHIDRA_CAST<EntityPtr *>(0x25f);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_64));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_64),1.0,2,0,1.0,0.0);
|
|
return;
|
|
}
|
|
switch(param_2) {
|
|
case 8:
|
|
local_64 = GHIDRA_CAST<EntityPtr *>(0x25);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_64));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_64),1.0,2,0,1.0,0.0);
|
|
manager = g_manager;
|
|
local_64 = GHIDRA_CAST<EntityPtr *>(0x95);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_64));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_64),1.0,2,0,1.5,0.0);
|
|
rngResult = Random();
|
|
local_60.x = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xc3,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,
|
|
rngResult,0);
|
|
oldParent = (GHIDRA_CAST<Entity *>(local_60.x))->_parent;
|
|
pAVar3 = &(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_60.x) + 0x410)))->_sprite;
|
|
(pAVar3->_filename)._buf[4] = '$';
|
|
(pAVar3->_filename)._buf[5] = '\0';
|
|
(pAVar3->_filename)._buf[6] = '\0';
|
|
(pAVar3->_filename)._buf[7] = '\0';
|
|
parentRef = &(GHIDRA_CAST<Entity *>(local_60.x))->_parent;
|
|
pAVar3 = &(GHIDRA_CAST<Entity *>((GHIDRA_INT(local_60.x) + 0x410)))->_sprite;
|
|
(pAVar3->_filename)._buf[8] = '$';
|
|
(pAVar3->_filename)._buf[9] = '\0';
|
|
(pAVar3->_filename)._buf[10] = '\0';
|
|
(pAVar3->_filename)._buf[0xb] = '\0';
|
|
if (oldParent != (EntityPtr)0x0) {
|
|
local_64 = parentRef;
|
|
std::multiset<unsigned_int>::erase(&local_64);
|
|
}
|
|
*parentRef = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(parentRef);
|
|
(**(code **)(*GHIDRA_CAST<int *>(local_60.x) + 0xc))();
|
|
break;
|
|
case 9:
|
|
(GHIDRA_CAST<Color *>((&fartColor)))->Color::Color();
|
|
pos = &this->_pos;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(pos,85.0,GHIDRA_CAST<Entity *>(this),1.0,0,color);
|
|
Game::ButterBeanFart(g_game,pos,120.0,GHIDRA_CAST<Entity *>(this),0,0);
|
|
rngResult = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x8d,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,rngResult,0);
|
|
iVar1 = *GHIDRA_CAST<int *>(spawned);
|
|
pAVar3 = &spawned[1]._sprite;
|
|
(pAVar3->_filename)._buf[4] = -1;
|
|
(pAVar3->_filename)._buf[5] = -1;
|
|
(pAVar3->_filename)._buf[6] = -1;
|
|
(pAVar3->_filename)._buf[7] = -1;
|
|
pAVar3 = &spawned[1]._sprite;
|
|
(pAVar3->_filename)._buf[8] = -1;
|
|
(pAVar3->_filename)._buf[9] = -1;
|
|
(pAVar3->_filename)._buf[10] = -1;
|
|
(pAVar3->_filename)._buf[0xb] = -1;
|
|
(**(code **)(iVar1 + 0xc))();
|
|
return;
|
|
case 10:
|
|
GetBombFlags(this,&bombFlags,0);
|
|
rngResult = Random();
|
|
local_60.x = (this->_velocity).x * 0.1;
|
|
local_60.y = (this->_velocity).y * 0.1;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(4,9,&this->_pos,&local_60,GHIDRA_CAST<Entity *>(this),0,rngResult,0);
|
|
spawned = (Entity *)
|
|
__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor,0);
|
|
spawned[1]._type = GHIDRA_INT(bombFlags._l);
|
|
spawned[1]._variant = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bombFlags._l)) + 0x4)));
|
|
spawned[1]._subtype = GHIDRA_INT(bombFlags._h);
|
|
spawned[1]._spawnerType = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bombFlags._h)) + 0x4)));
|
|
spawned[1]._sprite._filename._buf[0xb] = '\x01';
|
|
TryHoldEntity(this,spawned);
|
|
manager = g_manager;
|
|
local_64 = GHIDRA_CAST<EntityPtr *>(0x25f);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_64));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_64),1.0,2,0,1.0,0.0);
|
|
return;
|
|
case 0xb:
|
|
local_64 = GHIDRA_CAST<EntityPtr *>(0x25);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_64));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_64),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0,-1);
|
|
nullItems = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(nullItems) & 0xfffffffcU)) < 1) {
|
|
local_60.x = 0.0;
|
|
}
|
|
else {
|
|
local_60.x = *nullItems;
|
|
}
|
|
local_60.y = 0.0;
|
|
local_54 = 0;
|
|
local_58 = 0x3c;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&local_60,1,1);
|
|
AnimateSad(this);
|
|
ShootCandle(this,direction);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d7740
|
|
void Entity_Player::RecomputeWispCollectibles(Entity_Familiar *wisp)
|
|
{
|
|
char cVar1;
|
|
void *pvVar2;
|
|
void *pvVar3;
|
|
int *piVar4;
|
|
int *piVar5;
|
|
byte bVar6;
|
|
Entity_Familiar *pEVar7;
|
|
int iVar8;
|
|
Game *game;
|
|
Entity_Player *this_00;
|
|
uint uVar9;
|
|
Entity_Familiar *pEVar10;
|
|
ItemConfig_Item *item;
|
|
int *removedNode;
|
|
undefined1 local_50 [8];
|
|
Entity_Familiar *roomWispFoundNode;
|
|
undefined1 local_44 [4];
|
|
undefined1 local_40 [4];
|
|
Entity_Familiar *wispFoundNode;
|
|
int *removedItems;
|
|
undefined4 local_34;
|
|
Entity_Familiar *newWispItems;
|
|
uint newWispItemsSize;
|
|
Entity_Familiar *insertKey;
|
|
std_map *local_24;
|
|
undefined1 local_20 [4];
|
|
Entity_Familiar *local_1c;
|
|
Entity_Player *player;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Entity_Familiar *oldListHead;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b003d5;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
newWispItems = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
newWispItemsSize = 0;
|
|
player = this;
|
|
pEVar7 = operator_new(0x18);
|
|
*GHIDRA_CAST<Entity_Familiar **>(pEVar7) = pEVar7;
|
|
*GHIDRA_CAST<Entity_Familiar **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar7)) + 0x4)))) = pEVar7;
|
|
(pEVar7->_damageEvents)._begin = pEVar7;
|
|
*GHIDRA_CAST<undefined2 *>(&(pEVar7->_damageEvents)._end) = 0x101;
|
|
local_8 = 0;
|
|
newWispItems = pEVar7;
|
|
if ((((wisp != GHIDRA_CAST<Entity_Familiar *>(0x0)) && (wisp->_type == 3)) && (wisp->_variant == 0xed)) &&
|
|
(wisp->_dead == 0)) {
|
|
pEVar10 = GHIDRA_CAST<Entity_Familiar *>(wisp->_subtype);
|
|
wisp = pEVar10;
|
|
std::set<int>::find_node(local_44,&wisp);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_INT(&(wispFoundNode->_damageEvents)._end) + 1)) == '\0') &&
|
|
(GHIDRA_INT((wispFoundNode->_damageEvents)._capacity) <= GHIDRA_INT(pEVar10))) &&
|
|
(wispFoundNode != pEVar7)) {
|
|
wispFoundNode->_pendingDamage = (float)(GHIDRA_INT(wispFoundNode->_pendingDamage) + 1);
|
|
}
|
|
else {
|
|
local_24 = GHIDRA_CAST<std_map *>(0x1);
|
|
insertKey = pEVar10;
|
|
FUN_005cc7e0(local_20,&insertKey);
|
|
}
|
|
}
|
|
uVar9 = 0;
|
|
local_1c = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0x1254)) != 0) {
|
|
do {
|
|
iVar8 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0x124c)) + uVar9 * 4));
|
|
if (((iVar8 != 0) && (*GHIDRA_CAST<int *>((iVar8 + 0x28)) == 3)) &&
|
|
((*GHIDRA_CAST<Entity_Player **>((iVar8 + 0x410)) == this &&
|
|
(((*GHIDRA_CAST<int *>((iVar8 + 0x2c)) == 0xed && (*GHIDRA_CAST<char *>((iVar8 + 0x172)) != '\0')) &&
|
|
(*GHIDRA_CAST<char *>((iVar8 + 0x173)) == '\0')))))) {
|
|
pEVar7 = *GHIDRA_CAST<Entity_Familiar **>((iVar8 + 0x30));
|
|
wisp = pEVar7;
|
|
std::set<int>::find_node(local_50,&wisp);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_INT(&(roomWispFoundNode->_damageEvents)._end) + 1)) == '\0') &&
|
|
(GHIDRA_INT((roomWispFoundNode->_damageEvents)._capacity) <= GHIDRA_INT(pEVar7))) &&
|
|
(roomWispFoundNode != newWispItems)) {
|
|
roomWispFoundNode->_pendingDamage = (float)(GHIDRA_INT(roomWispFoundNode->_pendingDamage) + 1);
|
|
}
|
|
else {
|
|
local_24 = GHIDRA_CAST<std_map *>(0x1);
|
|
insertKey = pEVar7;
|
|
FUN_005cc7e0(local_40,&insertKey);
|
|
}
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
} while (uVar9 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_1c) + 0x1254)));
|
|
}
|
|
local_24 = &this->_itemWispsList;
|
|
pEVar7 = *GHIDRA_CAST<Entity_Familiar **>((this->_itemWispsList)._head);
|
|
pEVar10 = *GHIDRA_CAST<Entity_Familiar **>(newWispItems);
|
|
removedItems = GHIDRA_CAST<int *>(0x0);
|
|
local_34 = 0;
|
|
wisp = pEVar10;
|
|
local_1c = pEVar7;
|
|
removedItems = operator_new(0x14);
|
|
*removedItems = GHIDRA_INT(removedItems);
|
|
removedItems[1] = GHIDRA_INT(removedItems);
|
|
removedItems[2] = GHIDRA_INT(removedItems);
|
|
*GHIDRA_CAST<undefined2 *>((removedItems + 3)) = 0x101;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
game = g_game;
|
|
LAB_007d7900:
|
|
while (oldListHead = local_24->_head, pEVar7 != oldListHead) {
|
|
if (pEVar10 == newWispItems) {
|
|
LAB_007d7a52:
|
|
pvVar2 = (pEVar7->_damageEvents)._capacity;
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(pvVar2)) goto LAB_007d7a8a;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(pvVar2) < 0) {
|
|
if ((GHIDRA_INT(pvVar2) < 0) &&
|
|
(pvVar3 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~GHIDRA_UINT(pvVar2)) <
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar3) >> 2)) {
|
|
iVar8 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar3) + ~GHIDRA_UINT(pvVar2) * 4));
|
|
}
|
|
else {
|
|
iVar8 = 0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007d7a8a:
|
|
pvVar3 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar3) >> 2 <= GHIDRA_INT(pvVar2))
|
|
goto LAB_007d7ab7;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + GHIDRA_INT(pvVar2) * 4));
|
|
}
|
|
if (iVar8 != 0) {
|
|
player->_cacheFlags = player->_cacheFlags | *GHIDRA_CAST<uint *>((iVar8 + 0x54));
|
|
}
|
|
}
|
|
LAB_007d7ab7:
|
|
FUN_007dd660(local_40,&(pEVar7->_damageEvents)._capacity);
|
|
std::
|
|
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
*)&local_1c);
|
|
pEVar7 = local_1c;
|
|
game = g_game;
|
|
}
|
|
else {
|
|
pvVar3 = (pEVar7->_damageEvents)._capacity;
|
|
pvVar2 = (pEVar10->_damageEvents)._capacity;
|
|
if (GHIDRA_INT(pvVar2) < GHIDRA_INT(pvVar3)) goto LAB_007d7914;
|
|
if (GHIDRA_INT(pvVar3) < GHIDRA_INT(pvVar2)) goto LAB_007d7a52;
|
|
if (pEVar7->_pendingDamage != pEVar10->_pendingDamage) {
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(pvVar3)) goto LAB_007d79a5;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(pvVar3) < 0) {
|
|
if ((GHIDRA_INT(pvVar3) < 0) &&
|
|
(pvVar2 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~GHIDRA_UINT(pvVar3)) <
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar2) >> 2)) {
|
|
iVar8 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar2) + ~GHIDRA_UINT(pvVar3) * 4));
|
|
}
|
|
else {
|
|
iVar8 = 0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007d79a5:
|
|
pvVar2 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar2) >> 2 <= GHIDRA_INT(pvVar3))
|
|
goto LAB_007d79d2;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + GHIDRA_INT(pvVar3) * 4));
|
|
}
|
|
if (iVar8 != 0) {
|
|
player->_cacheFlags = player->_cacheFlags | *GHIDRA_CAST<uint *>((iVar8 + 0x54));
|
|
}
|
|
}
|
|
}
|
|
LAB_007d79d2:
|
|
std::
|
|
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
*)&local_1c);
|
|
std::
|
|
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
*)&wisp);
|
|
pEVar10 = wisp;
|
|
pEVar7 = local_1c;
|
|
}
|
|
}
|
|
if (pEVar10 != newWispItems) {
|
|
LAB_007d7914:
|
|
pvVar2 = (pEVar10->_damageEvents)._capacity;
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(pvVar2)) goto LAB_007d79f5;
|
|
LAB_007d7a24:
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(pvVar2) < 0) {
|
|
if ((GHIDRA_INT(pvVar2) < 0) &&
|
|
(pvVar3 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~GHIDRA_UINT(pvVar2)) <
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar3) >> 2)) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar3) + ~GHIDRA_UINT(pvVar2) * 4)));
|
|
}
|
|
else {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_007d79f5:
|
|
pvVar3 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar3) >> 2 <= GHIDRA_INT(pvVar2))
|
|
goto LAB_007d7a24;
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar3) + GHIDRA_INT(pvVar2) * 4));
|
|
}
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
player->_cacheFlags = player->_cacheFlags | item->cacheFlags;
|
|
}
|
|
}
|
|
std::
|
|
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
|
|
*)&wisp);
|
|
if (item->addCostumeOnPickup == 0) {
|
|
pEVar10 = wisp;
|
|
}
|
|
else {
|
|
AddCostume(player,item,0);
|
|
pEVar10 = wisp;
|
|
game = g_game;
|
|
}
|
|
goto LAB_007d7900;
|
|
}
|
|
if (local_24 != GHIDRA_CAST<std_map *>(&newWispItems)) {
|
|
local_24->_head = newWispItems;
|
|
uVar9 = local_24->_size;
|
|
local_24->_size = newWispItemsSize;
|
|
newWispItems = oldListHead;
|
|
newWispItemsSize = uVar9;
|
|
}
|
|
removedNode = GHIDRA_CAST<int *>(*removedItems);
|
|
if (removedNode == removedItems) {
|
|
this_00 = player;
|
|
LAB_007d7bcf:
|
|
EvaluateItems(this_00);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&removedItems,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&removedItems
|
|
,(_Tree_node<unsigned_int,void*> *)removedItems[1]);
|
|
operator_delete(removedItems,0x14);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&newWispItems,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&newWispItems
|
|
,*(_Tree_node<unsigned_int,void*> **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((newWispItems)) + 0x4))));
|
|
operator_delete(newWispItems,0x18);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
do {
|
|
this_00 = player;
|
|
uVar9 = removedNode[4];
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar9)) goto LAB_007d7b33;
|
|
LAB_007d7b52:
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else if (GHIDRA_INT(uVar9) < 0) {
|
|
if ((-1 < GHIDRA_INT(uVar9)) ||
|
|
(pvVar2 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar2) >> 2 <= GHIDRA_INT(~uVar9)
|
|
)) goto LAB_007d7b52;
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar2) + ~uVar9 * 4)));
|
|
}
|
|
else {
|
|
LAB_007d7b33:
|
|
pvVar2 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar2) >> 2 <= GHIDRA_INT(uVar9))
|
|
goto LAB_007d7b52;
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar2) + uVar9 * 4));
|
|
}
|
|
TriggerCollectibleRemoved(player,uVar9);
|
|
if ((item->addCostumeOnPickup != 0) &&
|
|
(bVar6 = HasCollectible(this_00,removedNode[4],0), bVar6 == 0)) {
|
|
RemoveCostume(this_00,item);
|
|
}
|
|
piVar4 = GHIDRA_CAST<int *>(removedNode[2]);
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar4) + 0xd)) == '\0') {
|
|
cVar1 = *GHIDRA_CAST<char *>((*piVar4 + 0xd));
|
|
removedNode = piVar4;
|
|
piVar4 = GHIDRA_CAST<int *>(*piVar4);
|
|
while (cVar1 == '\0') {
|
|
cVar1 = *GHIDRA_CAST<char *>((*piVar4 + 0xd));
|
|
removedNode = piVar4;
|
|
piVar4 = GHIDRA_CAST<int *>(*piVar4);
|
|
}
|
|
}
|
|
else {
|
|
cVar1 = *GHIDRA_CAST<char *>((removedNode[1] + 0xd));
|
|
piVar5 = GHIDRA_CAST<int *>(removedNode[1]);
|
|
piVar4 = removedNode;
|
|
while ((removedNode = piVar5, cVar1 == '\0' && (piVar4 == GHIDRA_CAST<int *>(removedNode[2])))) {
|
|
cVar1 = *GHIDRA_CAST<char *>((removedNode[1] + 0xd));
|
|
piVar5 = GHIDRA_CAST<int *>(removedNode[1]);
|
|
piVar4 = removedNode;
|
|
}
|
|
}
|
|
if (removedNode == removedItems) goto LAB_007d7bcf;
|
|
game = g_game;
|
|
} while( true );
|
|
}
|
|
|
|
// 007d7c30
|
|
void Entity_Player::trigger_cracked_orb(Vector *effectPos)
|
|
{
|
|
Entity_Player *door = this;
|
|
float fVar1;
|
|
float fVar2;
|
|
code *pcVar3;
|
|
Entity_Player *parent;
|
|
byte bVar4;
|
|
uint uVar5;
|
|
RoomDescriptor *revealedRoom;
|
|
Game *pGVar6;
|
|
Entity *unlockEffect;
|
|
Entity_Effect *orbEffect;
|
|
float *extraout_EAX;
|
|
int *piVar7;
|
|
void *pvVar8;
|
|
uint uVar9;
|
|
int iVar10;
|
|
int *pushCursor;
|
|
uint roomCount;
|
|
int *roomListEntry;
|
|
uint *rngSeed;
|
|
EntityRef playerRef;
|
|
int *unrevealedRooms;
|
|
int *unrevealedEnd;
|
|
int *unrevealedCapacity;
|
|
Vector local_44;
|
|
Vector blownDoorPos;
|
|
Vector gridEffectPos;
|
|
int *unrevealedCapEnd;
|
|
int *unrevealedBegin;
|
|
Game *local_24;
|
|
Entity_Player *player;
|
|
uint local_1c;
|
|
char isAnyOpened;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
GridEntity_Door *door;
|
|
Manager *manager;
|
|
int *roomIdxList;
|
|
|
|
puStack_c = &LAB_00b0040d;
|
|
local_10 = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
iVar10 = 0;
|
|
piVar7 = GHIDRA_CAST<int *>(0x0);
|
|
local_24 = g_game;
|
|
pushCursor = GHIDRA_CAST<int *>(0x0);
|
|
unrevealedBegin = GHIDRA_CAST<int *>(0x0);
|
|
unrevealedRooms = GHIDRA_CAST<int *>(0x0);
|
|
unrevealedEnd = GHIDRA_CAST<int *>(0x0);
|
|
unrevealedCapEnd = GHIDRA_CAST<int *>(0x0);
|
|
unrevealedCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
player = door;
|
|
if (0 < g_game->_nbRooms) {
|
|
roomListEntry = &g_game->_roomList[0].SafeGridIndex;
|
|
do {
|
|
if (((byte)roomListEntry[0xe] & 5) != 5) {
|
|
if (pushCursor == piVar7) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(pushCursor,roomListEntry);
|
|
piVar7 = unrevealedCapacity;
|
|
pushCursor = unrevealedEnd;
|
|
}
|
|
else {
|
|
*pushCursor = *roomListEntry;
|
|
unrevealedEnd = pushCursor + 1;
|
|
pushCursor = unrevealedEnd;
|
|
}
|
|
}
|
|
roomIdxList = unrevealedRooms;
|
|
iVar10 = iVar10 + 1;
|
|
roomListEntry = roomListEntry + 0x2e;
|
|
} while (iVar10 < local_24->_nbRooms);
|
|
unrevealedBegin = unrevealedRooms;
|
|
unrevealedCapEnd = piVar7;
|
|
if (unrevealedRooms != pushCursor) {
|
|
roomCount = GHIDRA_INT(pushCursor) - GHIDRA_INT(unrevealedRooms) >> 2;
|
|
pvVar8 = (player->_collectibleRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar8) + 0x2a30));
|
|
uVar9 = *rngSeed;
|
|
if (uVar9 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar9 = *rngSeed;
|
|
if (uVar9 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar9 = uVar9 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar8) + 0x2a34)) & 0x1f) ^ uVar9;
|
|
uVar9 = uVar9 ^ uVar9 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar8) + 0x2a38)) & 0x1f);
|
|
uVar9 = uVar9 ^ uVar9 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar8) + 0x2a3c)) & 0x1f);
|
|
*rngSeed = uVar9;
|
|
if (roomCount == 0) {
|
|
uVar9 = 0;
|
|
}
|
|
else {
|
|
uVar9 = uVar9 % roomCount;
|
|
}
|
|
revealedRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(local_24))))->Level::GetRoomByIdx(roomIdxList[uVar9],-1);
|
|
revealedRoom->DisplayFlags = revealedRoom->DisplayFlags | 5;
|
|
(GHIDRA_CAST<Minimap *>((&g_game->_minimap)))->Minimap::Refresh();
|
|
manager = g_manager;
|
|
local_24 = GHIDRA_CAST<Game *>(0x352);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_24));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_24),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
isAnyOpened = '\0';
|
|
local_24 = GHIDRA_CAST<Game *>(0x0);
|
|
pvVar8 = g_game->_room;
|
|
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x10)) * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0xc))) {
|
|
local_1c = 0x24;
|
|
do {
|
|
if (((local_24 < GHIDRA_CAST<Game *>(0x1c0)) &&
|
|
(piVar7 = *GHIDRA_CAST<int **>((local_1c + GHIDRA_INT(pvVar8))), piVar7 != GHIDRA_CAST<int *>(0x0))) &&
|
|
((((iVar10 = piVar7[1], iVar10 == 2 ||
|
|
(((((iVar10 == 3 || (iVar10 == 4)) || (iVar10 == 5)) ||
|
|
((iVar10 == 6 || (iVar10 == 0x16)))) || (iVar10 == 0x18)))) ||
|
|
(((iVar10 == 0x19 || (iVar10 == 0x1a)) || (iVar10 == 0x1b)))) &&
|
|
((((piVar7[3] == 1 || (piVar7[3] == 4)) && (iVar10 != 3)) && (iVar10 != 0x18)))))) {
|
|
if ((iVar10 != 4) && (iVar10 != 0x16)) {
|
|
if ((g_game->_levelStateFlags & 0x2000U) == 0) {
|
|
pGVar6 = *GHIDRA_CAST<Game **>((GHIDRA_CAST<char *>(pvVar8) + 0x768));
|
|
}
|
|
else {
|
|
pGVar6 = GHIDRA_CAST<Game *>(0xffffffff);
|
|
}
|
|
if (pGVar6 != local_24) goto LAB_007d7f10;
|
|
}
|
|
pcVar3 = *(code **)(*piVar7 + 0x14);
|
|
(GHIDRA_CAST<EntityRef *>((&playerRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(*pcVar3)(1,&playerRef,uVar5);
|
|
uVar9 = Random();
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
gridEffectPos.x = (float)(piVar7[9] % iVar10) * 40.0 + 40.0;
|
|
gridEffectPos.y = (float)(piVar7[9] / iVar10) * 40.0 + 120.0;
|
|
unlockEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xad,&gridEffectPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar9);
|
|
unlockEffect->Update();
|
|
isAnyOpened = '\x01';
|
|
}
|
|
LAB_007d7f10:
|
|
local_24 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_24->_stage) + 1));
|
|
local_1c = local_1c + 4;
|
|
pvVar8 = g_game->_room;
|
|
} while (GHIDRA_INT(local_24) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x10)) * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0xc)));
|
|
}
|
|
local_1c = 0;
|
|
local_24 = GHIDRA_CAST<Game *>(0x724);
|
|
do {
|
|
pGVar6 = local_24;
|
|
local_1c = local_1c + 1;
|
|
if ((local_1c < 9) &&
|
|
(door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(g_game->_room) + GHIDRA_INT((local_24->_roomList + -1)) + 0xa4)),
|
|
door != GHIDRA_CAST<GridEntity_Door *>(0x0))) {
|
|
iVar10 = (door->_desc)._variant;
|
|
if (((iVar10 == 1) || (((iVar10 == 4 || (iVar10 == 3)) || (iVar10 == 2)))) || (iVar10 == 5)) {
|
|
bVar4 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryUnlock(player,1);
|
|
if (bVar4 == 0) goto LAB_007d80f4;
|
|
uVar5 = Random();
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
local_44.x = (float)(door->_gridIndex % iVar10) * 40.0 + 40.0;
|
|
local_44.y = (float)(door->_gridIndex / iVar10) * 40.0 + 120.0;
|
|
unlockEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xad,&local_44,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar5);
|
|
unlockEffect->Update();
|
|
isAnyOpened = '\x01';
|
|
}
|
|
else {
|
|
if ((((door->_currentRoomType != 7) && (door->_targetRoomType != 7)) &&
|
|
((door->_currentRoomType != 8 && (door->_targetRoomType != 8)))) ||
|
|
(bVar4 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryBlowOpen(0,GHIDRA_CAST<Entity *>(0x0)), bVar4 == 0))
|
|
goto LAB_007d80f4;
|
|
uVar5 = Random();
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
blownDoorPos.x = (float)(door->_gridIndex % iVar10) * 40.0 + 40.0;
|
|
blownDoorPos.y = (float)(door->_gridIndex / iVar10) * 40.0 + 120.0;
|
|
unlockEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xad,&blownDoorPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar5);
|
|
unlockEffect->Update();
|
|
isAnyOpened = '\x01';
|
|
}
|
|
}
|
|
else {
|
|
LAB_007d80f4:
|
|
local_24 = pGVar6;
|
|
}
|
|
local_24 = GHIDRA_CAST<Game *>(&local_24->_stageType);
|
|
if (0x743 < GHIDRA_INT(local_24)) {
|
|
if (isAnyOpened != '\0') {
|
|
uVar5 = Random();
|
|
orbEffect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xad,effectPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar5);
|
|
parent = player;
|
|
(orbEffect->_sprite)._scale.x = (player->_playerSpriteScale).x;
|
|
(orbEffect->_sprite)._scale.y = (player->_playerSpriteScale).y;
|
|
if ((effectPos->x == g_vectorZero.x) && (effectPos->y == g_vectorZero.y)) {
|
|
(orbEffect->_pos).x = (player->_pos).x;
|
|
(orbEffect->_pos).y = (player->_pos).y;
|
|
GetFlyingOffset(player,&local_44);
|
|
fVar1 = extraout_EAX[1];
|
|
fVar2 = (parent->_posOffset).y;
|
|
(orbEffect->_posOffset).x = (parent->_posOffset).x + *extraout_EAX;
|
|
(orbEffect->_posOffset).y = fVar1 + fVar2;
|
|
(GHIDRA_CAST<Entity_Effect *>((orbEffect)))->Entity_Effect::FollowParent(GHIDRA_CAST<Entity *>(parent));
|
|
}
|
|
else {
|
|
(orbEffect->_posOffset).x = 0.0;
|
|
(orbEffect->_posOffset).y = -16.0;
|
|
}
|
|
orbEffect->Update();
|
|
}
|
|
if (unrevealedBegin != GHIDRA_CAST<int *>(0x0)) {
|
|
uVar5 = GHIDRA_INT(unrevealedCapEnd) - GHIDRA_INT(unrevealedBegin) & 0xfffffffc;
|
|
piVar7 = unrevealedBegin;
|
|
if (0xfff < uVar5) {
|
|
piVar7 = GHIDRA_CAST<int *>(unrevealedBegin[-1]);
|
|
uVar5 = uVar5 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(unrevealedBegin) + (-4 - GHIDRA_INT(piVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(piVar7,uVar5);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 007d8240
|
|
uint Entity_Player::AddItemCard(uint itemID)
|
|
{
|
|
void **ppvVar1;
|
|
void *pvVar2;
|
|
void *pvVar3;
|
|
uint *_Src;
|
|
int starterDeckCount;
|
|
uint uVar4;
|
|
Entity *droppedCard;
|
|
int starterDeckCount;
|
|
size_t _Size;
|
|
Vector dropPos;
|
|
uint *cardsEnd;
|
|
|
|
if (itemID != 0) {
|
|
pvVar2 = (this->_itemCards)._end;
|
|
pvVar3 = (this->_itemCards)._begin;
|
|
starterDeckCount = GetCollectibleNum(this,0xfb,0);
|
|
starterDeckCount = 0x14;
|
|
if (starterDeckCount + 3 < 0x14) {
|
|
starterDeckCount = starterDeckCount + 3;
|
|
}
|
|
if (GHIDRA_INT(pvVar2) - GHIDRA_INT(pvVar3) >> 2 == starterDeckCount) {
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&dropPos,&this->_pos,0.0,0,0,0);
|
|
uVar4 = Random();
|
|
droppedCard = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,300,&dropPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),
|
|
*GHIDRA_CAST<uint *>((this->_itemCards)._begin) | 0x8000,uVar4,0);
|
|
if (droppedCard != GHIDRA_CAST<Entity *>(0x0)) {
|
|
droppedCard[1]._sprite._championColor._offset[0] = 5.60519e-45;
|
|
}
|
|
pvVar3 = (this->_itemCards)._begin;
|
|
pvVar2 = (void *)(GHIDRA_INT(pvVar3) + 4);
|
|
memmove(pvVar3,pvVar2,GHIDRA_INT((this->_itemCards)._end) - GHIDRA_INT(pvVar2));
|
|
ppvVar1 = &(this->_itemCards)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + -4);
|
|
}
|
|
}
|
|
pvVar2 = (this->_itemCards)._end;
|
|
pvVar3 = (this->_itemCards)._begin;
|
|
starterDeckCount = GetCollectibleNum(this,0xfb,0);
|
|
uVar4 = 0x14;
|
|
if (GHIDRA_INT((starterDeckCount + 3U)) < 0x14) {
|
|
uVar4 = starterDeckCount + 3U;
|
|
}
|
|
if (uVar4 <= GHIDRA_UINT((GHIDRA_INT(pvVar2) - GHIDRA_INT(pvVar3) >> 2))) {
|
|
return 0;
|
|
}
|
|
if (itemID == 0) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT((this->_collectibleRNGs)._begin) + 0x2c60)))))->RNG::Next();
|
|
itemID = ItemPool::GetCardImpl(uVar4);
|
|
}
|
|
uVar4 = itemID;
|
|
cardsEnd = (this->_itemCards)._end;
|
|
_Src = (this->_itemCards)._begin;
|
|
if (cardsEnd == (this->_itemCards)._capacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(_Src,&itemID);
|
|
uVar4 = itemID;
|
|
}
|
|
else if (_Src == cardsEnd) {
|
|
*cardsEnd = itemID;
|
|
ppvVar1 = &(this->_itemCards)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 4);
|
|
}
|
|
else {
|
|
*cardsEnd = cardsEnd[-1];
|
|
ppvVar1 = &(this->_itemCards)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 4);
|
|
_Size = GHIDRA_INT(cardsEnd) + (-4 - GHIDRA_INT(_Src));
|
|
memmove((void *)(GHIDRA_INT(cardsEnd) - _Size),_Src,_Size);
|
|
*_Src = uVar4;
|
|
}
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
return uVar4;
|
|
}
|
|
|
|
// 007d83f0
|
|
void Entity_Player::spawn_lil_clot_familiars()
|
|
{
|
|
int lilClotMultiplier;
|
|
int iVar1;
|
|
uint flagsHigh;
|
|
Entity *pEVar3;
|
|
Entity *bloodPoof;
|
|
uint uVar4;
|
|
int iVar5;
|
|
bool bVar6;
|
|
bool bVar7;
|
|
float local_1c;
|
|
int clotsToSpawn;
|
|
float cosAngle;
|
|
Vector velocity;
|
|
undefined4 flagsHigh;
|
|
Manager *manager;
|
|
|
|
uVar4 = 0;
|
|
iVar5 = 0;
|
|
flagsHigh = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1254));
|
|
if (flagsHigh != 0) {
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x124c)) + uVar4 * 4));
|
|
if ((((*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 3) && (*GHIDRA_CAST<int *>((iVar1 + 0x2c)) == 0xee)) &&
|
|
(*GHIDRA_CAST<int *>((iVar1 + 0x30)) == 7)) && (*GHIDRA_CAST<Entity_Player **>((iVar1 + 0x410)) == this)) {
|
|
iVar5 = iVar5 + 1;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < flagsHigh);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef8)))) != 0xb0)) {
|
|
iVar1 = GetTrinketMultiplier(this,0xb0);
|
|
bVar7 = false;
|
|
bVar6 = iVar1 == 0;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ef0))) != '\0') goto LAB_007d8486;
|
|
lilClotMultiplier = GetTrinketMultiplier(this,0xb0);
|
|
bVar7 = SBORROW4(lilClotMultiplier,1);
|
|
iVar1 = lilClotMultiplier + -1;
|
|
bVar6 = lilClotMultiplier == 1;
|
|
}
|
|
if (bVar6 || bVar7 != iVar1 < 0) {
|
|
return;
|
|
}
|
|
LAB_007d8486:
|
|
iVar1 = GetTrinketMultiplier(this,0xb0);
|
|
if ((iVar5 < iVar1) && (clotsToSpawn = GetTrinketMultiplier(this,0xb0), iVar5 < clotsToSpawn)) {
|
|
clotsToSpawn = clotsToSpawn - iVar5;
|
|
do {
|
|
flagsHigh = Random();
|
|
uVar4 = Random();
|
|
local_1c = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_1c = local_1c + local_1c;
|
|
cosAngle = cos(local_1c);
|
|
velocity.y = sin(local_1c);
|
|
velocity.x = cosAngle + cosAngle;
|
|
velocity.y = velocity.y + velocity.y;
|
|
pEVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0xee,&this->_pos,&velocity,GHIDRA_CAST<Entity *>(this),7,flagsHigh,0);
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4));
|
|
iVar5 = *GHIDRA_CAST<int *>(pEVar3);
|
|
*GHIDRA_CAST<uint *>(&pEVar3->_flags) = GHIDRA_UINT(pEVar3->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4)) = flagsHigh;
|
|
(**(code **)(iVar5 + 0xc))();
|
|
manager = g_manager;
|
|
local_1c = 1.00893e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1c),1.0,2,0,1.0,0.0);
|
|
flagsHigh = Random();
|
|
bloodPoof = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2,flagsHigh,0);
|
|
bloodPoof->SetColor(&pEVar3->_splatColor,0xffffffff,0xff,0,1);
|
|
iVar5 = *GHIDRA_CAST<int *>(bloodPoof);
|
|
(bloodPoof->_sprite)._offset.x = 0.0;
|
|
(bloodPoof->_sprite)._offset.y = -6.0;
|
|
bloodPoof->_renderDepthOffset = 10.0;
|
|
(**(code **)(iVar5 + 0xc))();
|
|
clotsToSpawn = clotsToSpawn + -1;
|
|
} while (clotsToSpawn != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d8740
|
|
void Entity_Player::creep_contact_add(int flags, int count)
|
|
{
|
|
int oldCount;
|
|
int oldCount;
|
|
int oldFlags;
|
|
|
|
oldCount = this->_grantedCollectibleCountdown;
|
|
oldCount = count + oldCount;
|
|
oldFlags = this->_grantedCollectibleFlags;
|
|
this->_grantedCollectibleFlags = flags;
|
|
if (4 < oldCount) {
|
|
oldCount = 4;
|
|
}
|
|
this->_grantedCollectibleCountdown = oldCount;
|
|
if ((0 < oldCount != 0 < oldCount) || (oldFlags != flags)) {
|
|
this->_cacheFlags = this->_cacheFlags | 99;
|
|
EvaluateItems(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007d87a0
|
|
byte Entity_Player::spawn_ghost_corpse()
|
|
{
|
|
int iVar1;
|
|
byte bVar2;
|
|
uint uVar3;
|
|
EntityPtr corpseEffect;
|
|
LayerState *ghostLayer;
|
|
byte *cursor;
|
|
char *deathCursor;
|
|
ANM2 *this_00;
|
|
EntityPtr *pEVar4;
|
|
bool isLess;
|
|
ANM2 spriteCopy;
|
|
Entity_Player *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
byte *animData;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00430;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_14 = this;
|
|
uVar3 = Random();
|
|
corpseEffect = (EntityPtr)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,6,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar3,0);
|
|
(GHIDRA_CAST<ANM2 *>((&spriteCopy)))->ANM2::ANM2(&this->_sprite);
|
|
Isaac::SwapANM2(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(corpseEffect) + 0x48)),&spriteCopy);
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((this_00)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&spriteCopy._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&spriteCopy._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((spriteCopy._animDefaultName._buf)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&spriteCopy))))->std::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
ghostLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(corpseEffect) + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ghost"));
|
|
if (ghostLayer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
ghostLayer->_visible = 0;
|
|
}
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(corpseEffect) + 0x98)))))->AnimationState::SetAnimationData((void *)0x0);
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(corpseEffect) + 0x14c)) = 1.0;
|
|
animData = *(void **)(GHIDRA_CAST<char *>(corpseEffect) + 0x7c);
|
|
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
|
cursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
cursor = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
deathCursor = "Death";
|
|
do {
|
|
bVar2 = *cursor;
|
|
isLess = bVar2 < (byte)*deathCursor;
|
|
if (bVar2 != *deathCursor) {
|
|
LAB_007d88c0:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007d88c5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = cursor[1];
|
|
isLess = bVar2 < (byte)deathCursor[1];
|
|
if (bVar2 != deathCursor[1]) goto LAB_007d88c0;
|
|
cursor = cursor + 2;
|
|
deathCursor = deathCursor + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_007d88c5:
|
|
if ((uVar3 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(corpseEffect) + 0x8c)) != 0))))
|
|
goto LAB_007d88f8;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(corpseEffect) + 0x48)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Death"),1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(corpseEffect) + 0x78)))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(corpseEffect) + 0x8c)) = 1;
|
|
}
|
|
LAB_007d88f8:
|
|
if (*(void **)(GHIDRA_CAST<char *>(corpseEffect) + 0x7c) != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(corpseEffect) + 0x78)))))->AnimationState::SetFrameFloat(6.0);
|
|
}
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(corpseEffect) + 0x168)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(corpseEffect) + 0x168)) | 0x200000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(corpseEffect) + 0x16c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(corpseEffect) + 0x16c));
|
|
iVar1 = *GHIDRA_CAST<int *>(corpseEffect);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity *>((GHIDRA_INT(corpseEffect) + 0x410))))) + 0x40)))) = 10;
|
|
(**(code **)(iVar1 + 0xc))();
|
|
pEVar4 = &local_14->_astralProjectionBody;
|
|
if (*pEVar4 != (EntityPtr)0x0) {
|
|
local_14 = GHIDRA_CAST<Entity_Player *>(pEVar4);
|
|
std::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*pEVar4 = corpseEffect;
|
|
std::multiset<unsigned_int>::insert(pEVar4);
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
|
|
// 007d8980
|
|
void Entity_Player::AddCurseMistEffect()
|
|
{
|
|
void **ppvVar1;
|
|
uint *puVar2;
|
|
int iVar3;
|
|
qword qVar4;
|
|
Entity_Familiar *familiar;
|
|
void *familiarListData;
|
|
undefined8 emptyBackup;
|
|
undefined8 uStack_60;
|
|
undefined8 local_58;
|
|
undefined8 uStack_50;
|
|
undefined4 local_48;
|
|
undefined4 uStack_44;
|
|
undefined8 uStack_40;
|
|
undefined4 local_38;
|
|
int tmpBackup [3];
|
|
undefined2 local_28;
|
|
EntityList_EL familiarList;
|
|
uint familiarIdx;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
void *backupEnd;
|
|
undefined4 *backupSlot;
|
|
int *familiarEntity;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0045d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (this->_hasCurseMistEffect == 0) {
|
|
if ((this->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) && (this->_valid != 0)) {
|
|
AddCurseMistEffect(this->_backupPlayer);
|
|
}
|
|
qVar4 = this->_flags;
|
|
puVar2 = GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_flags) + 4));
|
|
*puVar2 = *puVar2 & 0xfffffffb;
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
*GHIDRA_CAST<int *>(&this->_flags) = GHIDRA_INT(qVar4);
|
|
this->_bleedOutHealth = 0;
|
|
this->_hasCurseMistEffect = 1;
|
|
UpdateCostumes(this);
|
|
if (this->_valid != 0) {
|
|
(this->_consumablesBackup).coins = this->_numCoins;
|
|
(this->_consumablesBackup).keys = this->_numKeys;
|
|
(this->_consumablesBackup).bombs = this->_numBombs;
|
|
(this->_consumablesBackup).goldkey = this->_hasGoldenKey;
|
|
(this->_consumablesBackup).goldbomb = this->_hasGoldenBomb;
|
|
(this->_consumablesBackup).gigabombs = this->_numGigaBombs;
|
|
(this->_consumablesBackup).soulcharges = this->_effectiveSoulCharge;
|
|
(this->_consumablesBackup).bloodcharges = this->_effectiveBloodCharge;
|
|
(this->_consumablesBackup).poopmana = this->_poopMana;
|
|
tmpBackup[0] = 0;
|
|
tmpBackup[1] = 0;
|
|
tmpBackup[2] = 0;
|
|
local_28 = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(familiarList)) + 0x0))) = 0;
|
|
familiarList._data = (void *)0x0;
|
|
familiarList._capacity = 0;
|
|
familiarList._size = 0;
|
|
restore_curse_mist_backup(this,tmpBackup);
|
|
(this->_curseMistFamiliars)._end = (this->_curseMistFamiliars)._begin;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiarList,3,-1,-1,0,0);
|
|
local_8 = 0;
|
|
familiarIdx = 0;
|
|
if (familiarList._size != 0) {
|
|
familiarListData = familiarList._data;
|
|
do {
|
|
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(familiarListData) + familiarIdx * 4)) + 0x2c));
|
|
if (((iVar3 == 0x58) || (iVar3 == 0xca)) || (iVar3 == 0xe7)) {
|
|
backupSlot = (this->_curseMistFamiliars)._end;
|
|
emptyBackup = 0;
|
|
uStack_60 = 0;
|
|
local_58 = 0;
|
|
uStack_50 = 0;
|
|
uStack_40 = 0;
|
|
local_38 = 0;
|
|
uStack_44 = 0;
|
|
local_48 = 0;
|
|
if (backupSlot == (this->_curseMistFamiliars)._capacity) {
|
|
vector_PlayerItemBackup_emplace_reallocate(backupSlot,&emptyBackup);
|
|
familiarListData = familiarList._data;
|
|
}
|
|
else {
|
|
*backupSlot = 0;
|
|
backupSlot[1] = 0;
|
|
backupSlot[2] = 0;
|
|
backupSlot[3] = 0;
|
|
backupSlot[4] = 0;
|
|
backupSlot[5] = 0;
|
|
backupSlot[6] = 0;
|
|
backupSlot[7] = 0;
|
|
backupSlot[8] = 0;
|
|
backupSlot[9] = 0;
|
|
backupSlot[10] = 0;
|
|
backupSlot[0xb] = 0;
|
|
backupSlot[0xc] = 0;
|
|
ppvVar1 = &(this->_curseMistFamiliars)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x34);
|
|
}
|
|
backupEnd = (this->_curseMistFamiliars)._end;
|
|
familiar = (Entity_Familiar *)
|
|
__RTDynamicCast(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(familiarListData) + familiarIdx * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0
|
|
);
|
|
(GHIDRA_CAST<Entity_Familiar *>((familiar)))->Entity_Familiar::store_backup((void *)(GHIDRA_INT(backupEnd) + -0x34));
|
|
familiarEntity = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(familiarList._data) + familiarIdx * 4));
|
|
if (familiarEntity[0xb] == 0xe7) {
|
|
(**(code **)(*familiarEntity + 0x28))();
|
|
}
|
|
familiarListData = familiarList._data;
|
|
}
|
|
familiarIdx = familiarIdx + 1;
|
|
} while (familiarIdx < GHIDRA_UINT(familiarList._size));
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiarList)) + 0x0))) == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,familiarList._data,0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
}
|
|
iVar3 = this->_pocketSlots[0];
|
|
this->_curseMistPocketSlots[1] = this->_pocketSlots[1];
|
|
this->_curseMistPocketSlots[0] = iVar3;
|
|
this->_pocketSlots[0] = 0;
|
|
this->_pocketSlots[1] = 1;
|
|
iVar3 = this->_pocketSlots[2];
|
|
this->_curseMistPocketSlots[3] = this->_pocketSlots[3];
|
|
this->_curseMistPocketSlots[2] = iVar3;
|
|
this->_pocketSlots[2] = 0;
|
|
this->_pocketSlots[3] = 1;
|
|
iVar3 = this->_pocketSlots[4];
|
|
this->_curseMistPocketSlots[5] = this->_pocketSlots[5];
|
|
this->_curseMistPocketSlots[4] = iVar3;
|
|
this->_pocketSlots[4] = 0;
|
|
this->_pocketSlots[5] = 1;
|
|
iVar3 = this->_pocketSlots[6];
|
|
this->_curseMistPocketSlots[7] = this->_pocketSlots[7];
|
|
this->_curseMistPocketSlots[6] = iVar3;
|
|
this->_pocketSlots[6] = 0;
|
|
this->_pocketSlots[7] = 1;
|
|
this->_curseMistTrinkets[0] = this->_trinketsID[0];
|
|
iVar3 = this->_trinketsID[1];
|
|
this->_trinketsID[0] = 0;
|
|
this->_curseMistTrinkets[1] = iVar3;
|
|
this->_trinketsID[1] = 0;
|
|
EvaluateItems(this);
|
|
if (this->_playerType == 0xe) {
|
|
this->_curseMistRedHearts = this->_redHearts;
|
|
AddMaxHearts(this,0,0);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007d8d20
|
|
void Entity_Player::RemoveCurseMistEffect()
|
|
{
|
|
ConsumableData *backup;
|
|
qword qVar1;
|
|
byte bVar2;
|
|
Entity_Player *itemOwner;
|
|
int iVar3;
|
|
undefined4 *puVar4;
|
|
uint *puVar5;
|
|
uint uVar6;
|
|
uint variantIdx;
|
|
Entity_Familiar *familiar;
|
|
int *piVar7;
|
|
qword *allocatedBytes;
|
|
int iVar8;
|
|
uint *key;
|
|
EntityList_EL familiars;
|
|
undefined1 lowerBound [8];
|
|
void *lowerBoundNode;
|
|
void *variantCounts;
|
|
undefined4 variantCountsSize;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
uint local_8;
|
|
Game *game;
|
|
void *savedFamiliars;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00495;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (this->_hasCurseMistEffect != 0) {
|
|
if ((this->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) && (this->_valid != 0)) {
|
|
RemoveCurseMistEffect(this->_backupPlayer);
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
this->_hasCurseMistEffect = 0;
|
|
UpdateCostumes(this);
|
|
bVar2 = 0;
|
|
if (this->_valid != 0) {
|
|
backup = &this->_consumablesBackup;
|
|
iVar8 = this->_numCoins + backup->coins;
|
|
itemOwner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x1a0,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
iVar3 = (-GHIDRA_UINT((itemOwner != GHIDRA_CAST<Entity_Player *>(0x0))) & 900) + 99;
|
|
if (iVar8 < iVar3) {
|
|
iVar3 = iVar8;
|
|
}
|
|
iVar8 = this->_numKeys + (this->_consumablesBackup).keys;
|
|
backup->coins = iVar3;
|
|
iVar3 = 99;
|
|
if (iVar8 < 99) {
|
|
iVar3 = iVar8;
|
|
}
|
|
(this->_consumablesBackup).keys = iVar3;
|
|
iVar8 = (this->_consumablesBackup).bombs + this->_numBombs;
|
|
iVar3 = 99;
|
|
if (iVar8 < 99) {
|
|
iVar3 = iVar8;
|
|
}
|
|
(this->_consumablesBackup).bombs = iVar3;
|
|
if (((this->_consumablesBackup).goldkey == 0) && (this->_hasGoldenKey == 0)) {
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
bVar2 = 1;
|
|
}
|
|
(this->_consumablesBackup).goldkey = bVar2;
|
|
if (((this->_consumablesBackup).goldbomb == 0) && (this->_hasGoldenBomb == 0)) {
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
bVar2 = 1;
|
|
}
|
|
(this->_consumablesBackup).goldbomb = bVar2;
|
|
local_14 = (this->_consumablesBackup).gigabombs + this->_numGigaBombs;
|
|
piVar7 = GHIDRA_CAST<int *>(&local_14);
|
|
if (iVar3 <= GHIDRA_INT(local_14)) {
|
|
piVar7 = &(this->_consumablesBackup).bombs;
|
|
}
|
|
iVar8 = this->_effectiveSoulCharge + (this->_consumablesBackup).soulcharges;
|
|
(this->_consumablesBackup).gigabombs = *piVar7;
|
|
game = g_game;
|
|
iVar3 = 99;
|
|
if (iVar8 < 99) {
|
|
iVar3 = iVar8;
|
|
}
|
|
(this->_consumablesBackup).soulcharges = iVar3;
|
|
iVar8 = (this->_consumablesBackup).bloodcharges + this->_effectiveBloodCharge;
|
|
iVar3 = 99;
|
|
if (iVar8 < 99) {
|
|
iVar3 = iVar8;
|
|
}
|
|
(this->_consumablesBackup).bloodcharges = iVar3;
|
|
iVar8 = this->_poopMana + (this->_consumablesBackup).poopmana;
|
|
itemOwner = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::FirstBirthrightOwner(0x19);
|
|
iVar3 = (-GHIDRA_UINT((itemOwner != GHIDRA_CAST<Entity_Player *>(0x0))) & 0x14) + 9;
|
|
if (iVar8 < iVar3) {
|
|
iVar3 = iVar8;
|
|
}
|
|
(this->_consumablesBackup).poopmana = iVar3;
|
|
restore_curse_mist_backup(this,&backup->coins);
|
|
bVar2 = this->_valid;
|
|
}
|
|
iVar3 = this->_curseMistPocketSlots[1];
|
|
this->_pocketSlots[0] = this->_curseMistPocketSlots[0];
|
|
iVar8 = this->_curseMistPocketSlots[2];
|
|
this->_pocketSlots[1] = iVar3;
|
|
iVar3 = this->_curseMistPocketSlots[3];
|
|
this->_pocketSlots[2] = iVar8;
|
|
iVar8 = this->_curseMistPocketSlots[4];
|
|
this->_pocketSlots[3] = iVar3;
|
|
iVar3 = this->_curseMistPocketSlots[5];
|
|
this->_pocketSlots[4] = iVar8;
|
|
iVar8 = this->_curseMistPocketSlots[6];
|
|
this->_pocketSlots[5] = iVar3;
|
|
iVar3 = this->_curseMistPocketSlots[7];
|
|
this->_pocketSlots[6] = iVar8;
|
|
this->_pocketSlots[7] = iVar3;
|
|
this->_trinketsID[0] = this->_curseMistTrinkets[0];
|
|
this->_trinketsID[1] = this->_curseMistTrinkets[1];
|
|
if (bVar2 != 0) {
|
|
ConsumableCountChanged(this,-1);
|
|
}
|
|
EvaluateItems(this);
|
|
savedFamiliars = (this->_curseMistFamiliars)._begin;
|
|
variantCounts = (void *)0x0;
|
|
variantCountsSize = 0;
|
|
variantCounts = operator_new(0x18);
|
|
*(void **)variantCounts = variantCounts;
|
|
*(void **)(GHIDRA_CAST<char *>(variantCounts) + 4) = variantCounts;
|
|
*(void **)(GHIDRA_CAST<char *>(variantCounts) + 8) = variantCounts;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(variantCounts) + 0xc)) = 0x101;
|
|
local_8 = 0;
|
|
if (savedFamiliars != (this->_curseMistFamiliars)._end) {
|
|
key = GHIDRA_CAST<uint *>((GHIDRA_INT(savedFamiliars) + 4));
|
|
do {
|
|
_Find_lower_bound<>(lowerBound,key);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(lowerBoundNode) + 0xd)) != '\0') ||
|
|
(*key < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(lowerBoundNode) + 0x10)))) || (lowerBoundNode == variantCounts)) {
|
|
puVar4 = map_find_value(&variantCounts,GHIDRA_UINT(key));
|
|
*puVar4 = 0;
|
|
}
|
|
puVar5 = map_find_value(&variantCounts,GHIDRA_UINT(key));
|
|
uVar6 = *key;
|
|
variantIdx = *puVar5;
|
|
local_14 = variantIdx;
|
|
if (uVar6 == 0xe7) {
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xe7,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),key[1],uVar6);
|
|
uVar6 = *key;
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,uVar6,-1,0,0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
if (familiars._size != 0) {
|
|
variantIdx = -GHIDRA_UINT((variantIdx != 0)) & variantIdx;
|
|
uVar6 = familiars._size - 1U;
|
|
if (variantIdx < familiars._size - 1U) {
|
|
uVar6 = variantIdx;
|
|
}
|
|
familiar = (Entity_Familiar *)
|
|
__RTDynamicCast(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(familiars._data) + uVar6 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
(GHIDRA_CAST<Menu_Stats *>((GHIDRA_CAST<Menu_Stats *>(familiar))))->Menu_Stats::Render(key + -1);
|
|
*GHIDRA_CAST<uint *>(&familiar->_flags) = GHIDRA_UINT(familiar->_flags) | 4;
|
|
iVar3 = familiar->_variant;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&familiar->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&familiar->_flags) + 4));
|
|
if (iVar3 == 0xca) {
|
|
familiar->_subtype = key[1];
|
|
}
|
|
variantIdx = local_14;
|
|
}
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (familiars._data != (void *)0x0) {
|
|
uVar6 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(familiars._data) + -4));
|
|
qVar1 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar6;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar6));
|
|
free(GHIDRA_CAST<uint *>((GHIDRA_INT(familiars._data) + -4)));
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
piVar7 = map_find_value(&variantCounts,GHIDRA_UINT(key));
|
|
*piVar7 = variantIdx + 1;
|
|
puVar5 = key + 0xc;
|
|
key = key + 0xd;
|
|
} while (puVar5 != (this->_curseMistFamiliars)._end);
|
|
}
|
|
iVar3 = this->_playerType;
|
|
(this->_curseMistFamiliars)._end = (this->_curseMistFamiliars)._begin;
|
|
if (iVar3 == 0xe) {
|
|
bVar2 = 0;
|
|
iVar3 = GetHeartLimit(this,0);
|
|
AddMaxHearts(this,iVar3 - this->_maxHearts,bVar2);
|
|
this->_redHearts = this->_curseMistRedHearts;
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&variantCounts,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&variantCounts,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(variantCounts) + 4));
|
|
operator_delete(variantCounts,0x18);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007d9180
|
|
void Entity_Player::AttachMinecart(Entity_NPC *minecart)
|
|
{
|
|
Entity_Player *local_c [2];
|
|
float cartY;
|
|
EntityPtr *minecartRef;
|
|
float playerY;
|
|
|
|
minecartRef = &this->_minecart;
|
|
if (this->_minecart != (EntityPtr)minecart) {
|
|
local_c[0] = this;
|
|
if (this->_minecart != (EntityPtr)0x0) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Player *>(minecartRef);
|
|
std::multiset<unsigned_int>::erase(local_c);
|
|
}
|
|
*minecartRef = (EntityPtr)minecart;
|
|
if (minecart != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(minecartRef);
|
|
}
|
|
}
|
|
playerY = (this->_pos).y;
|
|
cartY = (minecart->_targetPosition).y;
|
|
(this->_minecartOffset).x = (this->_pos).x - (minecart->_targetPosition).x;
|
|
(this->_minecartOffset).y = playerY - cartY;
|
|
return;
|
|
}
|
|
|
|
// 007d9200
|
|
void Entity_Player::add_samson_berserk_charge(int amount)
|
|
{
|
|
int *cappedCharge;
|
|
int local_1c;
|
|
int berserkEffect [3];
|
|
undefined4 local_c;
|
|
int *berserkCharge;
|
|
int berserkItem;
|
|
void *collectibles;
|
|
Manager *manager;
|
|
|
|
berserkItem = amount + this->_samsonBerserkCharge;
|
|
berserkCharge = &this->_samsonBerserkCharge;
|
|
*berserkCharge = berserkItem;
|
|
if (this->_suplexState != 0) {
|
|
local_1c = 99999;
|
|
cappedCharge = &local_1c;
|
|
if (berserkItem < 100000) {
|
|
cappedCharge = berserkCharge;
|
|
}
|
|
berserkItem = *cappedCharge;
|
|
*berserkCharge = berserkItem;
|
|
}
|
|
if (99999 < berserkItem) {
|
|
*berserkCharge = 0;
|
|
collectibles = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0xb00 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibles) &
|
|
0xfffffffcU))) &&
|
|
(berserkItem = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibles) + 0xb00)), berserkItem != 0)) {
|
|
berserkEffect[2] = *GHIDRA_CAST<undefined4 *>((berserkItem + 0x78));
|
|
berserkEffect[1] = 0;
|
|
local_c = 0;
|
|
berserkEffect[0] = berserkItem;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(berserkEffect,1,1);
|
|
}
|
|
manager = g_manager;
|
|
local_1c = 0x250;
|
|
seed_fart_sound_override(&local_1c);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_1c,1.0,2,0,1.0,0.0);
|
|
manager = g_manager;
|
|
local_1c = 0x28a;
|
|
seed_fart_sound_override(&local_1c);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_1c,1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Level *>((g_game->_room)))->Level::UpdateBackwardsPathStages();
|
|
}
|
|
this->_cacheFlags = this->_cacheFlags | 0x1000;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
return;
|
|
}
|
|
|
|
// 007d93b0
|
|
void Entity_Player::RevivePlayerGhost()
|
|
{
|
|
int iVar1;
|
|
byte isAnimSet;
|
|
std_string *ANM2Path;
|
|
int iVar2;
|
|
uint seed;
|
|
Entity_Player *twin;
|
|
void *configNode;
|
|
void *configHead;
|
|
int aiStack_1c [2];
|
|
undefined1 lowerBound [8];
|
|
void *boundNode;
|
|
Manager *manager;
|
|
|
|
aiStack_1c[1] = 0x100000;
|
|
do {
|
|
this->_isCoopGhost = 0;
|
|
this->_isInvicible = 0;
|
|
this->_entityCollisionClass = 4;
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
manager = g_manager;
|
|
_Find_lower_bound<>(lowerBound,aiStack_1c + 1);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(boundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(boundNode) + 0x10)) < 0x100001))
|
|
{
|
|
configNode = boundNode;
|
|
configHead = (manager->_entityConfig)._entities._head;
|
|
}
|
|
else {
|
|
configNode = (manager->_entityConfig)._entities._head;
|
|
configHead = configNode;
|
|
}
|
|
ANM2Path = GHIDRA_CAST<std_string *>((GHIDRA_INT(configNode) + 0x8c));
|
|
if (configNode == configHead) {
|
|
ANM2Path = GHIDRA_CAST<std_string *>(0x74);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(ANM2Path,0);
|
|
update_player_skin(this);
|
|
if (g_game->_isRestoringGlowingHourglassState == 0) {
|
|
PlayExtraAnimation(this,GHIDRA_CAST<byte *>("Appear"));
|
|
}
|
|
this->_damageCooldown = 0x3c;
|
|
UpdateCostumes(this);
|
|
iVar2 = this->_ghostPocketSlots[0];
|
|
this->_pocketSlots[1] = this->_ghostPocketSlots[1];
|
|
iVar1 = this->_ghostPocketSlots[3];
|
|
this->_pocketSlots[0] = iVar2;
|
|
iVar2 = this->_ghostPocketSlots[2];
|
|
this->_pocketSlots[3] = iVar1;
|
|
iVar1 = this->_ghostPocketSlots[5];
|
|
this->_pocketSlots[2] = iVar2;
|
|
iVar2 = this->_ghostPocketSlots[4];
|
|
this->_pocketSlots[5] = iVar1;
|
|
iVar1 = this->_ghostPocketSlots[7];
|
|
this->_pocketSlots[4] = iVar2;
|
|
iVar2 = this->_ghostPocketSlots[6];
|
|
this->_pocketSlots[7] = iVar1;
|
|
this->_pocketSlots[6] = iVar2;
|
|
this->_trinketsID[0] = this->_ghostTrinkets[0];
|
|
this->_trinketsID[1] = this->_ghostTrinkets[1];
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
EvaluateItems(this);
|
|
iVar2 = this->_maxHearts;
|
|
this->_soulHearts = 0;
|
|
this->_blackHearts = 0;
|
|
this->_eternalHearts = 0;
|
|
this->_boneHeartsMask = 0;
|
|
this->_boneHearts = 0;
|
|
this->_rottenHearts = 0;
|
|
if (iVar2 < 1) {
|
|
iVar2 = GetHealthType(this);
|
|
if (iVar2 == 4) {
|
|
this->_redHearts = 2;
|
|
AddBoneHearts(this,1);
|
|
}
|
|
else {
|
|
iVar2 = GetHealthType(this);
|
|
if (iVar2 == 3) {
|
|
this->_redHearts = 4;
|
|
this->_maxHearts = 4;
|
|
}
|
|
else {
|
|
iVar2 = GetHealthType(this);
|
|
this->_redHearts = 0;
|
|
this->_soulHearts = GHIDRA_UINT((iVar2 != 2)) * 2 + 1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (3 < iVar2) {
|
|
iVar2 = 3;
|
|
}
|
|
this->_redHearts = iVar2;
|
|
iVar2 = GetHealthType(this);
|
|
if (iVar2 == 3) {
|
|
this->_redHearts = 2;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
aiStack_1c[0] = 0x50;
|
|
seed_fart_sound_override(aiStack_1c);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(aiStack_1c[0],1.0,2,0,1.0,0.0);
|
|
seed = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed,0);
|
|
if (this->_playerType == 0x23) {
|
|
twin = InitTwin(this,0x28);
|
|
InitPostLevelInitStats(twin);
|
|
twin->_isPlayingItemAnimation = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&twin->_bodySprite)))->ANM2::Reset();
|
|
(twin->_sprite)._playbackSpeed = 1.0;
|
|
(GHIDRA_CAST<AnimationState *>((&(twin->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((&twin->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Appear"),1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(twin->_sprite)._animState)))->AnimationState::Rewind();
|
|
(twin->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
twin->_isPlayingExtraAnimation = 1;
|
|
twin->_isPlayingItemAnimation = 0;
|
|
twin->_damageCooldown = 0x3c;
|
|
}
|
|
this = this->_backupPlayer;
|
|
} while ((this != GHIDRA_CAST<Entity_Player *>(0x0)) && (this->_isCoopGhost != 0));
|
|
return;
|
|
}
|
|
|
|
// 007d96f0
|
|
void Entity_Player::MorphToCoopGhost()
|
|
{
|
|
qword qVar1;
|
|
byte isAnimChanged;
|
|
uint uVar2;
|
|
int secondTrinket;
|
|
int iVar3;
|
|
qword *allocCounter;
|
|
uint i;
|
|
EntityList_EL itemWisps;
|
|
EntityList_EL wisps;
|
|
EntityPtr *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Entity_Player *backupPlayer;
|
|
Game *game;
|
|
EntityPtr *twinRef;
|
|
int *wisp;
|
|
void *wispData;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b004d5;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
if (this->_playerType != 0x28) {
|
|
if (this->_playerType == 0x23) {
|
|
twinRef = &this->_twinPlayer;
|
|
if ((this->_twinPlayer != (EntityPtr)0x0) &&
|
|
(PlayerManager::RemoveCoPlayer
|
|
(&g_game->_playerManager,GHIDRA_CAST<Entity_Player *>(this->_twinPlayer),
|
|
(byte)&g_game->_playerManager), *twinRef != (EntityPtr)0x0)) {
|
|
local_14 = twinRef;
|
|
std::multiset<unsigned_int>::erase(&local_14);
|
|
*twinRef = (EntityPtr)0x0;
|
|
}
|
|
}
|
|
Revive(this);
|
|
if ((this->_playerType == 0x11) && (this->_forgottenBody != (void *)0x0)) {
|
|
SwapForgottenForm(this,1,0);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveNullEffect(0x70,1);
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>((g_game->_deathmatchManager)._type) + 0x60))(this,uVar2);
|
|
}
|
|
UpdateCostumes(this);
|
|
if (this->_hasCurseMistEffect == 0) {
|
|
iVar3 = this->_pocketSlots[1];
|
|
this->_ghostPocketSlots[0] = this->_pocketSlots[0];
|
|
this->_ghostPocketSlots[1] = iVar3;
|
|
this->_pocketSlots[0] = 0;
|
|
this->_pocketSlots[1] = 1;
|
|
iVar3 = this->_pocketSlots[3];
|
|
this->_ghostPocketSlots[2] = this->_pocketSlots[2];
|
|
this->_ghostPocketSlots[3] = iVar3;
|
|
this->_pocketSlots[2] = 0;
|
|
this->_pocketSlots[3] = 1;
|
|
iVar3 = this->_pocketSlots[5];
|
|
this->_ghostPocketSlots[4] = this->_pocketSlots[4];
|
|
this->_ghostPocketSlots[5] = iVar3;
|
|
this->_pocketSlots[4] = 0;
|
|
this->_pocketSlots[5] = 1;
|
|
iVar3 = this->_pocketSlots[7];
|
|
this->_ghostPocketSlots[6] = this->_pocketSlots[6];
|
|
this->_ghostPocketSlots[7] = iVar3;
|
|
this->_pocketSlots[6] = 0;
|
|
this->_pocketSlots[7] = 1;
|
|
iVar3 = this->_trinketsID[0];
|
|
secondTrinket = this->_trinketsID[1];
|
|
this->_trinketsID[0] = 0;
|
|
this->_trinketsID[1] = 0;
|
|
}
|
|
else {
|
|
iVar3 = this->_curseMistPocketSlots[1];
|
|
this->_ghostPocketSlots[0] = this->_curseMistPocketSlots[0];
|
|
this->_ghostPocketSlots[1] = iVar3;
|
|
this->_curseMistPocketSlots[0] = 0;
|
|
this->_curseMistPocketSlots[1] = 1;
|
|
iVar3 = this->_curseMistPocketSlots[3];
|
|
this->_ghostPocketSlots[2] = this->_curseMistPocketSlots[2];
|
|
this->_ghostPocketSlots[3] = iVar3;
|
|
this->_curseMistPocketSlots[2] = 0;
|
|
this->_curseMistPocketSlots[3] = 1;
|
|
iVar3 = this->_curseMistPocketSlots[5];
|
|
this->_ghostPocketSlots[4] = this->_curseMistPocketSlots[4];
|
|
this->_ghostPocketSlots[5] = iVar3;
|
|
this->_curseMistPocketSlots[4] = 0;
|
|
this->_curseMistPocketSlots[5] = 1;
|
|
iVar3 = this->_curseMistPocketSlots[7];
|
|
this->_ghostPocketSlots[6] = this->_curseMistPocketSlots[6];
|
|
this->_ghostPocketSlots[7] = iVar3;
|
|
this->_curseMistPocketSlots[6] = 0;
|
|
this->_curseMistPocketSlots[7] = 1;
|
|
iVar3 = this->_curseMistTrinkets[0];
|
|
secondTrinket = this->_curseMistTrinkets[1];
|
|
this->_curseMistTrinkets[0] = 0;
|
|
this->_curseMistTrinkets[1] = 0;
|
|
}
|
|
this->_ghostTrinkets[0] = iVar3;
|
|
this->_ghostTrinkets[1] = secondTrinket;
|
|
reset_body_sprite(this);
|
|
this->_isPlayingItemAnimation = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_bodySprite)))->ANM2::Reset();
|
|
(this->_sprite)._playbackSpeed = 1.0;
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0);
|
|
isAnimChanged = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("GhostAppear"),1);
|
|
if (isAnimChanged != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
game = g_game;
|
|
this->_isPlayingExtraAnimation = 1;
|
|
this->_isPlayingItemAnimation = 0;
|
|
if (1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) {
|
|
this->_entityCollisionClass = 0;
|
|
}
|
|
this->_entityGridCollisionClass = 3;
|
|
this->_cacheFlags = this->_cacheFlags | 0xffff;
|
|
this->_isCoopGhost = 1;
|
|
this->_isInvicible = 1;
|
|
this->_visible = 1;
|
|
EvaluateItems(this);
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&wisps,3,0xce,-1,0,0);
|
|
wispData = wisps._data;
|
|
local_8 = 0;
|
|
i = 0;
|
|
uVar2 = wisps._size;
|
|
if (wisps._size != 0) {
|
|
do {
|
|
wisp = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(wispData) + i * 4));
|
|
if (GHIDRA_CAST<Entity_Player *>(wisp[0x104]) == this) {
|
|
(**(code **)(*wisp + 0x28))();
|
|
uVar2 = wisps._size;
|
|
}
|
|
i = i + 1;
|
|
} while (i < uVar2);
|
|
}
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&itemWisps,3,0xed,-1,0,0);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
i = 0;
|
|
uVar2 = itemWisps._size;
|
|
if (itemWisps._size != 0) {
|
|
do {
|
|
wisp = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(itemWisps._data) + i * 4));
|
|
if (GHIDRA_CAST<Entity_Player *>(wisp[0x104]) == this) {
|
|
(**(code **)(*wisp + 0x28))();
|
|
uVar2 = itemWisps._size;
|
|
}
|
|
i = i + 1;
|
|
} while (i < uVar2);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(itemWisps)) + 0x0))) == '\0') {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (itemWisps._data != (void *)0x0) {
|
|
uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(itemWisps._data) + -4));
|
|
qVar1 = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
|
|
free((void *)(GHIDRA_INT(itemWisps._data) + -4));
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(wisps)) + 0x0))) == '\0') {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (wisps._data != (void *)0x0) {
|
|
uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(wisps._data) + -4));
|
|
qVar1 = *allocCounter;
|
|
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
|
|
free(GHIDRA_CAST<uint *>((GHIDRA_INT(wisps._data) + -4)));
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
backupPlayer = this->_backupPlayer;
|
|
if ((backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) && (backupPlayer->_isCoopGhost == 0)) {
|
|
MorphToCoopGhost(backupPlayer);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007d9b70
|
|
void Entity_Player::reset_body_sprite()
|
|
{
|
|
EntityConfig_Entity *playerEntityConfig;
|
|
int iVar1;
|
|
int extraout_ECX;
|
|
uint layerId;
|
|
int iVar2;
|
|
undefined1 findResult [8];
|
|
void *node;
|
|
Entity_Player *local_c;
|
|
Manager *local_8;
|
|
Manager *manager;
|
|
ANM2 *sprite;
|
|
|
|
manager = g_manager;
|
|
local_8 = GHIDRA_CAST<Manager *>(0x100100);
|
|
local_c = this;
|
|
_Find_lower_bound<>(findResult,&local_8);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(node) + 0xd)) == '\0') && (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(node) + 0x10)) < 0x100101)) &&
|
|
(node != (manager->_entityConfig)._entities._head)) {
|
|
playerEntityConfig = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(node) + 0x18));
|
|
}
|
|
else {
|
|
playerEntityConfig = (GHIDRA_CAST<EntityConfig *>((&manager->_entityConfig)))->EntityConfig::GetEntity(1,0,0);
|
|
}
|
|
sprite = &this->_sprite;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Load(&playerEntityConfig->anm2Path,0);
|
|
iVar2 = this->_playerType;
|
|
iVar1 = 0x3c;
|
|
if ((iVar2 == 4) || (iVar2 == 0x19)) {
|
|
iVar1 = 0x3e;
|
|
}
|
|
else if (((iVar2 == 0xe) || (iVar2 == 0x21)) ||
|
|
((iVar2 == 0xf || (((iVar2 == 0x22 || (iVar2 == 0x10)) || (iVar2 == 0x23)))))) {
|
|
iVar1 = 0x3f;
|
|
}
|
|
else if (((iVar2 == 7) || (iVar2 == 0x1c)) || ((iVar2 == 0xd || (iVar2 == 0x20)))) {
|
|
iVar1 = 0x3d;
|
|
}
|
|
layerId = 0;
|
|
local_8 = g_manager;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
iVar2 = iVar1 * 0x38;
|
|
do {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(sprite),layerId,
|
|
GHIDRA_CAST<std_string *>((GHIDRA_INT((local_8->_entityConfig)._babies._begin) + iVar2 + 0x1c)));
|
|
layerId = layerId + 1;
|
|
iVar1 = extraout_ECX;
|
|
} while (layerId < GHIDRA_UINT((local_c->_sprite)._layerCount));
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::LoadGraphics((byte)iVar1);
|
|
return;
|
|
}
|
|
|
|
// 007d9d00
|
|
uint * Entity_Player::CalculateBagOfCraftingOutput(uint *output, byte *bagContent, byte unused)
|
|
{
|
|
int iVar1;
|
|
code *pcVar2;
|
|
byte pickup4;
|
|
ItemConfig_Item *recipeItem;
|
|
uint *puVar4;
|
|
uint uVar5;
|
|
int iVar6;
|
|
int iVar7;
|
|
uint weightCount;
|
|
void *pvVar8;
|
|
Game *game;
|
|
std_vector *psVar9;
|
|
undefined4 *puVar10;
|
|
float fVar11;
|
|
float fVar12;
|
|
int itemWeightsEnd;
|
|
void *itemWeightsCapacityEnd;
|
|
uint seed;
|
|
uint local_7c;
|
|
int maxQuality;
|
|
int minQuality;
|
|
void *local_70;
|
|
float totalWeight;
|
|
std_vector *local_68;
|
|
byte *local_64;
|
|
undefined8 *local_60;
|
|
undefined4 *local_5c;
|
|
void *poolWeights;
|
|
undefined4 *poolWeightsEnd;
|
|
undefined4 *poolWeightsCapacityEnd;
|
|
uint local_4c;
|
|
float local_48;
|
|
byte pickupCounts [31];
|
|
void *prevExceptionList;
|
|
undefined1 *puStack_18;
|
|
undefined4 ehState;
|
|
Manager *manager;
|
|
byte pickup2;
|
|
byte pickup3;
|
|
byte pickup4;
|
|
byte pickup5;
|
|
byte pickup6;
|
|
byte pickup7;
|
|
|
|
manager = g_manager;
|
|
ehState = 0xffffffff;
|
|
puStack_18 = &LAB_00b00518;
|
|
prevExceptionList = ExceptionList;
|
|
ExceptionList = &prevExceptionList;
|
|
local_64 = bagContent;
|
|
FUN_00753660(&local_4c,bagContent);
|
|
recipeItem = (GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig::GetCollectible(local_4c);
|
|
if ((recipeItem == GHIDRA_CAST<ItemConfig_Item *>(0x0)) ||
|
|
(pickup4 = (GHIDRA_CAST<Item *>((recipeItem)))->Item::IsAvailable(0xffffffff), pickup4 == 0)) {
|
|
local_4c = 0;
|
|
local_48 = -NAN;
|
|
}
|
|
if (local_4c == 0) {
|
|
pickupCounts[0] = 0;
|
|
pickupCounts[1] = 0;
|
|
pickupCounts[2] = 0;
|
|
pickupCounts[3] = 0;
|
|
pickupCounts[4] = 0;
|
|
pickupCounts[5] = 0;
|
|
pickupCounts[6] = 0;
|
|
pickupCounts[7] = 0;
|
|
pickupCounts[8] = 0;
|
|
pickupCounts[9] = 0;
|
|
pickupCounts[10] = 0;
|
|
pickupCounts[0xb] = 0;
|
|
pickupCounts[0xc] = 0;
|
|
pickupCounts[0xd] = 0;
|
|
pickupCounts[0xe] = 0;
|
|
pickupCounts[0xf] = 0;
|
|
pickupCounts[0x18] = 0;
|
|
pickupCounts[0x19] = 0;
|
|
pickupCounts[0x1a] = 0;
|
|
pickupCounts[0x1b] = 0;
|
|
pickupCounts[0x10] = 0;
|
|
pickupCounts[0x11] = 0;
|
|
pickupCounts[0x12] = 0;
|
|
pickupCounts[0x13] = 0;
|
|
pickupCounts[0x14] = 0;
|
|
pickupCounts[0x15] = 0;
|
|
pickupCounts[0x16] = 0;
|
|
pickupCounts[0x17] = 0;
|
|
pickup4 = *local_64;
|
|
pickup3 = local_64[3];
|
|
pickup4 = local_64[4];
|
|
pickup5 = local_64[5];
|
|
pickupCounts[0x1c] = 0;
|
|
pickupCounts[0x1d] = 0;
|
|
pickupCounts[0x1e] = 0;
|
|
pickupCounts[pickup4] = pickupCounts[pickup4] + 1;
|
|
local_68 = GHIDRA_CAST<std_vector *>(GHIDRA_UINT(local_64[1]));
|
|
poolWeights = (void *)0x0;
|
|
poolWeightsEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
pickupCounts[GHIDRA_INT(local_68)] = pickupCounts[GHIDRA_INT(local_68)] + 1;
|
|
pickup2 = local_64[2];
|
|
pickup6 = local_64[6];
|
|
poolWeightsCapacityEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
pickupCounts[pickup2] = pickupCounts[pickup2] + 1;
|
|
pickupCounts[pickup3] = pickupCounts[pickup3] + 1;
|
|
pickupCounts[pickup4] = pickupCounts[pickup4] + 1;
|
|
pickupCounts[pickup5] = pickupCounts[pickup5] + 1;
|
|
pickup7 = local_64[7];
|
|
pickupCounts[pickup6] = pickupCounts[pickup6] + 1;
|
|
pickupCounts[pickup7] = pickupCounts[pickup7] + 1;
|
|
iVar6 = *GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup7) * 4)) +
|
|
*GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup6) * 4)) +
|
|
*GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup5) * 4)) +
|
|
*GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup4) * 4)) +
|
|
*GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup3) * 4)) +
|
|
*GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup2) * 4)) +
|
|
*GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_INT(local_68) * 4)) + *GHIDRA_CAST<int *>((&DAT_00b6ba30 + GHIDRA_UINT(pickup4) * 4));
|
|
ehState = 0;
|
|
local_4c = 0;
|
|
local_48 = 1.0;
|
|
FUN_007dd690(0,&local_4c);
|
|
local_4c = 1;
|
|
local_48 = 2.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 1;
|
|
poolWeightsEnd[1] = 0x40000000;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 2;
|
|
local_48 = 2.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 2;
|
|
poolWeightsEnd[1] = 0x40000000;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 4;
|
|
local_48 = (float)pickupCounts[4] * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 4;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 3;
|
|
local_48 = (float)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0x0))) >> 0x18) * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 3;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 5;
|
|
local_48 = (float)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0x4))) >> 0x10 & 0xff) * 5.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 5;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 8;
|
|
local_48 = (float)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0x4))) >> 8 & 0xff) * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 8;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 0xc;
|
|
local_48 = (float)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0x4))) >> 0x18) * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 0xc;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 9;
|
|
local_48 = (float)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0x18))) >> 8 & 0xff) * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 9;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
local_4c = 7;
|
|
local_48 = (float)pickupCounts[0x1d] * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 7;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
if (((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0x0))) >> 8 & 0xff) + GHIDRA_UINT(pickupCounts[8]) + GHIDRA_UINT(pickupCounts[0xc]) +
|
|
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(pickupCounts))) + 0xc))) >> 0x18) == 0) {
|
|
local_4c = 0x1a;
|
|
local_48 = (float)pickupCounts[0x17] * 10.0;
|
|
if (poolWeightsEnd == poolWeightsCapacityEnd) {
|
|
local_5c = poolWeightsEnd;
|
|
FUN_007dd690(poolWeightsEnd,&local_4c);
|
|
}
|
|
else {
|
|
*poolWeightsEnd = 0x1a;
|
|
poolWeightsEnd[1] = local_48;
|
|
poolWeightsEnd = poolWeightsEnd + 2;
|
|
}
|
|
}
|
|
game = g_game;
|
|
seed = (g_game->_seedEffects)._gameStartSeed;
|
|
local_5c = poolWeightsEnd;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
seed = (game->_seedEffects)._gameStartSeed;
|
|
}
|
|
local_70 = (void *)0x0;
|
|
psVar9 = GHIDRA_CAST<std_vector *>((1 - GHIDRA_INT(pickupCounts)));
|
|
local_60 = &DAT_00b1f4d4;
|
|
local_7c = 0x1f;
|
|
local_68 = psVar9;
|
|
do {
|
|
if (pickupCounts[GHIDRA_INT(local_70)] != 0) {
|
|
if (&DAT_00000050 < pickupCounts + GHIDRA_INT(&psVar9->_begin) + GHIDRA_INT(local_70)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG: Invalid ShiftIdx\n"));
|
|
}
|
|
local_64 = GHIDRA_CAST<byte *>(0x0);
|
|
do {
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
puVar4 = GHIDRA_CAST<uint *>((*pcVar2)());
|
|
return puVar4;
|
|
}
|
|
seed = seed >> ((byte)*local_60 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)((ulonglong)*local_60 >> 0x20) & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)*GHIDRA_CAST<undefined4 *>((local_60 + 1)) & 0x1f) ^ seed;
|
|
local_64 = local_64 + 1;
|
|
} while (local_64 < GHIDRA_CAST<byte *>(GHIDRA_UINT(pickupCounts[GHIDRA_INT(local_70)])));
|
|
psVar9 = local_68;
|
|
}
|
|
puVar10 = local_5c;
|
|
local_60 = GHIDRA_CAST<undefined8 *>((GHIDRA_INT(local_60) + 0xc));
|
|
local_70 = (void *)(GHIDRA_INT(local_70) + 1);
|
|
local_7c = local_7c + -1;
|
|
} while (local_7c != 0);
|
|
local_48 = 2.8026e-44;
|
|
pickupCounts[0x10] = 1;
|
|
pickupCounts[0x11] = 0;
|
|
pickupCounts[0x12] = 0;
|
|
pickupCounts[0x13] = 0;
|
|
pickupCounts[0x14] = 0x15;
|
|
pickupCounts[0x15] = 0;
|
|
pickupCounts[0x16] = 0;
|
|
pickupCounts[0x17] = 0;
|
|
local_68 = GHIDRA_CAST<std_vector *>(0x0);
|
|
local_70 = (void *)0x0;
|
|
local_64 = GHIDRA_CAST<byte *>((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2));
|
|
itemWeightsEnd = 0;
|
|
itemWeightsCapacityEnd = (void *)0x0;
|
|
if (local_64 != GHIDRA_CAST<byte *>(0x0)) {
|
|
if (0x3fffffff < local_64) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
uVar5 = GHIDRA_INT(local_64) * 4;
|
|
local_70 = std::_Allocate(uVar5);
|
|
itemWeightsCapacityEnd = (void *)(GHIDRA_INT(local_70) + uVar5);
|
|
itemWeightsEnd = std::fill_n<4byte>(local_70,local_64,&local_68);
|
|
}
|
|
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),1);
|
|
totalWeight = 0.0;
|
|
puVar10 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(puVar10) - GHIDRA_INT(poolWeights) >> 3));
|
|
local_64 = GHIDRA_CAST<byte *>(0x0);
|
|
pvVar8 = poolWeights;
|
|
local_5c = puVar10;
|
|
if (puVar10 != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
do {
|
|
fVar11 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + GHIDRA_INT(local_64) * 8 + 4));
|
|
if (0.0 < fVar11) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + GHIDRA_INT(local_64) * 8));
|
|
if (((iVar1 == 4) || (iVar1 == 3)) || (iVar7 = iVar6, iVar1 == 5)) {
|
|
iVar7 = iVar6 + -5;
|
|
}
|
|
minQuality = 0;
|
|
maxQuality = 1;
|
|
if (iVar7 < 0x23) {
|
|
if (iVar7 < 0x1f) {
|
|
if (iVar7 < 0x1b) {
|
|
if (iVar7 < 0x17) {
|
|
if (iVar7 < 0x13) {
|
|
if (iVar7 < 0xf) {
|
|
if (iVar7 < 9) goto LAB_007da41c;
|
|
minQuality = 0;
|
|
}
|
|
else {
|
|
minQuality = 1;
|
|
}
|
|
maxQuality = 2;
|
|
}
|
|
else {
|
|
maxQuality = 3;
|
|
minQuality = 2;
|
|
}
|
|
}
|
|
else {
|
|
maxQuality = 4;
|
|
minQuality = 2;
|
|
}
|
|
}
|
|
else {
|
|
maxQuality = 4;
|
|
minQuality = 3;
|
|
}
|
|
}
|
|
else {
|
|
maxQuality = 4;
|
|
minQuality = 3;
|
|
}
|
|
}
|
|
else {
|
|
maxQuality = 4;
|
|
minQuality = 4;
|
|
}
|
|
LAB_007da41c:
|
|
local_7c = 0;
|
|
local_68 = &(g_game->_itemPool)._pools[iVar1]._poolList;
|
|
pvVar8 = local_68->_begin;
|
|
iVar7 = GHIDRA_INT(local_68->_end) - GHIDRA_INT(pvVar8);
|
|
iVar1 = iVar7 >> 0x1f;
|
|
if (iVar7 / 0x18 + iVar1 == iVar1) {
|
|
pvVar8 = poolWeights;
|
|
}
|
|
else {
|
|
local_60 = GHIDRA_CAST<undefined8 *>(0x0);
|
|
game = g_game;
|
|
do {
|
|
uVar5 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar8) + GHIDRA_INT(local_60)));
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar5)) goto LAB_007da49b;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar5) < 0) {
|
|
if ((GHIDRA_INT(uVar5) < 0) &&
|
|
(pvVar8 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar5) <
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar8) >> 2))
|
|
{
|
|
pvVar8 = (void *)**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar8) + ~uVar5 * 4));
|
|
}
|
|
else {
|
|
pvVar8 = (void *)0x0;
|
|
}
|
|
LAB_007da4b3:
|
|
if (((pvVar8 != (void *)0x0) && (pickup4 = (GHIDRA_CAST<Item *>((pvVar8)))->Item::IsAvailable(1), pickup4 != 0))
|
|
&& ((minQuality <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0xc4)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0xc4)) <= maxQuality)))) {
|
|
fVar12 = fVar11 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + GHIDRA_INT(local_68->_begin) + 4));
|
|
totalWeight = fVar12 + totalWeight;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_70) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 4)) * 4)) =
|
|
fVar12 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_70) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 4)) * 4));
|
|
}
|
|
}
|
|
else {
|
|
LAB_007da49b:
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT(uVar5) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2) {
|
|
pvVar8 = *(void **)(GHIDRA_CAST<char *>(pvVar8) + uVar5 * 4);
|
|
goto LAB_007da4b3;
|
|
}
|
|
}
|
|
game = g_game;
|
|
}
|
|
local_60 = local_60 + 3;
|
|
local_7c = local_7c + 1;
|
|
pvVar8 = local_68->_begin;
|
|
} while (local_7c < GHIDRA_UINT(((GHIDRA_INT(local_68->_end) - GHIDRA_INT(pvVar8)) / 0x18)));
|
|
pvVar8 = poolWeights;
|
|
puVar10 = local_5c;
|
|
}
|
|
}
|
|
local_64 = GHIDRA_CAST<byte *>((GHIDRA_INT(local_64) + 1));
|
|
} while (local_64 < puVar10);
|
|
}
|
|
local_5c = GHIDRA_CAST<undefined4 *>(0x19);
|
|
game = g_game;
|
|
if (0.0 < totalWeight) {
|
|
local_68 = GHIDRA_CAST<std_vector *>(0x0);
|
|
do {
|
|
local_5c = GHIDRA_CAST<undefined4 *>(0x19);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
puVar4 = GHIDRA_CAST<uint *>((*pcVar2)());
|
|
return puVar4;
|
|
}
|
|
seed = seed >> (pickupCounts[0x10] & 0x1f) ^ seed;
|
|
seed = seed << (pickupCounts[0x14] & 0x1f) ^ seed;
|
|
seed = seed >> (SUB41(local_48,0) & 0x1f) ^ seed;
|
|
weightCount = itemWeightsEnd - GHIDRA_INT(local_70) >> 2;
|
|
uVar5 = 0;
|
|
fVar11 = (float)((double)GHIDRA_INT(seed) + __uint_to_double_fixup[-(GHIDRA_INT(seed) >> 0x1f)]) *
|
|
2.3283062e-10 * totalWeight;
|
|
if (weightCount != 0) {
|
|
do {
|
|
fVar12 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_70) + uVar5 * 4));
|
|
if (fVar11 < fVar12) {
|
|
local_5c = GHIDRA_CAST<undefined4 *>(uVar5);
|
|
goto LAB_007da627;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
fVar11 = fVar11 - fVar12;
|
|
} while (uVar5 < weightCount);
|
|
}
|
|
LAB_007da627:
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(local_5c)) goto LAB_007da666;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(local_5c) < 0) {
|
|
iVar6 = -1 - GHIDRA_INT(local_5c);
|
|
if ((iVar6 < 0) ||
|
|
(pvVar8 = (game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar8) >> 2 <= iVar6
|
|
)) {
|
|
pvVar8 = (void *)0x0;
|
|
}
|
|
else {
|
|
pvVar8 = (void *)**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar8) + iVar6 * 4));
|
|
}
|
|
}
|
|
else {
|
|
LAB_007da666:
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) >> 2 <= GHIDRA_INT(local_5c)
|
|
) goto LAB_007da698;
|
|
pvVar8 = *(void **)(GHIDRA_CAST<char *>(pvVar8) + GHIDRA_INT(local_5c) * 4);
|
|
}
|
|
if (pvVar8 != (void *)0x0) {
|
|
pickup4 = (GHIDRA_CAST<Item *>((pvVar8)))->Item::IsAvailable(6);
|
|
game = g_game;
|
|
if (pickup4 != 0) break;
|
|
}
|
|
}
|
|
LAB_007da698:
|
|
local_68 = GHIDRA_CAST<std_vector *>((GHIDRA_INT(&local_68->_begin) + 1));
|
|
local_5c = GHIDRA_CAST<undefined4 *>(0x19);
|
|
} while (GHIDRA_INT(local_68) < 0x14);
|
|
}
|
|
uVar5 = (GHIDRA_CAST<ItemPool *>((&game->_itemPool)))->ItemPool::GetFirstItemPoolForCollectible(GHIDRA_INT(local_5c));
|
|
*output = GHIDRA_UINT(local_5c);
|
|
output[1] = uVar5;
|
|
if (local_70 != (void *)0x0) {
|
|
uVar5 = GHIDRA_INT(itemWeightsCapacityEnd) - GHIDRA_INT(local_70) & 0xfffffffc;
|
|
pvVar8 = local_70;
|
|
if (0xfff < uVar5) {
|
|
pvVar8 = *(void **)(GHIDRA_CAST<char *>(local_70) + -4);
|
|
uVar5 = uVar5 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_70) + (-4 - GHIDRA_INT(pvVar8))))) goto LAB_007da72b;
|
|
}
|
|
operator_delete(pvVar8,uVar5);
|
|
}
|
|
if (poolWeights != (void *)0x0) {
|
|
uVar5 = GHIDRA_INT(poolWeightsCapacityEnd) - GHIDRA_INT(poolWeights) & 0xfffffff8;
|
|
pvVar8 = poolWeights;
|
|
if (0xfff < uVar5) {
|
|
pvVar8 = *(void **)(GHIDRA_CAST<char *>(poolWeights) + -4);
|
|
uVar5 = uVar5 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(poolWeights) + (-4 - GHIDRA_INT(pvVar8))))) {
|
|
LAB_007da72b:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar8,uVar5);
|
|
}
|
|
}
|
|
else {
|
|
output[1] = GHIDRA_UINT(local_48);
|
|
*output = local_4c;
|
|
}
|
|
ExceptionList = prevExceptionList;
|
|
return output;
|
|
}
|
|
|
|
// 007da810
|
|
void Entity_Player::SpawnClot(Vector *pos, byte unk)
|
|
{
|
|
undefined4 uVar1;
|
|
byte isBoneHeart;
|
|
int iVar2;
|
|
float blackHeartMask;
|
|
uint uVar3;
|
|
uint angleRoll;
|
|
Entity *bloodSplat;
|
|
int minRedHearts;
|
|
int extraout_EDX;
|
|
int iVar4;
|
|
uint uVar5;
|
|
float local_18;
|
|
Entity *local_14;
|
|
Vector clotVelocity;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
iVar2 = GetHealthType(this);
|
|
game = g_game;
|
|
if (0 < this->_goldenHearts) {
|
|
iVar2 = this->_goldenHearts + -1;
|
|
this->_goldenHearts = iVar2;
|
|
if (((*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) && (this->_dead == 0)) && (0 < iVar2)) {
|
|
iVar4 = this->_redHearts;
|
|
if (this->_maxHearts < this->_redHearts) {
|
|
iVar4 = this->_maxHearts;
|
|
}
|
|
iVar4 = (iVar4 + 1) / 2 + (this->_soulHearts + 1) / 2 + this->_boneHearts;
|
|
if (iVar4 < iVar2) {
|
|
BreakGoldenHearts(this,iVar2 - iVar4);
|
|
this->_goldenHearts = iVar4;
|
|
}
|
|
}
|
|
uVar5 = 4;
|
|
goto LAB_007daaa6;
|
|
}
|
|
if (0 < this->_eternalHearts) {
|
|
this->_eternalHearts = this->_eternalHearts + -1;
|
|
UpdateHeartDependentEffects(this);
|
|
uVar5 = 3;
|
|
goto LAB_007daaa6;
|
|
}
|
|
iVar4 = this->_redHearts;
|
|
if ((iVar4 < 1) || (this->_boneHearts + this->_soulHearts < 1)) {
|
|
if (unk == 0) {
|
|
minRedHearts = (iVar2 == 3) + 1;
|
|
}
|
|
else {
|
|
minRedHearts = 0;
|
|
}
|
|
if (iVar4 - this->_rottenHearts <= minRedHearts) {
|
|
iVar2 = this->_boneHearts;
|
|
uVar5 = this->_soulHearts;
|
|
if (GHIDRA_INT((iVar2 + uVar5)) <= GHIDRA_INT((unk ^ 1))) {
|
|
return;
|
|
}
|
|
if ((0 < iVar2) &&
|
|
(isBoneHeart = IsBoneHeart(this,(GHIDRA_INT((uVar5 + 1)) >> 1) + iVar2 + -1), isBoneHeart != 0)) {
|
|
AddBoneHearts(this,-1);
|
|
uVar5 = 5;
|
|
goto LAB_007daaa6;
|
|
}
|
|
iVar2 = GetHealthType(this);
|
|
if ((iVar2 == 2) && (unk != 0)) {
|
|
this->_soulHearts = 0;
|
|
}
|
|
else {
|
|
if (0 < GHIDRA_INT(uVar5)) {
|
|
uVar3 = uVar5 & 0x80000001;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if (uVar3 != 1) goto LAB_007daa01;
|
|
blackHeartMask = (float)this->_blackHearts;
|
|
if ((GHIDRA_UINT(blackHeartMask) & 1 << ((byte)(GHIDRA_INT((uVar5 - 1)) / 2) & 0x1f)) == 0)
|
|
goto LAB_007daa0d;
|
|
LAB_007daa69:
|
|
this->_blackHearts = GHIDRA_UINT(blackHeartMask) & ~(1 << (uVar5 >> 1 & 0x1f));
|
|
ClampGoldenHearts(this,0);
|
|
update_bone_hearts(this);
|
|
LAB_007daa84:
|
|
AddSoulHearts(this,-1,0);
|
|
uVar5 = 2;
|
|
goto LAB_007daaa6;
|
|
}
|
|
LAB_007daa01:
|
|
if (0 < GHIDRA_INT(uVar5)) {
|
|
LAB_007daa0d:
|
|
uVar3 = uVar5 - 1;
|
|
if ((GHIDRA_INT(uVar3) <= GHIDRA_INT(uVar5)) && (0 < GHIDRA_INT(uVar3))) {
|
|
uVar3 = uVar3 & 0x80000001;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if (uVar3 == 1) {
|
|
blackHeartMask = (float)this->_blackHearts;
|
|
local_18 = blackHeartMask;
|
|
if ((GHIDRA_UINT(blackHeartMask) & 1 << ((byte)(GHIDRA_INT((uVar5 - 2)) / 2) & 0x1f)) != 0) {
|
|
uVar3 = uVar5 & 0x80000001;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if ((uVar3 == 1) && (-1 < GHIDRA_INT(uVar5))) goto LAB_007daa69;
|
|
goto LAB_007daa84;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
AddSoulHearts(this,-1,0);
|
|
}
|
|
uVar5 = 1;
|
|
goto LAB_007daaa6;
|
|
}
|
|
}
|
|
if (this->_rottenHearts < 1) {
|
|
uVar5 = 0;
|
|
iVar4 = 2;
|
|
if (iVar2 != 3) {
|
|
iVar4 = 1;
|
|
}
|
|
iVar2 = scale_for_hard_difficulty(iVar4);
|
|
this->_redHearts = extraout_EDX - iVar2;
|
|
UpdateHeartDependentEffects(this);
|
|
}
|
|
else {
|
|
this->_rottenHearts = this->_rottenHearts + -1;
|
|
iVar2 = 0x10;
|
|
uVar5 = 6;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
iVar2 = 2;
|
|
}
|
|
this->_redHearts = iVar4 - iVar2;
|
|
UpdateHeartDependentEffects(this);
|
|
}
|
|
LAB_007daaa6:
|
|
uVar3 = Random();
|
|
angleRoll = Random();
|
|
local_18 = (float)((double)GHIDRA_INT(angleRoll) + __uint_to_double_fixup[-(GHIDRA_INT(angleRoll) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_18 = local_18 + local_18;
|
|
local_14 = GHIDRA_CAST<Entity *>(cos(local_18));
|
|
clotVelocity.y = sin(local_18);
|
|
clotVelocity.x = (float)local_14 + (float)local_14;
|
|
clotVelocity.y = clotVelocity.y + clotVelocity.y;
|
|
local_14 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0xee,pos,&clotVelocity,GHIDRA_CAST<Entity *>(this),uVar5,uVar3,0);
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&local_14->_flags) + 4));
|
|
iVar2 = *GHIDRA_CAST<int *>(local_14);
|
|
*GHIDRA_CAST<uint *>(&local_14->_flags) = GHIDRA_UINT(local_14->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&local_14->_flags) + 4)) = uVar1;
|
|
(**(code **)(iVar2 + 0xc))();
|
|
manager = g_manager;
|
|
local_18 = 1.00893e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_18));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18),1.0,2,0,1.0,0.0);
|
|
uVar5 = Random();
|
|
bloodSplat = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2,uVar5,0);
|
|
bloodSplat->SetColor(&local_14->_splatColor,0xffffffff,0xff,0,1);
|
|
iVar2 = *GHIDRA_CAST<int *>(bloodSplat);
|
|
(bloodSplat->_sprite)._offset.x = 0.0;
|
|
(bloodSplat->_sprite)._offset.y = -6.0;
|
|
bloodSplat->_renderDepthOffset = 10.0;
|
|
(**(code **)(iVar2 + 0xc))();
|
|
if (unk != 0) {
|
|
try_trigger_astral_projection(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007dac80
|
|
byte Entity_Player::TryForgottenThrow(Vector *dir)
|
|
{
|
|
float *extraout_EAX;
|
|
Vector throwVelocity;
|
|
Vector throwDir;
|
|
Vector inheritedVelocity;
|
|
Entity_Player *soul;
|
|
|
|
if ((((this->_playerType == 0x23) &&
|
|
(soul = *GHIDRA_CAST<Entity_Player **>(&this->_twinPlayer), soul != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(soul->_heldEntity == this)) && (this->_peeBurstCooldown < 1)) {
|
|
(GHIDRA_CAST<Vector *>((dir)))->Vector::Normalized(&throwDir);
|
|
throwVelocity.x = throwDir.x * 10.0;
|
|
throwVelocity.y = throwDir.y * 10.0;
|
|
GetTearMovementInheritance(soul,&inheritedVelocity,&throwDir,0);
|
|
throwVelocity.x = (throwVelocity.x + *extraout_EAX) * 1.2;
|
|
throwVelocity.y = (extraout_EAX[1] + throwVelocity.y) * 1.2;
|
|
ThrowHeldEntity(soul,&throwVelocity);
|
|
(GHIDRA_CAST<ANM2 *>((&soul->_heldSprite)))->ANM2::Reset();
|
|
soul->_blinkTime = 1;
|
|
soul->_itemStateCooldown = 5;
|
|
PlayExtraAnimation(soul,GHIDRA_CAST<byte *>("HideItem"));
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007daed0
|
|
void Entity_Player::ResetPlayer()
|
|
{
|
|
void *oldBegin;
|
|
std_vector *greedResetCollectibles;
|
|
uint uVar2;
|
|
int emptyCollectibles [4];
|
|
void *oldBegin;
|
|
|
|
if ((this->_variant == 0) && (this->_isCoopGhost == 0)) {
|
|
InitPostLevelInitStats(this);
|
|
uVar2 = 0;
|
|
if (GHIDRA_INT((this->_greedResetCollectibles)._end) - GHIDRA_INT((this->_greedResetCollectibles)._begin) >> 2
|
|
!= 0) {
|
|
do {
|
|
AddCollectible(this,*GHIDRA_CAST<int *>((GHIDRA_INT((this->_greedResetCollectibles)._begin) + uVar2 * 4)),0,0,0,
|
|
0,0);
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < GHIDRA_UINT((GHIDRA_INT((this->_greedResetCollectibles)._end) -
|
|
GHIDRA_INT((this->_greedResetCollectibles)._begin) >> 2)));
|
|
}
|
|
EvaluateItems(this);
|
|
RecomputeWispCollectibles(this,GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
}
|
|
greedResetCollectibles = &this->_greedResetCollectibles;
|
|
if (GHIDRA_CAST<std_vector *>(emptyCollectibles) != greedResetCollectibles) {
|
|
oldBegin = greedResetCollectibles->_begin;
|
|
oldBegin = (this->_greedResetCollectibles)._capacity;
|
|
greedResetCollectibles->_begin = (void *)0x0;
|
|
(this->_greedResetCollectibles)._end = (void *)0x0;
|
|
(this->_greedResetCollectibles)._capacity = (void *)0x0;
|
|
if (oldBegin != (void *)0x0) {
|
|
uVar2 = GHIDRA_INT(oldBegin) - GHIDRA_INT(oldBegin) & 0xfffffffc;
|
|
oldBegin = oldBegin;
|
|
if (0xfff < uVar2) {
|
|
oldBegin = *(void **)(GHIDRA_CAST<char *>(oldBegin) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(oldBegin) + (-4 - GHIDRA_INT(oldBegin))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(oldBegin,uVar2);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007db160
|
|
void Entity_Player::remove_wooden_cross_mantles()
|
|
{
|
|
int iVar1;
|
|
int *effect;
|
|
byte mantleStacks;
|
|
uint keptCrossStacks;
|
|
uint crossStacksLeft;
|
|
int removedEffect [3];
|
|
undefined4 local_c;
|
|
int stacksToRemove;
|
|
void *collectibles;
|
|
byte crossStacks;
|
|
int *effectsEnd;
|
|
int mantleConfig;
|
|
|
|
iVar1 = GetTrinketMultiplier(this,0x79);
|
|
if (iVar1 == 0) {
|
|
iVar1 = 0;
|
|
}
|
|
else if (iVar1 == 1) {
|
|
iVar1 = 1;
|
|
}
|
|
else {
|
|
iVar1 = 2;
|
|
}
|
|
mantleStacks = this->_holyMantleStacks;
|
|
keptCrossStacks = iVar1 - (mantleStacks & 0xf);
|
|
if (GHIDRA_INT(keptCrossStacks) < 0) {
|
|
keptCrossStacks = 0;
|
|
}
|
|
crossStacks = mantleStacks >> 4;
|
|
crossStacksLeft = GHIDRA_UINT(crossStacks);
|
|
if (keptCrossStacks < crossStacksLeft) {
|
|
stacksToRemove = crossStacksLeft - keptCrossStacks;
|
|
do {
|
|
iVar1 = stacksToRemove;
|
|
crossStacksLeft = crossStacksLeft - 1;
|
|
crossStacks = (byte)crossStacksLeft;
|
|
collectibles = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x4e4 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibles) &
|
|
0xfffffffcU))) &&
|
|
(mantleConfig = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectibles) + 0x4e4)), mantleConfig != 0)) {
|
|
removedEffect[2] = *GHIDRA_CAST<undefined4 *>((mantleConfig + 0x78));
|
|
removedEffect[1] = 0;
|
|
local_c = 0;
|
|
removedEffect[0] = mantleConfig;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::RemoveEffect(removedEffect,1);
|
|
}
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
effect = (this->_temporaryeffects)._effects._begin;
|
|
effectsEnd = (this->_temporaryeffects)._effects._end;
|
|
if (effect != effectsEnd) {
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>(*effect);
|
|
if ((((iVar1 == 1) || (iVar1 == 3)) || (iVar1 == 4)) && ((GHIDRA_CAST<int *>(*effect))[1] == 0x139))
|
|
{
|
|
if (0 < effect[1]) goto LAB_007db29a;
|
|
break;
|
|
}
|
|
effect = effect + 4;
|
|
} while (effect != effectsEnd);
|
|
iVar1 = stacksToRemove;
|
|
}
|
|
}
|
|
collectibles = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectibles) & 0xfffffffcU))
|
|
< 0x4e5) {
|
|
RemoveCostume(this,GHIDRA_CAST<ItemConfig_Item *>(0x0));
|
|
stacksToRemove = iVar1;
|
|
}
|
|
else {
|
|
RemoveCostume(this,*GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(collectibles) + 0x4e4)));
|
|
stacksToRemove = iVar1;
|
|
}
|
|
LAB_007db29a:
|
|
stacksToRemove = stacksToRemove + -1;
|
|
} while (stacksToRemove != 0);
|
|
mantleStacks = this->_holyMantleStacks;
|
|
}
|
|
this->_holyMantleStacks = mantleStacks & 0xf | crossStacks << 4;
|
|
return;
|
|
}
|
|
|
|
// 007db6b0
|
|
byte Entity_Player::HasInstantDeathCurse()
|
|
{
|
|
int *effect;
|
|
|
|
if ((this->_temporaryeffects)._disabled == 0) {
|
|
for (effect = (this->_temporaryeffects)._effects._begin;
|
|
effect != (this->_temporaryeffects)._effects._end; effect = effect + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*effect) == 0) && ((GHIDRA_CAST<int *>(*effect))[1] == 0x70)) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
if (this->_playerType == 0x27) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007db700
|
|
byte Entity_Player::IsHologram()
|
|
{
|
|
EntityPtr twin;
|
|
|
|
if (((this->_exists == 0) ||
|
|
(((this->_playerType != 0x1d && (this->_playerType != 0x26)) ||
|
|
(twin = this->_twinPlayer, twin == (EntityPtr)0x0)))) ||
|
|
(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x161c)) == -1 || (this->_playerIndex <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x161c))))
|
|
|| (twin == (EntityPtr)this)))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007db740
|
|
void Entity_Player::TriggerEchoChamber(uint pocketItemType, int cardOrPillColor)
|
|
{
|
|
uint pillColor;
|
|
byte isEchoChamberHeld;
|
|
int iVar1;
|
|
uint uVar2;
|
|
Vector local_10;
|
|
uint *entry;
|
|
|
|
isEchoChamberHeld = HasCollectible(this,700,0);
|
|
if (isEchoChamberHeld != 0) {
|
|
local_10.x = (float)(this->_echoChamberItems)._proxy;
|
|
uVar2 = (this->_echoChamberItems)._offset;
|
|
while (uVar2 != (this->_echoChamberItems)._size + (this->_echoChamberItems)._offset) {
|
|
if (GHIDRA_CAST<int *>(local_10.x) == GHIDRA_CAST<int *>(0x0)) {
|
|
iVar1 = 0;
|
|
}
|
|
else {
|
|
iVar1 = *GHIDRA_CAST<int *>(local_10.x);
|
|
}
|
|
entry = GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar1 + 4)) + (uVar2 >> 1 & *GHIDRA_CAST<int *>((iVar1 + 8)) - 1U) * 4)) +
|
|
(uVar2 & 1) * 8));
|
|
if (entry[1] == 1) {
|
|
UseCard(this,*entry,0x980);
|
|
uVar2 = uVar2 + 1;
|
|
}
|
|
else {
|
|
if (entry[1] == 0) {
|
|
pillColor = *entry;
|
|
iVar1 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetPillEffect(pillColor,this);
|
|
UsePill(this,iVar1,pillColor,0x980);
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
}
|
|
}
|
|
local_10.y = (float)pocketItemType;
|
|
local_10.x = (float)cardOrPillColor;
|
|
if ((pocketItemType == 1) || (pocketItemType == 0)) {
|
|
(GHIDRA_CAST<std::deque *>((&this->_echoChamberItems)))->std::deque::push_back(&local_10);
|
|
uVar2 = (this->_echoChamberItems)._size;
|
|
if (3 < uVar2) {
|
|
while( true ) {
|
|
uVar2 = uVar2 - 1;
|
|
(this->_echoChamberItems)._size = uVar2;
|
|
if (uVar2 == 0) break;
|
|
if (uVar2 < 4) {
|
|
return;
|
|
}
|
|
}
|
|
(this->_echoChamberItems)._offset = 0;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007db8d0
|
|
int Entity_Player::get_seeded_variant()
|
|
{
|
|
code *pcVar1;
|
|
int unlockState;
|
|
int gameStartSeed;
|
|
uint uVar2;
|
|
Game *game;
|
|
|
|
unlockState = is_achievement_79_unlocked(this);
|
|
game = g_game;
|
|
switch(unlockState) {
|
|
case 0:
|
|
case 1:
|
|
return -1;
|
|
case 2:
|
|
return 0;
|
|
case 3:
|
|
return 1;
|
|
case 4:
|
|
return 2;
|
|
case 5:
|
|
return 3;
|
|
case 6:
|
|
return 4;
|
|
case 7:
|
|
return 5;
|
|
}
|
|
gameStartSeed = (g_game->_seedEffects)._gameStartSeed;
|
|
if (gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
gameStartSeed = (game->_seedEffects)._gameStartSeed;
|
|
}
|
|
uVar2 = 1;
|
|
if (1 < GHIDRA_UINT((gameStartSeed + unlockState))) {
|
|
uVar2 = gameStartSeed + unlockState;
|
|
}
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
unlockState = (*pcVar1)();
|
|
return unlockState;
|
|
}
|
|
uVar2 = uVar2 >> 2 ^ uVar2;
|
|
uVar2 = uVar2 << 0xf ^ uVar2;
|
|
return ((uVar2 >> 0x11 ^ uVar2) & 3) + 2;
|
|
}
|
|
|
|
// 007dba30
|
|
byte Entity_Player::is_evil_charm_immune(EntityRef source)
|
|
{
|
|
byte isHasEvilCharm;
|
|
bool isHazardSource;
|
|
|
|
isHazardSource = false;
|
|
isHasEvilCharm = HasCollectible(this,0x278,0);
|
|
if ((isHasEvilCharm == 0) &&
|
|
(isHasEvilCharm = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x278),
|
|
isHasEvilCharm == 0)) {
|
|
return 0;
|
|
}
|
|
if (source._type < 0x22) {
|
|
if (source._type == 0x21) {
|
|
return 1;
|
|
}
|
|
if (source._type == 0) {
|
|
isHazardSource = source._variant == 10000;
|
|
}
|
|
else if ((source._type == 9) && (source._variant == 2)) {
|
|
switchD_007dbabc_caseD_16:
|
|
isHazardSource = true;
|
|
}
|
|
}
|
|
else if (source._type == 1000) {
|
|
switch(source._variant) {
|
|
case 0x16:
|
|
case 0x17:
|
|
case 0x18:
|
|
case 0x19:
|
|
case 0x1a:
|
|
case 0x20:
|
|
case 0x25:
|
|
case 0x2c:
|
|
case 0x2d:
|
|
case 0x2e:
|
|
case 0x35:
|
|
case 0x36:
|
|
case 0x38:
|
|
case 0x4e:
|
|
case 0x5a:
|
|
case 0x5e:
|
|
case 0x8d:
|
|
case 0x93:
|
|
case 0x9b:
|
|
case 0xa9:
|
|
case 0xcc:
|
|
goto switchD_007dbabc_caseD_16;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26d4))) != '\0') || (isHazardSource)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26d4))) = 1;
|
|
if ((isHazardSource) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26d0)))) < 0x1e)) {
|
|
return 1;
|
|
}
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26d4))) = 0;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007dbba0
|
|
void Entity_Player::add_random_drug_item_effect()
|
|
{
|
|
code *pcVar1;
|
|
uint seed;
|
|
uint *brokenSyringeSeed;
|
|
int drugItems [4];
|
|
ItemConfig_Item *local_18;
|
|
undefined4 uStack_14;
|
|
int iStack_10;
|
|
undefined4 uStack_c;
|
|
uint local_8;
|
|
int collectibleId;
|
|
Manager *manager;
|
|
void *trinketRngs;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((drugItems + 9));
|
|
drugItems[0] = 0xd;
|
|
drugItems[1] = 0xe;
|
|
drugItems[2] = 0xf0;
|
|
drugItems[3] = 0x46;
|
|
trinketRngs = (this->_trinketRNGs)._begin;
|
|
brokenSyringeSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(trinketRngs) + 0x840));
|
|
local_18 = GHIDRA_CAST<ItemConfig_Item *>(0x8f);
|
|
uStack_14 = 0x159;
|
|
iStack_10 = 0x1ed;
|
|
uStack_c = 0x1f0;
|
|
seed = *brokenSyringeSeed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = *brokenSyringeSeed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
seed = seed >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(trinketRngs) + 0x844)) & 0x1f) ^ seed;
|
|
seed = seed << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(trinketRngs) + 0x848)) & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(trinketRngs) + 0x84c)) & 0x1f) ^ seed;
|
|
*brokenSyringeSeed = seed;
|
|
collectibleId = drugItems[seed & 7];
|
|
local_18 = (GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig::GetCollectible(collectibleId);
|
|
iStack_10 = local_18->maxCooldown;
|
|
uStack_14 = 0;
|
|
uStack_c = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&local_18,1,1);
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2edc)))) = collectibleId;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007dbc80
|
|
void Entity_Player::AddRandomMomItemEffect()
|
|
{
|
|
code *pcVar1;
|
|
uint rngState;
|
|
uint *rngSeed;
|
|
ItemConfig_Item *effectItem;
|
|
undefined4 local_48;
|
|
int effectCooldown;
|
|
undefined4 local_40;
|
|
int momItems [13];
|
|
int momItemId;
|
|
void *playerRngs;
|
|
|
|
momItems[0xc] = 0x2dc;
|
|
momItems[0] = 0x1d;
|
|
momItems[1] = 0x1e;
|
|
momItems[2] = 0x1f;
|
|
momItems[3] = 0x37;
|
|
playerRngs = (this->_trinketRNGs)._begin;
|
|
rngSeed = GHIDRA_CAST<uint *>((GHIDRA_INT(playerRngs) + 0x990));
|
|
momItems[4] = 0x6e;
|
|
momItems[5] = 0x72;
|
|
momItems[6] = 199;
|
|
momItems[7] = 200;
|
|
rngState = *rngSeed;
|
|
momItems[8] = 0xd9;
|
|
momItems[9] = 0xe4;
|
|
momItems[10] = 0x163;
|
|
momItems[0xb] = 0x1fc;
|
|
if (rngState == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
rngState = *rngSeed;
|
|
if (rngState == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
rngState = rngState >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(playerRngs) + 0x994)) & 0x1f) ^ rngState;
|
|
rngState = rngState << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(playerRngs) + 0x998)) & 0x1f) ^ rngState;
|
|
rngState = rngState >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(playerRngs) + 0x99c)) & 0x1f) ^ rngState;
|
|
*rngSeed = rngState;
|
|
momItemId = momItems[rngState % 0xd];
|
|
effectItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(momItemId);
|
|
effectCooldown = effectItem->maxCooldown;
|
|
local_48 = 0;
|
|
local_40 = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryeffects)))->TemporaryEffects::AddEffect(&effectItem,1,1);
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2ee0)))) = momItemId;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007dbd70
|
|
void Entity_Player::ModelingClay_roll(RNG *rng)
|
|
{
|
|
void *pvVar1;
|
|
code *pcVar2;
|
|
uint seed;
|
|
int collectibleId;
|
|
ItemConfig_Item *collectibleConfig;
|
|
code *filterFn;
|
|
undefined4 *filterSlot;
|
|
void **filtersEnd;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
filterFn = FUN_007dbe70;
|
|
filterSlot = (g_manager->_itemConfig)._availabilityFilters._end;
|
|
if (filterSlot == (g_manager->_itemConfig)._availabilityFilters._capacity) {
|
|
std::vector<4byte>::_Emplace_reallocate(filterSlot,&filterFn);
|
|
}
|
|
else {
|
|
*filterSlot = FUN_007dbe70;
|
|
filtersEnd = &(manager->_itemConfig)._availabilityFilters._end;
|
|
*filtersEnd = (void *)(GHIDRA_INT(*filtersEnd) + 4);
|
|
}
|
|
seed = rng->_seed;
|
|
pvVar1 = g_game->_room;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)rng->_shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)rng->_shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)rng->_shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
collectibleId = ItemPool::GetSeededCollectible(seed,1,*GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(pvVar1) + 4)));
|
|
manager = g_manager;
|
|
this->_modelingClayEffect = collectibleId;
|
|
filtersEnd = &(manager->_itemConfig)._availabilityFilters._end;
|
|
*filtersEnd = (void *)(GHIDRA_INT(*filtersEnd) + -4);
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig::GetCollectible(this->_modelingClayEffect);
|
|
if (collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
this->_cacheFlags = this->_cacheFlags | collectibleConfig->cacheFlags;
|
|
(this->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
if (collectibleConfig->addCostumeOnPickup != 0) {
|
|
AddCostume(this,collectibleConfig,0);
|
|
}
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,0,0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007dbeb0
|
|
void Entity_Player::twins_duplicate_familiars(int count)
|
|
{
|
|
void *pvVar1;
|
|
code *pcVar2;
|
|
ItemConfig_Item *collectibleConfig;
|
|
ItemConfig *itemConfig;
|
|
int *piVar3;
|
|
uint *puVar4;
|
|
uint uVar5;
|
|
uint *itemsBegin;
|
|
uint *itemsEnd;
|
|
int iVar6;
|
|
uint uVar7;
|
|
int effectEntry [3];
|
|
undefined4 local_38;
|
|
uint *familiarItems;
|
|
uint *familiarItemsEnd;
|
|
uint *familiarItemsCapEnd;
|
|
TemporaryEffects *temporaryEffects;
|
|
uint local_24;
|
|
uint local_20;
|
|
Entity_Player *player;
|
|
uint *itemsCapEnd;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Game *game;
|
|
Entity_Player *playerReg;
|
|
int roomEntity;
|
|
|
|
puStack_c = &LAB_00b0059d;
|
|
local_10 = ExceptionList;
|
|
if (count < 1) {
|
|
return;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1264));
|
|
if (iVar6 != 0) {
|
|
piVar3 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(g_game->_room) + 0x125c));
|
|
uVar7 = 0;
|
|
do {
|
|
roomEntity = *piVar3;
|
|
piVar3 = piVar3 + 1;
|
|
uVar5 = uVar7 + 1;
|
|
if (*GHIDRA_CAST<int *>((roomEntity + 0x28)) != 3) {
|
|
uVar5 = uVar7;
|
|
}
|
|
iVar6 = iVar6 + -1;
|
|
uVar7 = uVar5;
|
|
} while (iVar6 != 0);
|
|
if (0x3b < uVar5) {
|
|
return;
|
|
}
|
|
}
|
|
puVar4 = GHIDRA_CAST<uint *>(0x0);
|
|
itemsEnd = GHIDRA_CAST<uint *>(0x0);
|
|
familiarItems = GHIDRA_CAST<uint *>(0x0);
|
|
familiarItemsEnd = GHIDRA_CAST<uint *>(0x0);
|
|
itemsCapEnd = GHIDRA_CAST<uint *>(0x0);
|
|
familiarItemsCapEnd = GHIDRA_CAST<uint *>(0x0);
|
|
local_8 = 0;
|
|
uVar7 = 1;
|
|
itemConfig = &g_manager->_itemConfig;
|
|
ExceptionList = &local_10;
|
|
player = this;
|
|
if (4 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((itemConfig->_collectibles)._begin) & 0xfffffffcU))) {
|
|
do {
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar7)) goto LAB_007dbf93;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar7) < 0) {
|
|
if ((GHIDRA_INT(uVar7) < 0) &&
|
|
(pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar7) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar1) >> 2)) {
|
|
piVar3 = GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar1) + ~uVar7 * 4)));
|
|
}
|
|
else {
|
|
piVar3 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
LAB_007dbf93:
|
|
pvVar1 = (itemConfig->_collectibles)._begin;
|
|
if (GHIDRA_INT((itemConfig->_collectibles)._end) - GHIDRA_INT(pvVar1) >> 2 <= GHIDRA_INT(uVar7))
|
|
goto LAB_007dc03e;
|
|
piVar3 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar1) + uVar7 * 4));
|
|
}
|
|
if (piVar3 != GHIDRA_CAST<int *>(0x0)) {
|
|
if ((piVar3[0x2e] & 0x8000000U) == 0) {
|
|
if (*piVar3 == 4) {
|
|
iVar6 = GetCollectibleNum(player,uVar7,0);
|
|
if (((((iVar6 < 1) || (uVar7 == 0)) ||
|
|
(GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._begin) >> 2 <= GHIDRA_INT(uVar7))) ||
|
|
((uVar7 == 0xeb || (uVar7 == 0x2b)))) || (uVar7 == 0x3d)) {
|
|
puVar4 = itemsCapEnd;
|
|
}
|
|
else {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(uVar7);
|
|
puVar4 = itemsCapEnd;
|
|
if (collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
local_20 = uVar7;
|
|
if (itemsEnd == itemsCapEnd) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(itemsEnd,&local_20);
|
|
itemsCapEnd = familiarItemsCapEnd;
|
|
puVar4 = familiarItemsCapEnd;
|
|
itemsEnd = familiarItemsEnd;
|
|
}
|
|
else {
|
|
*itemsEnd = uVar7;
|
|
familiarItemsEnd = itemsEnd + 1;
|
|
itemsEnd = familiarItemsEnd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007dc03e:
|
|
uVar7 = uVar7 + 1;
|
|
itemConfig = &g_manager->_itemConfig;
|
|
} while (GHIDRA_INT(uVar7) <
|
|
GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) -
|
|
GHIDRA_INT((itemConfig->_collectibles)._begin) >> 2);
|
|
}
|
|
temporaryEffects = &player->_temporaryeffects;
|
|
itemsBegin = familiarItems;
|
|
do {
|
|
playerReg = player;
|
|
if (itemsBegin == itemsEnd) {
|
|
local_20 = 8;
|
|
if (itemsEnd == puVar4) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(itemsEnd,&local_20);
|
|
itemsCapEnd = familiarItemsCapEnd;
|
|
puVar4 = familiarItemsCapEnd;
|
|
itemsBegin = familiarItems;
|
|
}
|
|
else {
|
|
*itemsEnd = 8;
|
|
familiarItemsEnd = itemsEnd + 1;
|
|
}
|
|
local_20 = 0x43;
|
|
if (familiarItemsEnd == puVar4) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(familiarItemsEnd,&local_20);
|
|
itemsCapEnd = familiarItemsCapEnd;
|
|
itemsBegin = familiarItems;
|
|
itemsEnd = familiarItemsEnd;
|
|
}
|
|
else {
|
|
*familiarItemsEnd = 0x43;
|
|
familiarItemsEnd = familiarItemsEnd + 1;
|
|
itemsEnd = familiarItemsEnd;
|
|
}
|
|
}
|
|
pvVar1 = (playerReg->_trinketRNGs)._begin;
|
|
puVar4 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar1) + 0xb70));
|
|
local_20 = GHIDRA_INT(itemsEnd) - GHIDRA_INT(itemsBegin) >> 2;
|
|
uVar7 = *puVar4;
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar7 = *puVar4;
|
|
if (uVar7 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar7 = uVar7 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0xb74)) & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0xb78)) & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0xb7c)) & 0x1f) ^ uVar7;
|
|
*puVar4 = uVar7;
|
|
if (local_20 != 0) {
|
|
local_20 = uVar7 % local_20;
|
|
}
|
|
pvVar1 = (player->_trinketRNGs)._begin;
|
|
puVar4 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar1) + 0xb70));
|
|
local_24 = GHIDRA_INT(itemsEnd) - GHIDRA_INT(itemsBegin) >> 2;
|
|
uVar7 = *puVar4;
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar7 = *puVar4;
|
|
if (uVar7 == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar7 = uVar7 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0xb74)) & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 << ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0xb78)) & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 >> ((byte)*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar1) + 0xb7c)) & 0x1f) ^ uVar7;
|
|
uVar5 = 0;
|
|
*puVar4 = uVar7;
|
|
if (local_24 != 0) {
|
|
uVar5 = uVar7 % local_24;
|
|
}
|
|
uVar7 = itemsBegin[uVar5];
|
|
local_24 = uVar7;
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < GHIDRA_INT(uVar7)) goto LAB_007dc1df;
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar7) < 0) {
|
|
if ((GHIDRA_INT(uVar7) < 0) &&
|
|
(pvVar1 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar7) <
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar1) >> 2)) {
|
|
iVar6 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar1) + ~uVar7 * 4));
|
|
}
|
|
else {
|
|
iVar6 = 0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007dc1df:
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) >> 2 <= GHIDRA_INT(uVar7))
|
|
goto LAB_007dc222;
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + uVar7 * 4));
|
|
}
|
|
if (iVar6 != 0) {
|
|
effectEntry[2] = *GHIDRA_CAST<undefined4 *>((iVar6 + 0x78));
|
|
effectEntry[1] = 0;
|
|
local_38 = 0;
|
|
effectEntry[0] = iVar6;
|
|
(GHIDRA_CAST<TemporaryEffects *>((temporaryEffects)))->TemporaryEffects::AddEffect(effectEntry,1,1);
|
|
}
|
|
}
|
|
LAB_007dc222:
|
|
itemsEnd = itemsEnd + -1;
|
|
uVar5 = itemsBegin[local_20];
|
|
itemsBegin[local_20] = *itemsEnd;
|
|
game = g_game;
|
|
*itemsEnd = uVar5;
|
|
familiarItemsEnd = itemsEnd;
|
|
if (1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) {
|
|
puVar4 = *GHIDRA_CAST<uint **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ee8))));
|
|
if (puVar4 == *GHIDRA_CAST<uint **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2eec))))) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(puVar4,&local_24);
|
|
}
|
|
else {
|
|
*puVar4 = uVar7;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ee8)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x2ee8)))) + 4;
|
|
}
|
|
}
|
|
count = count + -1;
|
|
if (count == 0) {
|
|
if (itemsBegin != GHIDRA_CAST<uint *>(0x0)) {
|
|
uVar7 = GHIDRA_INT(itemsCapEnd) - GHIDRA_INT(itemsBegin) & 0xfffffffc;
|
|
puVar4 = itemsBegin;
|
|
if (0xfff < uVar7) {
|
|
puVar4 = GHIDRA_CAST<uint *>(itemsBegin[-1]);
|
|
uVar7 = uVar7 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(itemsBegin) + (-4 - GHIDRA_INT(puVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(puVar4,uVar7);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
puVar4 = itemsCapEnd;
|
|
} while( true );
|
|
}
|
|
|
|
// 007e9280
|
|
std_string * Entity_Player::GetName()
|
|
{
|
|
std_string *nameBuf;
|
|
|
|
nameBuf = &this->_name;
|
|
if (0xf < (this->_name)._capacity) {
|
|
nameBuf = *GHIDRA_CAST<std_string **>(nameBuf->_buf);
|
|
}
|
|
return nameBuf;
|
|
}
|
|
|
|
// 007e92a0
|
|
float10 Entity_Player::GetSmoothBodyRotation()
|
|
{
|
|
return (float10)this->_bodyAngle;
|
|
}
|
|
|
|
// 00832850
|
|
void Entity_Player::TriggerRoomExit()
|
|
{
|
|
void *pvVar1;
|
|
void *pvVar2;
|
|
undefined4 uVar3;
|
|
int iVar4;
|
|
int iVar5;
|
|
LayerState *layerState;
|
|
int iVar6;
|
|
void *pvVar7;
|
|
AnimationState *lastAnimState;
|
|
KColor *color;
|
|
KColor *color_00;
|
|
KColor *color_01;
|
|
int *transitionTarget;
|
|
float fVar8;
|
|
float fVar9;
|
|
AnimationLayer *local_168;
|
|
Vector local_164;
|
|
Vector local_15c;
|
|
void *layerFrame;
|
|
Vector local_150;
|
|
int layerOffset;
|
|
float local_144;
|
|
KColor local_140;
|
|
uint local_120;
|
|
int local_11c;
|
|
undefined4 local_118;
|
|
undefined4 local_114;
|
|
undefined4 local_110;
|
|
float local_10c;
|
|
undefined4 local_108;
|
|
KColor whiteColor;
|
|
undefined1 quadPrimary [104];
|
|
undefined1 auStack_88 [8];
|
|
undefined1 quadSecondary [124];
|
|
AnimationLayer *layerId;
|
|
|
|
iVar6 = *GHIDRA_CAST<int *>(this);
|
|
if ((iVar6 != 2) && (iVar6 != 3)) {
|
|
return;
|
|
}
|
|
if ((this->_bossStatusEffectCooldown != 0) && (iVar6 == 2)) {
|
|
local_15c.x = g_screenWidth * 0.5;
|
|
local_11c = *GHIDRA_CAST<int *>(((this->_sprite)._animDefaultName._buf + 0xc));
|
|
local_15c.y = g_screenHeight * 0.5;
|
|
if (local_11c == 0) {
|
|
return;
|
|
}
|
|
local_120 = 0;
|
|
if (*GHIDRA_CAST<int *>((local_11c + 0x1c)) == 0) {
|
|
return;
|
|
}
|
|
layerOffset = 0;
|
|
do {
|
|
layerId = *GHIDRA_CAST<AnimationLayer **>((layerOffset + *GHIDRA_CAST<int *>((local_11c + 0x18))));
|
|
layerFrame = AnimationState::GetLayerFrame
|
|
(GHIDRA_CAST<AnimationState *>(((this->_sprite)._animDefaultName._buf + 8)),
|
|
GHIDRA_INT(layerId));
|
|
layerState = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&this->_spawnerVariant))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(layerId));
|
|
if (((layerState->_visible != 0) && (layerFrame != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(layerFrame) + 0x2c)) != '\0')) {
|
|
local_168 = GHIDRA_CAST<AnimationLayer *>((*GHIDRA_CAST<int *>((local_11c + 0x18)) + layerOffset));
|
|
if ((((GHIDRA_INT(layerId) < 0) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(((this->_sprite)._animDefaultName._buf + 8)) + 0x80)) <= GHIDRA_INT(layerId)))
|
|
&& (KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n")), GHIDRA_INT(layerId) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(((this->_sprite)._animDefaultName._buf + 8)) + 0x80)) <= GHIDRA_INT(layerId))) {
|
|
iVar6 = 0;
|
|
}
|
|
else {
|
|
iVar6 = *GHIDRA_CAST<int *>(((this->_sprite)._animDefaultName._size +
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(((this->_sprite)._animDefaultName._buf + 0xc)) + 0x38 +
|
|
GHIDRA_INT(layerId) * 4)) * 4));
|
|
}
|
|
AnimationLayer::RenderFrame
|
|
(local_168,&local_15c,iVar6,&g_vectorZero,&g_vectorZero,
|
|
GHIDRA_CAST<ANM2 *>(&this->_spawnerVariant));
|
|
local_168 = layerId;
|
|
_Find_lower_bound<>(&local_140,&local_168);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_140._blue) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<AnimationLayer **>((GHIDRA_CAST<char *>(local_140._blue) + 0x10)) <= layerId)) &&
|
|
((local_140._blue != (float)this->_charmedCountdown &&
|
|
(local_168 = layerId, iVar6 = FUN_00833010(&local_168), *GHIDRA_CAST<char *>((iVar6 + 0x109)) != '\0'
|
|
)))) {
|
|
local_150.x = -*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x20)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x18));
|
|
local_164.x = -*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x24)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x1c));
|
|
local_144 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x5c)) * 0.017453292;
|
|
local_168 = GHIDRA_CAST<AnimationLayer *>(cos(local_144));
|
|
fVar8 = sin(local_144);
|
|
local_144 = (float)local_168 * local_150.x - fVar8 * local_164.x;
|
|
local_168 = GHIDRA_CAST<AnimationLayer *>(((float)local_168 * local_164.x + fVar8 * local_150.x));
|
|
local_164.x = (float)layerId;
|
|
local_150.x = (float)(GHIDRA_INT(layerFrame) + 0x30);
|
|
iVar6 = FUN_00833010(&local_164);
|
|
if (GHIDRA_CAST<AnimationState *>((iVar6 + 0xa8)) != GHIDRA_CAST<AnimationState *>(local_150.x)) {
|
|
pvVar7 = *(void **)(GHIDRA_CAST<char *>(local_150.x) + 4);
|
|
pvVar1 = *(void **)(GHIDRA_CAST<char *>(local_150.x) + 8);
|
|
pvVar2 = *(void **)(GHIDRA_CAST<char *>(local_150.x) + 0xc);
|
|
(GHIDRA_CAST<AnimationState *>((iVar6 + 0xa8)))->_animation = *(void **)local_150.x;
|
|
*(void **)(iVar6 + 0xac) = pvVar7;
|
|
*(void **)(iVar6 + 0xb0) = pvVar1;
|
|
*(void **)(iVar6 + 0xb4) = pvVar2;
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_150.x) + 0x14));
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_150.x) + 0x18));
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_150.x) + 0x1c));
|
|
*GHIDRA_CAST<float *>((iVar6 + 0xb8)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_150.x) + 0x10));
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xbc)) = uVar3;
|
|
*GHIDRA_CAST<int *>((iVar6 + 0xc0)) = iVar4;
|
|
*GHIDRA_CAST<int *>((iVar6 + 0xc4)) = iVar5;
|
|
*GHIDRA_CAST<undefined8 *>((iVar6 + 200)) = *GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(local_150.x) + 0x20));
|
|
*(void **)(iVar6 + 0xd0) = (GHIDRA_CAST<AnimationState *>((GHIDRA_INT(local_150.x) + 0x20)))->_layerFrames;
|
|
}
|
|
local_164.x = (float)layerId;
|
|
iVar6 = FUN_00833010(&local_164);
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xa4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(layerFrame) + 0x5c));
|
|
local_164.x = (float)layerId;
|
|
iVar6 = FUN_00833010(&local_164);
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0x9c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(layerFrame) + 0x18));
|
|
*GHIDRA_CAST<undefined4 *>((iVar6 + 0xa0)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(layerFrame) + 0x1c));
|
|
local_164.x = (float)layerId;
|
|
iVar6 = FUN_00833010(&local_164);
|
|
fVar8 = (float)(this->_sprite)._numNullLayers;
|
|
fVar9 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x14));
|
|
*GHIDRA_CAST<float *>((iVar6 + 0x94)) =
|
|
local_144 + (float)(this->_sprite)._nullLayerNames +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x10));
|
|
*GHIDRA_CAST<float *>((iVar6 + 0x98)) = (float)local_168 + fVar8 + fVar9;
|
|
local_164.x = (float)layerId;
|
|
iVar6 = FUN_00833010(&local_164);
|
|
if (*GHIDRA_CAST<char *>((iVar6 + 0x109)) != '\0') {
|
|
local_150.x = (float)(iVar6 + 0x50);
|
|
if (*GHIDRA_CAST<char *>((iVar6 + 0x70)) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((iVar6 + 0x30)),&local_15c,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = GHIDRA_CAST<AnimationState *>(local_150.x);
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(local_150.x),&local_15c,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = GHIDRA_CAST<AnimationState *>((iVar6 + 0x30));
|
|
}
|
|
AnimationState::Render(lastAnimState,&local_15c,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
}
|
|
local_120 = local_120 + 1;
|
|
layerOffset = layerOffset + 0x10;
|
|
} while (local_120 < *GHIDRA_CAST<uint *>((local_11c + 0x1c)));
|
|
return;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_pendingDamageFlags) + 4));
|
|
if ((((((iVar6 != 1) && (iVar6 != 2)) &&
|
|
(pvVar7 = (this->_damageEvents)._capacity, pvVar7 != (void *)0xffffffff)) &&
|
|
((iVar6 != 0xb && (iVar6 != 0x10)))) &&
|
|
((iVar6 != 0x11 && ((iVar6 != 0x12 && (iVar6 != 0x14)))))) && (iVar6 != 0x13)) {
|
|
pvVar1 = (this->_damageEvents)._end;
|
|
fVar9 = 1.0;
|
|
local_15c.y = 0.0;
|
|
local_15c.x = 0.0;
|
|
local_164.y = 0.0;
|
|
local_164.x = 0.0;
|
|
fVar8 = (3.0 - ((float)pvVar1 + (float)pvVar1)) * (float)pvVar1 * (float)pvVar1;
|
|
switch(pvVar7) {
|
|
case (void *)0x0:
|
|
local_15c.x = (float)this->_midasFreezeCountdown + g_screenWidth;
|
|
local_164.x = (fVar8 - 1.0) * local_15c.x;
|
|
local_15c.x = local_15c.x * fVar8;
|
|
break;
|
|
case (void *)0x1:
|
|
local_15c.y = (float)this->_fearCountdown + g_screenHeight;
|
|
local_164.y = (fVar8 - 1.0) * local_15c.y;
|
|
local_15c.y = local_15c.y * fVar8;
|
|
break;
|
|
case (void *)0x2:
|
|
local_15c.x = (float)this->_midasFreezeCountdown + g_screenWidth;
|
|
local_164.x = (1.0 - fVar8) * local_15c.x;
|
|
local_15c.x = -fVar8 * local_15c.x;
|
|
break;
|
|
case (void *)0x3:
|
|
local_15c.y = (float)this->_fearCountdown + g_screenHeight;
|
|
local_164.y = (1.0 - fVar8) * local_15c.y;
|
|
local_15c.y = -fVar8 * local_15c.y;
|
|
}
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
|
|
local_150.x = g_screenWidth;
|
|
local_150.y = g_screenHeight;
|
|
render_quad_set_rect(quadPrimary,&local_15c,&local_150,color);
|
|
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
|
|
local_15c.x = g_screenWidth;
|
|
local_15c.y = g_screenHeight;
|
|
render_quad_set_rect(quadSecondary,&local_164,&local_15c,color_00);
|
|
local_140._alpha = fVar9 - fVar8;
|
|
local_140._unk = 0;
|
|
local_140._red = 1.0;
|
|
local_140._green = 1.0;
|
|
local_140._blue = 1.0;
|
|
local_108 = 0;
|
|
local_118 = 0x3f800000;
|
|
local_114 = 0x3f800000;
|
|
local_110 = 0x3f800000;
|
|
local_10c = fVar8;
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_type) + 0x1c))(quadPrimary,&local_140);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_subtype) + 0x1c))(auStack_88,&local_120);
|
|
return;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 0;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 0;
|
|
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(quadPrimary,0.0,0.0,g_screenWidth,g_screenHeight,color_01);
|
|
if (*GHIDRA_CAST<int *>(this) == 2) {
|
|
transitionTarget = GHIDRA_CAST<int *>(this->_type);
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(this) != 3) goto LAB_00832ee2;
|
|
transitionTarget = GHIDRA_CAST<int *>(this->_subtype);
|
|
}
|
|
(**(code **)(*transitionTarget + 0x1c))(quadPrimary,g_drawRectUnset);
|
|
LAB_00832ee2:
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
if (((byte)g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_INT(&this->_pendingDamageFlags) + 4));
|
|
local_140._red = 0.0;
|
|
local_140._green = 0.0;
|
|
local_140._blue = 0.0;
|
|
if ((iVar6 == 3) || (iVar6 == 0x12)) {
|
|
local_140._red = 1.0;
|
|
local_140._green = 1.0;
|
|
local_140._blue = 1.0;
|
|
local_140._alpha = 1.0;
|
|
}
|
|
local_140._unk = 0;
|
|
local_140._alpha = (GHIDRA_CAST<RoomTransition *>((GHIDRA_CAST<RoomTransition *>(this))))->RoomTransition::get_hud_alpha();
|
|
local_140._alpha = 1.0 - local_140._alpha;
|
|
pvVar7 = render_quad_set_uniform_color
|
|
(quadSecondary,0.0,0.0,g_screenWidth,g_screenHeight,&local_140);
|
|
render_color_shader_pass(pvVar7);
|
|
return;
|
|
}
|
|
|
|
// 0083ab80
|
|
int Entity_Player::GetModelingClayEffect()
|
|
{
|
|
return this->_modelingClayEffect;
|
|
}
|
|
|
|
// 00841ca0
|
|
int Entity_Player::GetJarFlies()
|
|
{
|
|
return this->_jarFlies;
|
|
}
|
|
|
|
// 00841cb0
|
|
int Entity_Player::GetActiveSubCharge(int slot)
|
|
{
|
|
if (GHIDRA_UINT(slot) < 4) {
|
|
return this->_activeDesc[slot]._subCharge;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00841cd0
|
|
int Entity_Player::GetPoopSpell(int position)
|
|
{
|
|
if (GHIDRA_UINT(position) < 6) {
|
|
return GHIDRA_UINT(this->_poopSpellQueue[position]);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0085e200
|
|
byte Entity_Player::HasFullHeartsAndSoulHearts()
|
|
{
|
|
return this->_maxHearts <= this->_soulHearts + this->_redHearts;
|
|
}
|
|
|
|
// 0085e220
|
|
Vector * Entity_Player::GetMovementVector()
|
|
{
|
|
return &this->_movementVector;
|
|
}
|
|
|
|
// 0085e230
|
|
Vector * Entity_Player::GetRecentMovementVector()
|
|
{
|
|
return &this->_recentMovementVector;
|
|
}
|
|
|
|
// 0085e240
|
|
int Entity_Player::GetTearRangeModifier()
|
|
{
|
|
return this->_tearRangeModifier;
|
|
}
|
|
|
|
// 0085e250
|
|
int Entity_Player::ControlsCooldown()
|
|
{
|
|
return this->_controlsCooldown;
|
|
}
|
|
|
|
// 0085e260
|
|
void Entity_Player::AddControlsCooldown(int param_2)
|
|
{
|
|
this->_controlsCooldown = this->_controlsCooldown + param_2;
|
|
return;
|
|
}
|
|
|
|
// 0085e270
|
|
EntityRef * Entity_Player::GetLastDamageSource()
|
|
{
|
|
return &this->_lastDamageSource;
|
|
}
|
|
|
|
// 0085e280
|
|
qword Entity_Player::GetLastDamageFlags()
|
|
{
|
|
return this->_lastDamageFlags;
|
|
}
|
|
|
|
// 0085e290
|
|
int Entity_Player::GetTotalDamageTaken()
|
|
{
|
|
return this->_totalDamageTaken;
|
|
}
|
|
|
|
// 0085e2c0
|
|
int Entity_Player::GetLastActionTriggers()
|
|
{
|
|
return this->_lastActionTriggers;
|
|
}
|
|
|
|
// 0085e2d0
|
|
int Entity_Player::GetBodyColor()
|
|
{
|
|
return this->_bodyColor;
|
|
}
|
|
|
|
// 0085e2e0
|
|
int Entity_Player::GetHeadColor()
|
|
{
|
|
return this->_headColor;
|
|
}
|
|
|
|
// 0085e2f0
|
|
int Entity_Player::GetNumGigaBombs()
|
|
{
|
|
return this->_numGigaBombs;
|
|
}
|
|
|
|
// 0095ffb0
|
|
void Entity_Player::CheckPoopSpellQueue(Vector *param_2)
|
|
{
|
|
ColorMod *text;
|
|
KColor color;
|
|
KColor color_00;
|
|
float fVar1;
|
|
void *quad;
|
|
int *piVar2;
|
|
undefined4 ******ppppppuVar3;
|
|
byte ******ppppppbVar4;
|
|
void *pvVar5;
|
|
void *pvVar6;
|
|
uint uVar7;
|
|
Font *pFVar8;
|
|
int framePhase;
|
|
Font *line;
|
|
uint uVar9;
|
|
int framePhase;
|
|
undefined1 overlayQuad [112];
|
|
Vector *drawOffset;
|
|
Font *titleFont;
|
|
int *titleText;
|
|
int lineWidth;
|
|
undefined1 glyphQuads [4];
|
|
int *wordsBegin;
|
|
int *wordsEnd;
|
|
int wordsCapacity;
|
|
Vector local_7c;
|
|
KColor local_74;
|
|
int *local_60;
|
|
Font *local_5c;
|
|
Font *linesCapacity;
|
|
Font *linesBegin;
|
|
uint local_50;
|
|
ColorMod *local_4c;
|
|
byte ******word;
|
|
int iStack_44;
|
|
int iStack_40;
|
|
int iStack_3c;
|
|
uint wordSize;
|
|
uint wordCapacity;
|
|
undefined4 local_30;
|
|
undefined4 ******local_2c;
|
|
undefined4 local_28;
|
|
undefined4 local_24;
|
|
undefined4 local_20;
|
|
int local_1c;
|
|
uint local_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Font *bodyFont;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c86e;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
drawOffset = param_2;
|
|
local_74._unk = 0;
|
|
framePhase = g_manager->_framecount % 0x3c;
|
|
local_74._alpha = 1.0;
|
|
framePhase = 0x3c - framePhase;
|
|
if (framePhase < 0x1f) {
|
|
framePhase = framePhase;
|
|
}
|
|
local_74._red = (float)framePhase / 300.0 + 0.4;
|
|
local_7c.x = g_screenWidth;
|
|
local_7c.y = g_screenHeight;
|
|
local_74._green = local_74._red;
|
|
local_74._blue = local_74._red;
|
|
render_quad_set_rect(overlayQuad,param_2,&local_7c,&local_74);
|
|
render_color_shader_pass(quad);
|
|
titleText = &(this->_sprite)._numEvents;
|
|
if (0xf < GHIDRA_UINT((this->_sprite)._rotation)) {
|
|
titleText = GHIDRA_CAST<int *>(*titleText);
|
|
}
|
|
text = &(this->_sprite)._color;
|
|
local_4c = text;
|
|
if (0xf < GHIDRA_UINT((this->_sprite)._color._colorize[1])) {
|
|
local_4c = GHIDRA_CAST<ColorMod *>(text->_tint[0]);
|
|
}
|
|
titleFont = GHIDRA_CAST<Font *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x40))));
|
|
local_7c.y = (float)(GHIDRA_CAST<Font *>((titleFont)))->Font::get_string_width_n(GHIDRA_CAST<byte *>(titleText),-1);
|
|
local_5c = GHIDRA_CAST<Font *>(&(this->_sprite)._animState._isPlaying);
|
|
piVar2 = GHIDRA_CAST<int *>((GHIDRA_CAST<Font *>((local_5c)))->Font)::get_string_width_n(GHIDRA_CAST<byte *>(local_4c),-1);
|
|
linesBegin = GHIDRA_CAST<Font *>(0x0);
|
|
local_74._blue = 0.0;
|
|
local_74._alpha = 0.0;
|
|
linesCapacity = GHIDRA_CAST<Font *>(0x0);
|
|
local_74._unk = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
|
|
local_60 = GHIDRA_CAST<int *>((GHIDRA_INT(g_screenWidth) + -0x28));
|
|
if (local_60 < piVar2) {
|
|
string_split(&wordsBegin,GHIDRA_CAST<std_string *>(text),0x20);
|
|
lineWidth = 0;
|
|
local_1c = 0;
|
|
local_18 = 0xf;
|
|
local_2c = GHIDRA_CAST<undefined4 ******>(0x0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
piVar2 = wordsBegin;
|
|
pFVar8 = GHIDRA_CAST<Font *>(0x0);
|
|
if (wordsBegin != wordsEnd) {
|
|
do {
|
|
local_50 = piVar2[4];
|
|
word = GHIDRA_CAST<byte ******>(0x0);
|
|
wordSize = 0;
|
|
wordCapacity = 0;
|
|
local_4c = GHIDRA_CAST<ColorMod *>(piVar2);
|
|
if (0xf < GHIDRA_UINT(piVar2[5])) {
|
|
local_4c = GHIDRA_CAST<ColorMod *>(*piVar2);
|
|
}
|
|
if (local_50 < 0x10) {
|
|
word = *GHIDRA_CAST<byte *******>(local_4c);
|
|
iStack_44 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_4c) + 4));
|
|
iStack_40 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_4c) + 8));
|
|
iStack_3c = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_4c) + 0xc));
|
|
uVar9 = 0xf;
|
|
}
|
|
else {
|
|
uVar9 = local_50 | 0xf;
|
|
if (0x7fffffff < uVar9) {
|
|
uVar9 = 0x7fffffff;
|
|
}
|
|
word = std::_Allocate(uVar9 + 1);
|
|
memcpy(word,local_4c,local_50 + 1);
|
|
}
|
|
piVar2 = piVar2 + 6;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
|
wordSize = local_50;
|
|
wordCapacity = uVar9;
|
|
if (piVar2 != wordsEnd) {
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&word))))->std::string::append(&DAT_00b656ec,1);
|
|
}
|
|
ppppppbVar4 = GHIDRA_CAST<byte ******>(&word);
|
|
if (0xf < wordCapacity) {
|
|
ppppppbVar4 = word;
|
|
}
|
|
local_4c = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Font *>((local_5c)))->Font)::get_string_width_n(GHIDRA_CAST<byte *>(ppppppbVar4),-1);
|
|
fVar1 = local_74._alpha;
|
|
framePhase = lineWidth;
|
|
if (local_60 < GHIDRA_CAST<int *>((GHIDRA_INT(local_4c->_tint) + lineWidth))) {
|
|
if (GHIDRA_CAST<Font *>(local_74._alpha) == linesCapacity) {
|
|
vector_string_emplace_reallocate
|
|
(&local_74._blue,GHIDRA_CAST<std_string *>(local_74._alpha),&local_2c);
|
|
linesCapacity = GHIDRA_CAST<Font *>(local_74._unk);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(local_74._alpha))))->std::string::string(&local_2c);
|
|
local_74._alpha = (float)(GHIDRA_INT(fVar1) + 0x18);
|
|
}
|
|
local_1c = 0;
|
|
ppppppuVar3 = &local_2c;
|
|
if (0xf < local_18) {
|
|
ppppppuVar3 = local_2c;
|
|
}
|
|
framePhase = 0;
|
|
*GHIDRA_CAST<undefined1 *>(ppppppuVar3) = 0;
|
|
}
|
|
ppppppbVar4 = GHIDRA_CAST<byte ******>(&word);
|
|
if (0xf < wordCapacity) {
|
|
ppppppbVar4 = word;
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&local_2c))))->std::string::append(GHIDRA_CAST<byte *>(ppppppbVar4),wordSize);
|
|
lineWidth = GHIDRA_INT(local_4c->_tint) + framePhase;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
if (0xf < wordCapacity) {
|
|
uVar9 = wordCapacity + 1;
|
|
ppppppbVar4 = word;
|
|
if (0xfff < uVar9) {
|
|
ppppppbVar4 = GHIDRA_CAST<byte ******>(word[-1]);
|
|
uVar9 = wordCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(word) + (-4 - GHIDRA_INT(ppppppbVar4))))) goto LAB_009603a7;
|
|
}
|
|
operator_delete(ppppppbVar4,uVar9);
|
|
}
|
|
fVar1 = local_74._alpha;
|
|
} while (piVar2 != wordsEnd);
|
|
if (local_1c != 0) {
|
|
if (GHIDRA_CAST<Font *>(local_74._alpha) == linesCapacity) {
|
|
vector_string_emplace_reallocate(&local_74._blue,GHIDRA_CAST<std_string *>(local_74._alpha),&local_2c);
|
|
linesCapacity = GHIDRA_CAST<Font *>(local_74._unk);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(local_74._alpha))))->std::string::string(&local_2c);
|
|
local_74._alpha = (float)(GHIDRA_INT(fVar1) + 0x18);
|
|
}
|
|
}
|
|
linesBegin = GHIDRA_CAST<Font *>(local_74._blue);
|
|
pFVar8 = GHIDRA_CAST<Font *>(local_74._alpha);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
if (0xf < local_18) {
|
|
uVar9 = local_18 + 1;
|
|
ppppppuVar3 = local_2c;
|
|
if (0xfff < uVar9) {
|
|
ppppppuVar3 = GHIDRA_CAST<undefined4 ******>(local_2c[-1]);
|
|
uVar9 = local_18 + 0x24;
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(local_2c) + (-4 - GHIDRA_INT(ppppppuVar3)))))
|
|
goto LAB_009603a7;
|
|
}
|
|
operator_delete(ppppppuVar3,uVar9);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
if (wordsBegin != GHIDRA_CAST<int *>(0x0)) {
|
|
local_60 = wordsEnd;
|
|
piVar2 = wordsBegin;
|
|
if (wordsBegin != wordsEnd) {
|
|
do {
|
|
uVar9 = piVar2[5];
|
|
if (0xf < uVar9) {
|
|
pvVar5 = (void *)*piVar2;
|
|
uVar7 = uVar9 + 1;
|
|
pvVar6 = pvVar5;
|
|
if (0xfff < uVar7) {
|
|
pvVar6 = *(void **)(GHIDRA_CAST<char *>(pvVar5) + -4);
|
|
uVar7 = uVar9 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar5) + (-4 - GHIDRA_INT(pvVar6))))) goto LAB_009603a7;
|
|
}
|
|
operator_delete(pvVar6,uVar7);
|
|
wordsEnd = local_60;
|
|
}
|
|
piVar2[4] = 0;
|
|
piVar2[5] = 0xf;
|
|
*GHIDRA_CAST<undefined1 *>(piVar2) = 0;
|
|
piVar2 = piVar2 + 6;
|
|
} while (piVar2 != wordsEnd);
|
|
}
|
|
uVar9 = ((wordsCapacity - GHIDRA_INT(wordsBegin)) / 0x18) * 0x18;
|
|
piVar2 = wordsBegin;
|
|
if (0xfff < uVar9) {
|
|
piVar2 = GHIDRA_CAST<int *>(wordsBegin[-1]);
|
|
uVar9 = uVar9 + 0x23;
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(wordsBegin) + (-4 - GHIDRA_INT(piVar2))))) {
|
|
LAB_009603a7:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(piVar2,uVar9);
|
|
}
|
|
}
|
|
else {
|
|
vector_string_emplace_reallocate(&local_74._blue,GHIDRA_CAST<std_string *>(0x0),text);
|
|
linesCapacity = GHIDRA_CAST<Font *>(local_74._unk);
|
|
linesBegin = GHIDRA_CAST<Font *>(local_74._blue);
|
|
pFVar8 = GHIDRA_CAST<Font *>(local_74._alpha);
|
|
}
|
|
line = linesBegin;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
if (((byte)g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
local_4c = GHIDRA_CAST<ColorMod *>(((GHIDRA_INT(pFVar8) - GHIDRA_INT(linesBegin)) / 0x18));
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
local_30 = 0;
|
|
local_2c = GHIDRA_CAST<undefined4 ******>(0xffff);
|
|
local_28 = 0;
|
|
local_24 = 0x3f800000;
|
|
local_20 = 0xffffffff;
|
|
local_1c = 0;
|
|
local_18 = 0;
|
|
local_50 = GHIDRA_UINT((((g_screenHeight * 0.5 -
|
|
(float)((double)(GHIDRA_INT(local_4c) * 8) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_4c) * 8 >> 0x1f)])) - 64.0) +
|
|
drawOffset->y));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
local_7c.y = (float)(GHIDRA_INT(g_screenWidth) - GHIDRA_INT(local_7c.y)) * 0.5;
|
|
pvVar5 = (GHIDRA_CAST<Font *>((titleFont)))->Font::measure_string(glyphQuads,GHIDRA_CAST<byte *>(titleText),&local_30,&g_vectorOne);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
color._blue = 1.0;
|
|
color._red = 1.0;
|
|
color._green = 1.0;
|
|
color._alpha = 1.0;
|
|
color._unk = 0;
|
|
Font::render_glyph_quads(titleFont,pvVar5,local_7c.y,(float)GHIDRA_INT(local_50),1.0,1.0,color,&local_30)
|
|
;
|
|
std::vector<12byte>::clear();
|
|
std::vector<12byte>::_Tidy();
|
|
bodyFont = local_5c;
|
|
local_50 = local_50 + 0x40;
|
|
if (local_4c != GHIDRA_CAST<ColorMod *>(0x0)) {
|
|
do {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
local_5c = line;
|
|
if (0xf < *GHIDRA_CAST<uint *>(&line->_lineHeight)) {
|
|
local_5c = *GHIDRA_CAST<Font **>(line);
|
|
}
|
|
framePhase = (GHIDRA_CAST<Font *>((bodyFont)))->Font::get_string_width_n(&local_5c->_isLoaded,-1);
|
|
local_30 = 0;
|
|
local_2c = GHIDRA_CAST<undefined4 ******>(0xffff);
|
|
local_28 = 0;
|
|
local_24 = 0x3f800000;
|
|
local_20 = 0xffffffff;
|
|
local_1c = 0;
|
|
local_18 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
|
local_7c.y = (float)(GHIDRA_INT(g_screenWidth) - framePhase) * 0.5 + drawOffset->x;
|
|
pvVar5 = (GHIDRA_CAST<Font *>((bodyFont)))->Font::measure_string(glyphQuads,&local_5c->_isLoaded,&local_30,&g_vectorOne)
|
|
;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
|
|
color_00._blue = 0.8235294;
|
|
color_00._red = 0.98039216;
|
|
color_00._green = 0.98039216;
|
|
color_00._alpha = 1.0;
|
|
color_00._unk = 0;
|
|
Font::render_glyph_quads
|
|
(bodyFont,pvVar5,local_7c.y,(float)GHIDRA_INT(local_50),1.0,1.0,color_00,&local_30);
|
|
std::vector<12byte>::clear();
|
|
std::vector<12byte>::_Tidy();
|
|
local_50 = local_50 + 0x10;
|
|
line = GHIDRA_CAST<Font *>(&line->_scaleW);
|
|
local_4c = GHIDRA_CAST<ColorMod *>((GHIDRA_INT(local_4c) + -1));
|
|
} while (local_4c != GHIDRA_CAST<ColorMod *>(0x0));
|
|
local_4c = GHIDRA_CAST<ColorMod *>(0x0);
|
|
pFVar8 = GHIDRA_CAST<Font *>(local_74._alpha);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
line = linesBegin;
|
|
if (linesBegin != GHIDRA_CAST<Font *>(0x0)) {
|
|
for (; line != pFVar8; line = GHIDRA_CAST<Font *>(&line->_scaleW)) {
|
|
uVar9 = *GHIDRA_CAST<uint *>(&line->_lineHeight);
|
|
if (0xf < uVar9) {
|
|
pvVar5 = *(void **)line;
|
|
uVar7 = uVar9 + 1;
|
|
pvVar6 = pvVar5;
|
|
if (0xfff < uVar7) {
|
|
pvVar6 = *(void **)(GHIDRA_CAST<char *>(pvVar5) + -4);
|
|
uVar7 = uVar9 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar5) + (-4 - GHIDRA_INT(pvVar6))))) goto LAB_00960720;
|
|
}
|
|
operator_delete(pvVar6,uVar7);
|
|
}
|
|
*GHIDRA_CAST<uint *>(&line->_spacingVert) = 0;
|
|
*GHIDRA_CAST<uint *>(&line->_lineHeight) = 0xf;
|
|
line->_isLoaded = 0;
|
|
}
|
|
uVar9 = ((GHIDRA_INT(linesCapacity) - GHIDRA_INT(linesBegin)) / 0x18) * 0x18;
|
|
pFVar8 = linesBegin;
|
|
if (0xfff < uVar9) {
|
|
pFVar8 = GHIDRA_CAST<Font *>(linesBegin[-1]._missingCharacter);
|
|
uVar9 = uVar9 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(linesBegin) + (-4 - GHIDRA_INT(pFVar8))))) {
|
|
LAB_00960720:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pFVar8,uVar9);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009d16ee
|
|
undefined4 Entity_Player::restore_save_state_part2()
|
|
{
|
|
void *pvVar1;
|
|
int iVar2;
|
|
undefined4 uVar3;
|
|
undefined4 uVar4;
|
|
undefined4 uVar5;
|
|
char cVar6;
|
|
byte bVar7;
|
|
uint uVar8;
|
|
int iVar9;
|
|
undefined4 uVar10;
|
|
void *pvVar11;
|
|
ItemConfig_Item *collectibleConfig;
|
|
undefined1 uVar12;
|
|
void *checksum;
|
|
undefined4 extraout_ECX;
|
|
undefined4 extraout_ECX_00;
|
|
undefined4 extraout_ECX_01;
|
|
void *checksum2;
|
|
byte bVar13;
|
|
uint uVar14;
|
|
uint *puVar15;
|
|
int unaff_EBX;
|
|
int unaff_EBP;
|
|
int unaff_ESI;
|
|
undefined4 *puVar16;
|
|
undefined4 *fieldPtr;
|
|
ushort *shortField;
|
|
byte *shortArrayField;
|
|
int *piVar17;
|
|
undefined1 *byteField;
|
|
Manager *manager;
|
|
undefined4 *unaff_EDI;
|
|
int iVar18;
|
|
int iVar19;
|
|
char *format;
|
|
EntitySaveState *saveStateSlot;
|
|
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_ESI + 0x1d0));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
if (iVar9 != 0) {
|
|
do {
|
|
cVar6 = (**(code **)(*GHIDRA_CAST<int *>(*unaff_EDI) + 0x10))();
|
|
if (cVar6 != '\0') goto LAB_009d1988;
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) * 8;
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_ESI + 0x1d4)) + iVar18));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x1d4)) + 4 + iVar18));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
unaff_ESI = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
iVar9 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_ESI + 0x1d4)) + 4 + iVar18));
|
|
iVar18 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_ESI + 0x1d4)) + iVar18));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar9;
|
|
bVar7 = is_valid_item_config_id(iVar18,iVar9);
|
|
if (bVar7 == 0) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Invalid costume (type: %d, ID: %d)\n"));
|
|
goto code_r0x009d459a;
|
|
}
|
|
unaff_EDI = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x44)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_ESI + 0x1d0)));
|
|
}
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
uVar8 = puVar16[2];
|
|
if (0x2f < uVar8) {
|
|
GameStateReader::read_int_vector(puVar16,GHIDRA_CAST<int *>((unaff_ESI + 0x194)));
|
|
GameStateReader::read_int_vector(puVar16,GHIDRA_CAST<int *>((unaff_ESI + 0x1a0)));
|
|
GameStateReader::read_int_vector(puVar16,GHIDRA_CAST<int *>((unaff_ESI + 0x1ac)));
|
|
GameStateReader::read_int_vector(puVar16,GHIDRA_CAST<int *>((unaff_ESI + 0x1b8)));
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x2e < uVar8) {
|
|
GameStateReader::read_int_vector(puVar16,GHIDRA_CAST<int *>((unaff_ESI + 0x1c4)));
|
|
iVar18 = 0;
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_ESI + 0x1c8)) - *GHIDRA_CAST<int *>((unaff_ESI + 0x1c4)) >> 2;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar9;
|
|
if (0 < iVar9) {
|
|
do {
|
|
if (0 < iVar18) {
|
|
pvVar11 = (g_manager->_itemConfig)._pillEffects._begin;
|
|
if ((GHIDRA_INT((g_manager->_itemConfig)._pillEffects._end) - GHIDRA_INT(pvVar11) >> 2 <= iVar18) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + iVar18 * 4)) == 0)) {
|
|
format = "Invalid pill effect %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x1c));
|
|
}
|
|
iVar18 = iVar18 + 1;
|
|
} while (iVar18 < iVar9);
|
|
}
|
|
}
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x1ec));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x204));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x1f0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c)) = 5;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar9;
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(iVar9,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = **GHIDRA_CAST<undefined4 **>((unaff_EBP + -0x44));
|
|
(GHIDRA_CAST<Checksum *>((checksum)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + 4;
|
|
piVar17 = GHIDRA_CAST<int *>((unaff_EBP + -0x3c));
|
|
*piVar17 = *piVar17 + -1;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar9;
|
|
} while (*piVar17 != 0);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x208));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x4d) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x3c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
*GHIDRA_CAST<undefined2 *>((iVar9 + 0x20c)) = *GHIDRA_CAST<undefined2 *>((unaff_EBP + -0x3c));
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(iVar9 + 0x20c,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((iVar9 + 0x20c)));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<ushort *>((iVar9 + 0x20e)),2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((iVar9 + 0x20e)));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x210)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x210));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x214));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x218));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
if (0x1e < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x21c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x220));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x224));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if (0x1d < uVar8) {
|
|
iVar18 = *GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x50)) = iVar9 + 0x22c;
|
|
(**(code **)(iVar18 + 0x14))(iVar9 + 0x22c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x22c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x22c));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = 10;
|
|
piVar17 = GHIDRA_CAST<int *>((unaff_EBP + -0x1c));
|
|
if (iVar18 < 0xb) {
|
|
piVar17 = GHIDRA_CAST<int *>((iVar9 + 0x22c));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
iVar18 = *piVar17;
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x22c)) = iVar18;
|
|
if (0 < iVar18) {
|
|
iVar9 = iVar9 + 0x234;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) = iVar9;
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + -4)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + -4));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = **GHIDRA_CAST<undefined4 **>((unaff_EBP + -0x40));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) + 4));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) + 8));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) + 0xc));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) + 0x10));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x40));
|
|
*GHIDRA_CAST<undefined1 **>((unaff_EBP + -0x3c)) = GHIDRA_CAST<undefined1 *>((iVar9 + 0x14));
|
|
if (uVar8 < 0x74) {
|
|
*GHIDRA_CAST<undefined1 *>((iVar9 + 0x14)) = 0;
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c)),1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = **GHIDRA_CAST<undefined1 **>((unaff_EBP + -0x3c));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x40));
|
|
}
|
|
iVar9 = iVar9 + 0x1c;
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + 1;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar18;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) = iVar9;
|
|
} while (iVar18 < **GHIDRA_CAST<int **>((unaff_EBP + -0x50)));
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
}
|
|
if (0x38 < GHIDRA_UINT(puVar16[2])) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x50,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x50));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x1e8));
|
|
iVar19 = *GHIDRA_CAST<int *>((iVar9 + 0x1e0));
|
|
*GHIDRA_CAST<int **>((unaff_EBP + -0x3c)) = GHIDRA_CAST<int *>((iVar9 + 0x1e0));
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x50));
|
|
if (GHIDRA_UINT(((iVar18 - iVar19) / 0x78)) < uVar8) {
|
|
if (0x2222222 < uVar8) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlen();
|
|
}
|
|
std::vector<EntitySaveState>::_Reallocate_exactly(uVar8);
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x50));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
if (uVar8 != 0) {
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
do {
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xf0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xec)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xe8)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xe4)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x100)) = 0;
|
|
*GHIDRA_CAST<float *>((unaff_EBP + -0xd8)) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>((unaff_EBP + -0xd4)) = g_vectorZero.y;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xfc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xf8)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xf4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xe0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xdc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xd0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xcc)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -200)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xc4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xc0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xb8)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xb4)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xb0)) = 0x42700000;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xac)) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xa8)) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xa4)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0xa0)) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x9c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x98)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x94)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x90)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 3;
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x67) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x100,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x100));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xfc,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xfc));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xf8,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xf8));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xf0,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xf0));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xcc,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xcc));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
if (0x5a < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xd0,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0xd0));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xde,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0xde));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x5d < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0xdd,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0xdd));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0xf4)) = GHIDRA_INT(*GHIDRA_CAST<short *>((unaff_EBP + -0x30)));
|
|
}
|
|
}
|
|
else {
|
|
read_entity_save_state_tree((void *)(unaff_EBP + -0x100),puVar16);
|
|
}
|
|
saveStateSlot = *GHIDRA_CAST<EntitySaveState **>((*GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) + 4));
|
|
if (saveStateSlot == *GHIDRA_CAST<EntitySaveState **>((*GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) + 8))) {
|
|
std::vector<EntitySaveState>::_Emplace_reallocate(saveStateSlot,unaff_EBP + -0x100);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntitySaveState *>((saveStateSlot)))->EntitySaveState::copy((void *)(unaff_EBP + -0x100));
|
|
piVar17 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) + 4));
|
|
*piVar17 = *piVar17 + 0x78;
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 4;
|
|
if (((*GHIDRA_CAST<int **>((unaff_EBP + -0x90)) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar6 = (**(code **)(**GHIDRA_CAST<int **>((unaff_EBP + -0x90)) + 0xc))(), cVar6 != '\0')) &&
|
|
(g_entitySaveStateReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateReleaseFn)(unaff_EBP + -0x94);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 5;
|
|
if (((*GHIDRA_CAST<int **>((unaff_EBP + -0x98)) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar6 = (**(code **)(**GHIDRA_CAST<int **>((unaff_EBP + -0x98)) + 0xc))(), cVar6 != '\0')) &&
|
|
(g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateExtraDataReleaseFn)(unaff_EBP + -0x9c);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xffffffff;
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x44)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x50)));
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x348)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x348));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x34c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x350));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x354));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x358));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x35c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x360));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x364));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x368));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x8c) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x3c)),4);
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x36c)) = 0;
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(iVar9 + 0x36c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x36c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
}
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x23) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x370)) = 0;
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x370)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x370));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
}
|
|
if (0x1f < GHIDRA_UINT(puVar16[2])) {
|
|
iVar18 = *GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar9 + 0x37c;
|
|
(**(code **)(iVar18 + 0x14))(iVar9 + 0x37c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x37c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 6;
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x37c));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) = iVar9 + 0x380;
|
|
std::vector<52byte>::resize(uVar10);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xffffffff;
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x37c));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c)) = 0;
|
|
if (iVar18 != 0) {
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x30)) = 0;
|
|
do {
|
|
cVar6 = (**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x10))();
|
|
if (cVar6 != '\0') {
|
|
KAGE_LogMessage(1,(byte *)
|
|
"[warn] Invalid familiar count %d. Save file %s might be corrupt.\n");
|
|
goto code_r0x009d459a;
|
|
}
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x30))));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 4 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30))));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 8 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30))));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0xc + *GHIDRA_CAST<int *>((unaff_EBP + -0x30))))
|
|
;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x10 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x14 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x18 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x1c + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
if (0x54 < uVar8) {
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x20 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x24 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x59 < uVar8) {
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x28 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
iVar9 = **GHIDRA_CAST<int **>((unaff_EBP + -0x40));
|
|
if (uVar8 < 0x8f) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x2c + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)))) =
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + *GHIDRA_CAST<int *>((unaff_EBP + -0x30))));
|
|
}
|
|
else {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x30)) + 0x2c + iVar9));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
}
|
|
cVar6 = '\0';
|
|
uVar8 = puVar16[2];
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d)) = 0;
|
|
if (0x9b < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
cVar6 = *GHIDRA_CAST<char *>((unaff_EBP + -0x1d));
|
|
}
|
|
*GHIDRA_CAST<bool *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x30)) + 0x30)) =
|
|
cVar6 != '\0';
|
|
cVar6 = '\0';
|
|
uVar8 = puVar16[2];
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29)) = 0;
|
|
if (0x9f < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x29,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
cVar6 = *GHIDRA_CAST<char *>((unaff_EBP + -0x29));
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x30));
|
|
*GHIDRA_CAST<bool *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + 0x31 + iVar9)) = cVar6 != '\0';
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x30)) = iVar9 + 0x34;
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x3c)) = uVar8;
|
|
} while (uVar8 < **GHIDRA_CAST<uint **>((unaff_EBP + -0x44)));
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
}
|
|
if (0x3f < GHIDRA_UINT(puVar16[2])) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 8;
|
|
vector28_resize((void *)(iVar9 + 0x38c),GHIDRA_UINT(*GHIDRA_CAST<byte *>((unaff_EBP + -0x1d))));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xffffffff;
|
|
uVar10 = GameStatePlayer::read_part3();
|
|
return uVar10;
|
|
}
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x41) {
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34)) = uVar10;
|
|
LAB_009d29c0:
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28)) = uVar10;
|
|
}
|
|
else {
|
|
shortField = GHIDRA_CAST<ushort *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x3b8));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(shortField,2,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*shortField);
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
uVar8 = puVar16[2];
|
|
if (0x57 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x430));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (uVar8 < 0x72) {
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x434)) = GHIDRA_INT(*GHIDRA_CAST<short *>((unaff_EBP + -0x30)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
*GHIDRA_CAST<undefined2 *>((iVar9 + 0x438)) = *GHIDRA_CAST<undefined2 *>((unaff_EBP + -0x30));
|
|
uVar8 = puVar16[2];
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34));
|
|
if (uVar8 < 0x4f) {
|
|
pvVar11 = *(void **)(unaff_EBP + -0x34);
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x43c)),4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x34);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x43c));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x4f < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x440));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x444));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x34);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x51 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x448));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x34);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x5a < uVar8) {
|
|
shortArrayField = GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x458));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(shortArrayField,2,6);
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(shortArrayField,0xc);
|
|
shortArrayField = GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x464));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(shortArrayField,2,6);
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(shortArrayField,0xc);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x470));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x34);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c)) = uVar10;
|
|
*(void **)(unaff_EBP + -0x48) = pvVar11;
|
|
if (uVar8 < 0x5d) {
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*(void **)(unaff_EBP + -0x34) = pvVar11;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28)) = uVar10;
|
|
if (0x5b < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x44c)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x44c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x48))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34)) = extraout_ECX;
|
|
goto LAB_009d29c0;
|
|
}
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x44c)) = GHIDRA_UINT(*GHIDRA_CAST<byte *>((unaff_EBP + -0x1d)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x454)) = GHIDRA_UINT(*GHIDRA_CAST<byte *>((unaff_EBP + -0x1d)));
|
|
}
|
|
}
|
|
uVar8 = puVar16[2];
|
|
if (0x62 < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x29,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x450)) = GHIDRA_UINT(*GHIDRA_CAST<byte *>((unaff_EBP + -0x29)));
|
|
uVar8 = puVar16[2];
|
|
}
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28));
|
|
if (0x5e < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x474)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x474));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x478));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x47c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x480));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x484));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x488));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40)) = uVar10;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = uVar10;
|
|
if (uVar8 < 0x60) {
|
|
LAB_009d2c5b:
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
uVar8 = puVar16[2];
|
|
if (uVar8 < 0x61) {
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
}
|
|
else {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x490));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x61 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x494));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (uVar8 < 100) {
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40)) = uVar10;
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x498)) = GHIDRA_INT(*GHIDRA_CAST<short *>((unaff_EBP + -0x30)));
|
|
uVar8 = puVar16[2];
|
|
if (0x69 < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x49c)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x49c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4a0));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4a4));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4a8));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
if (0x6b < uVar8) {
|
|
uVar10 = 4;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x4ac)),4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x4ac));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x90) {
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -100)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x60)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x5c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x58)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xc;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x88)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x84)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x80)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x7c)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -4)) = 0xd;
|
|
GameStateReader::read_bool_vector(puVar16,(void *)(unaff_EBP + -100),0);
|
|
GameStateReader::read_bool_vector(puVar16,(void *)(unaff_EBP + -0x88),0);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34)) = 0;
|
|
if (*GHIDRA_CAST<int *>((unaff_EBP + -0x58)) != 0) {
|
|
do {
|
|
if (2 < *GHIDRA_CAST<uint *>((iVar9 + 0x4c0))) break;
|
|
if ((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((unaff_EBP + -100)) + (uVar8 >> 5) * 4)) &
|
|
1 << ((byte)uVar8 & 0x1f)) == 0) {
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x34));
|
|
}
|
|
else {
|
|
uVar8 = *GHIDRA_CAST<uint *>((iVar9 + 0x4bc));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x44)) = uVar8;
|
|
if (((uVar8 & 1) == 0) &&
|
|
(*GHIDRA_CAST<uint *>((unaff_EBP + -0x44)) = uVar8,
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x4b8)) <= *GHIDRA_CAST<int *>((iVar9 + 0x4c0)) + 2U >> 1)) {
|
|
std::deque<int>::_Growmap(*GHIDRA_CAST<int *>((unaff_EBP + -100)));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x4bc));
|
|
}
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x4b8));
|
|
uVar8 = iVar18 * 2;
|
|
uVar14 = uVar8 - 1 & *GHIDRA_CAST<uint *>((unaff_EBP + -0x44));
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x4bc)) = uVar14;
|
|
if (uVar14 == 0) {
|
|
uVar14 = uVar8;
|
|
}
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x50)) = uVar14;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x50)) = uVar14 - 1;
|
|
uVar8 = uVar14 - 1 >> 1 & iVar18 - 1U;
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x4b4));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
iVar19 = iVar9;
|
|
if (*GHIDRA_CAST<int *>((iVar18 + uVar8 * 4)) == 0) {
|
|
pvVar11 = operator_new(0x10);
|
|
*(void **)(*GHIDRA_CAST<int *>((iVar9 + 0x4b4)) + uVar8 * 4) = pvVar11;
|
|
iVar19 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x50)) & 1;
|
|
iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar9 + 0x4b4)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) * 4));
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x34));
|
|
*GHIDRA_CAST<int *>((iVar2 + uVar8 * 8)) = iVar18;
|
|
*GHIDRA_CAST<undefined4 *>((iVar2 + 4 + uVar8 * 8)) = 1;
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x4c0)) = *GHIDRA_CAST<int *>((iVar9 + 0x4c0)) + 1;
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x4bc)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x50));
|
|
iVar9 = iVar19;
|
|
if ((0 < iVar18) &&
|
|
((pvVar11 = (g_manager->_itemConfig)._cards._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar11) >> 2 <= iVar18 ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + iVar18 * 4)) == 0)))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Invalid pocket item (type: %d, ID: %d)\n"));
|
|
pvVar11 = *(void **)(unaff_EBP + -0x88);
|
|
if (pvVar11 != (void *)0x0) {
|
|
deallocate(pvVar11,*GHIDRA_CAST<int *>((unaff_EBP + -0x80)) - GHIDRA_INT(pvVar11) >> 2);
|
|
}
|
|
pvVar11 = *(void **)(unaff_EBP + -100);
|
|
if (pvVar11 == (void *)0x0) {
|
|
uVar10 = FUN_009d459a(uVar10);
|
|
return uVar10;
|
|
}
|
|
deallocate(pvVar11,*GHIDRA_CAST<int *>((unaff_EBP + -0x5c)) - GHIDRA_INT(pvVar11) >> 2);
|
|
goto code_r0x009d459a;
|
|
}
|
|
}
|
|
uVar8 = iVar18 + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x34)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x58)));
|
|
}
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
if (*GHIDRA_CAST<int *>((unaff_EBP + -0x7c)) != 0) {
|
|
do {
|
|
if (2 < *GHIDRA_CAST<uint *>((iVar9 + 0x4c0))) break;
|
|
if ((*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x88)) + (uVar8 >> 5) * 4)) &
|
|
1 << ((byte)uVar8 & 0x1f)) != 0) {
|
|
uVar8 = *GHIDRA_CAST<uint *>((iVar9 + 0x4bc));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x34)) = uVar8;
|
|
if (((uVar8 & 1) == 0) &&
|
|
(*GHIDRA_CAST<uint *>((unaff_EBP + -0x34)) = uVar8,
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x4b8)) <= *GHIDRA_CAST<int *>((iVar9 + 0x4c0)) + 2U >> 1)) {
|
|
std::deque<int>::_Growmap(iVar9 + 0x4b0);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x4bc));
|
|
}
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x4b8));
|
|
iVar2 = iVar18 * 2;
|
|
puVar15 = GHIDRA_CAST<uint *>((unaff_EBP + -0x34));
|
|
*puVar15 = *puVar15 & iVar2 - 1U;
|
|
uVar8 = *puVar15;
|
|
iVar19 = *GHIDRA_CAST<int *>((unaff_EBP + -0x34));
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x4bc)) = iVar19;
|
|
if (uVar8 == 0) {
|
|
iVar19 = iVar2;
|
|
}
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x34)) = iVar19 - 1U;
|
|
uVar8 = iVar19 - 1U >> 1 & iVar18 - 1U;
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x4b4));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
if (*GHIDRA_CAST<int *>((iVar18 + uVar8 * 4)) == 0) {
|
|
pvVar11 = operator_new(0x10);
|
|
*(void **)(*GHIDRA_CAST<int *>((iVar9 + 0x4b4)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) * 4) = pvVar11;
|
|
}
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x34));
|
|
uVar14 = uVar8 & 1;
|
|
iVar18 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar9 + 0x4b4)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) * 4));
|
|
*GHIDRA_CAST<undefined4 *>((iVar18 + uVar14 * 8)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44));
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
*GHIDRA_CAST<undefined4 *>((iVar18 + 4 + uVar14 * 8)) = 0;
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x4c0)) = *GHIDRA_CAST<int *>((iVar9 + 0x4c0)) + 1;
|
|
*GHIDRA_CAST<uint *>((iVar9 + 0x4bc)) = uVar8;
|
|
}
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x44)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x7c)));
|
|
}
|
|
pvVar11 = *(void **)(unaff_EBP + -0x88);
|
|
if (pvVar11 != (void *)0x0) {
|
|
deallocate(pvVar11,*GHIDRA_CAST<int *>((unaff_EBP + -0x80)) - GHIDRA_INT(pvVar11) >> 2);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xffffffff;
|
|
pvVar11 = *(void **)(unaff_EBP + -100);
|
|
if (pvVar11 != (void *)0x0) {
|
|
deallocate(pvVar11,*GHIDRA_CAST<int *>((unaff_EBP + -0x5c)) - GHIDRA_INT(pvVar11) >> 2);
|
|
}
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x29,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x38)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x38)),1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x35)) = 0;
|
|
if (*GHIDRA_CAST<char *>((unaff_EBP + -0x29)) != '\0') {
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x4c,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x4c));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x48,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
if (((*GHIDRA_CAST<char *>((unaff_EBP + -0x4c)) == '\x01') &&
|
|
(iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)), 0 < iVar9)) &&
|
|
((pvVar1 = (g_manager->_itemConfig)._cards._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar1) >> 2 <= iVar9 ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + iVar9 * 4)) == 0)))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Invalid pocket item (type: %d, ID: %d)\n"));
|
|
goto code_r0x009d459a;
|
|
}
|
|
bVar7 = *GHIDRA_CAST<char *>((unaff_EBP + -0x35)) + 1;
|
|
*GHIDRA_CAST<byte *>((unaff_EBP + -0x35)) = bVar7;
|
|
} while (bVar7 < *GHIDRA_CAST<byte *>((unaff_EBP + -0x29)));
|
|
}
|
|
}
|
|
piVar17 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4c4));
|
|
*GHIDRA_CAST<int **>((unaff_EBP + -0x1c)) = piVar17;
|
|
FUN_007dccd0(8);
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
do {
|
|
iVar9 = *piVar17;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined1 *>((iVar9 + uVar8)),1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((iVar9 + uVar8));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
piVar17 = *GHIDRA_CAST<int **>((unaff_EBP + -0x1c));
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < 8);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4d0));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
if (0x98 < GHIDRA_UINT(puVar16[2])) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4d4));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
}
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4dc;
|
|
FUN_007dccd0(6);
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
do {
|
|
byteField = GHIDRA_CAST<undefined1 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x1c)) + uVar8));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(byteField,1,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *byteField;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < 6);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
uVar12 = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
if (0x14 < *GHIDRA_CAST<byte *>((unaff_EBP + -0x1d))) {
|
|
uVar12 = 0x14;
|
|
}
|
|
piVar17 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4e8));
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d)) = uVar12;
|
|
*GHIDRA_CAST<int **>((unaff_EBP + -0x1c)) = piVar17;
|
|
FUN_007dccd0(uVar12);
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
if (*GHIDRA_CAST<char *>((unaff_EBP + -0x1d)) != '\0') {
|
|
do {
|
|
iVar9 = *piVar17;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined1 *>((iVar9 + uVar8)),1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((iVar9 + uVar8));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
piVar17 = *GHIDRA_CAST<int **>((unaff_EBP + -0x1c));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<byte *>((unaff_EBP + -0x1d)));
|
|
}
|
|
byteField = GHIDRA_CAST<undefined1 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4f4));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(byteField,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *byteField;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4d8));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4f8));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x4fc));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x528));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
}
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40));
|
|
}
|
|
uVar8 = puVar16[2];
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34)) = uVar10;
|
|
if (0x74 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x52c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40)) = extraout_ECX_00;
|
|
}
|
|
if (0x75 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x514));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x77 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x530));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if (0x7d < uVar8) {
|
|
GameStatePlayer::read_block_538(GHIDRA_CAST<uint *>((iVar9 + 0x538)),puVar16);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (uVar8 < 0xa4) {
|
|
*GHIDRA_CAST<undefined4 *>((iVar9 + 0x564)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 4));
|
|
}
|
|
else {
|
|
piVar17 = GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x38)) = 0;
|
|
(**(code **)(*piVar17 + 0x14))(unaff_EBP + -0x38,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x38));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xe;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x40)) = iVar9 + 0x558;
|
|
std::vector<52byte>::resize(*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x38)));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
if (0 < *GHIDRA_CAST<int *>((unaff_EBP + -0x38))) {
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28)) = 0;
|
|
do {
|
|
cVar6 = (**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x10))();
|
|
if (cVar6 != '\0') {
|
|
KAGE_LogMessage(1,(byte *)
|
|
"[warn] Invalid familiar count %d. Save file %s might be corrupt.\n");
|
|
goto code_r0x009d459a;
|
|
}
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28))));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 4))
|
|
;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 8))
|
|
;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0xc);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x10);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x14);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x18);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x1c);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x20);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x24);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x28);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = (undefined4 *)
|
|
(**GHIDRA_CAST<int **>((unaff_EBP + -0x40)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x2c);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x34);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
piVar17 = GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29)) = 0;
|
|
(**(code **)(*piVar17 + 0x14))(unaff_EBP + -0x29,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
*GHIDRA_CAST<bool *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x28)) + 0x30 + **GHIDRA_CAST<int **>((unaff_EBP + -0x40)))) =
|
|
*GHIDRA_CAST<char *>((unaff_EBP + -0x29)) != '\0';
|
|
piVar17 = GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d)) = 0;
|
|
(**(code **)(*piVar17 + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x28));
|
|
*GHIDRA_CAST<bool *>((iVar9 + 0x31 + **GHIDRA_CAST<int **>((unaff_EBP + -0x40)))) =
|
|
*GHIDRA_CAST<char *>((unaff_EBP + -0x1d)) != '\0';
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x28)) = iVar9 + 0x34;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x48)) = iVar18;
|
|
} while (iVar18 < *GHIDRA_CAST<int *>((unaff_EBP + -0x38)));
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x564)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x564));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x40)) = extraout_ECX_01;
|
|
}
|
|
uVar8 = puVar16[2];
|
|
if (0x7f < uVar8) {
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x50)) = iVar9 + 0x568;
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x29,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x50)) + 4)) = GHIDRA_INT(*GHIDRA_CAST<char *>((unaff_EBP + -0x29)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x44,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
cVar6 = *GHIDRA_CAST<char *>((unaff_EBP + -0x29));
|
|
piVar17 = *GHIDRA_CAST<int **>((unaff_EBP + -0x50));
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44));
|
|
*piVar17 = iVar18;
|
|
if ((cVar6 == '\x01') && (0 < iVar18)) {
|
|
pvVar11 = (g_manager->_itemConfig)._cards._begin;
|
|
pvVar1 = (g_manager->_itemConfig)._cards._end;
|
|
*(void **)(unaff_EBP + -0x1c) = pvVar11;
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if ((GHIDRA_INT(pvVar1) - GHIDRA_INT(pvVar11) >> 2 <= iVar18) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) + iVar18 * 4)) == 0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Invalid pre curse pocket item (type: %d, ID: %d)\n"));
|
|
goto code_r0x009d459a;
|
|
}
|
|
}
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
*GHIDRA_CAST<int **>((unaff_EBP + -0x50)) = piVar17 + 2;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x74)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(iVar9 + 0x588,4,2);
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((iVar9 + 0x588)),8);
|
|
uVar8 = 0;
|
|
puVar15 = GHIDRA_CAST<uint *>((iVar9 + 0x588));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
do {
|
|
uVar14 = *puVar15;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = uVar14;
|
|
if (0 < GHIDRA_INT(uVar14)) {
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
if ((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._trinkets._begin) >> 2 <= GHIDRA_INT((uVar14 & 0x7fff))) ||
|
|
(iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((g_manager->_itemConfig)._trinkets._begin) + (uVar14 & 0x7fff) * 4)) == 0))
|
|
{
|
|
format = "[warn] Invalid pre curse trinket %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x48));
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
puVar15 = puVar15 + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < 2);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x81 < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(iVar9 + 0x590,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((iVar9 + 0x590));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x50)) = iVar9 + 0x598;
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x35,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x35));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
**GHIDRA_CAST<int **>((unaff_EBP + -0x50)) = GHIDRA_INT(*GHIDRA_CAST<char *>((unaff_EBP + -0x35)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x44,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
piVar17 = *GHIDRA_CAST<int **>((unaff_EBP + -0x50));
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44));
|
|
piVar17[-1] = iVar18;
|
|
if (((*GHIDRA_CAST<char *>((iVar9 + 0x590)) != '\0') &&
|
|
(iVar19 = *piVar17, *GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) = iVar19, iVar19 == 1)) && (0 < iVar18))
|
|
{
|
|
pvVar11 = (g_manager->_itemConfig)._cards._begin;
|
|
pvVar1 = (g_manager->_itemConfig)._cards._end;
|
|
*(void **)(unaff_EBP + -0x1c) = pvVar11;
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if ((GHIDRA_INT(pvVar1) - GHIDRA_INT(pvVar11) >> 2 <= iVar18) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) + iVar18 * 4)) == 0)) {
|
|
KAGE_LogMessage(1,(byte *)
|
|
"[warn] Invalid pre coop ghost pocket item (type: %d, ID: %d)\n");
|
|
goto code_r0x009d459a;
|
|
}
|
|
}
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
*GHIDRA_CAST<int **>((unaff_EBP + -0x50)) = piVar17 + 2;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x74)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(iVar9 + 0x5b4,4,2);
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((iVar9 + 0x5b4)),8);
|
|
cVar6 = *GHIDRA_CAST<char *>((iVar9 + 0x590));
|
|
puVar15 = GHIDRA_CAST<uint *>((iVar9 + 0x5b4));
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<char *>((unaff_EBP + -0x35)) = cVar6;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
do {
|
|
if (cVar6 != '\0') {
|
|
uVar14 = *puVar15;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = uVar14;
|
|
if (0 < GHIDRA_INT(uVar14)) {
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
if ((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) -
|
|
GHIDRA_INT((g_manager->_itemConfig)._trinkets._begin) >> 2 <= GHIDRA_INT((uVar14 & 0x7fff))) ||
|
|
(iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((g_manager->_itemConfig)._trinkets._begin) + (uVar14 & 0x7fff) * 4)) == 0
|
|
)) {
|
|
format = "[warn] Invalid pre coop ghost trinket %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x48));
|
|
}
|
|
cVar6 = *GHIDRA_CAST<char *>((unaff_EBP + -0x35));
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
puVar15 = puVar15 + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < 2);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0x80 < uVar8) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x5c8)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x5c8));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (uVar8 < 0x82) {
|
|
pvVar11 = *(void **)(unaff_EBP + -0x40);
|
|
*(void **)(unaff_EBP + -0x28) = pvVar11;
|
|
}
|
|
else {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x5cc));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x40))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
if (0xa7 < uVar8) {
|
|
byteField = GHIDRA_CAST<undefined1 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x5d0));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(byteField,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *byteField;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
if (0xa8 < uVar8) {
|
|
byteField = GHIDRA_CAST<undefined1 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x5d1));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(byteField,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *byteField;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
pvVar11 = *(void **)(unaff_EBP + -0x40);
|
|
*(void **)(unaff_EBP + -0x28) = pvVar11;
|
|
if (0x82 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x524));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x34))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
pvVar11 = *(void **)(unaff_EBP + -0x28);
|
|
}
|
|
}
|
|
if (uVar8 < 0x6e) {
|
|
LAB_009d3eb4:
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
else {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x48)) = iVar9 + 0x500;
|
|
std::vector<4byte>::resize(*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d)));
|
|
uVar8 = 0;
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x35)) = 0;
|
|
if (*GHIDRA_CAST<char *>((unaff_EBP + -0x1d)) != '\0') {
|
|
iVar9 = **GHIDRA_CAST<int **>((unaff_EBP + -0x48));
|
|
do {
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((iVar9 + uVar8 * 4));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = **GHIDRA_CAST<int **>((unaff_EBP + -0x48));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar9;
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + uVar8 * 4));
|
|
if (0 < iVar18) {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar18);
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
format = "[warn] Invalid item card %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x1c));
|
|
}
|
|
bVar7 = *GHIDRA_CAST<char *>((unaff_EBP + -0x35)) + 1;
|
|
uVar8 = GHIDRA_UINT(bVar7);
|
|
*GHIDRA_CAST<byte *>((unaff_EBP + -0x35)) = bVar7;
|
|
} while (bVar7 < *GHIDRA_CAST<byte *>((unaff_EBP + -0x1d)));
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
goto LAB_009d3eb4;
|
|
}
|
|
}
|
|
if (GHIDRA_UINT(puVar16[2]) < 0x6f) {
|
|
LAB_009d3f14:
|
|
uVar8 = puVar16[2];
|
|
if (0x72 < uVar8) {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x510));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = puVar16[2];
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
if (0x7e < uVar8) {
|
|
iVar18 = *GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) = iVar9 + 0x5bc;
|
|
(**(code **)(iVar18 + 0x14))(iVar9 + 0x5bc,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((iVar9 + 0x5bc));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
if (*GHIDRA_CAST<char *>((iVar9 + 0x5bc)) != -1) {
|
|
iVar18 = *GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x48)) = iVar9 + 0x5c0;
|
|
(**(code **)(iVar18 + 0x14))(iVar9 + 0x5c0,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x5c0));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(GHIDRA_CAST<undefined4 *>((iVar9 + 0x5c4)),4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((iVar9 + 0x5c4));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
cVar6 = **GHIDRA_CAST<char **>((unaff_EBP + -0x3c));
|
|
*GHIDRA_CAST<char *>((unaff_EBP + -0x2d)) = cVar6;
|
|
if (cVar6 == '\x02') {
|
|
iVar9 = **GHIDRA_CAST<int **>((unaff_EBP + -0x48));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar9;
|
|
manager = g_manager;
|
|
if (0 < iVar9) {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(iVar9);
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
format = "[warn] Invalid active item wildcard effect %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
goto LAB_009d4022;
|
|
}
|
|
}
|
|
else {
|
|
manager = g_manager;
|
|
LAB_009d4022:
|
|
iVar9 = **GHIDRA_CAST<int **>((unaff_EBP + -0x48));
|
|
if (((*GHIDRA_CAST<char *>((unaff_EBP + -0x2d)) == '\x01') && (0 < iVar9)) &&
|
|
((pvVar11 = (manager->_itemConfig)._cards._begin,
|
|
GHIDRA_INT((manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar11) >> 2 <= iVar9 ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + iVar9 * 4)) == 0)))) {
|
|
KAGE_LogMessage(1,(byte *)
|
|
"[warn] Invalid pocket item wildcard effect (type: %d, id: %d)\n");
|
|
goto code_r0x009d459a;
|
|
}
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
}
|
|
if (0x42 < GHIDRA_UINT(puVar16[2])) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x44,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = 0;
|
|
if (*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) != 0) {
|
|
do {
|
|
cVar6 = (**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x10))();
|
|
if (cVar6 != '\0') {
|
|
KAGE_LogMessage(1,(byte *)
|
|
"[warn] Invalid history count %d. Save file %s might be corrupt.\n")
|
|
;
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x3c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x74,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x74));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x34,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x30));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x50,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x50));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x38,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x38));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
uVar8 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x3c));
|
|
uVar14 = uVar8 & 0xffffff;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = uVar14;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x3c)) = uVar14;
|
|
cVar6 = (char)(uVar8 >> 0x18);
|
|
if (cVar6 == '\x03') {
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x6c)) = 1;
|
|
uVar14 = -uVar14;
|
|
}
|
|
else {
|
|
if (cVar6 == '\x02') {
|
|
uVar14 = -uVar14;
|
|
}
|
|
else {
|
|
if (cVar6 == '\x01') {
|
|
if (uVar14 != 0) {
|
|
pvVar11 = (g_manager->_itemConfig)._trinkets._begin;
|
|
pvVar1 = (g_manager->_itemConfig)._trinkets._end;
|
|
*(void **)(unaff_EBP + -0x1c) = pvVar11;
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
if ((GHIDRA_INT(pvVar1) - GHIDRA_INT(pvVar11) >> 2 <= GHIDRA_INT((uVar8 & 0x7fff))) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) + (uVar8 & 0x7fff) * 4)) == 0)) {
|
|
format = "[warn] Invalid history trinket %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x6c)) = 1;
|
|
goto LAB_009d422f;
|
|
}
|
|
if (uVar14 != 0) {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(uVar14);
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
format = "[warn] Invalid history collectible %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
uVar14 = *GHIDRA_CAST<uint *>((unaff_EBP + -0x1c));
|
|
}
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x6c)) = 0;
|
|
}
|
|
LAB_009d422f:
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -100)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x74));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x60)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x34));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x5c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x30));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x68)) = uVar14;
|
|
uVar10 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x50));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x58)) = uVar10;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x70)) = *GHIDRA_CAST<int *>((unaff_EBP + -0x38));
|
|
if (*GHIDRA_CAST<int *>((unaff_EBP + -0x38)) < 0) {
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x70)) = g_game->_frameCount;
|
|
}
|
|
fieldPtr = *GHIDRA_CAST<undefined4 **>((iVar9 + 0x3c0));
|
|
if (fieldPtr == *GHIDRA_CAST<undefined4 **>((iVar9 + 0x3c4))) {
|
|
std::vector<28byte>::_Emplace_reallocate(fieldPtr,unaff_EBP + -0x70);
|
|
}
|
|
else {
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x6c));
|
|
uVar4 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x68));
|
|
uVar5 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -100));
|
|
*fieldPtr = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x70));
|
|
fieldPtr[1] = uVar3;
|
|
fieldPtr[2] = uVar4;
|
|
fieldPtr[3] = uVar5;
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x5c));
|
|
fieldPtr[4] = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x60));
|
|
fieldPtr[5] = uVar3;
|
|
fieldPtr[6] = uVar10;
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x3c0)) = *GHIDRA_CAST<int *>((iVar9 + 0x3c0)) + 0x1c;
|
|
}
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x48)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x44)));
|
|
}
|
|
if (100 < GHIDRA_UINT(puVar16[2])) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x29,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x29));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x35)) = 0;
|
|
if (*GHIDRA_CAST<char *>((unaff_EBP + -0x29)) != '\0') {
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
bVar7 = *GHIDRA_CAST<byte *>((unaff_EBP + -0x35));
|
|
bVar13 = bVar7 + 1;
|
|
*GHIDRA_CAST<byte *>((unaff_EBP + -0x35)) = bVar13;
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x3c8 + GHIDRA_UINT(bVar7) * 4)) = GHIDRA_INT(*GHIDRA_CAST<short *>((unaff_EBP + -0x30)));
|
|
} while (bVar13 < *GHIDRA_CAST<byte *>((unaff_EBP + -0x29)));
|
|
}
|
|
}
|
|
}
|
|
if (0x50 < GHIDRA_UINT(puVar16[2])) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x1d,1,1);
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x30)) = *GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x30)),1);
|
|
FUN_0042c820(*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x1d)));
|
|
*GHIDRA_CAST<undefined1 *>((unaff_EBP + -0x35)) = 0;
|
|
if (*GHIDRA_CAST<char *>((unaff_EBP + -0x1d)) != '\0') {
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x50,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x50));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
fieldPtr = *GHIDRA_CAST<undefined4 **>((iVar9 + 0x428));
|
|
if (fieldPtr == *GHIDRA_CAST<undefined4 **>((iVar9 + 0x42c))) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(fieldPtr,unaff_EBP + -0x50);
|
|
}
|
|
else {
|
|
*fieldPtr = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x50));
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x428)) = *GHIDRA_CAST<int *>((iVar9 + 0x428)) + 4;
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((unaff_EBP + -0x50))) &&
|
|
(collectibleConfig =
|
|
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(*GHIDRA_CAST<int *>((unaff_EBP + -0x50)))
|
|
, collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
|
|
format = "[warn] Invalid Monster Manual collectible %d\n";
|
|
goto LAB_009d4590;
|
|
}
|
|
bVar7 = *GHIDRA_CAST<char *>((unaff_EBP + -0x35)) + 1;
|
|
*GHIDRA_CAST<byte *>((unaff_EBP + -0x35)) = bVar7;
|
|
} while (bVar7 < *GHIDRA_CAST<byte *>((unaff_EBP + -0x1d)));
|
|
}
|
|
}
|
|
if (0x89 < GHIDRA_UINT(puVar16[2])) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x3c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x3c));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = 0;
|
|
if (*GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) != 0) {
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar9 + 0x5d4;
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x38,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x38)));
|
|
(GHIDRA_CAST<Checksum *>((checksum2)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x48)),2);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x48)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((checksum2)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x48)),2);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x54)) = GHIDRA_INT(*GHIDRA_CAST<short *>((unaff_EBP + -0x38)));
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x50)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
std_map_int_insert(*(void **)(unaff_EBP + -0x44),(void *)(unaff_EBP + -0x78),
|
|
GHIDRA_CAST<int *>((unaff_EBP + -0x54)));
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x3c)));
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
}
|
|
}
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x3c)) = iVar9 + 0x4b0;
|
|
std::deque<ptr>::_Tidy();
|
|
if (0x9c < GHIDRA_UINT(puVar16[2])) {
|
|
piVar17 = GHIDRA_CAST<int *>(*puVar16);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28)) = 0;
|
|
(**(code **)(*piVar17 + 0x14))(unaff_EBP + -0x28,4,1);
|
|
pvVar11 = *(void **)(unaff_EBP + -0x40);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x28));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = 0;
|
|
if (*GHIDRA_CAST<int *>((unaff_EBP + -0x28)) != 0) {
|
|
do {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x80,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x80));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x48)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x7c,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x48)) = *GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x7c));
|
|
(GHIDRA_CAST<Checksum *>((pvVar11)))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x48)),4);
|
|
std::deque<Vector>::push_back(unaff_EBP + -0x80);
|
|
uVar8 = *GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) + 1;
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = uVar8;
|
|
} while (uVar8 < *GHIDRA_CAST<uint *>((unaff_EBP + -0x28)));
|
|
}
|
|
}
|
|
uVar10 = 1;
|
|
goto LAB_009d459c;
|
|
}
|
|
piVar17 = GHIDRA_CAST<int *>((iVar9 + 0x50c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(piVar17,4,1);
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = *piVar17;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
if ((*piVar17 < 1) ||
|
|
(collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(*piVar17),
|
|
collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) goto LAB_009d3f14;
|
|
format = "[warn] Invalid modeling clay effect %d\n";
|
|
LAB_009d4590:
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>(format));
|
|
}
|
|
else {
|
|
fieldPtr = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x48c));
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(fieldPtr,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *fieldPtr;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x14))(unaff_EBP + -0x30,2,1);
|
|
*GHIDRA_CAST<uint *>((unaff_EBP + -0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),2);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 10;
|
|
uVar8 = GHIDRA_UINT(*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)));
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar9 + 0x51c));
|
|
iVar19 = *GHIDRA_CAST<int *>((iVar9 + 0x518));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar18;
|
|
uVar14 = iVar18 - iVar19 >> 4;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar19;
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
if (uVar8 < uVar14) {
|
|
iVar18 = uVar8 * 0x10 + *GHIDRA_CAST<int *>((iVar9 + 0x518));
|
|
LAB_009d2c3f:
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x51c)) = iVar18;
|
|
}
|
|
else if (uVar14 < uVar8) {
|
|
if (uVar8 <= GHIDRA_UINT((*GHIDRA_CAST<int *>((iVar9 + 0x520)) - *GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) >> 4))) {
|
|
iVar18 = uVar8 - uVar14;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar18;
|
|
if (iVar18 == 0) {
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44));
|
|
}
|
|
else {
|
|
memset(*(void **)(unaff_EBP + -0x44),0,iVar18 * 0x10);
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + *GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) * 0x10;
|
|
}
|
|
goto LAB_009d2c3f;
|
|
}
|
|
std::vector<16byte>::_Resize_reallocate(uVar8,uVar8);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -4)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x44)) = 0;
|
|
if (*GHIDRA_CAST<short *>((unaff_EBP + -0x30)) == 0) goto LAB_009d2c5b;
|
|
while (cVar6 = (**(code **)(*GHIDRA_CAST<int *>(*puVar16) + 0x10))(), cVar6 == '\0') {
|
|
iVar19 = (*GHIDRA_CAST<uint *>((unaff_EBP + -0x44)) & 0xffff) * 0x10;
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((iVar9 + 0x518)) + iVar19));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x518)) + 4 + iVar19));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x518)) + 8 + iVar19));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
puVar16 = GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((unaff_EBP + -0x24)) + 0x518)) + 0xc + iVar19));
|
|
(**(code **)(*GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((unaff_EBX + 8))) + 0x14))(puVar16,4,1);
|
|
*GHIDRA_CAST<undefined4 *>((unaff_EBP + -0x1c)) = *puVar16;
|
|
(GHIDRA_CAST<Checksum *>((*(void **)(unaff_EBP + -0x28))))->Checksum::Update(GHIDRA_CAST<byte *>((unaff_EBP + -0x1c)),4);
|
|
iVar9 = *GHIDRA_CAST<int *>((unaff_EBP + -0x24));
|
|
iVar18 = *GHIDRA_CAST<int *>((iVar19 + 4 + *GHIDRA_CAST<int *>((iVar9 + 0x518))));
|
|
iVar19 = *GHIDRA_CAST<int *>((iVar19 + *GHIDRA_CAST<int *>((iVar9 + 0x518))));
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x1c)) = iVar18;
|
|
bVar7 = is_valid_item_config_id(iVar19,iVar18);
|
|
if (bVar7 == 0) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Invalid temporary effect (type: %d, ID: %d)\n"));
|
|
goto code_r0x009d459a;
|
|
}
|
|
iVar18 = *GHIDRA_CAST<int *>((unaff_EBP + -0x44)) + 1;
|
|
*GHIDRA_CAST<int *>((unaff_EBP + -0x44)) = iVar18;
|
|
if (*GHIDRA_CAST<ushort *>((unaff_EBP + -0x30)) <= (ushort)iVar18) goto LAB_009d2c5b;
|
|
puVar16 = *GHIDRA_CAST<undefined4 **>((unaff_EBX + 8));
|
|
}
|
|
LAB_009d1988:
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Invalid costume count %d. Save file %s might be corrupt.\n"));
|
|
}
|
|
code_r0x009d459a:
|
|
uVar10 = 0;
|
|
LAB_009d459c:
|
|
ExceptionList = *(void **)(unaff_EBP + -0xc);
|
|
return uVar10;
|
|
}
|
|
|
|
// 00a9f630
|
|
void Entity_Player::AddTrinket(int param_2, char param_3)
|
|
{
|
|
uint streamSize;
|
|
uint unaff_EBX;
|
|
int unaff_ESI;
|
|
uint streamSize;
|
|
int iVar2;
|
|
uint nextChunkOffset;
|
|
uint unaff_EDI;
|
|
undefined4 uStack_2c;
|
|
uint *puStack_28;
|
|
int iStack_24;
|
|
int local_1c;
|
|
undefined1 riffHeader [12];
|
|
uint local_c;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&uStack_2c);
|
|
local_1c = param_2;
|
|
streamSize = this->Init();
|
|
this->Render(riffHeader,0xc,1);
|
|
streamSize = 0xc;
|
|
if (iStack_24 != 0x46464952) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Not RIFF format.\n"));
|
|
}
|
|
if (local_1c != 0x45564157) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Not Wave format.\n"));
|
|
}
|
|
if (0xc < streamSize) {
|
|
do {
|
|
this->Render(riffHeader + -0x1c,8,1);
|
|
iVar2 = streamSize + 8;
|
|
if (unaff_ESI == 0x20746d66) {
|
|
this->Render(uStack_2c,0x10,1);
|
|
nextChunkOffset = streamSize + 0x18;
|
|
if (0x10 < unaff_EBX) {
|
|
this->Render(riffHeader + -0x20,2,1);
|
|
iVar2 = streamSize + 0x1a;
|
|
streamSize = unaff_EDI & 0xffff;
|
|
LAB_00a9f733:
|
|
nextChunkOffset = iVar2 + streamSize;
|
|
if (nextChunkOffset == streamSize) {
|
|
return;
|
|
}
|
|
this->Update(streamSize,1);
|
|
}
|
|
}
|
|
else {
|
|
if (unaff_ESI != 0x61746164) {
|
|
streamSize = unaff_EBX;
|
|
goto LAB_00a9f733;
|
|
}
|
|
if (puStack_28 == GHIDRA_CAST<uint *>(0x0)) {
|
|
return;
|
|
}
|
|
*puStack_28 = unaff_EBX;
|
|
if (param_3 != '\0') {
|
|
return;
|
|
}
|
|
this->Render(puStack_28[1],1,unaff_EBX);
|
|
nextChunkOffset = iVar2 + unaff_EBX;
|
|
}
|
|
streamSize = nextChunkOffset;
|
|
} while (nextChunkOffset < streamSize);
|
|
}
|
|
return;
|
|
}
|