--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27249 lines
1.1 MiB
Plaintext
27249 lines
1.1 MiB
Plaintext
#include "classes.h"
|
|
|
|
// 00431be0
|
|
void Entity_Familiar::ai_umbilical_baby(uint8_t isInterpolated)
|
|
{
|
|
Entity_Familiar *sprite = this;
|
|
uint8_t *animName;
|
|
uint32_t *puVar1;
|
|
uint8_t bVar2;
|
|
char isDamaged;
|
|
uint32_t *puVar3;
|
|
uint32_t *listHead;
|
|
Entity *bloodEffect;
|
|
Weapon *newWeapon;
|
|
float *extraout_EAX;
|
|
Vector *pVVar4;
|
|
LayerState *layer;
|
|
LayerState *copyLayer;
|
|
float *pfVar5;
|
|
float **ppfVar6;
|
|
void *pvVar7;
|
|
Capsule *capsule;
|
|
int *piVar8;
|
|
BitSet128 *maskedFlags;
|
|
float *ropePointCount;
|
|
int cordSegment;
|
|
Entity *unused;
|
|
uint32_t uVar9;
|
|
uint32_t uVar10;
|
|
std_vector *psVar11;
|
|
Entity_Projectile *pEVar12;
|
|
float fVar13;
|
|
Entity_Familiar *baby;
|
|
float fVar14;
|
|
float fVar15;
|
|
uint8_t auVar16 [12];
|
|
float fVar17;
|
|
float fVar18;
|
|
double dVar19;
|
|
undefined3 in_stack_00000005;
|
|
Capsule gridCapsule [13];
|
|
Vector bombPush;
|
|
Vector bombOffset;
|
|
EntityRef local_20c;
|
|
Vector tearPushDir;
|
|
Vector reflectDir;
|
|
Vector bombPushDir;
|
|
EntityList_EL capsuleHits;
|
|
float ropeForce;
|
|
Vector projectileOffset;
|
|
Vector pickupPos;
|
|
Vector tearPos;
|
|
Vector projectilePos;
|
|
Vector bombPos;
|
|
float babyPosX;
|
|
Vector aimDirection;
|
|
uint8_t local_184 [8];
|
|
uint32_t local_17c;
|
|
uint8_t local_178 [8];
|
|
uint32_t local_170;
|
|
float midVelX;
|
|
Vector local_168;
|
|
float midPosX;
|
|
Vector local_15c;
|
|
Vector local_154;
|
|
float local_14c;
|
|
Vector local_148;
|
|
uint8_t shieldedMask [4];
|
|
uint8_t local_13c [8];
|
|
float local_134;
|
|
Vector local_12c;
|
|
Vector local_124;
|
|
Vector local_11c;
|
|
float *local_114;
|
|
float tearFlags0;
|
|
float tearFlags1;
|
|
Vector VStack_108;
|
|
float *local_fc;
|
|
Vector *local_f8;
|
|
Vector local_f4;
|
|
uint32_t *local_ec;
|
|
Entity_Familiar *local_e8;
|
|
int *local_e4;
|
|
std_vector *local_e0;
|
|
float local_dc;
|
|
Vector *local_d8;
|
|
Vector *local_d4;
|
|
float local_d0;
|
|
float *local_cc;
|
|
ANM2 *local_c8;
|
|
Vector *local_c4;
|
|
Entity_Projectile *local_c0;
|
|
uint8_t local_b9;
|
|
TearParams tearHitParams;
|
|
Capsule cordCapsule [5];
|
|
std_string anm2Path;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_18;
|
|
int ehState;
|
|
Manager *manager;
|
|
Entity_Player *player;
|
|
float *prevPoint;
|
|
ANM2 *sprite;
|
|
code *vfn;
|
|
|
|
puStack_20 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(cordCapsule[0x19])) + 0x1)));
|
|
ehState = -1;
|
|
puStack_18 = &LAB_00af2166;
|
|
savedExceptionList = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(cordCapsule[0x15])) + 0x1))));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(sprite->_player) + 0x173)) != '\0') {
|
|
return;
|
|
}
|
|
ExceptionList = &savedExceptionList;
|
|
local_e8 = sprite;
|
|
puVar3 = (uint32_t *)
|
|
__RTDynamicCast(sprite->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor,0,
|
|
stackCookie);
|
|
local_ec = puVar3;
|
|
if (puVar3 == GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
puVar3 = operator_new(0x158);
|
|
local_12c.y = (float)puVar3;
|
|
if (puVar3 == GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
puVar3 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_ec = GHIDRA_CAST<uint32_t *>(0x0);
|
|
}
|
|
else {
|
|
ehState = 1;
|
|
puVar1 = puVar3 + 1;
|
|
*puVar3 = IsaacRepentancePlus::UmbilicalBabyData::vftable;
|
|
*puVar1 = 0;
|
|
puVar3[2] = 0;
|
|
puVar3[3] = 0;
|
|
puVar3[4] = 0;
|
|
puVar3[5] = 0;
|
|
local_ec = puVar3;
|
|
listHead = operator_new(8);
|
|
listHead[1] = 0;
|
|
*puVar1 = listHead;
|
|
*listHead = puVar1;
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),2);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((puVar3 + 6)))))->ANM2::constructor();
|
|
puVar3[0x4c] = 0;
|
|
puVar3[0x4d] = 0;
|
|
puVar3[0x4e] = 0;
|
|
puVar3[0x4f] = 0;
|
|
puVar3[0x53] = 0;
|
|
puVar3[0x52] = 0;
|
|
sprite = local_e8;
|
|
}
|
|
ehState = -1;
|
|
set_extra_data(&sprite->_extraData,puVar3);
|
|
(GHIDRA_CAST<msvc::string *>((anm2Path._buf)))->msvc::string::string(&sprite->_sprite);
|
|
ehState = 3;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((puVar3 + 6)))))->ANM2::Load(&anm2Path,1);
|
|
ehState = -1;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar9 = anm2Path._capacity + 1;
|
|
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)anm2Path._buf)) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4);
|
|
uVar9 = anm2Path._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar7,uVar9);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((puVar3 + 6)))))->ANM2::SetAnimation(&DAT_00b1d20c,1);
|
|
if (((bVar2 != 0) && (puVar3[0x13] != 0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((puVar3 + 0x12)))))->AnimationState::SetFrameFloat(0.0), puVar3[0x13] != 0)) {
|
|
*GHIDRA_CAST<uint8_t *>((puVar3 + 0x17)) = 0;
|
|
}
|
|
Entity_Player::GetTearHitParams(sprite->_player,&tearHitParams,10,1.0,1,GHIDRA_CAST<Entity *>(sprite->_player));
|
|
sprite->_collisionDamage = tearHitParams._tearDamage;
|
|
*GHIDRA_CAST<uint16_t *>((puVar3 + 0x50)) = 0;
|
|
puVar3[0x4c] = (uint32_t)tearHitParams._flags._l;
|
|
puVar3[0x4d] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearHitParams._flags._l)) + 0x4)));
|
|
puVar3[0x4e] = (uint32_t)tearHitParams._flags._h;
|
|
puVar3[0x4f] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearHitParams._flags._h)) + 0x4)));
|
|
msvc::deque<120byte>::resize();
|
|
puVar3[0x51] = 0x40a00000;
|
|
puVar3[0x52] = g_vectorZero.x;
|
|
puVar3[0x53] = g_vectorZero.y;
|
|
}
|
|
if (sprite->_updateTime <= 3.0 && sprite->_updateTime != 3.0) {
|
|
LAB_00434e1f:
|
|
sprite->_visible = 0;
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x340));
|
|
(sprite->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x33c));
|
|
(sprite->_pos).y = fVar14;
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
if (sprite->_visible == 0) {
|
|
if (isInterpolated != 0) goto LAB_00434e1f;
|
|
uVar9 = Random();
|
|
local_154.x = (sprite->_targetPosition).x * 6.0;
|
|
local_154.y = (sprite->_targetPosition).y * 6.0;
|
|
bloodEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,&sprite->_pos,&local_154,GHIDRA_CAST<Entity *>(0x0),2,uVar9);
|
|
cordSegment = *GHIDRA_CAST<int *>(bloodEffect);
|
|
(bloodEffect->_posOffset).x = 0.0;
|
|
(bloodEffect->_posOffset).y = -15.0;
|
|
(**(code **)(cordSegment + 0xc))();
|
|
sprite->_visible = 1;
|
|
local_dc = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x13e0));
|
|
LAB_00431f23:
|
|
pvVar7 = sprite->_weapon;
|
|
if (local_dc == 0.0) {
|
|
if (pvVar7 != (void *)0x0) {
|
|
Isaac::DestoryWeapon(&sprite->_weapon);
|
|
}
|
|
}
|
|
else if ((pvVar7 == (void *)0x0) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x30)) != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_dc) + 0x30)))) {
|
|
Isaac::DestoryWeapon(&sprite->_weapon);
|
|
newWeapon = Isaac::CreateWeapon(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_dc) + 0x30)),GHIDRA_CAST<Entity *>(sprite));
|
|
sprite->_weapon = newWeapon;
|
|
}
|
|
}
|
|
else {
|
|
sprite->_visible = 1;
|
|
local_dc = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x13e0));
|
|
if (isInterpolated == 0) goto LAB_00431f23;
|
|
}
|
|
player = sprite->_player;
|
|
local_f8 = GHIDRA_CAST<Vector *>(player->_fireDirection);
|
|
aimDirection.x = (player->_aimDirection).x;
|
|
aimDirection.y = (player->_aimDirection).y;
|
|
local_cc = GHIDRA_CAST<float *>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_cc)) + 0x1))),local_f8 != GHIDRA_CAST<Vector *>(0xffffffff)));
|
|
local_d0 = (player->_pos).x;
|
|
local_d8 = GHIDRA_CAST<Vector *>((player->_pos).y);
|
|
local_e0 = GHIDRA_CAST<std_vector *>(aimDirection.x);
|
|
local_d4 = local_f8;
|
|
VStack_108.y = aimDirection.y;
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetBodyMoveDirection(&local_f4);
|
|
local_d0 = local_d0 + *extraout_EAX * 6.0;
|
|
local_d8 = GHIDRA_CAST<Vector *>(((float)local_d8 + extraout_EAX[1] + extraout_EAX[1]));
|
|
bVar2 = CanPlayerFire(sprite);
|
|
if ((bVar2 != 0) && (sprite->_state != 2)) {
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(0x0);
|
|
local_12c.y = 0.0;
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
local_12c.x = 0.0;
|
|
PickEnemyTarget(sprite,800.0,-GHIDRA_UINT((sprite->_target != 0)) & 8,0x13,&g_vectorZero,15.0);
|
|
if ((local_dc != 0.0) && (sprite->_weapon != (void *)0x0)) {
|
|
TryAimAtMarkedTarget(sprite,&aimDirection,GHIDRA_CAST<int *>(&local_d4),&local_12c);
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(local_12c.x);
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(local_12c.y);
|
|
if ((local_12c.x == g_vectorZero.x) && (local_12c.y == g_vectorZero.y)) {
|
|
local_c8 = GHIDRA_CAST<ANM2 *>((sprite->_pos).x);
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>((sprite->_pos).y);
|
|
}
|
|
}
|
|
if (sprite->_counter < 1) {
|
|
local_c4 = local_d4;
|
|
if ((local_d4 == GHIDRA_CAST<Vector *>(0xffffffff)) &&
|
|
((sprite->_headFrameDelay < 1 ||
|
|
(local_c4 = GHIDRA_CAST<Vector *>(sprite->_shootDirection), local_c4 == GHIDRA_CAST<Vector *>(0xffffffff))))) {
|
|
local_c4 = GHIDRA_CAST<Vector *>(0x3);
|
|
}
|
|
if ((sprite->_weapon == GHIDRA_CAST<int *>(0x0)) ||
|
|
(cordSegment = (**(code **)(*GHIDRA_CAST<int *>(sprite->_weapon) + 0x24))(), cordSegment == 0)) {
|
|
pVVar4 = local_c4;
|
|
}
|
|
else {
|
|
local_11c.x = *GHIDRA_CAST<float *>((cordSegment + 0x33c)) - (sprite->_pos).x;
|
|
local_11c.y = *GHIDRA_CAST<float *>((cordSegment + 0x340)) - (sprite->_pos).y;
|
|
pVVar4 = GHIDRA_CAST<Vector *>(vector_to_direction(&local_11c));
|
|
}
|
|
sprite->_shootDirection = GHIDRA_INT(pVVar4);
|
|
fVar14 = atan2f(aimDirection.y,aimDirection.x);
|
|
puVar3[0x54] = fVar14 * 57.295776;
|
|
}
|
|
if ((local_dc != 0.0) && (pvVar7 = sprite->_weapon, pvVar7 != (void *)0x0)) {
|
|
*GHIDRA_CAST<ANM2 **>((GHIDRA_CAST<char *>(pvVar7) + 0x28)) = local_c8;
|
|
*GHIDRA_CAST<Entity_Projectile **>((GHIDRA_CAST<char *>(pvVar7) + 0x2c)) = local_c0;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(sprite->_weapon) + 0x10)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_dc) + 0x10));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(sprite->_weapon) + 0x34)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_dc) + 0x34));
|
|
(**(code **)(*GHIDRA_CAST<int *>(sprite->_weapon) + 8))();
|
|
(**(code **)(*GHIDRA_CAST<int *>(sprite->_weapon) + 0xc))(&aimDirection,local_cc,_isInterpolated);
|
|
}
|
|
if (sprite->_fireCooldown == 0) {
|
|
if (sprite->_headFrameDelay < 9) {
|
|
PlayFloatAnim(sprite,sprite->_shootDirection);
|
|
}
|
|
else {
|
|
PlayShootAnim(sprite,sprite->_shootDirection);
|
|
}
|
|
}
|
|
if (isInterpolated == 0) {
|
|
if (0 < sprite->_counter) {
|
|
sprite->_counter = sprite->_counter + -1;
|
|
}
|
|
if (0 < sprite->_headFrameDelay) {
|
|
sprite->_headFrameDelay = sprite->_headFrameDelay + -1;
|
|
}
|
|
if (0 < sprite->_fireCooldown) {
|
|
sprite->_fireCooldown = sprite->_fireCooldown + -1;
|
|
}
|
|
}
|
|
}
|
|
local_cc = GHIDRA_CAST<float *>(((float)puVar3[0x55] * 0.017453292));
|
|
local_d4 = GHIDRA_CAST<Vector *>(sin((float)local_cc));
|
|
local_fc = GHIDRA_CAST<float *>(cos((float)local_cc));
|
|
fVar14 = atan2f((float)local_d4,(float)local_fc);
|
|
fVar14 = fVar14 * 57.295776;
|
|
if (360.0 < ABS(fVar14)) {
|
|
fVar14 = fmodf(fVar14,360.0);
|
|
}
|
|
if (fVar14 <= 180.0) {
|
|
if (fVar14 < -180.0) {
|
|
fVar14 = fVar14 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar14 = fVar14 - 360.0;
|
|
}
|
|
local_cc = GHIDRA_CAST<float *>((fVar14 / 45.0 + 0.5));
|
|
dVar19 = floor((double)(float)local_cc);
|
|
local_cc = GHIDRA_CAST<float *>((GHIDRA_INT(dVar19) + 8U & 0x80000007));
|
|
if (GHIDRA_INT(local_cc) < 0) {
|
|
local_cc = GHIDRA_CAST<float *>(((GHIDRA_UINT((GHIDRA_INT(local_cc) + -1)) | 0xfffffff8) + 1));
|
|
}
|
|
animName = (&PTR_s_BodySide_00b1d240)[GHIDRA_INT(local_cc)];
|
|
local_c8 = &sprite->_sprite;
|
|
(sprite->_sprite)._overlayRenderFirst = local_cc != GHIDRA_CAST<float *>(&DAT_00000006);
|
|
(GHIDRA_CAST<ANM2 *>((local_c8)))->ANM2::PlayOverlay(animName,0);
|
|
if (((local_cc == GHIDRA_CAST<float *>(0x0)) || (local_cc == GHIDRA_CAST<float *>(0x1))) ||
|
|
(local_cc == GHIDRA_CAST<float *>(&DAT_00000007))) {
|
|
local_b9 = 1;
|
|
}
|
|
else {
|
|
local_b9 = 0;
|
|
}
|
|
local_b9 = (sprite->_sprite)._flipX ^ local_b9;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&sprite->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
layer->_flipX = local_b9;
|
|
local_114 = (GHIDRA_CAST<AnimationState *>((&(sprite->_sprite)._overlayAnimState)))->AnimationState::GetNullFrameById(0);
|
|
if (local_114 != GHIDRA_CAST<float *>(0x0)) {
|
|
local_cc = GHIDRA_CAST<float *>((*local_114 + 0.0 + (float)local_fc * 6.0));
|
|
local_fc = GHIDRA_CAST<float *>(((local_114[1] - 8.0) + (float)local_d4 * 6.0));
|
|
layer = (GHIDRA_CAST<ANM2 *>((&sprite->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(layer->_pos).x = (float)local_cc;
|
|
(layer->_pos).y = (float)local_fc;
|
|
if ((sprite->_sprite)._flipX != 0) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((local_c8)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
local_cc = GHIDRA_CAST<float *>((GHIDRA_UINT((layer->_pos).x) ^ 0x80000000));
|
|
layer = (GHIDRA_CAST<ANM2 *>((local_c8)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(layer->_pos).x = (float)local_cc;
|
|
}
|
|
sprite = local_c8;
|
|
layer = (GHIDRA_CAST<ANM2 *>((local_c8)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(0x0);
|
|
(layer->_size).x = local_114[4];
|
|
(layer->_size).y = local_114[5];
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
copyLayer = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::GetLayer(*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(local_c0) + 0xb1d238)));
|
|
(copyLayer->_pos).x = (layer->_pos).x;
|
|
(copyLayer->_pos).y = (layer->_pos).y;
|
|
layer = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
copyLayer = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::GetLayer(*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(local_c0) + 0xb1d238)));
|
|
(copyLayer->_size).x = (layer->_size).x;
|
|
(copyLayer->_size).y = (layer->_size).y;
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>((GHIDRA_INT(local_c0) + 4));
|
|
} while (local_c0 < &DAT_00000008);
|
|
sprite = local_e8;
|
|
puVar3 = local_ec;
|
|
}
|
|
if (sprite->_updateTime <= 10.0) {
|
|
local_d4 = &sprite->_targetPosition;
|
|
fVar14 = atan2f((sprite->_targetPosition).y,(sprite->_targetPosition).x);
|
|
puVar3[0x55] = fVar14 * 57.295776;
|
|
if (isInterpolated == 0) {
|
|
local_dc = sprite->_speedMultiplier + sprite->_updateTime;
|
|
pvVar7 = sprite->_player;
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(((local_dc - 3.0) / 6.0));
|
|
if (1.0 <= (float)local_c0) {
|
|
if ((float)local_c0 == 1.0) {
|
|
fVar14 = 1.2;
|
|
}
|
|
else {
|
|
VStack_108.y = (float)local_c0 - 1.0;
|
|
fVar14 = sin(VStack_108.y * 10.0);
|
|
fVar14 = (fVar14 * 0.02) / ((float)local_c0 * (float)local_c0 * VStack_108.y) + 1.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar14 = cos((float)local_c0 * 3.1415927);
|
|
fVar14 = (1.0 - fVar14) * 0.6;
|
|
}
|
|
local_cc = GHIDRA_CAST<float *>((fVar14 * 180.0 * local_d4->y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar7) + 0x340))));
|
|
local_e0 = GHIDRA_CAST<std_vector *>((fVar14 * 180.0 * local_d4->x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar7) + 0x33c))));
|
|
if (local_d4->x <= 0.0) {
|
|
VStack_108.y = 90.0;
|
|
}
|
|
else {
|
|
VStack_108.y = -90.0;
|
|
}
|
|
VStack_108.y = VStack_108.y * 0.017453292;
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(cos(VStack_108.y));
|
|
fVar14 = sin(VStack_108.y);
|
|
VStack_108.y = (float)local_c8 * local_d4->x;
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(((float)local_c8 * local_d4->y + fVar14 * local_d4->x));
|
|
VStack_108.y = VStack_108.y - fVar14 * local_d4->y;
|
|
if ((float)local_c0 == 0.0) {
|
|
fVar14 = 1.0;
|
|
}
|
|
else {
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(((float)local_c0 * 10.0));
|
|
fVar14 = sin((float)local_c0);
|
|
fVar14 = fVar14 / (float)local_c0;
|
|
}
|
|
fVar13 = (local_e8->_pos).y;
|
|
(local_e8->_velocity).x =
|
|
((float)local_e0 + fVar14 * 20.0 * VStack_108.y) - (local_e8->_pos).x;
|
|
(local_e8->_velocity).y = ((float)local_cc + fVar14 * 20.0 * (float)local_c8) - fVar13;
|
|
sprite = local_e8;
|
|
}
|
|
else {
|
|
local_dc = sprite->_speedMultiplier * 0.5 + sprite->_updateTime;
|
|
}
|
|
local_e0 = (std_vector *)
|
|
((sprite->_targetPosition).x * 233.99998 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x33c)));
|
|
local_cc = GHIDRA_CAST<float *>(((sprite->_targetPosition).y * 233.99998 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x340))));
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(&local_11c);
|
|
if (isInterpolated == 0) {
|
|
local_11c.y = sprite->_speedMultiplier * (sprite->_velocity).y + (sprite->_pos).y;
|
|
local_11c.x = sprite->_speedMultiplier * (sprite->_velocity).x + (sprite->_pos).x;
|
|
}
|
|
else {
|
|
local_11c.y = sprite->_speedMultiplier * (sprite->_velocity).y * 0.5 + (sprite->_pos).y;
|
|
local_11c.x = sprite->_speedMultiplier * (sprite->_velocity).x * 0.5 + (sprite->_pos).x;
|
|
}
|
|
uVar10 = 1;
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4]) * 4));
|
|
*ropePointCount = local_d0;
|
|
ropePointCount[1] = (float)local_d8;
|
|
ropePointCount[2] = -13.0;
|
|
uVar9 = puVar3[5];
|
|
if (1 < uVar9) {
|
|
do {
|
|
dVar19 = (double)GHIDRA_INT(uVar10);
|
|
cordSegment = GHIDRA_INT(uVar10) >> 0x1f;
|
|
local_f4.y = (float)puVar3[4];
|
|
uVar9 = GHIDRA_INT(local_f4.y) + uVar10;
|
|
uVar10 = uVar10 + 1;
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(((float)(dVar19 + __uint_to_double_fixup[-cordSegment]) /
|
|
(float)((double)(puVar3[5] + -1) +
|
|
__uint_to_double_fixup[-(puVar3[5] + -1 >> 0x1f)])));
|
|
fVar14 = 1.0 - (float)local_c8;
|
|
VStack_108.y = (fVar14 * -13.0 + (float)local_c8 * -15.0) * fVar14;
|
|
*ropePointCount =
|
|
(local_11c.x * (float)local_c8 + local_d0 * fVar14) * (float)local_c8 +
|
|
((float)local_e0 * (float)local_c8 + local_d0 * fVar14) * fVar14;
|
|
ropePointCount[2] =
|
|
VStack_108.y + (fVar14 * -13.0 + (float)local_c8 * -20.0) * (float)local_c8;
|
|
ropePointCount[1] =
|
|
(local_11c.y * (float)local_c8 + (float)local_d8 * fVar14) * (float)local_c8 +
|
|
((float)local_cc * (float)local_c8 + (float)local_d8 * fVar14) * fVar14;
|
|
uVar9 = puVar3[5];
|
|
} while (uVar10 < uVar9);
|
|
sprite = local_e8;
|
|
}
|
|
local_d8 = GHIDRA_CAST<Vector *>(0x1);
|
|
if (1 < uVar9) {
|
|
uVar9 = puVar3[5];
|
|
do {
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4] + GHIDRA_INT(local_d8)) * 4));
|
|
local_f4.y = (float)puVar3[4];
|
|
pfVar5 = *(float **)
|
|
(puVar3[2] + (GHIDRA_INT(local_f4.y) + (GHIDRA_INT(local_d8) - 1U) & puVar3[3] - 1) * 4);
|
|
VStack_108.y = *ropePointCount - *pfVar5;
|
|
local_e0 = GHIDRA_CAST<std_vector *>((ropePointCount[1] - pfVar5[1]));
|
|
if ((VStack_108.y != g_vectorZero.x) || ((float)local_e0 != g_vectorZero.y)) {
|
|
local_d0 = cos(1.5707964);
|
|
fVar14 = sin(1.5707964);
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>((local_d0 * VStack_108.y - fVar14 * (float)local_e0));
|
|
local_d0 = local_d0 * (float)local_e0 + fVar14 * VStack_108.y;
|
|
fVar14 = sqrtf((float)local_c0 * (float)local_c0 + local_d0 * local_d0);
|
|
if (0.0 < fVar14) {
|
|
local_d0 = local_d0 * (1.0 / fVar14);
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(((float)local_c0 * (1.0 / fVar14)));
|
|
}
|
|
VStack_108.y = 15.0 - local_dc;
|
|
local_e0 = GHIDRA_CAST<std_vector *>(0x0);
|
|
ropePointCount = &VStack_108.y;
|
|
if ((local_dc - 6.0) * VStack_108.y * 0.5 <= 0.0) {
|
|
ropePointCount = GHIDRA_CAST<float *>(&local_e0);
|
|
}
|
|
local_e0 = GHIDRA_CAST<std_vector *>(0x0);
|
|
pfVar5 = &VStack_108.y;
|
|
if (VStack_108.y <= 0.0) {
|
|
pfVar5 = GHIDRA_CAST<float *>(&local_e0);
|
|
}
|
|
fVar14 = ((float)((double)GHIDRA_INT((uVar9 - GHIDRA_INT(local_d8))) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT((uVar9 - GHIDRA_INT(local_d8))) >> 0x1f)]) *
|
|
(*ropePointCount + (float)*ropePointCount)) /
|
|
(float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]);
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(((float)local_c0 * fVar14));
|
|
local_d0 = local_d0 * fVar14;
|
|
fVar14 = (float)((double)GHIDRA_INT(local_d8) + __uint_to_double_fixup[-(GHIDRA_INT(local_d8) >> 0x1f)])
|
|
* (float)*pfVar5 * 0.4;
|
|
fVar14 = sin(((fVar14 + fVar14) * 3.1415927) /
|
|
(float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]));
|
|
local_f4.y = (float)puVar3[4];
|
|
ropePointCount =
|
|
*GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & GHIDRA_INT(local_f4.y) + GHIDRA_INT(local_d8)) * 4));
|
|
ropePointCount[1] = fVar14 * local_d0 + ropePointCount[1];
|
|
*ropePointCount = fVar14 * (float)local_c0 + *ropePointCount;
|
|
ropePointCount[2] = ropePointCount[2] + 0.0;
|
|
uVar9 = puVar3[5];
|
|
}
|
|
local_d8 = GHIDRA_CAST<Vector *>((GHIDRA_INT(local_d8) + 1));
|
|
} while (local_d8 < uVar9);
|
|
sprite = local_e8;
|
|
}
|
|
if (sprite->_updateTime <= 4.0) {
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
player = sprite->_player;
|
|
local_d8 = &sprite->_pos;
|
|
local_154.x = (player->_pos).x;
|
|
local_154.y = (player->_pos).y;
|
|
babyPosX = local_d8->x;
|
|
local_12c.y = (sprite->_pos).y;
|
|
local_c8 = GHIDRA_CAST<ANM2 *>((sprite->_collisionDamage * 3.0));
|
|
local_d0 = 16.0;
|
|
local_124.x = babyPosX;
|
|
local_124.y = local_12c.y;
|
|
local_114 = GHIDRA_CAST<float *>(local_154.x);
|
|
local_fc = GHIDRA_CAST<float *>(local_154.y);
|
|
if (((player->_playerType == 0x20) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x26b,0), bVar2 != 0)) &&
|
|
(cordSegment = sprite->_child, cordSegment != 0)) {
|
|
local_d0 = 1.0;
|
|
do {
|
|
if (30.0 <= local_d0) break;
|
|
cordSegment = *GHIDRA_CAST<int *>((cordSegment + 0x3c0));
|
|
VStack_108.y = local_d0 + 1.0;
|
|
local_e0 = GHIDRA_CAST<std_vector *>(0x41f00000);
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(((float)local_c8 + 3.0));
|
|
ropePointCount = &VStack_108.y;
|
|
if (30.0 <= VStack_108.y) {
|
|
ropePointCount = GHIDRA_CAST<float *>(&local_e0);
|
|
}
|
|
local_d0 = *ropePointCount;
|
|
} while (cordSegment != 0);
|
|
local_d0 = local_d0 + 16.0;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((sprite->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar2 != 0) {
|
|
local_d0 = local_d0 * 1.5;
|
|
}
|
|
(GHIDRA_CAST<Capsule *>((cordCapsule)))->Capsule::constructor2(&local_154,&local_124,local_d0);
|
|
if ((GHIDRA_UINT(g_game->_debugFlags) >> 5 & 1) != 0) {
|
|
pvVar7 = (GHIDRA_CAST<DebugRenderer *>((GHIDRA_CAST<DebugRenderer *>(&g_game->_debugRenderer))))->DebugRenderer::Get(sprite->_index,1);
|
|
(GHIDRA_CAST<Capsule *>((GHIDRA_CAST<Capsule *>(&local_20c))))->Capsule::constructor2(&local_154,&local_124,local_d0);
|
|
push_shape_points(pvVar7,capsule);
|
|
}
|
|
local_c0 = g_game->_room;
|
|
local_d0 = 18.0;
|
|
local_124.y = 0.0;
|
|
local_124.x = 0.0;
|
|
VStack_108.x = 0.0;
|
|
VStack_108.y = 0.0;
|
|
(GHIDRA_CAST<Capsule *>((cordCapsule)))->Capsule::get_bounding_box(&local_124,&VStack_108);
|
|
baby = local_e8;
|
|
fVar14 = (float)GHIDRA_INT(((local_124.x - 40.0) / 40.0 + 0.5));
|
|
local_dc = 0.0;
|
|
if (0 < GHIDRA_INT(fVar14)) {
|
|
local_dc = fVar14;
|
|
}
|
|
piVar8 = GHIDRA_CAST<int *>(GHIDRA_INT(((local_124.y - 120.0) / 40.0 + 0.5)));
|
|
local_f8 = GHIDRA_CAST<Vector *>(GHIDRA_CAST<int *>(0x0));
|
|
if (0 < GHIDRA_INT(piVar8)) {
|
|
local_f8 = GHIDRA_CAST<Vector *>(piVar8);
|
|
}
|
|
local_e0 = GHIDRA_CAST<std_vector *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_c0)) + 0xc)))) + -1));
|
|
psVar11 = GHIDRA_CAST<std_vector *>(GHIDRA_INT(((VStack_108.x - 40.0) / 40.0 + 0.5)));
|
|
if (GHIDRA_INT(psVar11) < GHIDRA_INT(local_e0)) {
|
|
local_e0 = psVar11;
|
|
}
|
|
fVar14 = (float)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_c0)) + 0x10)))) + -1);
|
|
fVar13 = (float)GHIDRA_INT(((VStack_108.y - 120.0) / 40.0 + 0.5));
|
|
if (GHIDRA_INT(fVar13) < GHIDRA_INT(fVar14)) {
|
|
fVar14 = fVar13;
|
|
}
|
|
VStack_108.y = fVar14;
|
|
pEVar12 = local_c0;
|
|
if (GHIDRA_INT(local_dc) <= GHIDRA_INT(local_e0)) {
|
|
do {
|
|
local_e4 = GHIDRA_CAST<int *>(local_f8);
|
|
fVar13 = local_dc;
|
|
pVVar4 = local_f8;
|
|
if (GHIDRA_INT(local_f8) <= GHIDRA_INT(fVar14)) {
|
|
do {
|
|
if ((((GHIDRA_INT(fVar13) < 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar12)) + 0xc)))) <= GHIDRA_INT(fVar13))) ||
|
|
(GHIDRA_INT(pVVar4) < 0)) ||
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar12)) + 0x10)))) <= GHIDRA_INT(pVVar4) ||
|
|
(cordSegment = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar12)) + 0xc)))) * GHIDRA_INT(pVVar4) + GHIDRA_INT(fVar13),
|
|
cordSegment < 0)))) {
|
|
local_c4 = GHIDRA_CAST<Vector *>(0x0);
|
|
}
|
|
else {
|
|
local_c4 = *(Vector **)
|
|
(GHIDRA_INT((&(pEVar12->_sprite)._filename + -2)) + 0xc + cordSegment * 4);
|
|
}
|
|
if (local_c4 != GHIDRA_CAST<Vector *>(0x0)) {
|
|
cordSegment = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
local_124.x = (float)(GHIDRA_INT(local_c4[4].y) % cordSegment) * 40.0 + 40.0;
|
|
local_124.y = (float)(GHIDRA_INT(local_c4[4].y) / cordSegment) * 40.0 + 120.0;
|
|
local_e4 = GHIDRA_CAST<int *>(pVVar4);
|
|
(GHIDRA_CAST<Capsule *>((gridCapsule)))->Capsule::constructor(&local_124,&g_vectorOne,0.0,20.0);
|
|
bVar2 = Capsule::Collide(gridCapsule,cordCapsule,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar2 != 0) {
|
|
vfn = *(code **)(GHIDRA_CAST<char *>(local_c4->x) + 0x10);
|
|
(GHIDRA_CAST<EntityRef *>((&local_20c)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(baby));
|
|
(*vfn)(1);
|
|
pVVar4 = GHIDRA_CAST<Vector *>(local_e4);
|
|
}
|
|
fVar13 = local_dc;
|
|
pEVar12 = local_c0;
|
|
}
|
|
pVVar4 = GHIDRA_CAST<Vector *>((GHIDRA_INT(pVVar4) + 1));
|
|
fVar14 = VStack_108.y;
|
|
local_e4 = GHIDRA_CAST<int *>(pVVar4);
|
|
} while (GHIDRA_INT(pVVar4) <= GHIDRA_INT(VStack_108.y));
|
|
}
|
|
local_dc = (float)(GHIDRA_INT(fVar13) + 1);
|
|
} while (GHIDRA_INT(local_dc) <= GHIDRA_INT(local_e0));
|
|
}
|
|
local_124.y = (float)(local_ec + 0x4c);
|
|
maskedFlags = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(shieldedMask),GHIDRA_CAST<BitSet128 *>(local_124.y),&g_tearFlagShielded)
|
|
;
|
|
if ((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
|
|
(uVar9 = 0x1c, GHIDRA_INT(maskedFlags->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) != 0)) {
|
|
uVar9 = 0x1e;
|
|
}
|
|
local_cc = GHIDRA_CAST<float *>(0x49742400);
|
|
local_11c.y = 0.0;
|
|
local_11c.x = 0.0;
|
|
local_b9 = '\0';
|
|
EntityList::query_player_capsule_hits
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&capsuleHits,cordCapsule,uVar9);
|
|
ehState = 4;
|
|
local_c4 = GHIDRA_CAST<Vector *>(0x0);
|
|
if (capsuleHits._size != 0) {
|
|
do {
|
|
pEVar12 = *GHIDRA_CAST<Entity_Projectile **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(capsuleHits)) + 0x4))) + GHIDRA_INT(local_c4) * 4));
|
|
local_c0 = pEVar12;
|
|
if ((pEVar12->_size == 0.0) || (pEVar12->_entityCollisionClass == 0)) goto LAB_004345ff;
|
|
bloodEffect = GHIDRA_CAST<Entity *>(local_e8->_child);
|
|
if (bloodEffect != GHIDRA_CAST<Entity *>(0x0)) {
|
|
do {
|
|
g_forceCollideDepth = g_forceCollideDepth + 1;
|
|
entity_collision_classes_match(bloodEffect,GHIDRA_CAST<Entity *>(pEVar12));
|
|
g_forceCollideDepth = g_forceCollideDepth + -1;
|
|
bloodEffect = GHIDRA_CAST<Entity *>(bloodEffect->_child);
|
|
} while (bloodEffect != GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
baby = local_e8;
|
|
local_f8 = GHIDRA_CAST<Vector *>(&pEVar12->_type);
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (*GHIDRA_CAST<int *>(local_f8) != 1)) {
|
|
cordSegment = *GHIDRA_CAST<int *>(local_f8);
|
|
if (cordSegment - 10U < 0x3de) goto LAB_004344ed;
|
|
LAB_00434a9f:
|
|
if (cordSegment == 4) {
|
|
if ((((void *)pEVar12->_parent == local_e8->_player) &&
|
|
((char)pEVar12->_wiggleFrameOffset != '\0')) &&
|
|
(ropePointCount = &(pEVar12->_posOffset).y,
|
|
!(0.0 < *ropePointCount || *ropePointCount == 0.0))) goto LAB_00434c47;
|
|
psVar11 = &local_e8->_hitList;
|
|
local_e0 = psVar11;
|
|
local_e4 = GHIDRA_CAST<int *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity)::GetHitListIndex();
|
|
puVar1 = (baby->_hitList)._end;
|
|
puVar3 = psVar11->_begin;
|
|
VStack_108.y = (float)puVar1;
|
|
uVar9 = GHIDRA_INT(puVar1) - GHIDRA_INT(puVar3) >> 2;
|
|
if (0 < GHIDRA_INT(uVar9)) {
|
|
do {
|
|
uVar10 = uVar9 >> 1;
|
|
if (GHIDRA_CAST<uint8_t *>(puVar3[uVar10]) < local_e4) {
|
|
puVar3 = puVar3 + uVar10 + 1;
|
|
uVar10 = uVar9 + (-1 - uVar10);
|
|
}
|
|
uVar9 = uVar10;
|
|
} while (0 < GHIDRA_INT(uVar10));
|
|
pEVar12 = local_c0;
|
|
}
|
|
if ((puVar3 == puVar1) || (GHIDRA_CAST<int *>(*puVar3) != local_e4)) {
|
|
FUN_00431620();
|
|
bombPos.x = (pEVar12->_pos).x;
|
|
bombPos.y = (pEVar12->_pos).y;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&bombPos)))->Vector::__sub(&bombOffset,&local_154);
|
|
(GHIDRA_CAST<Vector *>((pVVar4)))->Vector::Normalized(&bombPushDir);
|
|
bVar2 = 0;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&bombPushDir)))->Vector::__mul(&bombPush,&local_d0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity::AddVelocity_divided(pVVar4,bVar2);
|
|
}
|
|
}
|
|
else if (cordSegment == 9) {
|
|
if (local_e8->_player != (void *)0x0) {
|
|
if (pEVar12->_dead != 0) goto LAB_00434c47;
|
|
if (-50.0 < pEVar12->_height) {
|
|
projectilePos.x = (pEVar12->_pos).x;
|
|
projectilePos.y = (pEVar12->_pos).y;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&projectilePos)))->Vector::__sub(&projectileOffset,&local_154);
|
|
(GHIDRA_CAST<Vector *>((pVVar4)))->Vector::Normalized(&reflectDir);
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&reflectDir)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_184 + 4)),&local_d0);
|
|
(GHIDRA_CAST<Entity_Projectile *>((pEVar12)))->Entity_Projectile::Reflect(unused,pVVar4);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LAB_00434c47:
|
|
if ((local_e8->_player == (void *)0x0) || (cordSegment != 2)) {
|
|
if (((cordSegment == 5) &&
|
|
(((pEVar12->_variant != 100 && (pEVar12[1]._sprite._animData == (void *)0x0)) &&
|
|
(pEVar12->_dead == 0)))) &&
|
|
(((pEVar12->_entityCollisionClass != 0 &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity::HasEntityFlags(0x4000000), bVar2 == 0)) &&
|
|
(bVar2 = EntityList::HitListContains
|
|
(GHIDRA_CAST<EntityList *>(&baby->_hitList),GHIDRA_CAST<Entity *>(pEVar12)), bVar2 == 0))
|
|
)) {
|
|
FUN_00431620();
|
|
pickupPos.x = (pEVar12->_pos).x;
|
|
pickupPos.y = (pEVar12->_pos).y;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&pickupPos)))->Vector::__sub(&local_148,local_d8);
|
|
(GHIDRA_CAST<Vector *>((pVVar4)))->Vector::Normalized(&local_f4);
|
|
bVar2 = 0;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&local_f4)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_13c + 4)),&local_d0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity::AddVelocity_divided(pVVar4,bVar2);
|
|
}
|
|
}
|
|
else if ((void *)pEVar12->_parent == local_e8->_player) {
|
|
tearFlags0 = pEVar12->_curvingStrength;
|
|
tearFlags1 = pEVar12->_acceleration;
|
|
VStack_108.x = pEVar12->_orbitDistance;
|
|
VStack_108.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar12)) + 0x434))));
|
|
maskedFlags = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(&anm2Path) + 8)),GHIDRA_CAST<BitSet128 *>(&tearFlags0),
|
|
&g_tearFlagLudovico);
|
|
bVar2 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
|
|
if ((bVar2 != 0) &&
|
|
(bVar2 = EntityList::HitListContains
|
|
(GHIDRA_CAST<EntityList *>(&baby->_hitList),GHIDRA_CAST<Entity *>(pEVar12)), bVar2 == 0))
|
|
{
|
|
FUN_00431620();
|
|
tearPos.x = (pEVar12->_pos).x;
|
|
tearPos.y = (pEVar12->_pos).y;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&tearPos)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_178 + 4)),local_d8);
|
|
(GHIDRA_CAST<Vector *>((pVVar4)))->Vector::Normalized(&tearPushDir);
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&tearPushDir)))->Vector::__mul(&local_15c,&local_d0);
|
|
VStack_108.y = 1.25;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((pVVar4)))->Vector::__mul(&local_168,&VStack_108.y);
|
|
(pEVar12->_velocity).x = pVVar4->x;
|
|
(pEVar12->_velocity).y = pVVar4->y;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
cordSegment = 1;
|
|
LAB_004344ed:
|
|
if ((pEVar12->_flags & 0x20000000) != 0) goto LAB_00434a9f;
|
|
local_e4 = GHIDRA_CAST<int *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity)::GetHitListIndex();
|
|
local_e0 = (baby->_hitList)._end;
|
|
puVar3 = (baby->_hitList)._begin;
|
|
uVar9 = GHIDRA_INT(local_e0) - GHIDRA_INT(puVar3) >> 2;
|
|
if (0 < GHIDRA_INT(uVar9)) {
|
|
do {
|
|
uVar10 = uVar9 >> 1;
|
|
puVar1 = puVar3 + uVar10;
|
|
if (GHIDRA_CAST<uint8_t *>(*puVar1) < local_e4) {
|
|
puVar3 = puVar1 + 1;
|
|
uVar10 = uVar9 + (-1 - uVar10);
|
|
puVar1 = puVar3;
|
|
}
|
|
VStack_108.y = (float)puVar1;
|
|
uVar9 = uVar10;
|
|
} while (0 < GHIDRA_INT(uVar10));
|
|
baby = local_e8;
|
|
pEVar12 = local_c0;
|
|
}
|
|
if ((GHIDRA_CAST<std_vector *>(puVar3) == local_e0) || (GHIDRA_CAST<int *>(*puVar3) != local_e4)) {
|
|
cordSegment = *GHIDRA_CAST<int *>(local_f8);
|
|
if ((cordSegment != 0xf5) && (cordSegment != 0x124)) {
|
|
uVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(&baby->_hitList,uVar9);
|
|
cordSegment = pEVar12->_type;
|
|
}
|
|
if (cordSegment == 0x21) {
|
|
if (pEVar12->_variant == 0xb) {
|
|
LAB_00434715:
|
|
if (pEVar12->_dead == 0) {
|
|
local_e4 = GHIDRA_CAST<int *>(((pEVar12->_pos).x - (float)local_114));
|
|
local_f8 = GHIDRA_CAST<Vector *>(((pEVar12->_pos).y - (float)local_fc));
|
|
fVar14 = sqrtf((float)local_e4 * (float)local_e4 +
|
|
(float)local_f8 * (float)local_f8);
|
|
piVar8 = local_e4;
|
|
pVVar4 = local_f8;
|
|
if (0.0 < fVar14) {
|
|
pVVar4 = GHIDRA_CAST<Vector *>(((float)local_f8 * (1.0 / fVar14)));
|
|
piVar8 = GHIDRA_CAST<int *>(((float)local_e4 * (1.0 / fVar14)));
|
|
}
|
|
if ((pEVar12->_flags & 0x4000000) == 0) {
|
|
fVar13 = 900.0 / (pEVar12->_mass + 50.0);
|
|
fVar14 = pEVar12->_friction;
|
|
if (fVar14 != 0.0) {
|
|
fVar15 = pEVar12->_speedMultiplier;
|
|
(pEVar12->_velocity).x =
|
|
(fVar13 * (float)piVar8 * fVar15) / fVar14 + (pEVar12->_velocity).x;
|
|
(pEVar12->_velocity).y =
|
|
(fVar13 * (float)pVVar4 * fVar15) / fVar14 + (pEVar12->_velocity).y;
|
|
}
|
|
}
|
|
VStack_108.x = 0.0;
|
|
VStack_108.y = 0.0;
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar2 == 0) ||
|
|
(((bVar2 = (GHIDRA_CAST<Entity_Player *>((baby->_player)))->Entity_Player::HasPlayerForm(0), bVar2 == 0 &&
|
|
((bVar2 = (GHIDRA_CAST<Entity_Player *>((baby->_player)))->Entity_Player::HasCollectible(0x97,0), bVar2 == 0 ||
|
|
(uVar9 = Random(), uVar9 % 6 != 0)))) ||
|
|
(0x1d < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(baby->_player) + 0x136c)))))) {
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(VStack_108.y);
|
|
local_dc = VStack_108.x;
|
|
}
|
|
else {
|
|
local_dc = 2.29589e-41;
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(0x0);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(baby))))->Entity::HasEntityFlags(0x400000000);
|
|
if (bVar2 != 0) {
|
|
local_dc = (float)(GHIDRA_UINT(local_dc) | 0x20000000);
|
|
}
|
|
vfn = *(code **)(*GHIDRA_CAST<int *>(pEVar12) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&local_20c)))->EntityRef::constructor(local_e8->_player);
|
|
isDamaged = (*vfn)(local_c8,local_dc,local_c0,&local_20c);
|
|
if (isDamaged == '\0') {
|
|
LAB_004349aa:
|
|
pVVar4 = local_d8;
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar12))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
manager = g_manager;
|
|
if (bVar2 == 0) goto LAB_004349aa;
|
|
local_e4 = GHIDRA_CAST<int *>(0x4d);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_e4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_e4),1.0,10,0,1.5,0.0);
|
|
pVVar4 = local_d8;
|
|
Entity_Tear::ApplyTearFlagEffects
|
|
(GHIDRA_CAST<Entity *>(pEVar12),local_d8,*GHIDRA_CAST<BitSet128 *>(local_124.y),
|
|
GHIDRA_CAST<Entity *>(local_e8),(float)local_c8);
|
|
}
|
|
if ((pEVar12->_pendingDamage < pEVar12->_health) &&
|
|
(*GHIDRA_CAST<char *>((local_ec + 0x50)) == '\0')) {
|
|
*GHIDRA_CAST<uint8_t *>((local_ec + 0x50)) = 1;
|
|
}
|
|
fVar15 = babyPosX - (float)local_114;
|
|
fVar17 = local_12c.y - (float)local_fc;
|
|
fVar13 = ((pEVar12->_pos).y - (float)local_fc) * fVar17 +
|
|
((pEVar12->_pos).x - (float)local_114) * fVar15;
|
|
fVar14 = fVar17 * fVar17 + fVar15 * fVar15;
|
|
fVar15 = (fVar15 * fVar13) / fVar14 + (float)local_114;
|
|
fVar17 = (fVar17 * fVar13) / fVar14 + (float)local_fc;
|
|
fVar14 = pVVar4->x - fVar15;
|
|
fVar13 = pVVar4->y - fVar17;
|
|
ropePointCount = GHIDRA_CAST<float *>((fVar13 * fVar13 + fVar14 * fVar14));
|
|
if ((float)ropePointCount < (float)local_cc) {
|
|
local_11c.x = fVar15;
|
|
local_11c.y = fVar17;
|
|
local_cc = ropePointCount;
|
|
}
|
|
local_b9 = '\x01';
|
|
}
|
|
}
|
|
else {
|
|
vfn = *(code **)(*GHIDRA_CAST<int *>(pEVar12) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&local_20c)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(local_e8->_parent));
|
|
(*vfn)(0x447a0000,0,0,&local_20c);
|
|
}
|
|
}
|
|
else if (cordSegment == 0x3c3) {
|
|
piVar8 = baby->_player;
|
|
g_forceCollideDepth = g_forceCollideDepth + 1;
|
|
(**(code **)(*piVar8 + 0x5c))(pEVar12);
|
|
pEVar12->HandleCollision(piVar8,0);
|
|
g_forceCollideDepth = g_forceCollideDepth + -1;
|
|
}
|
|
else if (cordSegment != 0x11) goto LAB_00434715;
|
|
}
|
|
}
|
|
LAB_004345ff:
|
|
local_c4 = GHIDRA_CAST<Vector *>((GHIDRA_INT(local_c4) + 1));
|
|
} while (local_c4 < GHIDRA_UINT(capsuleHits._size));
|
|
if ((local_b9 != '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_ec) + 0x141)) == '\0')) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_ec) + 0x141)) = 1;
|
|
play_sound_with_fart_seed(0x1ef,1.0,2,0,1.0);
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&local_11c)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar2 != 0) {
|
|
uVar9 = Random();
|
|
local_12c.y = 6.0;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((local_d4)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_13c + 4)),&local_12c.y);
|
|
bloodEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,&local_11c,pVVar4,GHIDRA_CAST<Entity *>(0x0),2,uVar9);
|
|
cordSegment = *GHIDRA_CAST<int *>(bloodEffect);
|
|
(bloodEffect->_posOffset).x = 0.0;
|
|
(bloodEffect->_posOffset).y = -15.0;
|
|
(**(code **)(cordSegment + 0xc))();
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((&capsuleHits)))->EntityList_Query::~EntityList_Query();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
if (((0 < sprite->_state) && (sprite->_headFrameDelay < 1)) && (20.0 < sprite->_updateTime)) {
|
|
if (sprite->_state == 1) {
|
|
fVar14 = (sprite->_pos).y;
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x340));
|
|
puVar3[0x52] = (sprite->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x33c));
|
|
puVar3[0x53] = fVar14 - fVar13;
|
|
}
|
|
local_cc = GHIDRA_CAST<float *>((sprite->_speedMultiplier * 10.0));
|
|
fVar14 = atan2f((float)puVar3[0x53],(float)puVar3[0x52]);
|
|
fVar14 = approach_angle((float)puVar3[0x55],fVar14 * 57.295776,(float)local_cc);
|
|
puVar3[0x55] = fVar14;
|
|
sprite->_state = 2;
|
|
if (isInterpolated == 0) {
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(((float)puVar3[0x51] - sprite->_speedMultiplier));
|
|
puVar3[0x51] = local_c8;
|
|
}
|
|
else {
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(((float)puVar3[0x51] - sprite->_speedMultiplier * 0.5));
|
|
}
|
|
local_fc = GHIDRA_CAST<float *>((((float)local_c8 - 0.0) / 5.0));
|
|
if ((float)local_fc <= 0.0) {
|
|
local_fc = GHIDRA_CAST<float *>(0x0);
|
|
}
|
|
if (1.0 <= (float)local_fc) {
|
|
local_fc = GHIDRA_CAST<float *>(0x3f800000);
|
|
}
|
|
fVar14 = (float)local_fc + 0.0;
|
|
fVar14 = (1.0 - fVar14) * fVar14 + fVar14;
|
|
local_e4 = GHIDRA_CAST<int *>((fVar14 * (float)puVar3[0x53] + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x340))));
|
|
local_114 = GHIDRA_CAST<float *>((fVar14 * (GHIDRA_CAST<Vector *>((puVar3 + 0x52)))->x +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sprite->_player) + 0x33c))));
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((puVar3 + 0x52)))))->Vector::Normalized(&local_f4);
|
|
local_cc = GHIDRA_CAST<float *>(cos(1.5707964));
|
|
fVar15 = sin(1.5707964);
|
|
baby = local_e8;
|
|
fVar14 = pVVar4->x;
|
|
fVar13 = pVVar4->y;
|
|
fVar18 = 1.0;
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4]) * 4));
|
|
ropePointCount[2] = -13.0;
|
|
fVar17 = fVar13 * (float)local_cc;
|
|
local_cc = GHIDRA_CAST<float *>((fVar14 * (float)local_cc - fVar13 * fVar15));
|
|
*ropePointCount = local_d0;
|
|
local_ec = GHIDRA_CAST<uint32_t *>((fVar17 + fVar14 * fVar15));
|
|
ropePointCount[1] = (float)local_d8;
|
|
local_c0 = (Entity_Projectile *)
|
|
Math::timescale_factor(1.0 - (float)local_fc * 0.8,local_e8->_speedMultiplier);
|
|
local_d4 = GHIDRA_CAST<Vector *>(0x1);
|
|
if (1 < GHIDRA_UINT(puVar3[5])) {
|
|
local_fc = GHIDRA_CAST<float *>(((5.0 - (float)local_c8) * 4.0));
|
|
local_dc = fVar18 - (float)local_c0;
|
|
do {
|
|
local_d8 = (Vector *)
|
|
((float)((double)GHIDRA_INT(local_d4) + __uint_to_double_fixup[-(GHIDRA_INT(local_d4) >> 0x1f)]
|
|
) /
|
|
(float)((double)(puVar3[5] + -1) +
|
|
__uint_to_double_fixup[-(puVar3[5] + -1 >> 0x1f)]));
|
|
local_c4 = GHIDRA_CAST<Vector *>((fVar18 - (float)local_d8));
|
|
local_f8 = (Vector *)
|
|
((float)local_114 * (float)local_d8 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(baby->_player) + 0x33c)) * (float)local_c4);
|
|
local_d0 = (float)local_e4 * (float)local_d8 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(baby->_player) + 0x340)) * (float)local_c4;
|
|
fVar14 = sin(((float)local_d8 * (float)local_c8 + (float)local_d8 * (float)local_c8) *
|
|
3.1415927);
|
|
ropePointCount = &local_d4->x;
|
|
local_d4 = GHIDRA_CAST<Vector *>((GHIDRA_INT(&local_d4->x) + 1));
|
|
ropePointCount =
|
|
*GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & GHIDRA_INT(ropePointCount) + puVar3[4]) * 4));
|
|
fVar18 = 1.0;
|
|
*ropePointCount =
|
|
(fVar14 * (float)local_cc * (float)local_fc + (float)local_f8) * (float)local_c0 +
|
|
local_dc * *ropePointCount;
|
|
ropePointCount[1] =
|
|
(fVar14 * (float)local_ec * (float)local_fc + local_d0) * (float)local_c0 +
|
|
local_dc * ropePointCount[1];
|
|
ropePointCount[2] =
|
|
((float)local_d8 * -20.0 - (float)local_c4 * 15.0) * (float)local_c0 +
|
|
local_dc * ropePointCount[2];
|
|
} while (local_d4 < GHIDRA_CAST<Vector *>(puVar3[5]));
|
|
}
|
|
(baby->_velocity).x = g_vectorZero.x;
|
|
(baby->_velocity).y = g_vectorZero.y;
|
|
ropePointCount = GHIDRA_CAST<float *>(UmbilicalBabyData)::last_point();
|
|
(baby->_pos).x = *ropePointCount;
|
|
(baby->_pos).y = ropePointCount[1];
|
|
if (!(0.0 < (float)puVar3[0x51] || (float)puVar3[0x51] == 0.0)) {
|
|
baby->Remove();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
cordSegment = puVar3[5];
|
|
local_c4 = GHIDRA_CAST<Vector *>(sprite->_speedMultiplier);
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
local_ec = (uint32_t *)
|
|
(90.0 / (float)((double)cordSegment + __uint_to_double_fixup[-(cordSegment >> 0x1f)]));
|
|
ropePointCount = GHIDRA_CAST<float *>(0x0);
|
|
if (cordSegment != 0) {
|
|
do {
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[4] + GHIDRA_INT(local_c8) & puVar3[3] - 1) * 4));
|
|
local_13c = *(uint8_t (*) [8])(ropePointCount + 3);
|
|
local_134 = ropePointCount[5];
|
|
ropePointCount[6] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_13c)) + 0x0)));
|
|
ropePointCount[7] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_13c)) + 0x4)));
|
|
ropePointCount[8] = local_134;
|
|
cordSegment = puVar3[4];
|
|
if (local_c8 < GHIDRA_CAST<float *>((puVar3[5] - 1))) {
|
|
local_d4 = *GHIDRA_CAST<Vector **>((puVar3[2] + (cordSegment + 1 + GHIDRA_INT(local_c8) & puVar3[3] - 1) * 4));
|
|
cordSegment = puVar3[4];
|
|
}
|
|
else {
|
|
local_d4 = &DAT_00c79c58;
|
|
}
|
|
if (local_c8 == GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
pVVar4 = &DAT_00c79c58;
|
|
}
|
|
else {
|
|
pVVar4 = *GHIDRA_CAST<Vector **>((puVar3[2] + (cordSegment + -1 + GHIDRA_INT(local_c8) & puVar3[3] - 1) * 4));
|
|
}
|
|
pfVar5 = umbilical_rope_force
|
|
(&local_14c,ropePointCount,ropePointCount + 3,&pVVar4->x,&local_d4->x,
|
|
(float)local_ec);
|
|
local_c8 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_c8) + 1));
|
|
ropePointCount[0x12] = *pfVar5;
|
|
ropePointCount[0x13] = pfVar5[1];
|
|
ropePointCount[0x14] = pfVar5[2];
|
|
ropePointCount = GHIDRA_CAST<float *>(puVar3[5]);
|
|
} while (local_c8 < ropePointCount);
|
|
}
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(0x0);
|
|
uVar9 = 0;
|
|
if (ropePointCount != GHIDRA_CAST<float *>(0x0)) {
|
|
do {
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[4] + GHIDRA_INT(local_c0) & puVar3[3] - 1) * 4));
|
|
ropePointCount[9] = (float)local_c4 * ropePointCount[0x12] * 0.5 + ropePointCount[3];
|
|
ropePointCount[10] = (float)local_c4 * ropePointCount[0x13] * 0.5 + ropePointCount[4];
|
|
ropePointCount[0xb] = (float)local_c4 * ropePointCount[0x14] * 0.5 + ropePointCount[5];
|
|
if (local_c0 < puVar3[5] - 1) {
|
|
pfVar5 = *GHIDRA_CAST<float **>((puVar3[2] + (GHIDRA_INT(local_c0) + 1U + puVar3[4] & puVar3[3] - 1) * 4));
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[4] + GHIDRA_INT(local_c0) + 1U & puVar3[3] - 1) * 4));
|
|
local_d4 = GHIDRA_CAST<Vector *>(local_13c);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x4))) = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x1c)) * 0.5 + pfVar5[1];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x0))) = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x18)) * 0.5 + *pfVar5;
|
|
local_134 = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x20)) * 0.5 + pfVar5[2];
|
|
}
|
|
else {
|
|
local_d4 = GHIDRA_CAST<Vector *>(local_178);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_178)) + 0x0))) = DAT_00c79c58.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_178)) + 0x4))) = DAT_00c79c58.y;
|
|
local_170 = DAT_00c79c60;
|
|
}
|
|
if (local_c0 == GHIDRA_CAST<Entity_Projectile *>(0x0)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_184)) + 0x0))) = DAT_00c79c58.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_184)) + 0x4))) = DAT_00c79c58.y;
|
|
pfVar5 = GHIDRA_CAST<float *>(local_184);
|
|
local_17c = DAT_00c79c60;
|
|
}
|
|
else {
|
|
uVar9 = GHIDRA_INT(local_c0) + puVar3[4] + -1;
|
|
prevPoint = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
local_148.x = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x1c)) * 0.5 + prevPoint[1];
|
|
local_14c = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x18)) * 0.5 + *prevPoint;
|
|
pfVar5 = &local_14c;
|
|
local_148.y = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x20)) * 0.5 + prevPoint[2];
|
|
}
|
|
local_168.x = (float)local_c4 * ropePointCount[0x13] * 0.5 + ropePointCount[4];
|
|
midVelX = (float)local_c4 * ropePointCount[0x12] * 0.5 + ropePointCount[3];
|
|
local_168.y = (float)local_c4 * ropePointCount[0x14] * 0.5 + ropePointCount[5];
|
|
midPosX = (float)local_c4 * ropePointCount[6] * 0.5 + *ropePointCount;
|
|
local_15c.x = (float)local_c4 * ropePointCount[7] * 0.5 + ropePointCount[1];
|
|
local_15c.y = (float)local_c4 * ropePointCount[8] * 0.5 + ropePointCount[2];
|
|
local_cc = ropePointCount;
|
|
pfVar5 = umbilical_rope_force
|
|
(&ropeForce,&midPosX,&midVelX,pfVar5,&local_d4->x,(float)local_ec);
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>((GHIDRA_INT(local_c0) + 1));
|
|
ropePointCount[0x15] = *pfVar5;
|
|
ropePointCount[0x16] = pfVar5[1];
|
|
ropePointCount[0x17] = pfVar5[2];
|
|
uVar9 = puVar3[5];
|
|
} while (local_c0 < uVar9);
|
|
}
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(0x0);
|
|
uVar10 = 0;
|
|
if (uVar9 != 0) {
|
|
do {
|
|
pVVar4 = *GHIDRA_CAST<Vector **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4] + GHIDRA_INT(local_c0)) * 4));
|
|
fVar14 = pVVar4[0xb].y;
|
|
fVar13 = pVVar4[2].y;
|
|
pVVar4[6].x = (float)local_c4 * pVVar4[10].y * 0.5 + pVVar4[1].y;
|
|
pVVar4[6].y = (float)local_c4 * pVVar4[0xb].x * 0.5 + pVVar4[2].x;
|
|
pVVar4[7].x = (float)local_c4 * fVar14 * 0.5 + fVar13;
|
|
if (local_c0 < puVar3[5] - 1) {
|
|
ropePointCount =
|
|
*GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4] + GHIDRA_INT(local_c0) + 1U) * 4));
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[3] - 1 & GHIDRA_INT(local_c0) + 1U + puVar3[4]) * 4));
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(local_13c);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x4))) = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x28)) * 0.5 + ropePointCount[1]
|
|
;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x0))) = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x24)) * 0.5 + *ropePointCount;
|
|
local_134 = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x2c)) * 0.5 + ropePointCount[2];
|
|
}
|
|
else {
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(local_178);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_178)) + 0x0))) = DAT_00c79c58.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_178)) + 0x4))) = DAT_00c79c58.y;
|
|
local_170 = DAT_00c79c60;
|
|
}
|
|
if (local_c0 == GHIDRA_CAST<Entity_Projectile *>(0x0)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_184)) + 0x0))) = DAT_00c79c58.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_184)) + 0x4))) = DAT_00c79c58.y;
|
|
ropePointCount = GHIDRA_CAST<float *>(local_184);
|
|
local_17c = DAT_00c79c60;
|
|
}
|
|
else {
|
|
uVar9 = GHIDRA_INT(local_c0) + puVar3[4] + -1;
|
|
pfVar5 = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
local_148.x = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x28)) * 0.5 + pfVar5[1];
|
|
local_14c = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x24)) * 0.5 + *pfVar5;
|
|
ropePointCount = &local_14c;
|
|
local_148.y = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x2c)) * 0.5 + pfVar5[2];
|
|
}
|
|
local_168.x = (float)local_c4 * pVVar4[0xb].x * 0.5 + pVVar4[2].x;
|
|
midVelX = (float)local_c4 * pVVar4[10].y * 0.5 + pVVar4[1].y;
|
|
local_168.y = (float)local_c4 * pVVar4[0xb].y * 0.5 + pVVar4[2].y;
|
|
midPosX = (float)local_c4 * pVVar4[4].y * 0.5 + pVVar4->x;
|
|
local_15c.x = (float)local_c4 * pVVar4[5].x * 0.5 + pVVar4->y;
|
|
local_15c.y = (float)local_c4 * pVVar4[5].y * 0.5 + pVVar4[1].x;
|
|
local_d4 = pVVar4;
|
|
ropePointCount =
|
|
umbilical_rope_force
|
|
(&ropeForce,&midPosX,&midVelX,ropePointCount,GHIDRA_CAST<float *>(local_c8),(float)local_ec)
|
|
;
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>((GHIDRA_INT(local_c0) + 1));
|
|
pVVar4[0xc].x = *ropePointCount;
|
|
pVVar4[0xc].y = ropePointCount[1];
|
|
pVVar4[0xd].x = ropePointCount[2];
|
|
uVar10 = puVar3[5];
|
|
} while (local_c0 < uVar10);
|
|
}
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>(0x0);
|
|
uVar9 = 0;
|
|
if (uVar10 != 0) {
|
|
do {
|
|
pVVar4 = *GHIDRA_CAST<Vector **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4] + GHIDRA_INT(local_c0)) * 4));
|
|
fVar14 = pVVar4[0xd].x;
|
|
fVar13 = pVVar4[2].x;
|
|
fVar15 = pVVar4[2].y;
|
|
pVVar4[7].y = (float)local_c4 * pVVar4[0xc].x + pVVar4[1].y;
|
|
pVVar4[8].x = (float)local_c4 * pVVar4[0xc].y + fVar13;
|
|
pVVar4[8].y = (float)local_c4 * fVar14 + fVar15;
|
|
if (local_c0 < puVar3[5] - 1) {
|
|
ropePointCount =
|
|
*GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4] + GHIDRA_INT(local_c0) + 1U) * 4));
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[3] - 1 & GHIDRA_INT(local_c0) + 1U + puVar3[4]) * 4));
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(local_13c);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x4))) = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x34)) + ropePointCount[1];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x0))) = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x30)) + *ropePointCount;
|
|
local_134 = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x38)) + ropePointCount[2];
|
|
}
|
|
else {
|
|
local_c8 = GHIDRA_CAST<ANM2 *>(local_178);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_178)) + 0x0))) = DAT_00c79c58.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_178)) + 0x4))) = DAT_00c79c58.y;
|
|
local_170 = DAT_00c79c60;
|
|
}
|
|
if (local_c0 == GHIDRA_CAST<Entity_Projectile *>(0x0)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_184)) + 0x0))) = DAT_00c79c58.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_184)) + 0x4))) = DAT_00c79c58.y;
|
|
ropePointCount = GHIDRA_CAST<float *>(local_184);
|
|
local_17c = DAT_00c79c60;
|
|
}
|
|
else {
|
|
uVar9 = GHIDRA_INT(local_c0) + puVar3[4] + -1;
|
|
pfVar5 = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
local_148.x = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x34)) + pfVar5[1];
|
|
local_14c = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x30)) + *pfVar5;
|
|
ropePointCount = &local_14c;
|
|
local_148.y = (float)local_c4 * *GHIDRA_CAST<float *>((cordSegment + 0x38)) + pfVar5[2];
|
|
}
|
|
local_168.x = (float)local_c4 * pVVar4[0xc].y + pVVar4[2].x;
|
|
midVelX = (float)local_c4 * pVVar4[0xc].x + pVVar4[1].y;
|
|
local_168.y = (float)local_c4 * pVVar4[0xd].x + pVVar4[2].y;
|
|
midPosX = (float)local_c4 * pVVar4[6].x + pVVar4->x;
|
|
local_15c.x = (float)local_c4 * pVVar4[6].y + pVVar4->y;
|
|
local_15c.y = (float)local_c4 * pVVar4[7].x + pVVar4[1].x;
|
|
local_d4 = pVVar4;
|
|
ropePointCount =
|
|
umbilical_rope_force
|
|
(&ropeForce,&midPosX,&midVelX,ropePointCount,GHIDRA_CAST<float *>(local_c8),(float)local_ec)
|
|
;
|
|
local_c0 = GHIDRA_CAST<Entity_Projectile *>((GHIDRA_INT(local_c0) + 1));
|
|
pVVar4[0xd].y = *ropePointCount;
|
|
pVVar4[0xe].x = ropePointCount[1];
|
|
pVVar4[0xe].y = ropePointCount[2];
|
|
uVar9 = puVar3[5];
|
|
} while (local_c0 < uVar9);
|
|
}
|
|
baby = local_e8;
|
|
uVar10 = 0;
|
|
if (uVar9 != 0) {
|
|
local_c4 = GHIDRA_CAST<Vector *>(((float)local_c4 / 6.0));
|
|
do {
|
|
uVar9 = puVar3[4] + uVar10;
|
|
uVar10 = uVar10 + 1;
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & uVar9) * 4));
|
|
*ropePointCount =
|
|
(float)local_c4 *
|
|
(ropePointCount[9] + ropePointCount[9] + ropePointCount[6] +
|
|
ropePointCount[0xc] + ropePointCount[0xc] + ropePointCount[0xf]) + *ropePointCount;
|
|
ropePointCount[1] =
|
|
(float)local_c4 *
|
|
(ropePointCount[10] + ropePointCount[10] + ropePointCount[7] +
|
|
ropePointCount[0xd] + ropePointCount[0xd] + ropePointCount[0x10]) + ropePointCount[1];
|
|
ropePointCount[2] =
|
|
(ropePointCount[0xb] + ropePointCount[0xb] + ropePointCount[8] +
|
|
ropePointCount[0xe] + ropePointCount[0xe] + ropePointCount[0x11]) * (float)local_c4 +
|
|
ropePointCount[2];
|
|
ropePointCount[3] =
|
|
(float)local_c4 *
|
|
(ropePointCount[0x15] + ropePointCount[0x15] + ropePointCount[0x12] +
|
|
ropePointCount[0x18] + ropePointCount[0x18] + ropePointCount[0x1b]) + ropePointCount[3];
|
|
ropePointCount[4] =
|
|
(float)local_c4 *
|
|
(ropePointCount[0x16] + ropePointCount[0x16] + ropePointCount[0x13] +
|
|
ropePointCount[0x19] + ropePointCount[0x19] + ropePointCount[0x1c]) + ropePointCount[4];
|
|
ropePointCount[5] =
|
|
(ropePointCount[0x17] + ropePointCount[0x17] + ropePointCount[0x14] +
|
|
ropePointCount[0x1a] + ropePointCount[0x1a] + ropePointCount[0x1d]) * (float)local_c4 +
|
|
ropePointCount[5];
|
|
} while (uVar10 < GHIDRA_UINT(puVar3[5]));
|
|
}
|
|
ropePointCount = *GHIDRA_CAST<float **>((puVar3[2] + (puVar3[3] - 1 & puVar3[4]) * 4));
|
|
*ropePointCount = local_d0;
|
|
ropePointCount[1] = (float)local_d8;
|
|
ropePointCount[2] = -13.0;
|
|
cordSegment = *GHIDRA_CAST<int *>((puVar3[2] + (puVar3[4] & puVar3[3] - 1) * 4));
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 0xc)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 0x10)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 0x14)) = 0;
|
|
if (isInterpolated == 0) {
|
|
local_e4 = GHIDRA_CAST<int *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_e8->_player) + 0x340)) - (local_e8->_pos).y));
|
|
local_114 = GHIDRA_CAST<float *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_e8->_player) + 0x33c)) - (local_e8->_pos).x));
|
|
fVar15 = sqrtf((float)local_114 * (float)local_114 + (float)local_e4 * (float)local_e4);
|
|
fVar13 = VStack_108.y;
|
|
fVar14 = baby->_speedMultiplier;
|
|
local_fc = GHIDRA_CAST<float *>(0x0);
|
|
local_cc = GHIDRA_CAST<float *>(((fVar15 - 160.0) * (1.0 / fVar15)));
|
|
auVar16 = ZEXT812(0x3f59999a);
|
|
ppfVar6 = &local_cc;
|
|
if ((float)local_cc <= 0.0) {
|
|
ppfVar6 = &local_fc;
|
|
}
|
|
ropePointCount = *ppfVar6;
|
|
if (fVar14 != 1.0) {
|
|
fVar15 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar16)) + 0x0)));
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auVar16)) + 0x4))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auVar16)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar16)) + 0x0))) = fVar15 / ((fVar14 + fVar15) - fVar14 * fVar15);
|
|
}
|
|
fVar15 = fVar14 * (float)ropePointCount * (float)local_114 * 0.2 +
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar16)) + 0x0))) * (baby->_velocity).x;
|
|
(baby->_velocity).x = fVar15;
|
|
(baby->_velocity).y =
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar16)) + 0x0))) * (baby->_velocity).y +
|
|
fVar14 * (float)ropePointCount * (float)local_e4 * 0.2;
|
|
if (local_f8 == GHIDRA_CAST<Vector *>(0xffffffff)) {
|
|
if (baby->_isNotCountedAsFollower != 0) goto LAB_00433767;
|
|
baby->_state = 1;
|
|
fVar14 = baby->_speedMultiplier;
|
|
fVar15 = fVar14 * fVar15;
|
|
}
|
|
else {
|
|
fVar14 = baby->_speedMultiplier;
|
|
(baby->_velocity).x = ((float)local_e0 + (float)local_e0) * fVar14 + fVar15;
|
|
(baby->_velocity).y = (VStack_108.y + VStack_108.y) * fVar14 + (baby->_velocity).y;
|
|
VStack_108.y = baby->_speedMultiplier * 10.0;
|
|
fVar14 = atan2f(fVar13,(float)local_e0);
|
|
fVar14 = approach_angle((float)puVar3[0x55],fVar14 * 57.295776,VStack_108.y);
|
|
puVar3[0x55] = fVar14;
|
|
fVar14 = baby->_speedMultiplier;
|
|
fVar15 = fVar14 * (baby->_velocity).x;
|
|
}
|
|
fVar14 = fVar14 * (baby->_velocity).y;
|
|
}
|
|
else {
|
|
LAB_00433767:
|
|
fVar14 = baby->_speedMultiplier * (baby->_velocity).y;
|
|
fVar15 = baby->_speedMultiplier * (baby->_velocity).x;
|
|
if (isInterpolated != 0) {
|
|
fVar13 = 0.5;
|
|
goto LAB_004336d9;
|
|
}
|
|
}
|
|
fVar13 = 1.0;
|
|
LAB_004336d9:
|
|
fVar15 = fVar13 * fVar15 + (baby->_pos).x;
|
|
fVar14 = fVar13 * fVar14 + (baby->_pos).y;
|
|
ropePointCount = GHIDRA_CAST<float *>(UmbilicalBabyData)::last_point();
|
|
*ropePointCount = fVar15;
|
|
ropePointCount[1] = fVar14;
|
|
ropePointCount[2] = 0.0;
|
|
cordSegment = UmbilicalBabyData::last_point();
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 8)) = 0xc1a00000;
|
|
cordSegment = UmbilicalBabyData::last_point();
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 0xc)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 0x10)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((cordSegment + 0x14)) = 0;
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 004357e0
|
|
void Entity_Familiar::set_extra_data(void *extraDataPtr, void *extraData)
|
|
{
|
|
char isLastRef;
|
|
uint32_t stackCookie;
|
|
ReferenceCountBase *extraDataRef;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af0d44;
|
|
local_10 = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
extraDataRef = operator_new(0x18);
|
|
local_8 = 0;
|
|
if (extraDataRef == GHIDRA_CAST<ReferenceCountBase *>(0x0)) {
|
|
extraDataRef = GHIDRA_CAST<ReferenceCountBase *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ReferenceCountBase *>((extraDataRef)))->ReferenceCountBase::ReferenceCountBase();
|
|
*GHIDRA_CAST<uint8_t ***>(extraDataRef) =
|
|
ReferenceCount<IsaacRepentancePlus::Entity_Familiar::ExtraData>::vftable;
|
|
*(void **)(extraDataRef + 0x14) = extraData;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(extraDataPtr) + 4)) != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(extraDataPtr) + 4)) + 0xc))(stackCookie);
|
|
if ((isLastRef != '\0') && (DAT_00c7e818 != (code *)0x0)) {
|
|
(*DAT_00c7e818)(extraDataPtr);
|
|
}
|
|
}
|
|
*GHIDRA_CAST<ReferenceCountBase **>((GHIDRA_CAST<char *>(extraDataPtr) + 4)) = extraDataRef;
|
|
*(void **)extraDataPtr = extraData;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 004361f0
|
|
void * Entity_Familiar::Player()
|
|
{
|
|
return this->_player;
|
|
}
|
|
|
|
// 00436330
|
|
void Entity_Familiar::WispInit()
|
|
{
|
|
float *node;
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
Vector *randomDir;
|
|
void *pvVar3;
|
|
LayerState *layer;
|
|
int *effectEntry;
|
|
KColor *rgbColor;
|
|
uint8_t rngShift2;
|
|
uint8_t rngShift3;
|
|
int collectibleId;
|
|
ANM2 *extraout_ECX;
|
|
ANM2 *this_00;
|
|
ColorMod *layerColor;
|
|
Game *game;
|
|
uint32_t uVar4;
|
|
uint32_t wispSubtype;
|
|
float fVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
uint32_t local_a4;
|
|
uint32_t local_a0;
|
|
uint32_t local_9c;
|
|
uint32_t local_98;
|
|
float local_94;
|
|
KColor local_90;
|
|
Vector local_7c;
|
|
float i;
|
|
uint64_t local_6c;
|
|
int *wispsByAge;
|
|
uint32_t wispsByAgeSize;
|
|
float *local_58;
|
|
float *local_54;
|
|
ColorMod wispColor;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint32_t *playerFlagWord;
|
|
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af219d;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
local_58 = GHIDRA_CAST<float *>(this->_subtype);
|
|
if (this->_variant == 0xed) {
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x248,0);
|
|
if (bVar2 == 0) {
|
|
this->_wispCollectibleType = 0x2c8;
|
|
local_58 = GHIDRA_CAST<float *>(0x2c8);
|
|
}
|
|
else {
|
|
this->_wispCollectibleType = 0x10012;
|
|
local_58 = GHIDRA_CAST<float *>(0x10012);
|
|
}
|
|
}
|
|
if ((this->_variant == 0xce) && ((local_58 == GHIDRA_CAST<float *>(0x203) || (local_58 == GHIDRA_CAST<float *>(0x1ea))))) {
|
|
this->_wispCollectibleType = GHIDRA_INT(local_58);
|
|
local_58 = GHIDRA_CAST<float *>(GetRandomWisp(&this->_dropRNG));
|
|
this->_subtype = GHIDRA_INT(local_58);
|
|
}
|
|
wispSubtype = GHIDRA_UINT(local_58);
|
|
if (local_58 < 0x1e5) {
|
|
if (local_58 == GHIDRA_CAST<float *>(0x1e4)) goto switchD_00436422_caseD_6f;
|
|
if (0x121 < local_58) {
|
|
switch(local_58) {
|
|
case GHIDRA_CAST<float *>(0x126):
|
|
case GHIDRA_CAST<float *>(0x152):
|
|
case GHIDRA_CAST<float *>(0x1a5):
|
|
goto switchD_00436422_caseD_6f;
|
|
case GHIDRA_CAST<float *>(0x1ab):
|
|
this->_entityCollisionClass = 0;
|
|
this->_entityGridCollisionClass = 3;
|
|
this->_isInvicible = 1;
|
|
this->_isNotCountedAsFollower = 1;
|
|
randomDir = MusicManager::RandomVector(&local_7c);
|
|
(this->_velocity).x = randomDir->x;
|
|
(this->_velocity).y = randomDir->y;
|
|
}
|
|
goto switchD_00436422_caseD_67;
|
|
}
|
|
if (local_58 == GHIDRA_CAST<float *>(0x121)) {
|
|
switchD_00436422_caseD_6f:
|
|
this->_isNotCountedAsFollower = 1;
|
|
goto switchD_004364c6_caseD_1e8;
|
|
}
|
|
switch(local_58) {
|
|
case GHIDRA_CAST<float *>(0x66):
|
|
if (this->_coins == 0) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(6);
|
|
this->_coins = uVar4 + 1;
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<float *>(0x6f):
|
|
case GHIDRA_CAST<float *>(0xa4):
|
|
goto switchD_00436422_caseD_6f;
|
|
case GHIDRA_CAST<float *>(0x11a):
|
|
goto switchD_00436422_caseD_11a;
|
|
}
|
|
goto switchD_00436422_caseD_67;
|
|
}
|
|
switch(local_58) {
|
|
case GHIDRA_CAST<float *>(0x1e7):
|
|
this->_entityCollisionClass = 0;
|
|
this->_isInvicible = 1;
|
|
if (this->_target != 0) {
|
|
local_54 = GHIDRA_CAST<float *>(&this->_target);
|
|
msvc::multiset<unsigned_int>::erase(&local_54);
|
|
}
|
|
this->_target = 0;
|
|
break;
|
|
default:
|
|
goto switchD_004364c6_caseD_1e8;
|
|
case GHIDRA_CAST<float *>(0x1f8):
|
|
case GHIDRA_CAST<float *>(0x25c):
|
|
case GHIDRA_CAST<float *>(0x2c1):
|
|
case GHIDRA_CAST<float *>(0x2c5):
|
|
case GHIDRA_CAST<float *>(0x2d2):
|
|
case GHIDRA_CAST<float *>(0x2d9):
|
|
goto switchD_00436422_caseD_6f;
|
|
case GHIDRA_CAST<float *>(0x22d):
|
|
playerFlagWord = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_player) + 0x1574));
|
|
*playerFlagWord = *playerFlagWord | 0x400;
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_player) + 0x1518)) = 1;
|
|
break;
|
|
case GHIDRA_CAST<float *>(0x261):
|
|
this->_isInvicible = 1;
|
|
break;
|
|
case GHIDRA_CAST<float *>(0x27b):
|
|
(this->_pos).y = (this->_pos).y + 1.0;
|
|
switchD_00436422_caseD_11a:
|
|
(this->_targetPosition).x = (this->_pos).x;
|
|
(this->_targetPosition).y = (this->_pos).y;
|
|
this->_isNotCountedAsFollower = 1;
|
|
wispsByAge = GHIDRA_CAST<int *>(0x0);
|
|
wispsByAgeSize = 0;
|
|
wispsByAge = operator_new(0x18);
|
|
*wispsByAge = GHIDRA_INT(wispsByAge);
|
|
wispsByAge[1] = GHIDRA_INT(wispsByAge);
|
|
wispsByAge[2] = GHIDRA_INT(wispsByAge);
|
|
*GHIDRA_CAST<uint16_t *>((wispsByAge + 3)) = 0x101;
|
|
local_14 = 0;
|
|
i = 0.0;
|
|
local_54 = g_game->_room;
|
|
game = g_game;
|
|
if (local_54[0x499] != 0.0) {
|
|
do {
|
|
fVar5 = *GHIDRA_CAST<float *>((GHIDRA_INT(local_54[0x497]) + GHIDRA_INT(i) * 4));
|
|
if ((((fVar5 != 0.0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar5) + 0x28)) == 3)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar5) + 0x2c)) == 0xce)) &&
|
|
((*(void **)(GHIDRA_CAST<char *>(fVar5) + 0x410) == this->_player &&
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar5) + 0x30)) == wispSubtype)))) {
|
|
local_7c.x = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar5) + 0x328)) - game->_frameCount);
|
|
local_7c.y = fVar5;
|
|
FUN_0043ed20(GHIDRA_INT(&local_6c) + 4,&local_7c);
|
|
game = g_game;
|
|
}
|
|
i = (float)(GHIDRA_INT(i) + 1);
|
|
} while (GHIDRA_UINT(i) < GHIDRA_UINT(local_54[0x499]));
|
|
}
|
|
if (5 < wispsByAgeSize) {
|
|
do {
|
|
local_a4 = 0;
|
|
local_a0 = 0;
|
|
local_9c = 0;
|
|
local_98 = 0;
|
|
local_94 = g_vectorZero.x;
|
|
local_90._red = g_vectorZero.y;
|
|
local_90._green = g_vectorZero.x;
|
|
local_90._blue = g_vectorZero.y;
|
|
local_90._alpha = 0.0;
|
|
local_90._unk = 0;
|
|
(**(code **)(**GHIDRA_CAST<int **>((*wispsByAge + 0x14)) + 0x24))(&local_a4);
|
|
node = GHIDRA_CAST<float *>(*wispsByAge);
|
|
local_54 = node;
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_54);
|
|
pvVar3 = std_tree_extract(&wispsByAge,node);
|
|
operator_delete(pvVar3,0x18);
|
|
} while (5 < wispsByAgeSize);
|
|
wispSubtype = GHIDRA_UINT(local_58);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&wispsByAge,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&wispsByAge,
|
|
(_Tree_node<unsigned_int,void*> *)wispsByAge[1]);
|
|
operator_delete(wispsByAge,0x18);
|
|
switchD_004364c6_caseD_1e8:
|
|
if (wispSubtype == 0x2c8) {
|
|
uVar4 = this->_subtype;
|
|
if (uVar4 < 0xf7) {
|
|
if (uVar4 == 0xf6) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyBlueMapEffect();
|
|
}
|
|
else {
|
|
if (uVar4 == 0x15) goto LAB_00436776;
|
|
if (uVar4 == 0x36) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyMapEffect();
|
|
}
|
|
}
|
|
}
|
|
else if (uVar4 == 0x14d) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyMapEffect();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyBlueMapEffect();
|
|
LAB_00436776:
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ApplyCompassEffect(1);
|
|
}
|
|
}
|
|
}
|
|
switchD_00436422_caseD_67:
|
|
if (this->_variant == 0xed) {
|
|
collectibleId = this->_wispCollectibleType;
|
|
}
|
|
else if (this->_variant == 0xce) {
|
|
collectibleId = this->_subtype;
|
|
}
|
|
else {
|
|
collectibleId = 0x248;
|
|
}
|
|
local_58 = ItemConfig::get_wisp_config(collectibleId);
|
|
fVar5 = *local_58;
|
|
this->_maxHitPoints = fVar5;
|
|
this->_health = fVar5;
|
|
fVar5 = local_58[0x61];
|
|
if (fVar5 != 0.0) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>((local_58 + 0x5d)));
|
|
}
|
|
this_00 = &this->_sprite;
|
|
if (local_58[0x5b] == 0.0) {
|
|
if (fVar5 == 0.0) goto LAB_0043680d;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(this_00))))->Sprite::ReplaceSpritesheet(1,GHIDRA_CAST<std_string *>((local_58 + 0x57)));
|
|
this_00 = extraout_ECX;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)this_00);
|
|
LAB_0043680d:
|
|
local_54 = local_58 + 0x36;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
if (&layer->_color != GHIDRA_CAST<ColorMod *>(local_54)) {
|
|
fVar5 = local_54[1];
|
|
fVar6 = local_54[2];
|
|
fVar7 = local_54[3];
|
|
(layer->_color)._tint[0] = *local_54;
|
|
(layer->_color)._tint[1] = fVar5;
|
|
(layer->_color)._tint[2] = fVar6;
|
|
(layer->_color)._tint[3] = fVar7;
|
|
fVar5 = local_54[5];
|
|
fVar6 = local_54[6];
|
|
fVar7 = local_54[7];
|
|
(layer->_color)._colorize[0] = local_54[4];
|
|
(layer->_color)._colorize[1] = fVar5;
|
|
(layer->_color)._colorize[2] = fVar6;
|
|
(layer->_color)._colorize[3] = fVar7;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) = *GHIDRA_CAST<uint64_t *>((local_54 + 8));
|
|
(layer->_color)._offset[2] = local_54[10];
|
|
}
|
|
local_54 = local_58 + 0x2b;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
if (&layer->_color != GHIDRA_CAST<ColorMod *>(local_54)) {
|
|
fVar5 = local_54[1];
|
|
fVar6 = local_54[2];
|
|
fVar7 = local_54[3];
|
|
(layer->_color)._tint[0] = *local_54;
|
|
(layer->_color)._tint[1] = fVar5;
|
|
(layer->_color)._tint[2] = fVar6;
|
|
(layer->_color)._tint[3] = fVar7;
|
|
fVar5 = local_54[5];
|
|
fVar6 = local_54[6];
|
|
fVar7 = local_54[7];
|
|
(layer->_color)._colorize[0] = local_54[4];
|
|
(layer->_color)._colorize[1] = fVar5;
|
|
(layer->_color)._colorize[2] = fVar6;
|
|
(layer->_color)._colorize[3] = fVar7;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) = *GHIDRA_CAST<uint64_t *>((local_54 + 8));
|
|
(layer->_color)._offset[2] = local_54[10];
|
|
}
|
|
if (wispSubtype == 0x2bf) {
|
|
pvVar3 = this->_player;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar3) + 0x1519)) == '\0') {
|
|
for (effectEntry = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar3) + 0x150c));
|
|
effectEntry != *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar3) + 0x1510)); effectEntry = effectEntry + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*effectEntry) == 0) && ((GHIDRA_CAST<int *>(*effectEntry))[1] == 100)) {
|
|
this->_coins = 1;
|
|
wispColor._offset[0] = -2.0078433;
|
|
wispColor._offset[1] = -2.0078433;
|
|
wispColor._offset[2] = -2.0078433;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
if (&layer->_color != &wispColor) {
|
|
(layer->_color)._tint[0] = (float)0x40323232;
|
|
(layer->_color)._tint[1] = (float)0x40323232;
|
|
(layer->_color)._tint[2] = (float)0x40323232;
|
|
(layer->_color)._tint[3] = 1.0;
|
|
(layer->_color)._colorize[0] = 0.0;
|
|
(layer->_color)._colorize[1] = 0.0;
|
|
(layer->_color)._colorize[2] = 0.0;
|
|
(layer->_color)._colorize[3] = 0.0;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) =
|
|
CONCAT44(wispColor._offset[1],wispColor._offset[0]);
|
|
(layer->_color)._offset[2] = wispColor._offset[2];
|
|
}
|
|
wispColor._offset[0] = 0.0;
|
|
wispColor._offset[1] = 0.0;
|
|
wispColor._offset[2] = 0.0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
layerColor = &layer->_color;
|
|
if (layerColor != &wispColor) {
|
|
fVar5 = 0.078431375;
|
|
fVar6 = 0.078431375;
|
|
fVar7 = 0.078431375;
|
|
fVar8 = 1.0;
|
|
goto LAB_00436ceb;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (wispSubtype == 0x7b) {
|
|
uVar4 = this->_initSeed;
|
|
local_6c = 0xb00000009;
|
|
local_58 = GHIDRA_CAST<float *>(&DAT_00000013);
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> 9 ^ uVar4;
|
|
uVar4 = uVar4 << 0xb ^ uVar4;
|
|
uVar4 = uVar4 >> 0x13 ^ uVar4;
|
|
local_54 = GHIDRA_CAST<float *>(((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)])
|
|
* 2.3283062e-10));
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> 9 ^ uVar4;
|
|
uVar4 = uVar4 << 0xb ^ uVar4;
|
|
uVar4 = uVar4 >> 0x13 ^ uVar4;
|
|
local_54 = GHIDRA_CAST<float *>(((((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283062e-10 +
|
|
(float)local_54) - 1.0) * 0.2 + 0.8));
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> 9 ^ uVar4;
|
|
uVar4 = uVar4 << 0xb ^ uVar4;
|
|
uVar4 = uVar4 >> 0x13 ^ uVar4;
|
|
hsv_to_rgb(&local_90,
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10 * 360.0,(float)local_54,0.8,1.0);
|
|
wispColor._tint[0] = local_90._red * 2.0;
|
|
wispColor._offset[0] = 0.0;
|
|
wispColor._offset[1] = 0.0;
|
|
wispColor._tint[1] = local_90._green * 2.0;
|
|
wispColor._offset[2] = 0.0;
|
|
wispColor._tint[3] = 1.0;
|
|
wispColor._tint[2] = local_90._blue * 2.0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
if (&layer->_color != &wispColor) {
|
|
(layer->_color)._tint[0] = wispColor._tint[0];
|
|
(layer->_color)._tint[1] = wispColor._tint[1];
|
|
(layer->_color)._tint[2] = wispColor._tint[2];
|
|
(layer->_color)._tint[3] = wispColor._tint[3];
|
|
(layer->_color)._colorize[0] = 0.0;
|
|
(layer->_color)._colorize[1] = 0.0;
|
|
(layer->_color)._colorize[2] = 0.0;
|
|
(layer->_color)._colorize[3] = 0.0;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) = CONCAT44(wispColor._offset[1],wispColor._offset[0]);
|
|
(layer->_color)._offset[2] = wispColor._offset[2];
|
|
}
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
bVar2 = (uint8_t)local_6c;
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
rngShift2 = (uint8_t)((uint64_t)local_6c >> 0x20);
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
rngShift3 = (uint8_t)local_58;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
local_54 = GHIDRA_CAST<float *>(((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)])
|
|
* 2.3283062e-10));
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
local_54 = GHIDRA_CAST<float *>(((((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283062e-10 +
|
|
(float)local_54) - 1.0) * 0.2 + 0.8));
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
rgbColor = hsv_to_rgb(&local_90,
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]
|
|
) * 2.3283062e-10 * 360.0,(float)local_54,0.8,1.0);
|
|
wispColor._offset[0] = 0.0;
|
|
wispColor._offset[1] = 0.0;
|
|
wispColor._offset[2] = 0.0;
|
|
wispColor._tint[3] = 1.0;
|
|
wispColor._tint[0] = rgbColor->_red * 2.0;
|
|
wispColor._tint[1] = rgbColor->_green * 2.0;
|
|
wispColor._tint[2] = rgbColor->_blue * 2.0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
layerColor = &layer->_color;
|
|
if (layerColor != &wispColor) {
|
|
fVar5 = wispColor._tint[0];
|
|
fVar6 = wispColor._tint[1];
|
|
fVar7 = wispColor._tint[2];
|
|
fVar8 = wispColor._tint[3];
|
|
LAB_00436ceb:
|
|
layerColor->_tint[0] = fVar5;
|
|
layerColor->_tint[1] = fVar6;
|
|
layerColor->_tint[2] = fVar7;
|
|
layerColor->_tint[3] = fVar8;
|
|
layerColor->_colorize[0] = 0.0;
|
|
layerColor->_colorize[1] = 0.0;
|
|
layerColor->_colorize[2] = 0.0;
|
|
layerColor->_colorize[3] = 0.0;
|
|
*GHIDRA_CAST<uint64_t *>(layerColor->_offset) = CONCAT44(wispColor._offset[1],wispColor._offset[0]);
|
|
layerColor->_offset[2] = wispColor._offset[2];
|
|
}
|
|
}
|
|
if (this->_variant == 0xed) {
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RecomputeWispCollectibles(this);
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::UpdateVisibility();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00436fd0
|
|
uint32_t Entity_Familiar::wisp_kill()
|
|
{
|
|
float fVar1;
|
|
void *pvVar2;
|
|
code *pcVar3;
|
|
Vector velocity;
|
|
Vector targetPos;
|
|
Entity *pEVar4;
|
|
ANM2 *pAVar5;
|
|
uint8_t bVar6;
|
|
uint32_t uVar7;
|
|
Vector *pVVar8;
|
|
ColorMod *Color;
|
|
ColorMod *color;
|
|
Entity_Laser *laser;
|
|
Entity_Tear *tear;
|
|
ColorMod *color_00;
|
|
Entity_Player *pEVar9;
|
|
uint32_t uVar10;
|
|
EntityRef *ref;
|
|
Entity *spawned;
|
|
LayerState *layer;
|
|
uint32_t uVar11;
|
|
Manager *manager;
|
|
Entity_Familiar *tear;
|
|
float fVar13;
|
|
float fVar14;
|
|
Entity_Familiar *spawned;
|
|
int iVar16;
|
|
uint8_t bVar17;
|
|
uint8_t isOnlyRunes;
|
|
Color layer0Color;
|
|
Color layer1Color;
|
|
Vector VStack_94;
|
|
void *wispConfig;
|
|
Vector VStack_88;
|
|
uint8_t auStack_80 [8];
|
|
Vector VStack_78;
|
|
Vector VStack_6c;
|
|
uint32_t uStack_64;
|
|
uint8_t auStack_60 [8];
|
|
float fStack_58;
|
|
float fStack_54;
|
|
float fStack_50;
|
|
float fStack_4c;
|
|
float fStack_48;
|
|
float fStack_44;
|
|
float fStack_40;
|
|
float fStack_3c;
|
|
float fStack_38;
|
|
uint8_t auStack_34 [12];
|
|
uint8_t *queryCount;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t uStack_14;
|
|
RNG *dropRng;
|
|
uint32_t *itemListEnd;
|
|
int *queriedEnemy;
|
|
Room *room;
|
|
ColorMod *spawnedColor;
|
|
|
|
puStack_20 = auStack_34 + 0x30;
|
|
uStack_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af21fd;
|
|
local_1c = ExceptionList;
|
|
uVar7 = __security_cookie ^ GHIDRA_UINT((auStack_34 + 0x24));
|
|
ExceptionList = &local_1c;
|
|
if (this->_variant == 0xed) {
|
|
iVar16 = this->_wispCollectibleType;
|
|
}
|
|
else if (this->_variant == 0xce) {
|
|
iVar16 = this->_subtype;
|
|
}
|
|
else {
|
|
iVar16 = 0x248;
|
|
}
|
|
uStack_64 = this;
|
|
local_24 = uVar7;
|
|
wispConfig = ItemConfig::get_wisp_config(iVar16);
|
|
pEVar9 = GHIDRA_CAST<Entity_Player *>(this->_subtype);
|
|
VStack_78.y = (float)pEVar9;
|
|
if (GHIDRA_CAST<Entity_Player *>(0x11f) < pEVar9) {
|
|
if (pEVar9 < GHIDRA_CAST<Entity_Player *>(0x222)) {
|
|
if (pEVar9 == GHIDRA_CAST<Entity_Player *>(0x221)) {
|
|
VStack_78.y = (float)Random();
|
|
VStack_88.y = (float)this->_player;
|
|
VStack_94.y = (float)Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,0.0,0,0
|
|
,0);
|
|
uVar7 = (this->_dropRNG)._seed;
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar7 = (this->_dropRNG)._seed;
|
|
if (uVar7 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
uVar10 = (*pcVar3)();
|
|
return uVar10;
|
|
}
|
|
}
|
|
uVar7 = uVar7 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar7;
|
|
uVar11 = 0xe3;
|
|
uVar7 = uVar7 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar7;
|
|
(this->_dropRNG)._seed = uVar7;
|
|
if (uVar7 == (uVar7 / 3) * 3) {
|
|
uVar11 = 0x115;
|
|
}
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(uVar11,0,GHIDRA_CAST<Vector *>(VStack_94.y),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(VStack_88.y),0,GHIDRA_UINT(VStack_78.y));
|
|
if ((spawned == GHIDRA_CAST<Entity *>(0x0)) ||
|
|
(((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 || (spawned->_type != 1)) &&
|
|
(0x3dd < spawned->_type - 10U)))) {
|
|
spawned = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
bVar17 = 0;
|
|
bVar6 = 0;
|
|
iVar16 = -1;
|
|
ref = (GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((auStack_60 + 4)))))->EntityRef::EntityRef();
|
|
(GHIDRA_CAST<Entity *>((spawned)))->Entity::AddCharmed(ref,iVar16,bVar6,bVar17);
|
|
spawned->Update();
|
|
(GHIDRA_CAST<Entity *>((spawned)))->Entity::SetVisibleFlag(0);
|
|
fVar13 = spawned->_maxHitPoints + spawned->_maxHitPoints;
|
|
VStack_6c.y = 3.71344e-43;
|
|
spawned->_maxHitPoints = fVar13;
|
|
spawned->_health = fVar13;
|
|
manager = g_manager;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&VStack_6c.y));
|
|
tear = GHIDRA_CAST<Entity_Familiar *>(VStack_6c.y);
|
|
goto code_r0x00437295;
|
|
}
|
|
switch(pEVar9) {
|
|
case GHIDRA_CAST<Entity_Player *>(0x120):
|
|
VStack_78.y = (float)this->_player;
|
|
room = g_game->_room;
|
|
pVVar8 = MusicManager::RandomVector(GHIDRA_CAST<Vector *>((auStack_34 + 8)));
|
|
uVar7 = Random();
|
|
fVar13 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 80.0 + 40.0;
|
|
VStack_88.y = fVar13 * pVVar8->y + (uStack_64->_pos).y;
|
|
VStack_88.x = fVar13 * pVVar8->x + (uStack_64->_pos).x;
|
|
pVVar8 = Room::FindFreePickupSpawnPosition(room,&VStack_94,&VStack_88,40.0,0,0,0);
|
|
this = uStack_64;
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(VStack_78.y))))->Entity_Player::ThrowBlueSpider(&uStack_64->_pos,pVVar8);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x122):
|
|
VStack_78.y = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomFloat();
|
|
if (VStack_78.y < 0.25) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawn heart!"));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,0.0,0,0,0);
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),2,uVar7);
|
|
spawned[1]._sprite._championColor._colorize[2] = 2.8026e-44;
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x125):
|
|
spawned = GHIDRA_CAST<Entity *>(FUN_00436260());
|
|
VStack_88.y = (float)spawned;
|
|
iVar16 = _get_index_plus_one_if_kind_4_5();
|
|
VStack_6c.y = 0.0;
|
|
VStack_78.y = (float)(iVar16 + -1) * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((spawned)) + 0x8)))) +
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((spawned)) + 0x4))));
|
|
do {
|
|
laser = Entity_Laser::ShootAngle
|
|
(1,&this->_pos,(float)GHIDRA_INT(VStack_6c.y) * 90.0,0x14,&this->_posOffset,
|
|
GHIDRA_CAST<Entity *>(this),0);
|
|
laser->_disableFollowParent = 1;
|
|
laser->SetCollisionDamage(VStack_78.y * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(VStack_88.y) + 0x18)));
|
|
laser->_scale = 0.5;
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::ResetSpriteScale();
|
|
laser->Update();
|
|
VStack_6c.y = (float)(GHIDRA_INT(VStack_6c.y) + 1);
|
|
} while (GHIDRA_INT(VStack_6c.y) < 4);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x127):
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(10);
|
|
if (uVar7 == 0) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
fVar13 = 0.0;
|
|
LAB_0043785e:
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,fVar13,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x15c):
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(auStack_80),3,-1,-1,1
|
|
,0);
|
|
uVar7 = 0;
|
|
uStack_14 = 2;
|
|
if (GHIDRA_CAST<Entity_Player *>(VStack_78.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
do {
|
|
if (*(void **)(*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x4))) + uVar7 * 4)) + 0x410) == this->_player) {
|
|
farting_baby_fart();
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < GHIDRA_UINT(VStack_78.y));
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x46,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
uStack_14 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((auStack_80)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x15d):
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(2);
|
|
if (uVar7 == 0) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
fVar13 = 40.0;
|
|
goto LAB_0043785e;
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x15f):
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(auStack_60))))->Color::Color();
|
|
pVVar8 = &this->_pos;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(pVVar8,160.0,this->_player,0.5,0,color_00);
|
|
Game::ButterBeanFart(g_game,pVVar8,200.0,this->_player,0,0);
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(auStack_34),pVVar8,
|
|
180.0,8);
|
|
uVar7 = 0;
|
|
uStack_14 = 0;
|
|
if (queryCount != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
do {
|
|
VStack_78.y = *GHIDRA_CAST<float *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4))) + uVar7 * 4));
|
|
bVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_78.y))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar6 != 0) {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((auStack_60 + 4)))))->EntityRef::constructor(this->_player);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_78.y))))->Entity::AddFreeze(GHIDRA_CAST<EntityRef *>((auStack_60 + 4)),-0x32,0);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < queryCount);
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((auStack_34)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x160):
|
|
if (DAT_00c7e83c == '\0') {
|
|
DAT_00c7e83c = 1;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(auStack_34),3,0xce,
|
|
0x160,0,0);
|
|
uStack_14 = 1;
|
|
VStack_6c.y = 0.0;
|
|
if (queryCount != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
uVar10 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4)));
|
|
do {
|
|
queriedEnemy = *GHIDRA_CAST<int **>((uVar10 + GHIDRA_INT(VStack_6c.y) * 4));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(queriedEnemy) + 0x173)) == '\0') {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_60)) + 0x4))) = 0.0;
|
|
fStack_58 = 0.0;
|
|
fStack_48 = g_vectorZero.y;
|
|
fStack_40 = g_vectorZero.y;
|
|
fStack_54 = 0.0;
|
|
fStack_50 = 0.0;
|
|
fStack_4c = g_vectorZero.x;
|
|
fStack_44 = g_vectorZero.x;
|
|
fStack_3c = 0.0;
|
|
fStack_38 = 0.0;
|
|
(**(code **)(*queriedEnemy + 0x24))(auStack_60 + 4);
|
|
}
|
|
VStack_6c.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Familiar *>(VStack_6c.y)))) + 0x1)));
|
|
} while (GHIDRA_UINT(VStack_6c.y) < queryCount);
|
|
this = uStack_64;
|
|
}
|
|
DAT_00c7e83c = '\0';
|
|
uStack_14 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((auStack_34)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x17f):
|
|
Entity_Player::UseActiveItem(this->_player,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_64) + 2)),0x17f,9,-1,0);
|
|
uVar7 = Random();
|
|
uStack_64 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
VStack_88.y = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 360.0 - 180.0;
|
|
do {
|
|
pEVar9 = this->_player;
|
|
VStack_6c.y = pEVar9->_shotspeed * 10.0;
|
|
VStack_78.y = ((float)uStack_64 + VStack_88.y) * 0.017453292;
|
|
VStack_94.x = cos(VStack_78.y);
|
|
VStack_94.x = VStack_94.x * VStack_6c.y;
|
|
fVar13 = sin(VStack_78.y);
|
|
VStack_94.y = fVar13 * VStack_6c.y;
|
|
velocity.y = VStack_94.y;
|
|
velocity.x = VStack_94.x;
|
|
tear = Entity_Player::FireTear(pEVar9,&this->_pos,velocity,6,GHIDRA_CAST<Entity *>(0x0),1.0);
|
|
fVar13 = (this->_pos).x;
|
|
(tear->_targetPosition).y = (this->_pos).y;
|
|
uStack_64 = GHIDRA_CAST<Entity_Familiar *>(((float)uStack_64 + 60.0));
|
|
(tear->_targetPosition).x = fVar13;
|
|
} while ((float)uStack_64 < 360.0);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x18c):
|
|
if (this->_parent != 0) {
|
|
iVar16 = *GHIDRA_CAST<int *>((this->_parent + 0x30));
|
|
FUN_0074a280(iVar16,*GHIDRA_CAST<uint32_t *>((g_game->_ventricleRazorPortals + iVar16 * 0xc + 4)),0);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1a5):
|
|
Game::CharmFart(&this->_pos,80.0,GHIDRA_CAST<Entity *>(this));
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1b5):
|
|
Entity_Player::UseActiveItem(this->_player,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_64) + 2)),0x1b5,9,-1,0);
|
|
pEVar9 = GHIDRA_CAST<Entity_Player *>(this->_subtype);
|
|
goto code_r0x00437e10;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1de):
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::SetPauseTimer(0x5a);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1df):
|
|
uVar7 = Random();
|
|
if ((uVar7 & 3) == 0) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x15e,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1e3):
|
|
uVar7 = Random();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,0x12,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1e4):
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3d,&this->_pos,&g_vectorZero,this->_player,0,uVar7);
|
|
VStack_88.y = (float)this->_player;
|
|
if (spawned->_parent != 0) {
|
|
VStack_78.y = (float)&spawned->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&VStack_78.y);
|
|
}
|
|
spawned->_parent = VStack_88.y;
|
|
if (GHIDRA_CAST<Entity *>(VStack_88.y) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(&spawned->_parent);
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x44)))) = this->_size;
|
|
pEVar4 = spawned + 1;
|
|
(pEVar4->_sprite)._filename._buf[0] = '\0';
|
|
(pEVar4->_sprite)._filename._buf[1] = '\0';
|
|
(pEVar4->_sprite)._filename._buf[2] = -0x4c;
|
|
(pEVar4->_sprite)._filename._buf[3] = 'B';
|
|
pAVar5 = &spawned[1]._sprite;
|
|
(pAVar5->_filename)._buf[4] = '\n';
|
|
(pAVar5->_filename)._buf[5] = '\0';
|
|
(pAVar5->_filename)._buf[6] = '\0';
|
|
(pAVar5->_filename)._buf[7] = '\0';
|
|
pAVar5 = &spawned[1]._sprite;
|
|
(pAVar5->_filename)._buf[8] = '\n';
|
|
(pAVar5->_filename)._buf[9] = '\0';
|
|
(pAVar5->_filename)._buf[10] = '\0';
|
|
(pAVar5->_filename)._buf[0xb] = '\0';
|
|
case GHIDRA_CAST<Entity_Player *>(0x126):
|
|
Game::ButterBeanFart(g_game,&this->_pos,80.0,this->_player,1,1);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x1e5):
|
|
if (DAT_00c7e83d == '\0') {
|
|
DAT_00c7e83d = 1;
|
|
uVar11 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(2);
|
|
if (uVar11 == 0) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(auStack_34),3,
|
|
0xce,-1,0,0);
|
|
uVar7 = 0;
|
|
uStack_14 = 3;
|
|
if (queryCount != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4))) + uVar7 * 4)) + 0x173)) == '\0') {
|
|
pEVar9 = this->_player;
|
|
VStack_78.x = (pEVar9->_pos).x;
|
|
VStack_78.y = (pEVar9->_pos).y;
|
|
Entity_Player::AddWisp
|
|
(pEVar9,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4))) + uVar7 * 4)) + 0x30)),
|
|
&VStack_78,0,0);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < queryCount);
|
|
}
|
|
}
|
|
else {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(auStack_34),3,
|
|
0xce,-1,0,0);
|
|
uStack_14 = 4;
|
|
if (queryCount != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
uVar11 = 0;
|
|
do {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_60)) + 0x4))) = 0.0;
|
|
fStack_58 = 0.0;
|
|
fStack_54 = 0.0;
|
|
fStack_48 = g_vectorZero.y;
|
|
fStack_40 = g_vectorZero.y;
|
|
fStack_50 = 0.0;
|
|
fStack_4c = g_vectorZero.x;
|
|
fStack_44 = g_vectorZero.x;
|
|
fStack_3c = 0.0;
|
|
fStack_38 = 0.0;
|
|
(**(code **)(**GHIDRA_CAST<int **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4))) + uVar11 * 4)) + 0x24))
|
|
(auStack_60 + 4,uVar7);
|
|
uVar11 = uVar11 + 1;
|
|
} while (uVar11 < queryCount);
|
|
this = uStack_64;
|
|
}
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((auStack_34)))->EntityList_Query::~EntityList_Query();
|
|
DAT_00c7e83d = '\0';
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x20b):
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),4,uVar7);
|
|
}
|
|
}
|
|
else {
|
|
switch(pEVar9) {
|
|
case GHIDRA_CAST<Entity_Player *>(0x10006):
|
|
case GHIDRA_CAST<Entity_Player *>(0x10007):
|
|
case GHIDRA_CAST<Entity_Player *>(0x10008):
|
|
case GHIDRA_CAST<Entity_Player *>(0x10009):
|
|
code_r0x00437e10:
|
|
FUN_0043d7f0(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pEVar9[-1])) + 0x2eff))));
|
|
this->_health = this->_maxHitPoints;
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
}
|
|
goto LAB_004372a0;
|
|
}
|
|
if (pEVar9 == GHIDRA_CAST<Entity_Player *>(0x11f)) {
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::trigger_cracked_orb(&this->_pos);
|
|
goto LAB_004372a0;
|
|
}
|
|
switch(pEVar9) {
|
|
case GHIDRA_CAST<Entity_Player *>(0x23):
|
|
Entity_Player::UseActiveItem(this->_player,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_64) + 2)),0x23,9,-1,0);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x25):
|
|
case GHIDRA_CAST<Entity_Player *>(0x41):
|
|
dropRng = &this->_dropRNG;
|
|
VStack_94.y = (float)(GHIDRA_CAST<RNG *>((dropRng)))->RNG::Next();
|
|
VStack_88.y = (float)this->_player;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::Next();
|
|
pVVar8 = RandomVector(GHIDRA_CAST<Vector *>((auStack_34 + 8)),uVar7);
|
|
fVar13 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::RandomFloat();
|
|
this = uStack_64;
|
|
VStack_6c.x = fVar13 * 2.0 + 2.0;
|
|
VStack_6c.y = VStack_6c.x * pVVar8->y;
|
|
VStack_6c.x = VStack_6c.x * pVVar8->x;
|
|
uVar7 = 0;
|
|
if (GHIDRA_CAST<Entity_Player *>(VStack_78.y) == GHIDRA_CAST<Entity_Player *>(0x41)) {
|
|
uVar7 = 3;
|
|
}
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,uVar7,&uStack_64->_pos,&VStack_6c,GHIDRA_CAST<Entity *>(VStack_88.y),0,
|
|
GHIDRA_UINT(VStack_94.y));
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetBombFlags(GHIDRA_CAST<BitSet128 *>(auStack_80),0);
|
|
if (this->_subtype == 0x25) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4)));
|
|
VStack_78.x = (float)(GHIDRA_UINT(VStack_78.x) | GHIDRA_UINT(g_tearFlagHoming._h));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x0))) | GHIDRA_UINT(g_tearFlagHoming._l);
|
|
VStack_78.y = (float)(GHIDRA_UINT(VStack_78.y) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4))));
|
|
}
|
|
spawned[1]._sprite._filename._buf[0xb] = '\x01';
|
|
spawned[1]._type = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x0)));
|
|
spawned[1]._variant = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_80)) + 0x4)));
|
|
spawned[1]._subtype = GHIDRA_INT(VStack_78.x);
|
|
spawned[1]._spawnerType = GHIDRA_INT(VStack_78.y);
|
|
if (this->_subtype == 0x25) {
|
|
spawned[1]._collisionIndex = 0x3f266666;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x3c)))) = 0x3f400000;
|
|
uVar7 = Random();
|
|
(spawned->_posOffset).x = 0.0;
|
|
(spawned->_posOffset).y = -3.0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0xc)))) =
|
|
-3.0 - (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0;
|
|
}
|
|
uVar10 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
|
|
*GHIDRA_CAST<uint32_t *>(&spawned->_flags) = GHIDRA_UINT(spawned->_flags) | 0x4000000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4)) = uVar10;
|
|
spawned->Update();
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x28):
|
|
pvVar2 = this->_player;
|
|
uStack_64 = GHIDRA_CAST<Entity_Familiar *>(((this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x33c))));
|
|
VStack_6c.y = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x340));
|
|
fVar13 = sqrtf((float)uStack_64 * (float)uStack_64 + VStack_6c.y * VStack_6c.y);
|
|
if (70.0 <= fVar13) {
|
|
spawned = uStack_64;
|
|
tear = GHIDRA_CAST<Entity_Familiar *>(VStack_6c.y);
|
|
}
|
|
else {
|
|
spawned = GHIDRA_CAST<Entity_Familiar *>(((float)uStack_64 * (70.0 / fVar13)));
|
|
tear = GHIDRA_CAST<Entity_Familiar *>((VStack_6c.y * (70.0 / fVar13)));
|
|
}
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(auStack_60))))->Color::Color();
|
|
VStack_88.x = (float)spawned + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x33c));
|
|
VStack_88.y = (float)tear + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x340));
|
|
Game::BombExplosionEffects
|
|
(g_game,&VStack_88,30.0,(BitSet128)ZEXT816(0),Color,GHIDRA_CAST<Entity *>(this),0.75,1,4,0);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x42):
|
|
pvVar2 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar2) & 0xfffffffcU)) < 0x109)
|
|
{
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x0))) = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 0x108));
|
|
}
|
|
queryCount = GHIDRA_CAST<uint8_t *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x8))) = 0x5a;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(g_game->_room) + 0x7310)))))->TemporaryEffects::AddEffect(auStack_34,1,1);
|
|
manager = g_manager;
|
|
fVar13 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::time_scale_update();
|
|
(manager->_musicManager)._targetPitch = fVar13;
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x4e):
|
|
TemporaryEffects::AddCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)),0x20e,1,1);
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0x7a,&this->_pos,&g_vectorZero,this->_player,0,uVar7);
|
|
if ((spawned == GHIDRA_CAST<Entity *>(0x0)) || (spawned->_type != 3)) {
|
|
spawned = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
spawned->Update();
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::EvaluateItems();
|
|
manager = g_manager;
|
|
uStack_64 = GHIDRA_CAST<Entity_Familiar *>(0x109);
|
|
seed_fart_sound_override(&uStack_64);
|
|
tear = uStack_64;
|
|
code_r0x00437295:
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(tear),1.0,2,0,1.0,0.0);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x55):
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
iVar16 = ItemPool::GetCardEx(uVar7,0x19,0,10,1);
|
|
isOnlyRunes = 0;
|
|
bVar17 = 0;
|
|
bVar6 = 1;
|
|
goto LAB_004372ff;
|
|
case GHIDRA_CAST<Entity_Player *>(0x66):
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x46,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
if (this->_coins == 6) {
|
|
targetPos.y = g_vectorZero.y;
|
|
targetPos.x = g_vectorZero.x;
|
|
Entity_NPC::ThrowSpider(&this->_pos,GHIDRA_CAST<Entity *>(0x0),targetPos,0,-30.0);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x6f):
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(auStack_60))))->Color::Color();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(&this->_pos,85.0,GHIDRA_CAST<Entity *>(this),1.0,0,color);
|
|
Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,0,0);
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x91):
|
|
spawned = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBlueFlies(1,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
if (spawned != GHIDRA_CAST<Entity *>(0x0)) {
|
|
iVar16 = __RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
*GHIDRA_CAST<uint32_t *>((iVar16 + 0xd88)) = 0xf;
|
|
pVVar8 = MusicManager::RandomVector(GHIDRA_CAST<Vector *>((auStack_34 + 8)));
|
|
uVar7 = Random();
|
|
fVar14 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar13 = pVVar8->y;
|
|
fVar1 = pVVar8->x;
|
|
*GHIDRA_CAST<uint32_t *>((iVar16 + 0x188)) = 0;
|
|
*GHIDRA_CAST<float *>((iVar16 + 0x364)) = fVar14 * fVar13 * 5.0;
|
|
*GHIDRA_CAST<float *>((iVar16 + 0x360)) = fVar14 * fVar1 * 5.0;
|
|
this = uStack_64;
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x107):
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
iVar16 = ItemPool::GetCardEx(uVar7,0,1,0,1);
|
|
isOnlyRunes = 1;
|
|
bVar17 = 1;
|
|
bVar6 = 0;
|
|
LAB_004372ff:
|
|
queryCount = &DAT_00000007;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x4))) = 5;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x8))) = 9;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_34)) + 0x0))) = uVar7;
|
|
uVar7 = lua_callback_run_get_card(GHIDRA_CAST<RNG *>(auStack_34),iVar16,bVar6,bVar17,isOnlyRunes);
|
|
uVar11 = (GHIDRA_CAST<RNG *>((&uStack_64->_dropRNG)))->RNG::Next();
|
|
pVVar8 = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_34 + 8)),&uStack_64->_pos,40.0,0,0,0);
|
|
this = uStack_64;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,300,pVVar8,&g_vectorZero,GHIDRA_CAST<Entity *>(uStack_64),uVar7,uVar11);
|
|
}
|
|
LAB_004372a0:
|
|
pEVar9 = GHIDRA_CAST<Entity_Player *>(this->_wispCollectibleType);
|
|
if ((pEVar9 == GHIDRA_CAST<Entity_Player *>(0x1ea)) || (pEVar9 == GHIDRA_CAST<Entity_Player *>(0x203))) {
|
|
pvVar2 = this->_player;
|
|
itemListEnd = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(pvVar2) + 0x1de0));
|
|
VStack_78.y = (float)pEVar9;
|
|
if (itemListEnd == *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(pvVar2) + 0x1de4))) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(itemListEnd,&VStack_78.y);
|
|
}
|
|
else {
|
|
*itemListEnd = GHIDRA_UINT(pEVar9);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1de0)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1de0)) + 4;
|
|
}
|
|
}
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
(spawned->_posOffset).x = 0.0;
|
|
spawnedColor = &(spawned->_sprite)._color;
|
|
(spawned->_posOffset).y = -6.0;
|
|
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x110)) || *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x110)) == 0.0) {
|
|
if (spawnedColor != GHIDRA_CAST<ColorMod *>((GHIDRA_INT(wispConfig) + 0x104))) {
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x108));
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x10c));
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x110));
|
|
spawnedColor->_tint[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x104));
|
|
(spawned->_sprite)._color._tint[1] = fVar13;
|
|
(spawned->_sprite)._color._tint[2] = fVar1;
|
|
(spawned->_sprite)._color._tint[3] = fVar14;
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x118));
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x11c));
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x120));
|
|
(spawned->_sprite)._color._colorize[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x114));
|
|
(spawned->_sprite)._color._colorize[1] = fVar13;
|
|
(spawned->_sprite)._color._colorize[2] = fVar1;
|
|
(spawned->_sprite)._color._colorize[3] = fVar14;
|
|
*GHIDRA_CAST<uint64_t *>((spawned->_sprite)._color._offset) = *GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(wispConfig) + 0x124));
|
|
layer1Color._offset[2] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 300));
|
|
goto LAB_00438335;
|
|
}
|
|
}
|
|
else {
|
|
::(GHIDRA_CAST<Color *>((&layer1Color)))->Color::Color();
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
layer1Color._colorize[0] = (layer->_color)._tint[0];
|
|
layer1Color._colorize[1] = (layer->_color)._tint[1];
|
|
layer1Color._colorize[2] = (layer->_color)._tint[2];
|
|
layer1Color._colorize[3] = (layer->_color)._tint[3];
|
|
if (spawnedColor != GHIDRA_CAST<ColorMod *>(&layer1Color)) {
|
|
spawnedColor->_tint[0] = layer1Color._tint[0];
|
|
(spawned->_sprite)._color._tint[1] = layer1Color._tint[1];
|
|
(spawned->_sprite)._color._tint[2] = layer1Color._tint[2];
|
|
(spawned->_sprite)._color._tint[3] = layer1Color._tint[3];
|
|
(spawned->_sprite)._color._colorize[0] = layer1Color._colorize[0];
|
|
(spawned->_sprite)._color._colorize[1] = layer1Color._colorize[1];
|
|
(spawned->_sprite)._color._colorize[2] = layer1Color._colorize[2];
|
|
(spawned->_sprite)._color._colorize[3] = layer1Color._colorize[3];
|
|
*GHIDRA_CAST<uint64_t *>((spawned->_sprite)._color._offset) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(layer1Color._offset)) + 0x0)));
|
|
LAB_00438335:
|
|
(spawned->_sprite)._color._offset[2] = layer1Color._offset[2];
|
|
}
|
|
}
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xc,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
|
(spawned->_posOffset).x = 0.0;
|
|
spawnedColor = &(spawned->_sprite)._color;
|
|
(spawned->_posOffset).y = -6.0;
|
|
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x13c)) || *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x13c)) == 0.0) {
|
|
if (spawnedColor == GHIDRA_CAST<ColorMod *>((GHIDRA_INT(wispConfig) + 0x130))) goto LAB_0043842f;
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x134));
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x138));
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x13c));
|
|
spawnedColor->_tint[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x130));
|
|
(spawned->_sprite)._color._tint[1] = fVar13;
|
|
(spawned->_sprite)._color._tint[2] = fVar1;
|
|
(spawned->_sprite)._color._tint[3] = fVar14;
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x144));
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x148));
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x14c));
|
|
(spawned->_sprite)._color._colorize[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x140));
|
|
(spawned->_sprite)._color._colorize[1] = fVar13;
|
|
(spawned->_sprite)._color._colorize[2] = fVar1;
|
|
(spawned->_sprite)._color._colorize[3] = fVar14;
|
|
*GHIDRA_CAST<uint64_t *>((spawned->_sprite)._color._offset) = *GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(wispConfig) + 0x150));
|
|
layer0Color._offset[2] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispConfig) + 0x158));
|
|
}
|
|
else {
|
|
::(GHIDRA_CAST<Color *>((&layer0Color)))->Color::Color();
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer0Color._colorize[0] = (layer->_color)._tint[0];
|
|
layer0Color._colorize[1] = (layer->_color)._tint[1];
|
|
layer0Color._colorize[2] = (layer->_color)._tint[2];
|
|
layer0Color._colorize[3] = (layer->_color)._tint[3];
|
|
if (spawnedColor == GHIDRA_CAST<ColorMod *>(&layer0Color)) goto LAB_0043842f;
|
|
spawnedColor->_tint[0] = layer0Color._tint[0];
|
|
(spawned->_sprite)._color._tint[1] = layer0Color._tint[1];
|
|
(spawned->_sprite)._color._tint[2] = layer0Color._tint[2];
|
|
(spawned->_sprite)._color._tint[3] = layer0Color._tint[3];
|
|
(spawned->_sprite)._color._colorize[0] = layer0Color._colorize[0];
|
|
(spawned->_sprite)._color._colorize[1] = layer0Color._colorize[1];
|
|
(spawned->_sprite)._color._colorize[2] = layer0Color._colorize[2];
|
|
(spawned->_sprite)._color._colorize[3] = layer0Color._colorize[3];
|
|
*GHIDRA_CAST<uint64_t *>((spawned->_sprite)._color._offset) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(layer0Color._offset)) + 0x0)));
|
|
}
|
|
(spawned->_sprite)._color._offset[2] = layer0Color._offset[2];
|
|
LAB_0043842f:
|
|
manager = g_manager;
|
|
wispConfig = (void *)0x105;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&wispConfig));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(wispConfig),1.0,2,0,1.0,0.0);
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
|
|
// 004386f0
|
|
Entity_Tear * Entity_Familiar::fire_wisp_projectile(Vector velocity)
|
|
{
|
|
Entity_Familiar *dropRng = this;
|
|
uint32_t *puVar1;
|
|
code *pcVar2;
|
|
BitSet128 flags;
|
|
BitSet128 flags_00;
|
|
ANM2 *pAVar3;
|
|
uint8_t bVar4;
|
|
void *pvVar5;
|
|
Vector *vecResult;
|
|
Entity_Laser *laser;
|
|
int iVar6;
|
|
Entity_Tear *shot;
|
|
uint32_t uVar7;
|
|
int *effect;
|
|
Entity *blueFly;
|
|
BitSet128 *spectralFlags;
|
|
LayerState *layer;
|
|
uint32_t rngResult;
|
|
float *tearStats;
|
|
long double depthOffset;
|
|
float fVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
Entity_Familiar *pEVar11;
|
|
uint32_t uVar12;
|
|
TypeDescriptor *pTVar13;
|
|
TypeDescriptor *pTVar14;
|
|
uint32_t uVar15;
|
|
RNG local_e0;
|
|
Vector local_d0;
|
|
float fallingAccel;
|
|
Entity_Familiar *local_c4;
|
|
float tearScale;
|
|
float tearDamage;
|
|
Vector local_b8;
|
|
void *local_b0;
|
|
float local_ac;
|
|
int *local_a8;
|
|
uint32_t local_a4;
|
|
int *local_a0;
|
|
int *local_9c;
|
|
BitSet128 local_98;
|
|
float local_84;
|
|
uint32_t local_80;
|
|
float local_7c;
|
|
Vector scratchVec;
|
|
Entity *local_70;
|
|
Color tearColor;
|
|
ColorMod tmpColor;
|
|
float local_14;
|
|
RNG *dropRng;
|
|
|
|
local_14 = (float)(__security_cookie ^ GHIDRA_UINT(((&tmpColor)[1]._tint + 1)));
|
|
if (dropRng->_variant == 0xed) {
|
|
iVar6 = dropRng->_wispCollectibleType;
|
|
}
|
|
else if (dropRng->_variant == 0xce) {
|
|
iVar6 = dropRng->_subtype;
|
|
}
|
|
else {
|
|
iVar6 = 0x248;
|
|
}
|
|
local_c4 = dropRng;
|
|
pvVar5 = ItemConfig::get_wisp_config(iVar6);
|
|
iVar6 = dropRng->_subtype;
|
|
local_b0 = pvVar5;
|
|
if (iVar6 == 0x10004) {
|
|
fire_robo_baby_laser(dropRng,&velocity);
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
if (iVar6 == 0x1000d) {
|
|
local_84 = velocity.y;
|
|
scratchVec.y = velocity.y;
|
|
local_9c = GHIDRA_CAST<int *>(velocity.x);
|
|
scratchVec.x = velocity.x;
|
|
fVar8 = sqrtf(velocity.y * velocity.y + velocity.x * velocity.x);
|
|
if (0.0 < fVar8) {
|
|
local_9c = GHIDRA_CAST<int *>(((1.0 / fVar8) * (float)local_9c));
|
|
local_84 = local_84 * (1.0 / fVar8);
|
|
scratchVec.x = (float)local_9c;
|
|
scratchVec.y = local_84;
|
|
}
|
|
bVar4 = 0;
|
|
vecResult = Vector::ToCardinal(&local_b8,&scratchVec);
|
|
laser = FireBrimstone(dropRng,vecResult,bVar4);
|
|
iVar6 = *GHIDRA_CAST<int *>(laser);
|
|
(laser->_posOffset).x = (float)local_9c * 7.0;
|
|
(laser->_posOffset).y = local_84 * 5.0 - 18.0;
|
|
LAB_00438842:
|
|
(**(code **)(iVar6 + 0xc))();
|
|
dropRng->_headFrameDelay = 0x1e;
|
|
if (ABS(local_84) < ABS((float)local_9c)) {
|
|
iVar6 = 2;
|
|
if ((float)local_9c < 0.0) {
|
|
iVar6 = 0;
|
|
}
|
|
PlayShootAnim(dropRng,iVar6);
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
PlayShootAnim(dropRng,GHIDRA_UINT((0.0 <= local_84)) * 2 + 1);
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
if (iVar6 == 0x10011) {
|
|
local_84 = velocity.y;
|
|
scratchVec.y = velocity.y;
|
|
local_9c = GHIDRA_CAST<int *>(velocity.x);
|
|
scratchVec.x = velocity.x;
|
|
fVar8 = sqrtf(velocity.y * velocity.y + velocity.x * velocity.x);
|
|
if (0.0 < fVar8) {
|
|
local_9c = GHIDRA_CAST<int *>(((1.0 / fVar8) * (float)local_9c));
|
|
local_84 = local_84 * (1.0 / fVar8);
|
|
scratchVec.x = (float)local_9c;
|
|
scratchVec.y = local_84;
|
|
}
|
|
bVar4 = 0;
|
|
vecResult = Vector::ToCardinal(&local_b8,&scratchVec);
|
|
laser = FireBrimstone(dropRng,vecResult,bVar4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0x40))
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_b0) + 4)) * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf34)))));
|
|
(laser->_posOffset).x = (float)local_9c * 7.0;
|
|
(laser->_posOffset).y = local_84 * 5.0 - 18.0;
|
|
iVar6 = *GHIDRA_CAST<int *>(laser);
|
|
goto LAB_00438842;
|
|
}
|
|
if (iVar6 == 0x1000f) {
|
|
if (dropRng->_player->_numBlueFlies < 5) {
|
|
(GHIDRA_CAST<Entity_Player *>((dropRng->_player)))->Entity_Player::AddBlueFlies(1,&dropRng->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
if (iVar6 == 0x22c) {
|
|
(GHIDRA_CAST<Vector *>((&velocity)))->Vector::Normalized(&scratchVec);
|
|
bVar4 = 1;
|
|
vecResult = Vector::ToCardinal(&local_b8,&scratchVec);
|
|
shot = GHIDRA_CAST<Entity_Tear *>(FireBrimstone(dropRng,vecResult,bVar4));
|
|
pAVar3 = &shot->_tearHaloANM2;
|
|
(pAVar3->_animDefaultName)._buf[0xc] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[0xd] = '\0';
|
|
(pAVar3->_animDefaultName)._buf[0xe] = '4';
|
|
(pAVar3->_animDefaultName)._buf[0xf] = 'C';
|
|
(shot->_posOffset).x = scratchVec.x * 7.0;
|
|
(shot->_posOffset).y = scratchVec.y * 5.0 - 18.0;
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(shot) + 0x40);
|
|
fVar8 = apply_tear_modifiers(local_c4);
|
|
(*pcVar2)(fVar8 * 3.5);
|
|
pEVar11 = local_c4;
|
|
apply_baby_bender(local_c4,shot);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar11))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(shot));
|
|
shot->Update();
|
|
depthOffset = (long double)copysignf(0x40a00000,shot->_renderDepthOffset);
|
|
shot->_renderDepthOffset = (float)depthOffset;
|
|
pEVar11->_headFrameDelay = 0x1e;
|
|
iVar6 = vector_to_direction(&scratchVec);
|
|
PlayShootAnim(pEVar11,iVar6);
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
if (iVar6 == 0x121) {
|
|
Vector::ToCardinal(&scratchVec,&velocity);
|
|
uVar7 = Random();
|
|
uVar15 = 0;
|
|
pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
local_b8.x = scratchVec.x * 5.0 + velocity.x;
|
|
pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar12 = 0;
|
|
local_b8.y = scratchVec.y * 5.0 + velocity.y;
|
|
blueFly = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x34,&dropRng->_pos,&local_b8,GHIDRA_CAST<Entity *>(dropRng),0,uVar7);
|
|
effect = GHIDRA_CAST<int *>(__RTDynamicCast(blueFly,uVar12,pTVar13,pTVar14,uVar15));
|
|
(**(code **)(*effect + 0x40))(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf34)))) * 10.0);
|
|
effect[0x11e] = 0x3f000000;
|
|
effect[0x117] = 0x96;
|
|
effect[0x118] = 0x96;
|
|
(**(code **)(*effect + 0xc))();
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
local_a8 = GHIDRA_CAST<int *>(0x0);
|
|
if (iVar6 == 0x280) {
|
|
uVar7 = Random();
|
|
if (uVar7 % 7 == 0) {
|
|
Vector::ToCardinal(&scratchVec,&velocity);
|
|
uVar7 = Random();
|
|
uVar15 = 0;
|
|
pTVar14 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
local_b8.x = scratchVec.x * 5.0 + velocity.x;
|
|
pTVar13 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar12 = 0;
|
|
local_b8.y = scratchVec.y * 5.0 + velocity.y;
|
|
blueFly = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,10,&dropRng->_pos,&local_b8,GHIDRA_CAST<Entity *>(dropRng),0,uVar7);
|
|
effect = GHIDRA_CAST<int *>(__RTDynamicCast(blueFly,uVar12,pTVar13,pTVar14,uVar15));
|
|
(**(code **)(*effect + 0x40))(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf34)))) * 10.0);
|
|
effect[0x11e] = 0x3f000000;
|
|
effect[0x117] = 0x5a;
|
|
effect[0x118] = 0x5a;
|
|
(**(code **)(*effect + 0xc))();
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
}
|
|
else if (iVar6 == 0x242) {
|
|
dropRng->_coins = dropRng->_coins + 1;
|
|
if ((dropRng->_coins & 1) == 0) {
|
|
uVar7 = Random();
|
|
blueFly = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,&dropRng->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(dropRng),0,uVar7);
|
|
iVar6 = *GHIDRA_CAST<int *>(blueFly);
|
|
pAVar3 = &blueFly[1]._sprite;
|
|
(pAVar3->_filename)._buf[4] = 'Z';
|
|
(pAVar3->_filename)._buf[5] = '\0';
|
|
(pAVar3->_filename)._buf[6] = '\0';
|
|
(pAVar3->_filename)._buf[7] = '\0';
|
|
pAVar3 = &blueFly[1]._sprite;
|
|
(pAVar3->_filename)._buf[8] = 'Z';
|
|
(pAVar3->_filename)._buf[9] = '\0';
|
|
(pAVar3->_filename)._buf[10] = '\0';
|
|
(pAVar3->_filename)._buf[0xb] = '\0';
|
|
(**(code **)(iVar6 + 0x40))(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf34)))) * 7.0);
|
|
blueFly->Update();
|
|
tmpColor._tint[0] = 1.0;
|
|
tmpColor._tint[1] = 1.0;
|
|
tmpColor._tint[2] = 1.0;
|
|
tmpColor._tint[3] = 1.0;
|
|
tmpColor._offset[0] = 0.0;
|
|
tmpColor._colorize[0] = 6.0714;
|
|
tmpColor._colorize[1] = 5.7857;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 1.0;
|
|
tmpColor._offset[1] = 0.0;
|
|
tmpColor._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&blueFly->_sprite))))->Sprite::SetColor(&tmpColor);
|
|
pvVar5 = local_b0;
|
|
}
|
|
}
|
|
else if (iVar6 == 0x27f) {
|
|
uVar7 = Random();
|
|
if (uVar7 % 10 != 0) {
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
puVar1 = &dropRng->_linkedEntity;
|
|
if (dropRng->_linkedEntity != 0) {
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
blueFly = (GHIDRA_CAST<Entity_Player *>((dropRng->_player)))->Entity_Player::AddBlueFlies(1,&dropRng->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
if (blueFly == GHIDRA_CAST<Entity *>(0x0)) {
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
if (*puVar1 != 0) {
|
|
local_a0 = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_a0);
|
|
}
|
|
*puVar1 = blueFly;
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
return GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
local_ac = 0.8;
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((dropRng->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar4 == 0) {
|
|
local_84 = 1.0;
|
|
}
|
|
else {
|
|
local_84 = 2.0;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((dropRng->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar4 != 0) {
|
|
local_ac = 1.0;
|
|
}
|
|
fallingAccel = 0.0;
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::Color();
|
|
iVar6 = _get_index_plus_one_if_kind_4_5();
|
|
local_a0 = GHIDRA_CAST<int *>(((float)(iVar6 + -1) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 8)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 4))
|
|
));
|
|
uVar7 = Random();
|
|
tearStats = GHIDRA_CAST<float *>((GHIDRA_INT(pvVar5) + 0x60));
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0xa8)) <=
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10) {
|
|
tearStats = GHIDRA_CAST<float *>((GHIDRA_INT(pvVar5) + 0x18));
|
|
}
|
|
tearDamage = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf30)))) * *tearStats * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf34)))) *
|
|
(float)local_a0;
|
|
fVar8 = sqrtf(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((dropRng)) + 0xf30)))));
|
|
fVar8 = fVar8 * tearStats[1] * local_ac;
|
|
tearScale = fVar8;
|
|
spectralFlags =
|
|
BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>(&local_e0),&g_tearFlagSpectral,GHIDRA_CAST<BitSet128 *>((tearStats + 0xe)));
|
|
local_a4 = GHIDRA_UINT(spectralFlags->_l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spectralFlags->_l) + 4));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(spectralFlags->_h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spectralFlags->_h) + 4));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4;
|
|
local_80 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4)));
|
|
local_7c = (float)GHIDRA_UINT(local_98._h);
|
|
local_70 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity *>(local_98._h))) + 0x4)));
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(GHIDRA_CAST<ColorMod *>((tearStats + 3)));
|
|
local_a0 = GHIDRA_CAST<int *>(tearStats[2]);
|
|
velocity.x = velocity.x * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_b0) + 0xc));
|
|
velocity.y = velocity.y * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_b0) + 0xc));
|
|
uVar7 = dropRng->_subtype;
|
|
local_b0 = (void *)velocity.x;
|
|
local_ac = velocity.y;
|
|
local_9c = local_a0;
|
|
if (uVar7 < 0x9f) {
|
|
if (uVar7 == 0x9e) {
|
|
scratchVec.x = velocity.x;
|
|
local_d0.y = sqrtf(velocity.y * velocity.y + velocity.x * velocity.x);
|
|
local_b0 = (void *)((float)local_b0 / local_d0.y);
|
|
local_70 = GHIDRA_CAST<Entity *>(0x0);
|
|
local_b8.y = (float)g_game->_room;
|
|
local_80 = 0;
|
|
local_ac = local_ac / local_d0.y;
|
|
local_7c = 0.0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_b8.y) + 0x1264)) != 0) {
|
|
do {
|
|
blueFly = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_b8.y) + 0x125c)) + local_80 * 4));
|
|
fVar8 = (blueFly->_pos).y - (dropRng->_pos).y;
|
|
fVar10 = (blueFly->_pos).x - (dropRng->_pos).x;
|
|
scratchVec.y = sqrtf(fVar8 * fVar8 + fVar10 * fVar10);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((blueFly)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (((bVar4 != 0) && ((blueFly->_flags & 0x20000000) == 0)) && (blueFly->_dead == 0)) {
|
|
local_a0 = GHIDRA_CAST<int *>(((blueFly->_pos).x - (dropRng->_pos).x));
|
|
local_c4 = GHIDRA_CAST<Entity_Familiar *>(((blueFly->_pos).y - (dropRng->_pos).y));
|
|
fVar8 = sqrtf((float)local_a0 * (float)local_a0 + (float)local_c4 * (float)local_c4);
|
|
pEVar11 = local_c4;
|
|
effect = local_a0;
|
|
if (0.0 < fVar8) {
|
|
pEVar11 = GHIDRA_CAST<Entity_Familiar *>(((float)local_c4 * (1.0 / fVar8)));
|
|
effect = GHIDRA_CAST<int *>(((float)local_a0 * (1.0 / fVar8)));
|
|
}
|
|
fVar8 = (float)local_b0 * (float)effect + local_ac * (float)pEVar11;
|
|
if (0.8 <= fVar8) {
|
|
fVar10 = 800.0 - scratchVec.y;
|
|
if (fVar10 <= 0.0) {
|
|
fVar10 = 0.0;
|
|
}
|
|
fVar9 = 400.0 - blueFly->_health;
|
|
if (fVar9 <= 0.0) {
|
|
fVar9 = 0.0;
|
|
}
|
|
fVar9 = fVar8 * 2000.0 + 0.0 + fVar10 + fVar9;
|
|
if (local_7c < fVar9) {
|
|
local_7c = fVar9;
|
|
local_70 = blueFly;
|
|
}
|
|
}
|
|
}
|
|
blueFly = local_70;
|
|
local_80 = local_80 + 1;
|
|
} while (local_80 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_b8.y) + 0x1264)));
|
|
if (local_70 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
fVar8 = (dropRng->_pos).y - (local_70->_pos).y;
|
|
fVar10 = (dropRng->_pos).x - (local_70->_pos).x;
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar10 * fVar10);
|
|
scratchVec.y = (fVar8 * (blueFly->_velocity).y * 0.05 + (blueFly->_pos).y) -
|
|
(dropRng->_pos).y;
|
|
scratchVec.x = (fVar8 * (blueFly->_velocity).x * 0.05 + (blueFly->_pos).x) -
|
|
(dropRng->_pos).x;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&scratchVec)))->Vector::Resized(&local_b8,local_d0.y);
|
|
velocity.x = vecResult->x;
|
|
velocity.y = vecResult->y;
|
|
}
|
|
}
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
switch(uVar7) {
|
|
case 0x26:
|
|
uVar7 = Random();
|
|
local_a0 = GHIDRA_CAST<int *>((((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]
|
|
) * 2.3283064e-10 * 40.0 - 20.0) * 0.017453292));
|
|
local_ac = cos((float)local_a0);
|
|
fVar8 = sin((float)local_a0);
|
|
fVar10 = fVar8 * velocity.x;
|
|
velocity.x = local_ac * velocity.x - fVar8 * velocity.y;
|
|
velocity.y = local_ac * velocity.y + fVar10;
|
|
break;
|
|
case 0x28:
|
|
uVar7 = Random();
|
|
local_a8 = GHIDRA_CAST<int *>(((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)])
|
|
* 2.3283064e-10 + 1.0 + 0.0));
|
|
break;
|
|
case 0x2a:
|
|
fallingAccel = 0.6;
|
|
uVar7 = Random();
|
|
local_a8 = GHIDRA_CAST<int *>((0.0 - ((float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 + 5.0)));
|
|
break;
|
|
case 0x2f:
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(dropRng->_player) + 0x1600)) == 0x2f) &&
|
|
(iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(dropRng->_player) + 0x13dc)), iVar6 != 0)) &&
|
|
((*GHIDRA_CAST<int *>((iVar6 + 0x30)) == 6 &&
|
|
((iVar6 = *GHIDRA_CAST<int *>((iVar6 + 0x44)), iVar6 != 0 &&
|
|
(0xf < g_game->_frameCount - *GHIDRA_CAST<int *>((iVar6 + 0x328)))))))) {
|
|
local_ac = *GHIDRA_CAST<float *>((iVar6 + 0x340));
|
|
local_a0 = *GHIDRA_CAST<int **>((iVar6 + 0x33c));
|
|
vecResult = MusicManager::RandomVector(&scratchVec);
|
|
uVar7 = Random();
|
|
local_c4 = GHIDRA_CAST<Entity_Familiar *>((dropRng->_pos).x);
|
|
fVar8 = (dropRng->_pos).y;
|
|
fallingAccel = 1.2;
|
|
fVar10 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
scratchVec.y = fVar10 * vecResult->y * 120.0 + local_ac;
|
|
local_b8.y = fVar10 * vecResult->x * 120.0 + (float)local_a0;
|
|
velocity.y = (scratchVec.y - fVar8) / 20.0;
|
|
velocity.x = (local_b8.y - (float)local_c4) / 20.0;
|
|
fVar10 = velocity.y * velocity.y + velocity.x * velocity.x;
|
|
local_d0.y = velocity.y;
|
|
local_b0 = (void *)velocity.y;
|
|
local_ac = fVar8;
|
|
local_a8 = GHIDRA_CAST<int *>(velocity.x);
|
|
local_a0 = GHIDRA_CAST<int *>(velocity.x);
|
|
if (225.0 < fVar10) {
|
|
fVar8 = sqrtf(fVar10);
|
|
local_a8 = local_a0;
|
|
local_b0 = (void *)local_d0.y;
|
|
if (0.0 < fVar8) {
|
|
local_b0 = (void *)((15.0 / fVar8) * local_d0.y);
|
|
local_a8 = GHIDRA_CAST<int *>(((15.0 / fVar8) * (float)local_a0));
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagExplosive._l);
|
|
tearDamage = tearDamage * 4.0 + 8.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagExplosive._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagExplosive._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagExplosive._h)) + 0x4)));
|
|
tearScale = tearScale * 1.5;
|
|
velocity.x = (float)local_a8;
|
|
velocity.y = (float)local_b0;
|
|
local_70 = (Entity *)
|
|
sqrtf((local_ac - scratchVec.y) * (local_ac - scratchVec.y) +
|
|
((float)local_c4 - local_b8.y) * ((float)local_c4 - local_b8.y));
|
|
fVar8 = sqrtf((float)local_b0 * (float)local_b0 + (float)local_a8 * (float)local_a8);
|
|
local_70 = GHIDRA_CAST<Entity *>(((float)local_70 / fVar8));
|
|
fVar8 = pow(0.9,(float)local_70);
|
|
fVar8 = (fVar8 - 1.0) * -9.491221;
|
|
if (fVar8 <= 0.01) {
|
|
fVar8 = 0.01;
|
|
}
|
|
local_a8 = GHIDRA_CAST<int *>(((18.0 - ((float)local_70 - fVar8) * 13.0) / fVar8));
|
|
}
|
|
break;
|
|
case 0x38:
|
|
local_a8 = GHIDRA_CAST<int *>(0x3f19999a);
|
|
break;
|
|
case 0x4d:
|
|
switchD_00438fa0_caseD_4d:
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
scratchVec.y = (layer->_color)._tint[0] * 0.5;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
local_b8.y = (layer->_color)._tint[1] * 0.5;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5;
|
|
tmpColor._colorize[0] = 0.0;
|
|
tmpColor._colorize[1] = 0.0;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 0.0;
|
|
tmpColor._tint[3] = 1.0;
|
|
tmpColor._tint[0] = scratchVec.y * 1.25;
|
|
tmpColor._tint[1] = local_b8.y * 1.25;
|
|
tmpColor._tint[2] = tmpColor._offset[2] * 1.25;
|
|
tmpColor._offset[0] = scratchVec.y * 0.25;
|
|
tmpColor._offset[1] = local_b8.y * 0.25;
|
|
tmpColor._offset[2] = tmpColor._offset[2] * 0.25;
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(&tmpColor);
|
|
break;
|
|
case 0x66:
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
scratchVec.y = (layer->_color)._tint[0] * 0.5;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
local_b8.y = (layer->_color)._tint[1] * 0.5;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5;
|
|
tmpColor._colorize[0] = 0.0;
|
|
tmpColor._colorize[1] = 0.0;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 0.0;
|
|
tmpColor._tint[3] = 1.0;
|
|
tmpColor._tint[0] = scratchVec.y * 1.25;
|
|
tmpColor._tint[1] = local_b8.y * 1.25;
|
|
tmpColor._tint[2] = tmpColor._offset[2] * 1.25;
|
|
tmpColor._offset[0] = scratchVec.y * 0.25;
|
|
tmpColor._offset[1] = local_b8.y * 0.25;
|
|
tmpColor._offset[2] = tmpColor._offset[2] * 0.25;
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(&tmpColor);
|
|
uVar7 = Random();
|
|
if ((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 < 0.15) {
|
|
switch(dropRng->_coins) {
|
|
case 1:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagPoison._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagPoison._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._h)) + 0x4)));
|
|
break;
|
|
case 2:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagFreeze._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagFreeze._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._h)) + 0x4)));
|
|
break;
|
|
case 3:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagConfusion._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagConfusion._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagConfusion._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagConfusion._h)) + 0x4)));
|
|
break;
|
|
case 4:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagBurn._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagBurn._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._h)) + 0x4)));
|
|
break;
|
|
case 5:
|
|
dropRng = &dropRng->_dropRNG;
|
|
local_b8.y = (float)(GHIDRA_CAST<RNG *>((dropRng)))->RNG::Next();
|
|
uVar7 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::Next();
|
|
vecResult = RandomVector(&local_d0,uVar7);
|
|
fVar8 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::RandomFloat();
|
|
dropRng = local_c4;
|
|
scratchVec.x = fVar8 * 2.0 + 2.0;
|
|
scratchVec.y = scratchVec.x * vecResult->y;
|
|
scratchVec.x = scratchVec.x * vecResult->x;
|
|
blueFly = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,3,&local_c4->_pos,&scratchVec,GHIDRA_CAST<Entity *>(0x0),0,
|
|
GHIDRA_UINT(local_b8.y));
|
|
blueFly->Update();
|
|
}
|
|
}
|
|
break;
|
|
case 0x7b:
|
|
local_e0._seed = dropRng->_initSeed;
|
|
local_e0._shift3 = 9;
|
|
local_e0._shift1 = 2;
|
|
local_e0._shift2 = 0x15;
|
|
familiar_wisp_pick_tear_color(&local_e0,GHIDRA_CAST<int *>(&local_a0),&local_98);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = GHIDRA_UINT(local_98._l) | GHIDRA_UINT(g_tearFlagSpectral._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_98._h) | GHIDRA_UINT(g_tearFlagSpectral._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4)));
|
|
scratchVec.y = (GHIDRA_CAST<RNG *>((&local_e0)))->RNG::RandomFloat();
|
|
tearDamage = (scratchVec.y * 0.4 + 0.8) * tearDamage;
|
|
fVar8 = (GHIDRA_CAST<RNG *>((&local_e0)))->RNG::RandomFloat();
|
|
fallingAccel = 0.0;
|
|
local_d0.y = fVar8 * 0.4 - 0.2;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
scratchVec.y = (layer->_color)._tint[0] * 0.5;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
local_b8.y = (layer->_color)._tint[1] * 0.5;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5;
|
|
tmpColor._colorize[0] = 0.0;
|
|
tmpColor._colorize[1] = 0.0;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 0.0;
|
|
tmpColor._tint[3] = 1.0;
|
|
tmpColor._tint[0] = scratchVec.y * 1.25;
|
|
tmpColor._tint[1] = local_b8.y * 1.25;
|
|
tmpColor._tint[2] = tmpColor._offset[2] * 1.25;
|
|
tmpColor._offset[0] = scratchVec.y * 0.25;
|
|
tmpColor._offset[1] = local_b8.y * 0.25;
|
|
tmpColor._offset[2] = tmpColor._offset[2] * 0.25;
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(&tmpColor);
|
|
fVar8 = (GHIDRA_CAST<RNG *>((&local_e0)))->RNG::RandomFloat();
|
|
local_9c = local_a0;
|
|
scratchVec.y = fVar8 * 0.6 + 0.7;
|
|
velocity.y = scratchVec.y * velocity.y;
|
|
velocity.x = scratchVec.y * velocity.x;
|
|
local_a8 = GHIDRA_CAST<int *>(local_d0.y);
|
|
}
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
if (0x204 < uVar7) {
|
|
if (uVar7 == 0x246) {
|
|
pvVar5 = dropRng->_player;
|
|
iVar6 = TemporaryEffects::GetCollectibleEffectNum
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(pvVar5) + 0x1508)),0x246);
|
|
scratchVec.y = (float)iVar6 * 0.75;
|
|
iVar6 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(pvVar5) + 0x1508)))))->TemporaryEffects::GetNullEffectNum(0x47);
|
|
local_84 = (float)iVar6 * 0.3 + scratchVec.y + local_84;
|
|
fVar8 = sqrtf(local_84);
|
|
tearScale = fVar8 * 0.23 + local_84 * 0.01 + 0.55;
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
if (uVar7 == 0x263) {
|
|
tearDamage = (float)dropRng->_keys * 0.5 * tearDamage;
|
|
tearScale = ((float)dropRng->_keys * 0.1 + 1.0) * fVar8;
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
if (uVar7 != 0x1000e) goto switchD_00438fa0_caseD_27;
|
|
LAB_00439c27:
|
|
vecResult = MusicManager::RandomVector(&scratchVec);
|
|
uVar7 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar10 = fVar8 * vecResult->y;
|
|
fVar8 = fVar8 * vecResult->x;
|
|
velocity.y = fVar10 + fVar10 + velocity.y;
|
|
velocity.x = fVar8 + fVar8 + velocity.x;
|
|
uVar7 = Random();
|
|
fallingAccel = 0.5;
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.25;
|
|
velocity.y = fVar8 * velocity.y;
|
|
velocity.x = fVar8 * velocity.x;
|
|
uVar7 = Random();
|
|
rngResult = Random();
|
|
tearScale = ((float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)])
|
|
* 2.3283064e-10 * 0.05 + ((float)(uVar7 & 1) + 0.0) * 0.4 + 0.9) * tearScale;
|
|
uVar7 = Random();
|
|
local_a8 = GHIDRA_CAST<int *>((0.0 - ((float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10
|
|
* 15.0 + 5.0)));
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
if (uVar7 == 0x204) {
|
|
dropRng->_coins = dropRng->_coins + 1;
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
switch(uVar7) {
|
|
case 0x12a:
|
|
goto switchD_00438fa0_caseD_4d;
|
|
default:
|
|
goto switchD_00438fa0_caseD_27;
|
|
case 0x144:
|
|
break;
|
|
case 0x145:
|
|
local_9c = GHIDRA_CAST<int *>(0x1);
|
|
goto LAB_00439c27;
|
|
case 0x196:
|
|
local_e0._seed = (dropRng->_dropRNG)._seed;
|
|
local_e0._shift1 = 2;
|
|
local_e0._shift2 = 7;
|
|
local_e0._shift3 = 7;
|
|
scratchVec.y = (GHIDRA_CAST<RNG *>((&local_e0)))->RNG::RandomFloat();
|
|
tearDamage = (scratchVec.y * 2.0 - 1.0) + tearDamage;
|
|
goto switchD_00438fa0_caseD_27;
|
|
}
|
|
uVar7 = Random();
|
|
switch(uVar7 % 9) {
|
|
case 1:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagBurn._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagBurn._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._h)) + 0x4)));
|
|
local_9c = GHIDRA_CAST<int *>(0x5);
|
|
break;
|
|
case 2:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagCharm._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCharm._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagCharm._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCharm._h)) + 0x4)));
|
|
tearColor._tint[0] = 1.0;
|
|
tearColor._tint[1] = 0.0;
|
|
tearColor._tint[2] = 1.0;
|
|
tearColor._tint[3] = 1.0;
|
|
tearColor._offset[0] = 0.19607845;
|
|
tearColor._offset[1] = 0.0;
|
|
tearColor._offset[2] = 0.0;
|
|
break;
|
|
case 3:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagConfusion._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagConfusion._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagConfusion._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagConfusion._h)) + 0x4)));
|
|
tearColor._tint[0] = 0.5;
|
|
tearColor._tint[1] = 0.5;
|
|
tearColor._tint[2] = 0.5;
|
|
tearColor._tint[3] = 1.0;
|
|
break;
|
|
case 4:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagFear._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFear._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagFear._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFear._h)) + 0x4)));
|
|
tearColor._tint[0] = 1.0;
|
|
tearColor._tint[1] = 1.0;
|
|
tearColor._tint[2] = 0.455;
|
|
tearColor._tint[3] = 1.0;
|
|
tearColor._offset[0] = 0.169;
|
|
tearColor._offset[1] = 0.145;
|
|
tearColor._offset[2] = 0.0;
|
|
break;
|
|
case 5:
|
|
tearColor._tint[0] = 1.25;
|
|
tearColor._tint[1] = 0.05;
|
|
tearColor._tint[2] = 0.15;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._h)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagFreeze._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagFreeze._h);
|
|
goto LAB_00439f99;
|
|
case 6:
|
|
tearColor._tint[0] = 0.4;
|
|
tearColor._tint[1] = 0.97;
|
|
tearColor._tint[2] = 0.5;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._h)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = GHIDRA_UINT(g_tearFlagPoison._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(g_tearFlagPoison._h);
|
|
LAB_00439f99:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(local_98._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(local_98._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4)));
|
|
tearColor._tint[3] = 1.0;
|
|
tearColor._offset[0] = 0.0;
|
|
tearColor._offset[1] = 0.0;
|
|
tearColor._offset[2] = 0.0;
|
|
break;
|
|
case 7:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagSlow._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagSlow._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._h)) + 0x4)));
|
|
tearColor._tint[0] = 2.0;
|
|
tearColor._tint[1] = 2.0;
|
|
tearColor._tint[2] = 2.0;
|
|
tearColor._tint[3] = 1.0;
|
|
tearColor._offset[0] = 0.19607845;
|
|
tearColor._offset[1] = 0.19607845;
|
|
tearColor._offset[2] = 0.19607845;
|
|
break;
|
|
case 8:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x0))) = local_a4 | GHIDRA_UINT(g_tearFlagShrink._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4))) = local_80 | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagShrink._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x0))) = GHIDRA_UINT(local_7c) | GHIDRA_UINT(g_tearFlagShrink._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4))) = GHIDRA_UINT(local_70) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagShrink._h)) + 0x4)));
|
|
tearColor._colorize[0] = 0.3;
|
|
tearColor._colorize[1] = 0.4;
|
|
tearColor._colorize[2] = 1.0;
|
|
tearColor._colorize[3] = 1.5;
|
|
}
|
|
switchD_00438fa0_caseD_27:
|
|
local_70 = GHIDRA_CAST<Entity *>(g_vectorZero.x);
|
|
local_7c = g_vectorZero.y;
|
|
if (dropRng->_subtype == 0x15b) {
|
|
vecResult = (GHIDRA_CAST<Vector *>((&velocity)))->Vector::Normalized(&local_b8);
|
|
scratchVec.y = cos(1.5707964);
|
|
fVar8 = sin(1.5707964);
|
|
local_70 = GHIDRA_CAST<Entity *>(((vecResult->x * scratchVec.y - vecResult->y * fVar8) * 5.0));
|
|
local_7c = (vecResult->y * scratchVec.y + vecResult->x * fVar8) * 5.0;
|
|
uVar7 = Random();
|
|
scratchVec.x = (float)local_70 + (dropRng->_pos).x;
|
|
scratchVec.y = local_7c + (dropRng->_pos).y;
|
|
shot = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,GHIDRA_UINT(local_9c),&scratchVec,&velocity,GHIDRA_CAST<Entity *>(dropRng),0,uVar7);
|
|
uVar7 = Random();
|
|
shot->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10
|
|
* 0.2 + (float)local_a8;
|
|
shot->_fallingAccel = fallingAccel;
|
|
shot->SetCollisionDamage(tearDamage * local_84);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = GHIDRA_UINT(local_98._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = GHIDRA_UINT(local_98._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4)));
|
|
(GHIDRA_CAST<Entity_Tear *>((shot)))->Entity_Tear::SetTearFlags(flags);
|
|
(GHIDRA_CAST<Entity_Tear *>((shot)))->Entity_Tear::SetScale(tearScale);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(shot))))->Entity::SetParent(GHIDRA_CAST<Entity *>(dropRng));
|
|
shot->SetColor(&tearColor,0xffffffff,0xff,0,1);
|
|
uVar7 = Random();
|
|
local_70 = GHIDRA_CAST<Entity *>(-(float)local_70);
|
|
local_7c = -local_7c;
|
|
shot->_tearIdx = uVar7 & 1;
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((dropRng->_player)))->Entity_Player::HasTrinket(0x7f,0);
|
|
if (bVar4 != 0) {
|
|
TryFireTear(dropRng,shot);
|
|
}
|
|
}
|
|
uVar7 = Random();
|
|
scratchVec.x = (float)local_70 + (dropRng->_pos).x;
|
|
scratchVec.y = local_7c + (dropRng->_pos).y;
|
|
shot = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,GHIDRA_UINT(local_9c),&scratchVec,&velocity,GHIDRA_CAST<Entity *>(dropRng),0,uVar7);
|
|
uVar7 = Random();
|
|
shot->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10 *
|
|
0.2 + (float)local_a8;
|
|
shot->_fallingAccel = fallingAccel;
|
|
shot->SetCollisionDamage(tearDamage * local_84);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x0))) = GHIDRA_UINT(local_98._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x0))) = GHIDRA_UINT(local_98._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_98._h)) + 0x4)));
|
|
(GHIDRA_CAST<Entity_Tear *>((shot)))->Entity_Tear::SetTearFlags(flags_00);
|
|
(GHIDRA_CAST<Entity_Tear *>((shot)))->Entity_Tear::SetScale(tearScale);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(shot))))->Entity::SetParent(GHIDRA_CAST<Entity *>(dropRng));
|
|
shot->SetColor(&tearColor,0xffffffff,0xff,0,1);
|
|
uVar7 = Random();
|
|
shot->_tearIdx = uVar7 & 1;
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((dropRng->_player)))->Entity_Player::HasTrinket(0x7f,0);
|
|
if (bVar4 != 0) {
|
|
TryFireTear(dropRng,shot);
|
|
}
|
|
return shot;
|
|
}
|
|
|
|
// 0043a5e0
|
|
uint32_t Entity_Familiar::wisp_take_damage(float *param_2, uint32_t *param_3, int *param_4)
|
|
{
|
|
uint8_t bVar1;
|
|
char cVar2;
|
|
Entity *fearTarget;
|
|
uint32_t uVar3;
|
|
uint32_t uVar4;
|
|
Entity_Effect *spawnedEffect;
|
|
EntityRef *pEVar5;
|
|
int unusedArg;
|
|
bool bVar6;
|
|
Entity_Familiar *local_3c;
|
|
Entity *local_38;
|
|
EntityRef selfRef;
|
|
Manager *manager;
|
|
uint32_t *parentSlot;
|
|
void *room;
|
|
int sourceType;
|
|
int wispItem;
|
|
|
|
local_3c = this;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasInvincibility(0,GHIDRA_CAST<EntityRef *>(0x0));
|
|
if (bVar1 != 0) {
|
|
return 0;
|
|
}
|
|
sourceType = *param_4;
|
|
if (((sourceType == 1) || (sourceType == 3)) && ((*param_3 & 0x1000000) != 0)) {
|
|
return 0;
|
|
}
|
|
if (this->_variant != 0xce) {
|
|
return 1;
|
|
}
|
|
wispItem = this->_subtype;
|
|
if (wispItem < 0xa1) {
|
|
if (wispItem == 0xa0) {
|
|
if (0x3dd < sourceType - 10U) {
|
|
return 1;
|
|
}
|
|
uVar4 = Random();
|
|
spawnedEffect =
|
|
(Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x13,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
local_38 = this->_player;
|
|
parentSlot = &spawnedEffect->_parent;
|
|
local_3c = GHIDRA_CAST<Entity_Familiar *>(spawnedEffect);
|
|
if (spawnedEffect->_parent != 0) {
|
|
local_3c = GHIDRA_CAST<Entity_Familiar *>(parentSlot);
|
|
msvc::multiset<unsigned_int>::erase(&local_3c);
|
|
}
|
|
*parentSlot = local_38;
|
|
if (local_38 != (void *)0x0) {
|
|
msvc::multiset<unsigned_int>::insert(parentSlot);
|
|
}
|
|
spawnedEffect->SetCollisionDamage(0x41400000);
|
|
local_3c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_UINT(g_vectorOne.x) ^ 0x80000000));
|
|
local_38 = GHIDRA_CAST<Entity *>(-g_vectorOne.y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedEffect))))->Entity::SetSize(80.0,
|
|
(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1);
|
|
spawnedEffect->_subtype = 1;
|
|
return 1;
|
|
}
|
|
switch(wispItem) {
|
|
case 0x28:
|
|
if ((*param_3 & 4) != 0) {
|
|
return 0;
|
|
}
|
|
if ((GHIDRA_CAST<Entity *>(param_4[9]) != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(param_4[9]))))->Entity::IsEnemy(), bVar1 != 0)) {
|
|
*param_2 = *param_2 * 3.0;
|
|
}
|
|
break;
|
|
case 0x3a:
|
|
if (sourceType < 10) {
|
|
return 0;
|
|
}
|
|
bVar6 = sourceType == 1000;
|
|
goto LAB_0043a7f7;
|
|
case 0x5d:
|
|
if (((this->_target == 0) && ((sourceType < 10 || (sourceType == 1000)))) &&
|
|
(GHIDRA_CAST<Entity *>(param_4[9]) != GHIDRA_CAST<Entity *>(0x0))) {
|
|
fearTarget = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(param_4[9]))))->Entity::GetLastSpawner();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((fearTarget)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar1 != 0) {
|
|
selfRef._type = this->_type;
|
|
selfRef._spawnerType = this->_spawnerType;
|
|
selfRef._position.x = (this->_pos).x;
|
|
selfRef._position.y = (this->_pos).y;
|
|
selfRef._spawnerVariant = this->_spawnerVariant;
|
|
selfRef._variant = this->_variant;
|
|
selfRef._velocity.x = (this->_velocity).x;
|
|
selfRef._velocity.y = (this->_velocity).y;
|
|
if ((this->_flags & 0x20000000) == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
uVar4 = 2;
|
|
}
|
|
local_3c = GHIDRA_CAST<Entity_Familiar *>((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&this->_flags) + 4)) & 0x400000));
|
|
if (local_3c == GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
uVar3 = 4;
|
|
}
|
|
selfRef._flags = uVar3 | uVar4 | GHIDRA_UINT(((this->_flags & 0x100) != 0));
|
|
selfRef._entity = this;
|
|
(GHIDRA_CAST<Entity *>((fearTarget)))->Entity::AddFear(&selfRef,2,0);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((fearTarget)))->Entity::HasEntityFlags(0x800);
|
|
if (bVar1 != 0) {
|
|
if (this->_target != 0) {
|
|
local_3c = GHIDRA_CAST<Entity_Familiar *>(&this->_target);
|
|
msvc::multiset<unsigned_int>::erase(&local_3c);
|
|
}
|
|
this->_target = fearTarget;
|
|
if (fearTarget != GHIDRA_CAST<Entity *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(&this->_target);
|
|
}
|
|
this->_counter = 0x96;
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0x7f:
|
|
goto switchD_0043a658_caseD_7f;
|
|
}
|
|
}
|
|
else {
|
|
if (wispItem == 0x27e) {
|
|
if (GHIDRA_CAST<Entity *>(param_4[9]) == GHIDRA_CAST<Entity *>(0x0)) {
|
|
return 0;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(param_4[9]))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar1 == 0) {
|
|
return 0;
|
|
}
|
|
cVar2 = (**(code **)(*GHIDRA_CAST<int *>(param_4[9]) + 0x4c))();
|
|
if ((cVar2 != '\0') && (*GHIDRA_CAST<float *>((param_4[9] + 0x14)) < *GHIDRA_CAST<float *>((param_4[9] + 0x380)))) {
|
|
return 0;
|
|
}
|
|
bVar6 = false;
|
|
Game::AddErasedEnemy(GHIDRA_CAST<Entity *>(param_4[9]));
|
|
uVar4 = 0;
|
|
room = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1264)) != 0) {
|
|
do {
|
|
local_38 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar4 * 4));
|
|
bVar1 = Game::ShouldEraseEnemy(local_38);
|
|
if (bVar1 != 0) {
|
|
Entity::RemoveWithPoof(local_38,unusedArg);
|
|
bVar6 = true;
|
|
}
|
|
this = local_3c;
|
|
manager = g_manager;
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(room) + 0x1264)));
|
|
if (bVar6) {
|
|
local_3c = GHIDRA_CAST<Entity_Familiar *>(0xed);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_3c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_3c),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
pEVar5 = (GHIDRA_CAST<EntityRef *>((&selfRef)))->EntityRef::EntityRef();
|
|
this->Kill(pEVar5);
|
|
return 0;
|
|
}
|
|
if (wispItem != 0x28a) {
|
|
if (wispItem == 0x2be) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
bVar6 = this->_state == 1;
|
|
LAB_0043a7f7:
|
|
if (bVar6) {
|
|
switchD_0043a658_caseD_7f:
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0043aa90
|
|
void Entity_Familiar::ai_wisp()
|
|
{
|
|
uint32_t *puVar1;
|
|
void *pvVar2;
|
|
Entity_Player *player;
|
|
GridEntity_Door *pickup;
|
|
code *pcVar3;
|
|
ANM2 *pAVar4;
|
|
char cVar5;
|
|
uint8_t bVar6;
|
|
uint32_t uVar7;
|
|
int *piVar8;
|
|
Entity *pEVar9;
|
|
LayerState *layer;
|
|
Entity_Laser *laser;
|
|
ColorMod *Color;
|
|
uint32_t extraout_EAX;
|
|
ColorMod *extraout_EAX_00;
|
|
ColorMod *extraout_EAX_01;
|
|
int cooldown;
|
|
float *extraout_EAX_02;
|
|
float *extraout_EAX_03;
|
|
Vector *orbitDistance;
|
|
Entity_Effect *splat;
|
|
EntityRef *killSource;
|
|
Entity_Tear *tear;
|
|
char *anim;
|
|
uint8_t *anim_00;
|
|
Vector *vec;
|
|
ColorMod *color;
|
|
code *extraout_EDX;
|
|
code *extraout_EDX_00;
|
|
code *extraout_EDX_01;
|
|
uint32_t pickupIndex;
|
|
int iVar10;
|
|
bool bVar11;
|
|
float fVar12;
|
|
float fVar13;
|
|
Room *pRVar14;
|
|
Entity *pEVar15;
|
|
float fVar16;
|
|
Entity_Familiar *source;
|
|
EntityRef parentDeadKillSource;
|
|
EntityRef timeoutKillSource;
|
|
EntityRef pickupCollideKillSource;
|
|
EntityRef chestOpenKillSource;
|
|
EntityRef lockUnlockKillSource;
|
|
EntityRef doorUnlockKillSource;
|
|
EntityRef noParentKillSource;
|
|
EntityRef nullEffectKillSource;
|
|
EntityRef gridDamageSource;
|
|
KColor secondaryHueColor;
|
|
EntityRef targetDamageSource;
|
|
EntityRef fearSource;
|
|
Color fadeColor;
|
|
Vector toEnemyDir;
|
|
Vector layerOrbitDistance;
|
|
Vector cardinalVelocity;
|
|
Vector toParentDir;
|
|
Vector lemonadeSplatOffset;
|
|
Vector spawnOrbitPos;
|
|
Vector lemonSplatOffset;
|
|
Vector leadTargetDir;
|
|
Vector ponyOrbitPos;
|
|
Vector chaseVelocity;
|
|
Vector returnVelocity;
|
|
RNG rng;
|
|
uint64_t uStack_2f0;
|
|
Vector whitePonyFireDirection;
|
|
KColor primaryHueColor;
|
|
EntityList_EL nearbyPickups;
|
|
EntityList_EL nuggetTargets [2];
|
|
Vector spawnParentPos;
|
|
Vector toParent;
|
|
Vector rotatedVelocity;
|
|
Vector tearVelocity;
|
|
Vector tearPos;
|
|
EntityList_EL nearbyEnemies;
|
|
Vector leadTargetDelta;
|
|
Vector toTarget;
|
|
Vector toPlayer;
|
|
Vector toEnemy;
|
|
Vector enemyPos;
|
|
Vector ponyFireDirection;
|
|
Vector explosionPos;
|
|
Vector laserOffset;
|
|
Vector clampedOrbitPos;
|
|
uint8_t texture [4];
|
|
int *textureRefBlock;
|
|
Vector orbitPos;
|
|
Vector parentPos;
|
|
Vector aimDirection;
|
|
int updateSteps;
|
|
Vector laserDirection;
|
|
Vector shotDirection;
|
|
Entity *local_1e0;
|
|
uint32_t *local_1dc;
|
|
float local_1d8;
|
|
Entity *local_1d4;
|
|
float local_1d0;
|
|
float local_1cc;
|
|
Vector *local_1c8;
|
|
float local_1c4;
|
|
Entity *local_1c0;
|
|
Entity *local_1bc;
|
|
char isFiring;
|
|
Room *local_1b4;
|
|
Color targetTintColor;
|
|
Color pillPrimaryColor;
|
|
Color pillSecondaryColor;
|
|
Color rainbowPrimaryColor;
|
|
Color explosionColor;
|
|
Color rainbowSecondaryColor;
|
|
ColorMod splatColor;
|
|
ColorMod lemonSplatColor;
|
|
ColorMod lemonadeSplatColor;
|
|
RNG seedRng;
|
|
uint32_t stackCookie;
|
|
void *prevExceptionList;
|
|
uint8_t *puStack_c;
|
|
float ehState;
|
|
Game *game;
|
|
Manager *manager;
|
|
Entity_Pickup *pickup;
|
|
ColorMod *pillLayerColor;
|
|
uint32_t swapValue;
|
|
|
|
ehState = -NAN;
|
|
puStack_c = &LAB_00af2261;
|
|
prevExceptionList = ExceptionList;
|
|
uVar7 = __security_cookie ^ GHIDRA_UINT((&lemonadeSplatColor)[1]._offset);
|
|
ExceptionList = &prevExceptionList;
|
|
if (this->_variant == 0xed) {
|
|
iVar10 = this->_wispCollectibleType;
|
|
}
|
|
else if (this->_variant == 0xce) {
|
|
iVar10 = this->_subtype;
|
|
}
|
|
else {
|
|
iVar10 = 0x248;
|
|
}
|
|
local_1b4 = GHIDRA_CAST<Room *>(this);
|
|
stackCookie = uVar7;
|
|
local_1c8 = ItemConfig::get_wisp_config(iVar10);
|
|
isFiring = *GHIDRA_CAST<char *>(&local_1c8[2].y);
|
|
updateSteps = GHIDRA_INT(this->_updateTime) - GHIDRA_INT(this->_prevUpdateTime);
|
|
if ((this->_variant == 0xce) && (this->_subtype == 0x28a)) {
|
|
iVar10 = this->_target;
|
|
if ((iVar10 == 0) ||
|
|
(((*GHIDRA_CAST<int *>((iVar10 + 0x28)) != 3 || (*GHIDRA_CAST<int *>((iVar10 + 0xd88)) != 6)) ||
|
|
(*GHIDRA_CAST<int *>((iVar10 + 0xd4c)) < 1)))) {
|
|
if (this->_state == 1) {
|
|
this->_state = 0;
|
|
this->_fireCooldown = 0;
|
|
this->_entityGridCollisionClass = 0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
piVar8 = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(texture);
|
|
ehState = 0.0;
|
|
anim_00 = s_Idle2;
|
|
if (*GHIDRA_CAST<uint32_t *>((*piVar8 + 0x10)) < 0x81) {
|
|
anim_00 = s_Idle;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(anim_00,0);
|
|
ehState = 1.4013e-45;
|
|
if (((textureRefBlock != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar5 = (**(code **)(*textureRefBlock + 0xc))(uVar7), cVar5 != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(texture);
|
|
}
|
|
ehState = -NAN;
|
|
}
|
|
goto LAB_0043ac23;
|
|
}
|
|
bVar11 = false;
|
|
if (this->_state == 0) {
|
|
this->_state = 1;
|
|
this->_fireCooldown = 0;
|
|
this->_entityGridCollisionClass = 3;
|
|
goto LAB_0043ac23;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0043ac23:
|
|
bVar11 = this->_state == 0;
|
|
}
|
|
local_1e0 = GHIDRA_CAST<Entity *>(0x3f800000);
|
|
if (bVar11) {
|
|
if (this->_orbitLayer < 0) {
|
|
fVar12 = (this->_formationOffset).x;
|
|
if ((fVar12 != g_vectorZero.x) || ((this->_formationOffset).y != g_vectorZero.y)) {
|
|
(this->_pos).x = fVar12;
|
|
(this->_pos).y = (this->_formationOffset).y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
}
|
|
}
|
|
else {
|
|
pEVar9 = get_orbit_parent(this);
|
|
local_1bc = GHIDRA_CAST<Entity *>((pEVar9->_pos).x);
|
|
local_1cc = (pEVar9->_velocity).y;
|
|
local_1d0 = (pEVar9->_pos).y;
|
|
local_1c4 = (pEVar9->_velocity).x;
|
|
if (((this->_subtype == 0x2c5) || (this->_subtype == 0x25c)) &&
|
|
((pEVar15 = GHIDRA_CAST<Entity *>((this->_targetPosition).x), (float)pEVar15 != g_vectorZero.x ||
|
|
((this->_targetPosition).y != g_vectorZero.y)))) {
|
|
local_1d0 = (this->_targetPosition).y;
|
|
local_1c4 = g_vectorZero.x;
|
|
local_1cc = g_vectorZero.y;
|
|
local_1bc = pEVar15;
|
|
}
|
|
if ((pEVar9->_type == 3) && (pEVar9->_variant == 0xf0)) {
|
|
local_1c4 = local_1c4 * 0.5;
|
|
local_1cc = local_1cc * 0.5;
|
|
}
|
|
parentPos.x = (float)local_1bc;
|
|
parentPos.y = local_1d0;
|
|
GetOrbitPosition(this,&orbitPos,&parentPos);
|
|
if (this->_subtype == 0x25c) {
|
|
Room::GetClampedPositionImpl(g_game->_room,&clampedOrbitPos,&orbitPos,0.0,0.0,0.0,0.0);
|
|
local_1d4 = GHIDRA_CAST<Entity *>(clampedOrbitPos.x);
|
|
local_1d8 = clampedOrbitPos.y;
|
|
}
|
|
else {
|
|
local_1d8 = orbitPos.y;
|
|
local_1d4 = GHIDRA_CAST<Entity *>(orbitPos.x);
|
|
}
|
|
local_1d0 = local_1d0 - (this->_pos).y;
|
|
local_1bc = GHIDRA_CAST<Entity *>(((float)local_1bc - (this->_pos).x));
|
|
local_1c0 = GHIDRA_CAST<Entity *>(sqrtf(local_1d0 * local_1d0 + (float)local_1bc * (float)local_1bc));
|
|
local_1d0 = local_1d0 * 0.01;
|
|
local_1bc = GHIDRA_CAST<Entity *>(((float)local_1bc * 0.01));
|
|
fVar12 = sqrtf(local_1d0 * local_1d0 + (float)local_1bc * (float)local_1bc);
|
|
if ((8.0 < fVar12) && (0.0 < fVar12)) {
|
|
local_1bc = GHIDRA_CAST<Entity *>(((float)local_1bc * (8.0 / fVar12)));
|
|
local_1d0 = local_1d0 * (8.0 / fVar12);
|
|
}
|
|
fVar12 = (this->_orbitDistance).y;
|
|
orbitDistance = &this->_orbitDistance;
|
|
if ((this->_orbitDistance).x <= fVar12 && fVar12 != (this->_orbitDistance).x) {
|
|
orbitDistance = GHIDRA_CAST<Vector *>(&(this->_orbitDistance).y);
|
|
}
|
|
pEVar15 = GHIDRA_CAST<Entity *>(((((float)local_1c0 - (orbitDistance->x + 10.0)) - 0.0) / 160.0));
|
|
if ((float)pEVar15 <= 0.0) {
|
|
pEVar15 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
if ((float)local_1e0 <= (float)pEVar15) {
|
|
pEVar15 = local_1e0;
|
|
}
|
|
fVar12 = (float)local_1e0 - ((float)pEVar15 + 0.0);
|
|
local_1c0 = GHIDRA_CAST<Entity *>(((float)local_1e0 - fVar12 * fVar12));
|
|
fVar12 = ((float)local_1e0 - (float)local_1c0) + ((float)local_1e0 - (float)local_1c0);
|
|
local_1c4 = (local_1c4 * fVar12) / pEVar9->_friction;
|
|
local_1cc = (local_1cc * fVar12) / pEVar9->_friction;
|
|
local_1d4 = GHIDRA_CAST<Entity *>((((float)local_1d4 - ((this->_pos).x + local_1c4)) * 0.5));
|
|
local_1d8 = (local_1d8 - ((this->_pos).y + local_1cc)) * 0.5;
|
|
fVar12 = sqrtf((float)local_1d4 * (float)local_1d4 + local_1d8 * local_1d8);
|
|
if ((fVar12 <= 5.0) || ((this->_flags & 0x20000000000) != 0)) {
|
|
pEVar9 = local_1d4;
|
|
fVar12 = local_1d8;
|
|
}
|
|
else {
|
|
pEVar9 = local_1d4;
|
|
fVar16 = local_1d8;
|
|
if (0.0 < fVar12) {
|
|
fVar16 = local_1d8 * ((float)local_1e0 / fVar12);
|
|
pEVar9 = GHIDRA_CAST<Entity *>(((float)local_1d4 * ((float)local_1e0 / fVar12)));
|
|
}
|
|
pEVar9 = GHIDRA_CAST<Entity *>(((float)pEVar9 * 4.0));
|
|
fVar12 = fVar16 * 4.0;
|
|
}
|
|
fVar16 = (fVar12 + local_1cc) / this->_friction;
|
|
fVar12 = ((float)pEVar9 + local_1c4) / this->_friction;
|
|
(this->_velocity).y = ((local_1d0 + (this->_velocity).y) - fVar16) * (float)local_1c0 + fVar16
|
|
;
|
|
(this->_velocity).x =
|
|
(((float)local_1bc + (this->_velocity).x) - fVar12) * (float)local_1c0 + fVar12;
|
|
}
|
|
}
|
|
local_1c4 = (this->_health / this->_maxHitPoints) * 0.4 + 0.6;
|
|
if (this->_variant == 0xce) {
|
|
if (this->_subtype == 0x242) {
|
|
local_1c4 = local_1c4 * 1.5;
|
|
}
|
|
else if (this->_subtype == 0x263) {
|
|
local_1c4 = ((float)this->_keys * 0.05 + (float)local_1e0) * local_1c4;
|
|
}
|
|
}
|
|
local_1cc = sqrtf(local_1c4);
|
|
local_1c0 = GHIDRA_CAST<Entity *>((local_1cc * g_vectorOne.x));
|
|
local_1cc = local_1cc * g_vectorOne.y;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(layer->_size).x = (float)local_1c0;
|
|
(layer->_size).y = local_1cc;
|
|
local_1c0 = GHIDRA_CAST<Entity *>((local_1c4 * g_vectorOne.x));
|
|
local_1c4 = local_1c4 * g_vectorOne.y;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
(layer->_size).x = (float)local_1c0;
|
|
(layer->_size).y = local_1c4;
|
|
player = this->_player;
|
|
local_1d8 = g_vectorZero.x;
|
|
local_1bc = GHIDRA_CAST<Entity *>((player->_meleeDamage + player->_meleeDamage));
|
|
local_1d4 = GHIDRA_CAST<Entity *>(g_vectorZero.y);
|
|
local_1cc = 0.0;
|
|
local_1c4 = 0.0;
|
|
this->_collisionDamage = (float)local_1bc;
|
|
local_1d0 = (float)GHIDRA_INT(local_1c8[2].x);
|
|
if (this->_variant != 0xce) goto LAB_0043cdfe;
|
|
uVar7 = this->_subtype;
|
|
if (uVar7 < 299) {
|
|
if (uVar7 == 0x12a) {
|
|
bVar6 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x12a);
|
|
if ((bVar6 != 0) ||
|
|
(bVar6 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x4d),
|
|
bVar6 != 0)) {
|
|
fVar12 = -5.0;
|
|
goto code_r0x0043bfeb;
|
|
}
|
|
fVar12 = 0.0;
|
|
LAB_0043bfef:
|
|
this->_collisionDamage = fVar12;
|
|
bVar6 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if ((bVar6 == 0) &&
|
|
(bVar6 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x12a),
|
|
bVar6 == 0)) {
|
|
local_1c0 = GHIDRA_CAST<Entity *>(0x3e99999a);
|
|
local_1bc = GHIDRA_CAST<Entity *>(0x3f333333);
|
|
local_1b4 = GHIDRA_CAST<Room *>((((float)(GHIDRA_UINT(((g_game->_frameCount - this->_spawnFrame) +
|
|
this->_initSeed)) % 0x3c) + 0.0) / 60.0));
|
|
}
|
|
else {
|
|
local_1c0 = local_1e0;
|
|
local_1bc = local_1e0;
|
|
local_1b4 = GHIDRA_CAST<Room *>((((float)(GHIDRA_UINT(((g_game->_frameCount - this->_spawnFrame) +
|
|
this->_initSeed)) % 0x1e) + 0.0) / 30.0));
|
|
}
|
|
hsv_to_rgb(&primaryHueColor,(float)local_1b4 * 360.0,(float)local_1c0,(float)local_1bc,1.0);
|
|
::(GHIDRA_CAST<Color *>((&rainbowPrimaryColor)))->Color::Color();
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
if (&layer->_color != GHIDRA_CAST<ColorMod *>(extraout_EAX_02)) {
|
|
fVar12 = extraout_EAX_02[1];
|
|
fVar16 = extraout_EAX_02[2];
|
|
fVar13 = extraout_EAX_02[3];
|
|
(layer->_color)._tint[0] = *extraout_EAX_02;
|
|
(layer->_color)._tint[1] = fVar12;
|
|
(layer->_color)._tint[2] = fVar16;
|
|
(layer->_color)._tint[3] = fVar13;
|
|
fVar12 = extraout_EAX_02[5];
|
|
fVar16 = extraout_EAX_02[6];
|
|
fVar13 = extraout_EAX_02[7];
|
|
(layer->_color)._colorize[0] = extraout_EAX_02[4];
|
|
(layer->_color)._colorize[1] = fVar12;
|
|
(layer->_color)._colorize[2] = fVar16;
|
|
(layer->_color)._colorize[3] = fVar13;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) = *GHIDRA_CAST<uint64_t *>((extraout_EAX_02 + 8));
|
|
(layer->_color)._offset[2] = extraout_EAX_02[10];
|
|
}
|
|
fVar12 = (float)local_1b4 + 0.2;
|
|
if ((float)local_1e0 < fVar12) {
|
|
fVar12 = fVar12 - (float)local_1e0;
|
|
}
|
|
hsv_to_rgb(&secondaryHueColor,fVar12 * 360.0,(float)local_1c0,(float)local_1bc,1.0);
|
|
::(GHIDRA_CAST<Color *>((&rainbowSecondaryColor)))->Color::Color();
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
if (&layer->_color != GHIDRA_CAST<ColorMod *>(extraout_EAX_03)) {
|
|
fVar12 = extraout_EAX_03[1];
|
|
fVar16 = extraout_EAX_03[2];
|
|
fVar13 = extraout_EAX_03[3];
|
|
(layer->_color)._tint[0] = *extraout_EAX_03;
|
|
(layer->_color)._tint[1] = fVar12;
|
|
(layer->_color)._tint[2] = fVar16;
|
|
(layer->_color)._tint[3] = fVar13;
|
|
fVar12 = extraout_EAX_03[5];
|
|
fVar16 = extraout_EAX_03[6];
|
|
fVar13 = extraout_EAX_03[7];
|
|
(layer->_color)._colorize[0] = extraout_EAX_03[4];
|
|
(layer->_color)._colorize[1] = fVar12;
|
|
(layer->_color)._colorize[2] = fVar16;
|
|
(layer->_color)._colorize[3] = fVar13;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) = *GHIDRA_CAST<uint64_t *>((extraout_EAX_03 + 8));
|
|
(layer->_color)._offset[2] = extraout_EAX_03[10];
|
|
}
|
|
}
|
|
else {
|
|
switch(uVar7) {
|
|
case 0x28:
|
|
local_1c8 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::GetCollectibleEffect(0x28);
|
|
if ((player->_dead == 0) && (local_1c8 != GHIDRA_CAST<Vector *>(0x0))) {
|
|
pvVar2 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar2) >> 2 < 0x29) {
|
|
iVar10 = 0;
|
|
}
|
|
else {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0xa0));
|
|
}
|
|
if (local_1c8[1].x == (float)(*GHIDRA_CAST<int *>((iVar10 + 0x78)) + -1)) {
|
|
local_1b4 = GHIDRA_CAST<Room *>(((this->_pos).x - (player->_pos).x));
|
|
local_1bc = GHIDRA_CAST<Entity *>(((this->_pos).y - (player->_pos).y));
|
|
fVar12 = sqrtf((float)local_1b4 * (float)local_1b4 + (float)local_1bc * (float)local_1bc
|
|
);
|
|
if (70.0 <= fVar12) {
|
|
pRVar14 = local_1b4;
|
|
pEVar9 = local_1bc;
|
|
}
|
|
else {
|
|
pRVar14 = GHIDRA_CAST<Room *>(((float)local_1b4 * (70.0 / fVar12)));
|
|
pEVar9 = GHIDRA_CAST<Entity *>(((float)local_1bc * (70.0 / fVar12)));
|
|
}
|
|
::(GHIDRA_CAST<Color *>((&explosionColor)))->Color::Color();
|
|
explosionPos.x = (float)pRVar14 + (player->_pos).x;
|
|
explosionPos.y = (float)pEVar9 + (player->_pos).y;
|
|
Game::BombExplosionEffects
|
|
(g_game,&explosionPos,30.0,(BitSet128)ZEXT816(0),Color,GHIDRA_CAST<Entity *>(this),0.75,1,4
|
|
,0);
|
|
}
|
|
}
|
|
break;
|
|
case 0x2c:
|
|
LAB_0043c942:
|
|
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf24))))) {
|
|
case 0:
|
|
iVar10 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf28))));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf28)))) = iVar10 + -1;
|
|
if (iVar10 < 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf24)))) = 1;
|
|
}
|
|
break;
|
|
case 1:
|
|
isFiring = '\0';
|
|
this->_collisionDamage = 0.0;
|
|
if (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c)))) <= 0.0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf24)))) = 3;
|
|
uVar7 = Random();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf28)))) = uVar7 % 0x1e + 0x1e;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c)))) = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c)))) - 0.1;
|
|
}
|
|
break;
|
|
case 2:
|
|
if ((float)local_1e0 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c))))) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf24)))) = 0;
|
|
uVar7 = Random();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf28)))) = uVar7 % 0x1e + 0x3c;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c)))) = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c)))) + 0.1;
|
|
}
|
|
break;
|
|
case 3:
|
|
iVar10 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf28))));
|
|
isFiring = '\0';
|
|
this->_visible = 0;
|
|
this->_collisionDamage = 0.0;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf28)))) = iVar10 + -1;
|
|
if (iVar10 < 0) {
|
|
this->_visible = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf24)))) = 2;
|
|
}
|
|
}
|
|
::(GHIDRA_CAST<Color *>((&fadeColor)))->Color::operator_assign(&(this->_sprite)._color);
|
|
fadeColor._tint[3] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf2c))));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetColor(color);
|
|
break;
|
|
case 0x2f:
|
|
if (((player->_itemState == 0x2f) && (pvVar2 = player->_weapons[0], pvVar2 != (void *)0x0))
|
|
&& ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x30)) == 6 &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x44)) != 0 &&
|
|
(0xf < g_game->_frameCount - *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x44)) + 0x328)))))))) {
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
local_1d8 = 0.0;
|
|
local_1d4 = local_1e0;
|
|
}
|
|
break;
|
|
case 0x31:
|
|
if (((player->_itemState == 0x31) && (player->_itemStateCooldown == 0x1e)) &&
|
|
(this->_counter < 1)) {
|
|
laserDirection.x = (player->_aimDirection).x;
|
|
laserDirection.y = (player->_aimDirection).y;
|
|
if ((laserDirection.x == g_vectorZero.x) && (laserDirection.y == g_vectorZero.y)) {
|
|
laserDirection.x = (this->_targetPosition).x;
|
|
laserDirection.y = (this->_targetPosition).y;
|
|
}
|
|
(GHIDRA_CAST<Vector *>((&laserDirection)))->Vector::Normalize();
|
|
bVar6 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar6 == 0) {
|
|
local_1e0 = GHIDRA_CAST<Entity *>(0x40000000);
|
|
}
|
|
orbitDistance = &laserOffset;
|
|
bVar6 = 0;
|
|
iVar10 = 0xf;
|
|
laserOffset.x = 0.0;
|
|
laserOffset.y = -18.0;
|
|
source = this;
|
|
fVar12 = atan2f(laserDirection.y,laserDirection.x);
|
|
laser = Entity_Laser::ShootAngle
|
|
(3,&this->_pos,fVar12 * 57.295776,iVar10,orbitDistance,GHIDRA_CAST<Entity *>(source),
|
|
bVar6);
|
|
laser->SetCollisionDamage((float)local_1e0 * 3.5);
|
|
laser->_scale = (float)local_1e0 * 0.15 + 0.35;
|
|
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::ResetSpriteScale();
|
|
if (laserDirection.y <= -0.5) {
|
|
fVar12 = -50.0;
|
|
}
|
|
else {
|
|
fVar12 = 3000.0;
|
|
}
|
|
laser->_renderDepthOffset = fVar12;
|
|
laser->Update();
|
|
this->_counter = 8;
|
|
}
|
|
break;
|
|
case 0x38:
|
|
bVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(4,0);
|
|
if (bVar6 != 0) {
|
|
uVar7 = Random();
|
|
if (uVar7 % 6 == 0) {
|
|
uVar7 = Random();
|
|
pEVar9 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
fVar16 = g_vectorOne.x * 0.65;
|
|
fVar12 = g_vectorOne.y * 0.65;
|
|
pAVar4 = &pEVar9[1]._sprite;
|
|
(pAVar4->_filename)._buf[4] = 'Z';
|
|
(pAVar4->_filename)._buf[5] = '\0';
|
|
(pAVar4->_filename)._buf[6] = '\0';
|
|
(pAVar4->_filename)._buf[7] = '\0';
|
|
(pEVar9->_sprite)._scale.x = fVar16;
|
|
pAVar4 = &pEVar9[1]._sprite;
|
|
(pAVar4->_filename)._buf[8] = 'Z';
|
|
(pAVar4->_filename)._buf[9] = '\0';
|
|
(pAVar4->_filename)._buf[10] = '\0';
|
|
(pAVar4->_filename)._buf[0xb] = '\0';
|
|
(pEVar9->_sprite)._scale.y = fVar12;
|
|
pEVar9->SetCollisionDamage(0x40e00000);
|
|
pEVar9->Update();
|
|
splatColor._tint[0] = 1.0;
|
|
splatColor._tint[1] = 1.0;
|
|
splatColor._tint[2] = 1.0;
|
|
splatColor._tint[3] = 1.0;
|
|
splatColor._offset[0] = 0.0;
|
|
splatColor._colorize[0] = 6.0714;
|
|
splatColor._colorize[1] = 5.7857;
|
|
splatColor._colorize[2] = 0.0;
|
|
splatColor._colorize[3] = 1.0;
|
|
splatColor._offset[1] = 0.0;
|
|
splatColor._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar9->_sprite))))->Sprite::SetColor(&splatColor);
|
|
}
|
|
uVar7 = Random();
|
|
if (uVar7 % 6 == 0) {
|
|
uVar7 = Random();
|
|
splat = Entity_NPC::MakeSplat
|
|
(GHIDRA_CAST<Entity_NPC *>(this),
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10
|
|
* 0.5 + 0.2);
|
|
orbitDistance = MusicManager::RandomVector(&lemonSplatOffset);
|
|
lemonSplatColor._offset[0] = 0.7843138;
|
|
lemonSplatColor._offset[1] = 0.7843138;
|
|
lemonSplatColor._offset[2] = 0.0;
|
|
fVar12 = orbitDistance->y;
|
|
iVar10 = *GHIDRA_CAST<int *>(splat);
|
|
fVar16 = (this->_pos).y;
|
|
(splat->_pos).x = orbitDistance->x + orbitDistance->x + (this->_pos).x + 0.0;
|
|
lemonSplatColor._colorize[0] = 0.0;
|
|
lemonSplatColor._colorize[1] = 0.0;
|
|
lemonSplatColor._colorize[2] = 0.0;
|
|
lemonSplatColor._colorize[3] = 0.0;
|
|
(splat->_pos).y = fVar12 + fVar12 + fVar16 + 8.0;
|
|
lemonSplatColor._tint[0] = 0.0;
|
|
lemonSplatColor._tint[1] = 0.0;
|
|
lemonSplatColor._tint[2] = 0.0;
|
|
lemonSplatColor._tint[3] = 0.7;
|
|
(**(code **)(iVar10 + 0x3c))(&lemonSplatColor,0xffffffff,0xff,0,1);
|
|
}
|
|
}
|
|
break;
|
|
case 0x4d:
|
|
fVar12 = 8.0;
|
|
code_r0x0043bfeb:
|
|
fVar12 = (float)local_1bc + fVar12;
|
|
goto LAB_0043bfef;
|
|
case 0x5d:
|
|
puVar1 = &this->_target;
|
|
local_1c8 = GHIDRA_CAST<Vector *>(puVar1);
|
|
if (this->_target != 0) {
|
|
if ((this->_counter < 1) || (*GHIDRA_CAST<char *>((this->_target + 0x173)) != '\0')) {
|
|
msvc::multiset<unsigned_int>::erase(&local_1c8);
|
|
*puVar1 = 0;
|
|
}
|
|
else {
|
|
::(GHIDRA_CAST<Color *>((&targetTintColor)))->Color::Color();
|
|
(*extraout_EDX)(extraout_EAX,2,0,0,1);
|
|
pEVar9 = GHIDRA_CAST<Entity *>(*puVar1);
|
|
(GHIDRA_CAST<EntityRef *>((&fearSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((pEVar9)))->Entity::AddFear(&fearSource,-2,0);
|
|
uVar7 = Random();
|
|
if ((uVar7 & 3) == 0) {
|
|
pcVar3 = *(code **)(*GHIDRA_CAST<int *>(local_1c8->x) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&targetDamageSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(local_1b4));
|
|
(*pcVar3)(0,0x4000000,0,&targetDamageSource,0x1e);
|
|
this = GHIDRA_CAST<Entity_Familiar *>(local_1b4);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0x66:
|
|
if (g_game->_frameCount == this->_spawnFrame) {
|
|
if ((0 < this->_coins) && (GHIDRA_UINT(this->_coins) < 7)) {
|
|
local_1c0 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds)::GetStartSeed();
|
|
if (local_1c0 != pERam00c7e838) {
|
|
uRam00c7e820 = 0;
|
|
uRam00c7e824 = 1;
|
|
uRam00c7e828 = 2;
|
|
uRam00c7e82c = 3;
|
|
local_1c8 = GHIDRA_CAST<Vector *>(&DAT_0000000f);
|
|
uRam00c7e830 = 4;
|
|
uRam00c7e834 = 5;
|
|
uStack_2f0 = 0x900000002;
|
|
local_1bc = GHIDRA_CAST<Entity *>(0x0);
|
|
pEVar9 = local_1c0;
|
|
do {
|
|
if (pEVar9 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(pEVar9) >> 2 ^ GHIDRA_UINT(pEVar9);
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
pEVar9 = GHIDRA_CAST<Entity *>((uVar7 >> 0xf ^ uVar7));
|
|
if (6U - GHIDRA_INT(local_1bc) == 0) {
|
|
uVar7 = 0;
|
|
}
|
|
else {
|
|
uVar7 = GHIDRA_UINT(pEVar9) % (6U - GHIDRA_INT(local_1bc));
|
|
}
|
|
swapValue = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_1bc) * 4 + 0xc7e820));
|
|
iVar10 = GHIDRA_INT((&(local_1bc->_sprite)._filename + -3)) + uVar7;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_1bc) * 4 + 0xc7e820)) =
|
|
*GHIDRA_CAST<uint32_t *>((iVar10 * 4 + 0xc7e820));
|
|
local_1bc = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_1bc)) + 0x1))));
|
|
*GHIDRA_CAST<uint32_t *>((iVar10 * 4 + 0xc7e820)) = swapValue;
|
|
} while (local_1bc < &DAT_00000005);
|
|
this = GHIDRA_CAST<Entity_Familiar *>(local_1b4);
|
|
pERam00c7e838 = local_1c0;
|
|
}
|
|
FUN_00a0f720(*GHIDRA_CAST<int *>(((GHIDRA_CAST<Room *>(this))->_gridPaths[0x184] * 4 + 0xc7e81c)) * 0x14 +
|
|
0xc33a98);
|
|
::(GHIDRA_CAST<Color *>((&pillPrimaryColor)))->Color::Color();
|
|
pillLayerColor = extraout_EAX_00;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 9)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(pillLayerColor);
|
|
::(GHIDRA_CAST<Color *>((&pillSecondaryColor)))->Color::Color();
|
|
pillLayerColor = extraout_EAX_01;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 9)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
::(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(pillLayerColor);
|
|
}
|
|
}
|
|
break;
|
|
case 0x7b:
|
|
seedRng._seed = this->_initSeed;
|
|
seedRng._shift1 = 1;
|
|
seedRng._shift2 = 0xb;
|
|
seedRng._shift3 = 0x10;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&seedRng)))->RNG::RandomInt(0xe);
|
|
local_1d0 = (float)(uVar7 + 0x10);
|
|
break;
|
|
case 0x82:
|
|
iVar10 = player->_fireDirection;
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&ponyFireDirection,iVar10);
|
|
cooldown = this->_fireCooldown;
|
|
if (0 < cooldown) {
|
|
cooldown = cooldown + -1;
|
|
this->_fireCooldown = cooldown;
|
|
}
|
|
if (((-1 < cooldown) && (this->_isInvicible != 0)) &&
|
|
(orbitDistance =
|
|
GetOrbitPosition(this,&ponyOrbitPos,GHIDRA_CAST<Vector *>((GHIDRA_INT(this->_player) + 0x33c))),
|
|
fVar12 = (this->_pos).x - orbitDistance->x, fVar16 = (this->_pos).y - orbitDistance->y,
|
|
fVar16 * fVar16 + fVar12 * fVar12 < 50.0)) {
|
|
this->_isInvicible = 0;
|
|
PlayFloatAnim(this,-1);
|
|
}
|
|
game = g_game;
|
|
cooldown = this->_fireCooldown;
|
|
if (cooldown < 0) {
|
|
if (((this->_collidesWithGrid != 0) || (cooldown < -1)) ||
|
|
(bVar6 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsPositionInRoom(&this->_pos,-100.0), bVar6 == 0)) {
|
|
this->_entityGridCollisionClass = 0;
|
|
pRVar14 = game->_room;
|
|
iVar10 = (GHIDRA_CAST<Room *>((pRVar14)))->Room::GetGridIndex(GHIDRA_CAST<Vector *>((local_1b4->_gridEntities + 0xc6)));
|
|
(GHIDRA_CAST<EntityRef *>((&gridDamageSource)))->EntityRef::constructor(local_1b4->_gridEntities[0xfb]);
|
|
(GHIDRA_CAST<Room *>((pRVar14)))->Room::DamageGridWithSource(iVar10,1,&gridDamageSource);
|
|
(GHIDRA_CAST<Vector *>((local_1b4->_gridEntities + 0xcf)))->x =
|
|
(GHIDRA_CAST<Vector *>((local_1b4->_gridEntities + 0xcf)))->x * 0.5;
|
|
local_1b4->_gridEntities[0xd0] = (void *)((float)local_1b4->_gridEntities[0xd0] * 0.5);
|
|
local_1b4->_gridPaths[0x178] = local_1b4->_gridPaths[0x178] + -1;
|
|
this = GHIDRA_CAST<Entity_Familiar *>(local_1b4);
|
|
if (local_1b4->_gridPaths[0x178] < -10) {
|
|
local_1b4->_gridPaths[0x178] = 0x3c;
|
|
local_1b4->_gridPaths[0x187] = 0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
(this->_sprite)._flipX = ponyFireDirection.x < 0.0;
|
|
if ((iVar10 != -1) && (cooldown < 1)) {
|
|
this->_state = 1;
|
|
this->_isInvicible = 1;
|
|
this->_fireCooldown = -1;
|
|
this->_entityGridCollisionClass = 4;
|
|
(this->_velocity).x = ponyFireDirection.x * 10.0;
|
|
(this->_velocity).y = ponyFireDirection.y * 10.0;
|
|
PlayShootAnim(this,-1);
|
|
}
|
|
}
|
|
iVar10 = 1;
|
|
if (*GHIDRA_CAST<uint8_t *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xe3)) != 0) {
|
|
(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd9] =
|
|
(void *)((float)(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd9] * 0.2);
|
|
}
|
|
goto LAB_0043ce03;
|
|
case 0xaf:
|
|
local_1b4 = g_game->_room;
|
|
local_1bc = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Room *>((local_1b4)))->Room)::GetGridIndex(&this->_pos);
|
|
if ((-1 < GHIDRA_INT(local_1bc)) && (GHIDRA_INT(local_1bc) < 0x1c0)) {
|
|
local_1c8 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Room *>((local_1b4)))->Room)::GetGridCollision(GHIDRA_INT(local_1bc));
|
|
pickup = local_1b4->_gridEntities[GHIDRA_INT(local_1bc)];
|
|
if (pickup != GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickup)) + 0x4)))) == 0x10) {
|
|
if ((((local_1c8 == GHIDRA_CAST<Vector *>(&DAT_00000004)) &&
|
|
(bVar6 = (GHIDRA_CAST<GridEntity_Door *>((pickup)))->GridEntity_Door::IsLocked(), bVar6 != 0)) &&
|
|
((local_1b4->_gridEntities[GHIDRA_INT(local_1bc)]->_doorFlags & 1) == 0)) &&
|
|
(bVar6 = GridEntity_Door::TryUnlock
|
|
(local_1b4->_gridEntities[GHIDRA_INT(local_1bc)],player,1), bVar6 != 0)
|
|
) {
|
|
killSource = &doorUnlockKillSource;
|
|
goto LAB_0043bc25;
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickup)) + 0x4)))) == 0xb) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickup)) + 0xc)))) == 0)) {
|
|
(GHIDRA_CAST<GridEntity_Lock *>((GHIDRA_CAST<GridEntity_Lock *>(pickup))))->GridEntity_Lock::try_unlock(player,1);
|
|
killSource = &lockUnlockKillSource;
|
|
LAB_0043bc25:
|
|
killSource = (GHIDRA_CAST<EntityRef *>((killSource)))->EntityRef::EntityRef();
|
|
(*extraout_EDX_00)(killSource);
|
|
}
|
|
}
|
|
}
|
|
if (this->_dead == 0) {
|
|
bVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
if (bVar6 != 0) {
|
|
EntityList::QueryRadius(&local_1b4->_entityList,&nearbyPickups,&this->_pos,24.0,0x10);
|
|
ehState = 2.8026e-45;
|
|
pickupIndex = 0;
|
|
uVar7 = nearbyPickups._size;
|
|
if (nearbyPickups._size == 0) {
|
|
LAB_0043bd3e:
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((&nearbyPickups)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else {
|
|
do {
|
|
pickup = *GHIDRA_CAST<Entity_Pickup **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyPickups)) + 0x4))) + pickupIndex * 4));
|
|
if (pickup != GHIDRA_CAST<Entity_Pickup *>(0x0)) {
|
|
if (pickup->_type == 5) {
|
|
iVar10 = pickup->_variant;
|
|
if (((iVar10 == 0x3c) || (iVar10 == 0x35)) || (iVar10 == 0x37)) {
|
|
bVar6 = (GHIDRA_CAST<Entity_Pickup *>((pickup)))->Entity_Pickup::TryOpenChest(this->_player);
|
|
if (bVar6 != 0) {
|
|
killSource = &chestOpenKillSource;
|
|
goto LAB_0043bd2f;
|
|
}
|
|
uVar7 = nearbyPickups._size;
|
|
}
|
|
}
|
|
else if (((pickup->_type == 6) && (pickup->_variant == 7)) &&
|
|
((pvVar2 = (pickup->_sprite)._animState._animData, pvVar2 == (void *)0x0
|
|
|| ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar2) + 0x34)) != '\0' ||
|
|
((pickup->_sprite)._animState._isPlaying == 0)))))) {
|
|
Entity::ForceCollide(this->_player,GHIDRA_CAST<Entity *>(pickup),1);
|
|
killSource = &pickupCollideKillSource;
|
|
LAB_0043bd2f:
|
|
killSource = (GHIDRA_CAST<EntityRef *>((killSource)))->EntityRef::EntityRef();
|
|
(*extraout_EDX_01)(killSource);
|
|
goto LAB_0043bd3e;
|
|
}
|
|
}
|
|
pickupIndex = pickupIndex + 1;
|
|
} while (pickupIndex < uVar7);
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((&nearbyPickups)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0xb5:
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&whitePonyFireDirection,player->_fireDirection);
|
|
(this->_sprite)._flipX = whitePonyFireDirection.x < 0.0;
|
|
break;
|
|
case 0x11a:
|
|
LAB_0043cc72:
|
|
this->_collisionDamage = (float)local_1bc * 0.5;
|
|
}
|
|
}
|
|
goto LAB_0043cdfe;
|
|
}
|
|
if (0x242 < uVar7) {
|
|
if (uVar7 < 0x2d3) {
|
|
if (uVar7 == 0x2d2) {
|
|
iVar10 = this->_parent;
|
|
if (iVar10 == 0) {
|
|
killSource = (GHIDRA_CAST<EntityRef *>((&noParentKillSource)))->EntityRef::EntityRef();
|
|
this->Kill(killSource);
|
|
}
|
|
else {
|
|
toParent.x = *GHIDRA_CAST<float *>((iVar10 + 0x33c)) - (this->_pos).x;
|
|
toParent.y = *GHIDRA_CAST<float *>((iVar10 + 0x340)) - (this->_pos).y;
|
|
orbitDistance = (GHIDRA_CAST<Vector *>((&toParent)))->Vector::Normalized(&toParentDir);
|
|
local_1d8 = orbitDistance->x;
|
|
local_1d4 = GHIDRA_CAST<Entity *>(orbitDistance->y);
|
|
}
|
|
}
|
|
else {
|
|
switch(uVar7) {
|
|
case 0x263:
|
|
this->_collisionDamage = (float)this->_keys * 0.15 * (float)local_1bc;
|
|
break;
|
|
case 0x27b:
|
|
goto LAB_0043cc72;
|
|
case 0x2be:
|
|
this->_mass = 0.1;
|
|
this->_collisionDamage = (float)local_1bc * 0.25;
|
|
break;
|
|
case 0x2bf:
|
|
bVar6 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasNullEffect(100);
|
|
if (((bVar6 != 0) && (this->_coins == 0)) ||
|
|
((bVar6 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasNullEffect(100), bVar6 == 0
|
|
&& (this->_coins == 1)))) {
|
|
killSource = (GHIDRA_CAST<EntityRef *>((&nullEffectKillSource)))->EntityRef::EntityRef();
|
|
this->Kill(killSource);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (uVar7 != 0x2d8) {
|
|
if (uVar7 == 0x1000e) {
|
|
uVar7 = Random();
|
|
iVar10 = (uVar7 & 3) + 5;
|
|
}
|
|
else {
|
|
if (uVar7 != 0x10010) goto LAB_0043cdfe;
|
|
iVar10 = 4;
|
|
local_1cc = 90.0;
|
|
if ((this->_coins & 1U) == 0) {
|
|
local_1c4 = 45.0;
|
|
}
|
|
if ((float)this->_fireCooldown == local_1d0) {
|
|
this->_coins = this->_coins + 1;
|
|
}
|
|
}
|
|
goto LAB_0043ce03;
|
|
}
|
|
this->_isInvicible = g_game->_frameCount - this->_spawnFrame < 0x3c;
|
|
}
|
|
goto LAB_0043cdfe;
|
|
}
|
|
if (uVar7 == 0x242) {
|
|
bVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(4,0);
|
|
if (bVar6 != 0) {
|
|
uVar7 = Random();
|
|
if (uVar7 % 6 == 0) {
|
|
uVar7 = Random();
|
|
splat = Entity_NPC::MakeSplat
|
|
(GHIDRA_CAST<Entity_NPC *>(this),
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10 *
|
|
0.5 + 0.2);
|
|
orbitDistance = MusicManager::RandomVector(&lemonadeSplatOffset);
|
|
lemonadeSplatColor._offset[0] = 0.7843138;
|
|
lemonadeSplatColor._offset[1] = 0.7843138;
|
|
lemonadeSplatColor._offset[2] = 0.0;
|
|
fVar12 = orbitDistance->y;
|
|
iVar10 = *GHIDRA_CAST<int *>(splat);
|
|
fVar16 = (this->_pos).y;
|
|
(splat->_pos).x = orbitDistance->x + orbitDistance->x + (this->_pos).x + 0.0;
|
|
lemonadeSplatColor._colorize[0] = 0.0;
|
|
lemonadeSplatColor._colorize[1] = 0.0;
|
|
lemonadeSplatColor._colorize[2] = 0.0;
|
|
lemonadeSplatColor._colorize[3] = 0.0;
|
|
(splat->_pos).y = fVar12 + fVar12 + fVar16 + 8.0;
|
|
lemonadeSplatColor._tint[0] = 0.0;
|
|
lemonadeSplatColor._tint[1] = 0.0;
|
|
lemonadeSplatColor._tint[2] = 0.0;
|
|
lemonadeSplatColor._tint[3] = 0.7;
|
|
(**(code **)(iVar10 + 0x3c))(&lemonadeSplatColor,0xffffffff,0xff,0,1);
|
|
}
|
|
}
|
|
goto LAB_0043cdfe;
|
|
}
|
|
switch(uVar7) {
|
|
case 0x143:
|
|
if (0x5a < g_game->_frameCount - this->_spawnFrame) {
|
|
killSource = (GHIDRA_CAST<EntityRef *>((&timeoutKillSource)))->EntityRef::EntityRef();
|
|
this->Kill(killSource);
|
|
}
|
|
break;
|
|
case 0x145:
|
|
uVar7 = Random();
|
|
iVar10 = (uVar7 & 1) + 2;
|
|
goto LAB_0043ce03;
|
|
case 0x18c:
|
|
iVar10 = this->_parent;
|
|
if (g_game->_frameCount == this->_spawnFrame) {
|
|
if (iVar10 != 0) {
|
|
spawnParentPos.x = *GHIDRA_CAST<float *>((iVar10 + 0x33c));
|
|
spawnParentPos.y = *GHIDRA_CAST<float *>((iVar10 + 0x340));
|
|
orbitDistance = GetOrbitPosition(this,&spawnOrbitPos,&spawnParentPos);
|
|
(this->_pos).x = orbitDistance->x;
|
|
(this->_pos).y = orbitDistance->y;
|
|
}
|
|
}
|
|
else if (iVar10 == 0) {
|
|
this->Remove();
|
|
}
|
|
else if (*GHIDRA_CAST<char *>((iVar10 + 0x173)) != '\0') {
|
|
killSource = (GHIDRA_CAST<EntityRef *>((&parentDeadKillSource)))->EntityRef::EntityRef();
|
|
this->Kill(killSource);
|
|
}
|
|
break;
|
|
case 0x196:
|
|
(GHIDRA_CAST<RNG *>((&rng)))->RNG::game_constructor((this->_dropRNG)._seed,0xd);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5);
|
|
local_1d0 = (float)(GHIDRA_INT(local_1d0) + -2 + uVar7);
|
|
break;
|
|
case 0x1a3:
|
|
goto LAB_0043c942;
|
|
case 0x1ab:
|
|
FamiliarHelper::wisp_mine_crafter_update(this);
|
|
break;
|
|
case 0x1b9:
|
|
ai_mega_blast_wisp(this);
|
|
break;
|
|
case 0x1e7:
|
|
pEVar9 = GHIDRA_CAST<Entity *>(this->_target);
|
|
local_1c8 = GHIDRA_CAST<Vector *>((*GHIDRA_CAST<short *>(&local_1c8[0x31].y) + 7));
|
|
isFiring = '\0';
|
|
if (pEVar9 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
if (this->_orbitLayer < 0) {
|
|
this->_friction = 0.9;
|
|
orbitDistance = GetOrbitDistance(&layerOrbitDistance,GHIDRA_INT(local_1c8));
|
|
local_1b4 = GHIDRA_CAST<Room *>((this->_pos).x);
|
|
local_1bc = GHIDRA_CAST<Entity *>((this->_pos).y);
|
|
fVar12 = (float)local_1b4 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
fVar16 = (float)local_1bc - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
fVar12 = sqrtf(fVar12 * fVar12 + fVar16 * fVar16);
|
|
if (orbitDistance->x <= fVar12) {
|
|
bVar6 = 0;
|
|
toPlayer.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - (float)local_1b4;
|
|
toPlayer.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - (float)local_1bc;
|
|
orbitDistance = (GHIDRA_CAST<Vector *>((&toPlayer)))->Vector::Resized(&returnVelocity,0.5);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity_divided(orbitDistance,bVar6);
|
|
}
|
|
else {
|
|
AddToOrbit(this,GHIDRA_INT(local_1c8));
|
|
}
|
|
}
|
|
else {
|
|
this->_friction = 1.0;
|
|
}
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&nearbyEnemies,&this->_pos,100.0,8);
|
|
uVar7 = 0;
|
|
ehState = 5.60519e-45;
|
|
if (nearbyEnemies._size == 0) {
|
|
LAB_0043c7c6:
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((&nearbyEnemies)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else {
|
|
do {
|
|
bVar6 = Entity::IsVulnerableEnemy
|
|
(*GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x4))) + uVar7 * 4)),GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar6 != 0) {
|
|
local_1c8 = *GHIDRA_CAST<Vector **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x4))) + uVar7 * 4));
|
|
puVar1 = &this->_target;
|
|
if (this->_target != 0) {
|
|
local_1bc = GHIDRA_CAST<Entity *>(puVar1);
|
|
msvc::multiset<unsigned_int>::erase(&local_1bc);
|
|
}
|
|
*puVar1 = local_1c8;
|
|
if (local_1c8 != GHIDRA_CAST<Vector *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
}
|
|
RemoveFromOrbit(this);
|
|
goto LAB_0043c7c6;
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < GHIDRA_UINT(nearbyEnemies._size));
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((&nearbyEnemies)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
else {
|
|
this->_friction = 0.8;
|
|
toTarget.y = (pEVar9->_pos).y - (this->_pos).y;
|
|
toTarget.x = (pEVar9->_pos).x - (this->_pos).x;
|
|
local_1c8 = GHIDRA_CAST<Vector *>((toTarget.y * toTarget.y + toTarget.x * toTarget.x));
|
|
if (10000.0 < (float)local_1c8) {
|
|
bVar6 = 0;
|
|
orbitDistance = (GHIDRA_CAST<Vector *>((&toTarget)))->Vector::Resized(&chaseVelocity,1.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity_divided(orbitDistance,bVar6);
|
|
pEVar9 = GHIDRA_CAST<Entity *>(this->_target);
|
|
}
|
|
fVar12 = sqrtf((float)local_1c8);
|
|
leadTargetDelta.y =
|
|
(fVar12 * 0.02 * (pEVar9->_velocity).y + (pEVar9->_pos).y) - (this->_pos).y;
|
|
leadTargetDelta.x =
|
|
(fVar12 * 0.02 * (pEVar9->_velocity).x + (pEVar9->_pos).x) - (this->_pos).x;
|
|
orbitDistance = (GHIDRA_CAST<Vector *>((&leadTargetDelta)))->Vector::Normalized(&leadTargetDir);
|
|
local_1d8 = orbitDistance->x;
|
|
local_1d4 = GHIDRA_CAST<Entity *>(orbitDistance->y);
|
|
if (this->_fireCooldown < 1) {
|
|
isFiring = '\x01';
|
|
}
|
|
else {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
bVar6 = (GHIDRA_CAST<Entity *>((pEVar9)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar6 == 0) {
|
|
if (this->_target != 0) {
|
|
local_1dc = &this->_target;
|
|
msvc::multiset<unsigned_int>::erase(&local_1dc);
|
|
}
|
|
this->_target = 0;
|
|
}
|
|
}
|
|
break;
|
|
case 0x1f8:
|
|
isFiring = '\0';
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
local_1c8 = &this->_pos;
|
|
aimDirection.x = g_vectorZero.x;
|
|
aimDirection.y = g_vectorZero.y;
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),nuggetTargets,local_1c8,150.0,8);
|
|
ehState = 4.2039e-45;
|
|
local_1c0 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (GHIDRA_CAST<uint8_t *>(nuggetTargets[0]._size) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pEVar9 = GHIDRA_CAST<Entity *>(0x0);
|
|
do {
|
|
pEVar15 = *GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nuggetTargets[0])) + 0x4))) + GHIDRA_INT(local_1c0) * 4));
|
|
bVar6 = (GHIDRA_CAST<Entity *>((pEVar15)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar6 != 0) && ((pEVar15->_flags & 0x20000010) == 0)) {
|
|
enemyPos.y = (pEVar15->_pos).y;
|
|
enemyPos.x = (pEVar15->_pos).x;
|
|
bVar6 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(local_1c8,&enemyPos,3,900,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar6 != 0) {
|
|
pEVar9 = pEVar15;
|
|
}
|
|
}
|
|
this = GHIDRA_CAST<Entity_Familiar *>(local_1b4);
|
|
local_1c0 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_1c0)) + 0x1))));
|
|
} while (local_1c0 < GHIDRA_UINT(nuggetTargets[0]._size));
|
|
local_1c0 = pEVar9;
|
|
if (pEVar9 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
toEnemy.x = (pEVar9->_pos).x - (GHIDRA_CAST<Vector *>((local_1b4->_gridEntities + 0xc6)))->x;
|
|
toEnemy.y = (pEVar9->_pos).y - (float)local_1b4->_gridEntities[199];
|
|
orbitDistance = (GHIDRA_CAST<Vector *>((&toEnemy)))->Vector::Normalized(&toEnemyDir);
|
|
aimDirection.x = orbitDistance->x;
|
|
aimDirection.y = orbitDistance->y;
|
|
}
|
|
}
|
|
bVar6 = (GHIDRA_CAST<Vector *>((&aimDirection)))->Vector::operator_ne(&g_vectorZero);
|
|
if ((bVar6 == 0) || ((float)GHIDRA_INT(local_1d0) <= 0.0)) {
|
|
if ((-1 < (GHIDRA_CAST<Room *>(this))->_gridPaths[0x179]) &&
|
|
(iVar10 = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] + -1,
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = iVar10, iVar10 < 0)) {
|
|
PlayFloatAnim(this,3);
|
|
}
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((nuggetTargets)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else {
|
|
iVar10 = vector_to_direction(vec);
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] < 1) {
|
|
FireProjectile(this,&aimDirection,0);
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] = GHIDRA_INT(local_1d0);
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = 0xc;
|
|
PlayShootAnim(this,iVar10);
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] + -1;
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((nuggetTargets)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] < 9) {
|
|
PlayFloatAnim(this,iVar10);
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = 8;
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((nuggetTargets)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else {
|
|
PlayShootAnim(this,iVar10);
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] + -1;
|
|
ehState = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((nuggetTargets)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
}
|
|
break;
|
|
case 0x204:
|
|
local_1c4 = (float)this->_coins * 45.0 + 0.0;
|
|
break;
|
|
case 0x209:
|
|
iVar10 = 3;
|
|
local_1cc = 15.0;
|
|
local_1c4 = -15.0;
|
|
goto LAB_0043ce03;
|
|
case 0x20f:
|
|
ai_mr_me_wisp(this);
|
|
}
|
|
LAB_0043cdfe:
|
|
iVar10 = 1;
|
|
LAB_0043ce03:
|
|
bVar6 = (GHIDRA_CAST<Entity_Player *>(((GHIDRA_CAST<Room *>(this))->_gridEntities[0xfb])))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar6 != 0) {
|
|
(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd9] =
|
|
(void *)((float)(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd9] +
|
|
(float)(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd9]);
|
|
}
|
|
if (0 < (GHIDRA_CAST<Room *>(this))->_gridPaths[399]) {
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[399] = (GHIDRA_CAST<Room *>(this))->_gridPaths[399] + -1;
|
|
}
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x187] != 0) {
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x187] != 1) {
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridEntities[2] != (void *)0xce) {
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridEntities[3] != (void *)0x28a) {
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
local_1dc = GHIDRA_CAST<uint32_t *>(cos(0.7853982));
|
|
fVar16 = sin(0.7853982);
|
|
fVar12 = (GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xcf)))->x;
|
|
rotatedVelocity.x =
|
|
fVar12 * (float)local_1dc - (float)(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd0] * fVar16;
|
|
rotatedVelocity.y =
|
|
fVar12 * fVar16 + (float)(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd0] * (float)local_1dc;
|
|
orbitDistance = Vector::ToCardinal(&cardinalVelocity,&rotatedVelocity);
|
|
local_1cc = cos(-0.7853982);
|
|
fVar13 = sin(-0.7853982);
|
|
fVar12 = orbitDistance->y;
|
|
fVar16 = orbitDistance->x;
|
|
local_1c4 = local_1cc * orbitDistance->x - fVar13 * orbitDistance->y;
|
|
(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd2] = (void *)0x3f7ae148;
|
|
local_1cc = local_1cc * fVar12 + fVar13 * fVar16;
|
|
if (0 < updateSteps) {
|
|
do {
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] + 1;
|
|
manager = g_manager;
|
|
uVar7 = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] & 0x80000003;
|
|
bVar11 = uVar7 == 0;
|
|
if (GHIDRA_INT(uVar7) < 0) {
|
|
bVar11 = (uVar7 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (bVar11) {
|
|
local_1c0 = GHIDRA_CAST<Entity *>(0xb9);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1c0));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1c0),1.0,2,0,1.0,0.0);
|
|
uVar7 = Random();
|
|
fVar12 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.9;
|
|
local_1c0 = GHIDRA_CAST<Entity *>((-local_1c4 * 5.0 * fVar12));
|
|
local_1b4 = GHIDRA_CAST<Room *>((-local_1cc * 5.0 * fVar12));
|
|
uVar7 = Random();
|
|
local_1dc = (uint32_t *)
|
|
(((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)])
|
|
* 2.3283064e-10 * 60.0 - 30.0) * 0.017453292);
|
|
local_1c8 = GHIDRA_CAST<Vector *>(cos((float)local_1dc));
|
|
fVar12 = sin((float)local_1dc);
|
|
tearPos.x = (GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xc6)))->x;
|
|
tearPos.y = (float)(GHIDRA_CAST<Room *>(this))->_gridEntities[199];
|
|
tearVelocity.x = (float)local_1c8 * (float)local_1c0 - fVar12 * (float)local_1b4;
|
|
tearVelocity.y = (float)local_1c8 * (float)local_1b4 + fVar12 * (float)local_1c0;
|
|
uVar7 = Random();
|
|
local_1dc = (uint32_t *)
|
|
((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10);
|
|
uVar7 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&tearPos,&tearVelocity,GHIDRA_CAST<Entity *>(this),0,uVar7);
|
|
tear->_fallingAccel = tear->_fallingAccel - 0.05;
|
|
uVar7 = Random();
|
|
fVar12 = (float)(&DAT_00b64e34)[uVar7 & 1];
|
|
if (fVar12 <= 0.01) {
|
|
fVar12 = 0.01;
|
|
}
|
|
tear->_baseScale = fVar12;
|
|
tear->_fScale = fVar12;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight(tear->_height - 10.0);
|
|
tear->SetCollisionDamage((float)local_1dc + 3.0);
|
|
}
|
|
updateSteps = updateSteps + -1;
|
|
} while (updateSteps != 0);
|
|
updateSteps = 0;
|
|
}
|
|
anim = "SpecialDown";
|
|
if (0.0 < local_1cc) {
|
|
anim = "SpecialUp";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 9)))))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim),0);
|
|
pvVar2 = (GHIDRA_CAST<Room *>(this))->_gridEntities[0xde];
|
|
(GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xcf)))->x =
|
|
local_1c4 * 0.4 * (float)pvVar2 + (GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xcf)))->x;
|
|
(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd0] =
|
|
(void *)(local_1cc * 0.4 * (float)pvVar2 + (float)(GHIDRA_CAST<Room *>(this))->_gridEntities[0xd0]);
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
if (isFiring == '\0') {
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
if (0 < (GHIDRA_CAST<Room *>(this))->_gridPaths[0x178]) {
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] + -1;
|
|
}
|
|
local_1b4 = *GHIDRA_CAST<Room **>((GHIDRA_INT((GHIDRA_CAST<Room *>(this))->_gridEntities[0xfb]) + 0x162c));
|
|
if ((((local_1b4 == GHIDRA_CAST<Room *>(0xffffffff)) && (local_1d8 == g_vectorZero.x)) &&
|
|
((float)local_1d4 == g_vectorZero.y)) || ((float)GHIDRA_INT(local_1d0) <= 0.0)) {
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] < 0) {
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
iVar10 = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] + -1;
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = iVar10;
|
|
if (iVar10 < 0) {
|
|
PlayFloatAnim(this,3);
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&shotDirection,GHIDRA_INT(local_1b4));
|
|
TryAimAtMarkedTarget(this,&shotDirection,GHIDRA_CAST<int *>(&local_1b4),GHIDRA_CAST<Vector *>(0x0));
|
|
if ((local_1d8 == g_vectorZero.x) && ((float)local_1d4 == g_vectorZero.y)) {
|
|
local_1d4 = GHIDRA_CAST<Entity *>(shotDirection.y);
|
|
local_1d8 = shotDirection.x;
|
|
}
|
|
local_1c4 = local_1c4 * 0.017453292;
|
|
local_1dc = GHIDRA_CAST<uint32_t *>(cos(local_1c4));
|
|
fVar12 = sin(local_1c4);
|
|
shotDirection.x = (float)local_1dc * local_1d8 - (float)local_1d4 * fVar12;
|
|
shotDirection.y = local_1d8 * fVar12 + (float)local_1d4 * (float)local_1dc;
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] < 1) {
|
|
if (iVar10 != 0) {
|
|
local_1cc = local_1cc * 0.017453292;
|
|
local_1dc = GHIDRA_CAST<uint32_t *>(cos(local_1cc));
|
|
local_1c8 = GHIDRA_CAST<Vector *>(sin(local_1cc));
|
|
do {
|
|
FireProjectile(this,&shotDirection,0);
|
|
fVar12 = shotDirection.x * (float)local_1c8;
|
|
shotDirection.x = shotDirection.x * (float)local_1dc - shotDirection.y * (float)local_1c8;
|
|
shotDirection.y = shotDirection.y * (float)local_1dc + fVar12;
|
|
iVar10 = iVar10 + -1;
|
|
} while (iVar10 != 0);
|
|
}
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x178] = GHIDRA_INT(local_1d0);
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = 0xc;
|
|
}
|
|
else if ((GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] < 9) {
|
|
PlayFloatAnim(this,GHIDRA_INT(local_1b4));
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = 8;
|
|
goto LAB_0043d0b0;
|
|
}
|
|
PlayShootAnim(this,GHIDRA_INT(local_1b4));
|
|
(GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] = (GHIDRA_CAST<Room *>(this))->_gridPaths[0x179] + -1;
|
|
LAB_0043d0b0:
|
|
if ((GHIDRA_CAST<Room *>(this))->_gridEntities[3] == (void *)0x31) {
|
|
(GHIDRA_CAST<Vector *>(((GHIDRA_CAST<Room *>(this))->_gridEntities + 0xc4)))->x = shotDirection.x;
|
|
(GHIDRA_CAST<Room *>(this))->_gridEntities[0xc5] = (void *)shotDirection.y;
|
|
}
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 0043db20
|
|
void Entity_Familiar::ai_mr_me_wisp()
|
|
{
|
|
Vector *pos;
|
|
Entity_Pickup *this_00;
|
|
uint8_t bVar1;
|
|
uint32_t uVar2;
|
|
float fVar3;
|
|
int iVar4;
|
|
void *wispConfig;
|
|
uint8_t *orbitLevel;
|
|
EntityRef *killSource;
|
|
Entity_Player *nearestPlayer;
|
|
Entity *explosion;
|
|
int targetPickup;
|
|
int target;
|
|
uint8_t *orbitLevelLow;
|
|
void *pvVar5;
|
|
float dx;
|
|
EntityRef doorKillRef;
|
|
EntityRef killRef;
|
|
uint8_t pickups [12];
|
|
uint32_t uStack_24;
|
|
float posY;
|
|
uint8_t *local_1c;
|
|
float local_18;
|
|
Entity_Familiar *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
GridEntity_Door *door;
|
|
Game *game;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af22cd;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((pickups + 0x2c));
|
|
ExceptionList = &local_10;
|
|
iVar4 = this->_keys;
|
|
if (iVar4 == 0) {
|
|
local_14 = this;
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0xf,this->_index);
|
|
game = g_game;
|
|
if (bVar1 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
pvVar5 = g_game->_room;
|
|
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 4)) + 0x44)) & 1) == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x764));
|
|
if (((((-1 < iVar4) && (iVar4 < 0x1c0)) &&
|
|
(target = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + iVar4 * 4 + 0x24)), target != 0)) &&
|
|
((*GHIDRA_CAST<int *>((target + 4)) == 4 || (*GHIDRA_CAST<int *>((target + 4)) == 0x16)))) &&
|
|
(*GHIDRA_CAST<int *>((target + 0xc)) != 2)) {
|
|
this->_keys = 1;
|
|
this->_coins = iVar4;
|
|
target = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
(this->_targetPosition).x = (float)(iVar4 % target) * 40.0 + 40.0;
|
|
(this->_targetPosition).y = (float)(iVar4 / target) * 40.0 + 120.0;
|
|
}
|
|
if (this->_keys == 0) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(pickups),5,0x3c,-1,0,0);
|
|
local_8 = 0;
|
|
local_18 = 0.0;
|
|
if (uStack_24 != 0) {
|
|
uVar2 = uStack_24;
|
|
pvVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)pickups)) + 0x4)));
|
|
do {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + GHIDRA_INT(local_18) * 4));
|
|
if (iVar4 != 0) {
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x28)) == 5) {
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x30)) != 0) {
|
|
if (this->_target != 0) {
|
|
local_1c = GHIDRA_CAST<uint8_t *>(&this->_target);
|
|
msvc::multiset<unsigned_int>::erase(&local_1c);
|
|
}
|
|
this->_target = iVar4;
|
|
msvc::multiset<unsigned_int>::insert(&this->_target);
|
|
this->_keys = 2;
|
|
fVar3 = *GHIDRA_CAST<float *>((iVar4 + 0x340));
|
|
(this->_targetPosition).x = *GHIDRA_CAST<float *>((iVar4 + 0x33c));
|
|
(this->_targetPosition).y = fVar3;
|
|
uVar2 = uStack_24;
|
|
pvVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)pickups)) + 0x4)));
|
|
}
|
|
}
|
|
}
|
|
local_18 = (float)(GHIDRA_INT(local_18) + 1);
|
|
} while (GHIDRA_UINT(local_18) < uVar2);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (pickups[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)pickups)) + 0x4))),0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
}
|
|
iVar4 = this->_keys;
|
|
if (iVar4 == 0) {
|
|
fVar3 = (float)(GHIDRA_INT(g_game->_room) + 0x724);
|
|
uVar2 = 0;
|
|
local_18 = fVar3;
|
|
do {
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(fVar3) + uVar2 * 4));
|
|
if (door != GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
if (((door->_doorFlags & 0x50U) == 0) &&
|
|
(((door->_doorFlags & 0x20U) == 0 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x8)))) != 4)))) {
|
|
iVar4 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::get_secret_exit_kind();
|
|
game = g_game;
|
|
fVar3 = local_18;
|
|
if ((iVar4 != 4) &&
|
|
((iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_18) + uVar2 * 4)), *GHIDRA_CAST<int *>((iVar4 + 0xc)) != 2 &&
|
|
((iVar4 = *GHIDRA_CAST<int *>((iVar4 + 0x160)), iVar4 == 7 || (iVar4 == 8)))))) {
|
|
this->_keys = 3;
|
|
this->_coins = uVar2;
|
|
iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_18) + uVar2 * 4)) + 0x24));
|
|
target = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
(this->_targetPosition).x = (float)(iVar4 % target) * 40.0 + 40.0;
|
|
(this->_targetPosition).y = (float)(iVar4 / target) * 40.0 + 120.0;
|
|
}
|
|
}
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < 8);
|
|
iVar4 = this->_keys;
|
|
if (iVar4 == 0) {
|
|
fVar3 = (float)(GHIDRA_INT(g_game->_room) + 0x724);
|
|
uVar2 = 0;
|
|
local_18 = fVar3;
|
|
do {
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(fVar3) + uVar2 * 4));
|
|
if (door != GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
if ((door->_doorFlags & 0x50U) == 0) {
|
|
if ((door->_doorFlags & 0x20U) != 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x8)))) == 4) goto LAB_0043df18;
|
|
}
|
|
iVar4 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::get_secret_exit_kind();
|
|
game = g_game;
|
|
fVar3 = local_18;
|
|
if (iVar4 != 4) {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_18) + uVar2 * 4));
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0xc)) != 2) {
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0x160)) != 7) && (*GHIDRA_CAST<int *>((iVar4 + 0x160)) != 8)) {
|
|
this = local_14;
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x394)) == g_game->_lastRoomIdx) {
|
|
local_1c = GHIDRA_CAST<uint8_t *>(g_manager->_netplayManager);
|
|
if (((local_1c != *GHIDRA_CAST<uint8_t **>((g_manager + 1))) &&
|
|
(1 < GHIDRA_UINT((GHIDRA_INT(*GHIDRA_CAST<uint8_t **>((g_manager + 1))) - GHIDRA_INT(local_1c) >> 2))))
|
|
&& (*GHIDRA_CAST<uint32_t *>((iVar4 + 0x154)) < 0x1f)) goto LAB_0043df18;
|
|
}
|
|
local_14->_keys = 4;
|
|
local_14->_coins = uVar2;
|
|
iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_18) + uVar2 * 4)) + 0x24));
|
|
target = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
(local_14->_targetPosition).x = (float)(iVar4 % target) * 40.0 + 40.0;
|
|
(local_14->_targetPosition).y = (float)(iVar4 / target) * 40.0 + 120.0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_0043df18:
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < 8);
|
|
iVar4 = this->_keys;
|
|
}
|
|
}
|
|
target = this->_orbitLayer;
|
|
if (iVar4 != 0) {
|
|
if (target < 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
RecalculateOrbitOffset(this,target,0);
|
|
this->_orbitLayer = -1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (-1 < target) {
|
|
this->_friction = 1.0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (this->_variant == 0xed) {
|
|
iVar4 = this->_wispCollectibleType;
|
|
}
|
|
else if (this->_variant == 0xce) {
|
|
iVar4 = this->_subtype;
|
|
}
|
|
else {
|
|
iVar4 = 0x248;
|
|
}
|
|
wispConfig = ItemConfig::get_wisp_config(iVar4);
|
|
this->_friction = 0.7;
|
|
pvVar5 = this->_player;
|
|
local_1c = GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(wispConfig) + 0x18c)) + 7));
|
|
orbitLevelLow = local_1c;
|
|
if (GHIDRA_INT(local_1c) < 1) {
|
|
orbitLevelLow = GHIDRA_CAST<uint8_t *>(0x0);
|
|
}
|
|
orbitLevel = GHIDRA_CAST<uint8_t *>(0xa);
|
|
if (GHIDRA_INT(orbitLevelLow) < 10) {
|
|
orbitLevel = orbitLevelLow;
|
|
}
|
|
posY = (local_14->_pos).y;
|
|
local_18 = (local_14->_pos).x;
|
|
fVar3 = posY - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x340));
|
|
dx = local_18 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x33c));
|
|
fVar3 = sqrtf(fVar3 * fVar3 + dx * dx);
|
|
if ((float)(&DAT_00c34130)[GHIDRA_INT(orbitLevel) * 5] <= fVar3) {
|
|
local_1c = GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x340)) - posY));
|
|
local_18 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x33c)) - local_18;
|
|
fVar3 = sqrtf((float)local_1c * (float)local_1c + local_18 * local_18);
|
|
if (0.0 < fVar3) {
|
|
local_1c = GHIDRA_CAST<uint8_t *>(((2.0 / fVar3) * (float)local_1c));
|
|
local_18 = (2.0 / fVar3) * local_18;
|
|
}
|
|
fVar3 = local_14->_speedMultiplier;
|
|
(local_14->_velocity).y = (fVar3 * (float)local_1c) / 0.7 + (local_14->_velocity).y;
|
|
(local_14->_velocity).x = (fVar3 * local_18) / 0.7 + (local_14->_velocity).x;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
AddToOrbit(local_14,GHIDRA_INT(local_1c));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this_00 = GHIDRA_CAST<Entity_Pickup *>(this->_target);
|
|
pos = &this->_pos;
|
|
this->_friction = 0.7;
|
|
local_18 = (this->_targetPosition).x;
|
|
fVar3 = (this->_targetPosition).y;
|
|
if (this_00 != GHIDRA_CAST<Entity_Pickup *>(0x0)) {
|
|
local_18 = (this_00->_pos).x;
|
|
fVar3 = (this_00->_pos).y;
|
|
}
|
|
local_14 = GHIDRA_CAST<Entity_Familiar *>((fVar3 - (this->_pos).y));
|
|
local_18 = local_18 - pos->x;
|
|
fVar3 = local_18 * local_18 + (float)local_14 * (float)local_14;
|
|
if (fVar3 <= 225.0) {
|
|
if (iVar4 == 2) {
|
|
if (((this_00 != GHIDRA_CAST<Entity_Pickup *>(0x0)) && (this_00->_type == 5)) &&
|
|
((this_00->_subtype != 0 &&
|
|
(bVar1 = (GHIDRA_CAST<Entity_Pickup *>((this_00)))->Entity_Pickup::TryOpenChest(GHIDRA_CAST<Entity_Player *>(0x0)), bVar1 != 0)))) {
|
|
LAB_0043e26b:
|
|
killSource = &killRef;
|
|
LAB_0043e26e:
|
|
killSource = (GHIDRA_CAST<EntityRef *>((killSource)))->EntityRef::EntityRef();
|
|
this->Kill(killSource,uVar2);
|
|
}
|
|
}
|
|
else if (iVar4 == 1) {
|
|
if (((GHIDRA_UINT(this->_coins) < 0x1c0) &&
|
|
(iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + this->_coins * 4 + 0x24)), iVar4 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar4 + 0xc)) != 2)) {
|
|
nearestPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNearestPlayer(pos);
|
|
fVar3 = (this->_pos).y - (nearestPlayer->_pos).y;
|
|
dx = pos->x - (nearestPlayer->_pos).x;
|
|
fVar3 = sqrtf(fVar3 * fVar3 + dx * dx);
|
|
if (100.0 < fVar3) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::BombDamage(pos,40.0,80.0,1,GHIDRA_CAST<Entity *>(this),g_tearFlagsNone,4,0);
|
|
uVar2 = Random();
|
|
explosion = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,1,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar2);
|
|
explosion->Update();
|
|
killSource = (GHIDRA_CAST<EntityRef *>((&killRef)))->EntityRef::EntityRef();
|
|
this->Kill(killSource);
|
|
}
|
|
goto LAB_0043e200;
|
|
}
|
|
}
|
|
else if (iVar4 == 3) {
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(g_game->_room) + this->_coins * 4 + 0x724));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0xc)))) != 2) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryBlowOpen(0,GHIDRA_CAST<Entity *>(0x0));
|
|
goto LAB_0043e26b;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 != 4) goto LAB_0043e200;
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(g_game->_room) + this->_coins * 4 + 0x724));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0xc)))) != 2) {
|
|
bVar1 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryUnlock(this->_player,1);
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::Open();
|
|
}
|
|
killSource = &doorKillRef;
|
|
goto LAB_0043e26e;
|
|
}
|
|
}
|
|
this->_keys = 0;
|
|
iVar4 = 0;
|
|
LAB_0043e43e:
|
|
target = this->_target;
|
|
if (target != 0) {
|
|
LAB_0043e448:
|
|
if ((*GHIDRA_CAST<char *>((target + 0x172)) == '\0') || (*GHIDRA_CAST<char *>((target + 0x173)) != '\0'))
|
|
goto LAB_0043e460;
|
|
}
|
|
}
|
|
else {
|
|
fVar3 = sqrtf(fVar3);
|
|
if (0.0 < fVar3) {
|
|
local_18 = local_18 * (2.0 / fVar3);
|
|
local_14 = GHIDRA_CAST<Entity_Familiar *>(((float)local_14 * (2.0 / fVar3)));
|
|
}
|
|
fVar3 = this->_speedMultiplier;
|
|
(this->_velocity).y = (fVar3 * (float)local_14) / 0.7 + (this->_velocity).y;
|
|
(this->_velocity).x = (fVar3 * local_18) / 0.7 + (this->_velocity).x;
|
|
LAB_0043e200:
|
|
iVar4 = this->_keys;
|
|
if (iVar4 != 1) {
|
|
if (iVar4 == 2) {
|
|
target = this->_target;
|
|
if (target != 0) {
|
|
targetPickup = 0;
|
|
if (*GHIDRA_CAST<int *>((target + 0x28)) == 5) {
|
|
targetPickup = target;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((targetPickup + 0x30)) == 1) goto LAB_0043e448;
|
|
}
|
|
}
|
|
else if (((iVar4 != 4) && (iVar4 != 3)) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + this->_coins * 4 + 0x724)) + 0xc)) != 2))
|
|
goto LAB_0043e43e;
|
|
LAB_0043e460:
|
|
this->_keys = 0;
|
|
goto LAB_0043e46a;
|
|
}
|
|
if (((0x1bf < GHIDRA_UINT(this->_coins)) ||
|
|
(target = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + this->_coins * 4 + 0x24)), target == 0)) ||
|
|
(*GHIDRA_CAST<int *>((target + 0xc)) == 2)) {
|
|
this->_keys = 0;
|
|
iVar4 = 0;
|
|
}
|
|
}
|
|
if (iVar4 != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
LAB_0043e46a:
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0043e4a0
|
|
void Entity_Familiar::ai_mega_blast_wisp()
|
|
{
|
|
uint8_t bVar1;
|
|
Entity_Laser *brimstone;
|
|
int iVar2;
|
|
int iVar3;
|
|
float fVar4;
|
|
uint32_t laserDepthOffset;
|
|
float awayDirY;
|
|
float awayDirX;
|
|
Vector local_18;
|
|
Vector local_10;
|
|
void *player;
|
|
|
|
player = this->_player;
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x162c));
|
|
fVar4 = sqrtf(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1630)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1630)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1634)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1634)));
|
|
if ((fVar4 < 0.5) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x1638)) == '\0')) {
|
|
iVar3 = -1;
|
|
}
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,this->_lastDirection);
|
|
bVar1 = TryAimAtMarkedTarget(this,&local_10,&this->_lastDirection,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar1 != 0) {
|
|
if (this->_fireCooldown < 0) {
|
|
iVar3 = -1;
|
|
}
|
|
iVar2 = this->_linkedEntity;
|
|
if ((((iVar2 != 0) && (*GHIDRA_CAST<int *>((iVar2 + 0x28)) == 7)) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((iVar2 + 0x30)), iVar2 != 1)) && ((iVar2 != 2 && (iVar2 != 3)))) {
|
|
fVar4 = atan2f(local_10.y,local_10.x);
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(this->_linkedEntity))))->Entity_Laser::RotateToAngle(fVar4 * 57.295776,8.0);
|
|
}
|
|
}
|
|
player = this->_player;
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(player) + 0x1398)) == '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(player) + 0x139a)) == '\0')) &&
|
|
((*GHIDRA_CAST<int *>(&g_game->_stageTransition) == 0 &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(player) + 0x410)) != '\0' && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x414)) < 1)))))) {
|
|
if (iVar3 == -1) {
|
|
if ((this->_fireCooldown < 0) &&
|
|
(((local_10.x != g_vectorZero.x || (local_10.y != g_vectorZero.y)) &&
|
|
(this->_linkedEntity == 0)))) {
|
|
brimstone = FireBrimstone(this,&local_10,1);
|
|
_DAT_00c5c554 = local_10.x * 7.0;
|
|
DAT_00c5c558 = local_10.y * 5.0 - 18.0;
|
|
iVar2 = *GHIDRA_CAST<int *>(brimstone);
|
|
(brimstone->_posOffset).x = _DAT_00c5c554;
|
|
(brimstone->_posOffset).y = DAT_00c5c558;
|
|
(**(code **)(iVar2 + 0xc))();
|
|
this->_headFrameDelay = 0x1e;
|
|
iVar2 = vector_to_direction(&local_10);
|
|
PlayShootAnim(this,iVar2);
|
|
}
|
|
iVar2 = this->_headFrameDelay;
|
|
this->_fireCooldown = 0x1e;
|
|
}
|
|
else {
|
|
iVar2 = this->_headFrameDelay;
|
|
if (iVar2 < 9) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
this->_lastDirection = iVar3;
|
|
}
|
|
if (iVar2 < 9) {
|
|
if (iVar3 == -1) {
|
|
PlayFloatAnim(this,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x1628)));
|
|
}
|
|
else {
|
|
PlayChargeAnim(this,this->_lastDirection);
|
|
}
|
|
this->_headFrameDelay = 8;
|
|
}
|
|
else {
|
|
this->_headFrameDelay = iVar2 + -1;
|
|
}
|
|
}
|
|
awayDirY = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
awayDirX = (this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_18.x = awayDirX;
|
|
local_18.y = awayDirY;
|
|
fVar4 = sqrtf(awayDirY * awayDirY + awayDirX * awayDirX);
|
|
if (0.0 < fVar4) {
|
|
awayDirX = awayDirX * (1.0 / fVar4);
|
|
awayDirY = awayDirY * (1.0 / fVar4);
|
|
local_18.x = awayDirX;
|
|
local_18.y = awayDirY;
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x18f4))) && (this->_linkedEntity == 0)) {
|
|
local_10.x = (float)FireBrimstone(this,&local_18,0);
|
|
awayDirX = local_18.x;
|
|
_DAT_00c5c554 = local_18.x * 7.0;
|
|
awayDirY = local_18.y;
|
|
DAT_00c5c558 = local_18.y * 5.0 - 18.0;
|
|
((GHIDRA_CAST<Entity_Laser *>(local_10.x))->_posOffset).x = _DAT_00c5c554;
|
|
((GHIDRA_CAST<Entity_Laser *>(local_10.x))->_posOffset).y = DAT_00c5c558;
|
|
(GHIDRA_CAST<Entity_Laser *>(local_10.x))->_timeout = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x18f4));
|
|
(**(code **)(*GHIDRA_CAST<int *>(local_10.x) + 0xc))();
|
|
if (this->_linkedEntity != 0) {
|
|
local_18.x = (float)&this->_linkedEntity;
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
this->_linkedEntity = local_10.x;
|
|
msvc::multiset<unsigned_int>::insert(&this->_linkedEntity);
|
|
this->_headFrameDelay = 0x1e;
|
|
PlayShootAnim(this,iVar3);
|
|
}
|
|
iVar3 = this->_linkedEntity;
|
|
if (iVar3 != 0) {
|
|
fVar4 = atan2f(awayDirY,awayDirX);
|
|
*GHIDRA_CAST<uint8_t *>((iVar3 + 0x4c0)) = 1;
|
|
*GHIDRA_CAST<uint32_t *>((iVar3 + 0x4c4)) = 0;
|
|
local_18.x = ABS(fVar4 * 57.295776);
|
|
fVar4 = angle_difference(*GHIDRA_CAST<float *>((iVar3 + 0x41c)),fVar4 * 57.295776);
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x4c8)) = fVar4;
|
|
if (fVar4 < 0.0) {
|
|
local_18.x = -local_18.x;
|
|
}
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x4cc)) = local_18.x;
|
|
if (-0.5 <= awayDirY) {
|
|
laserDepthOffset = 0x453b8000;
|
|
}
|
|
else {
|
|
laserDepthOffset = 0xc1200000;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((iVar3 + 0x358)) = laserDepthOffset;
|
|
_DAT_00c5c554 = awayDirX * 7.0;
|
|
DAT_00c5c558 = awayDirY * 5.0 - 18.0;
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x34c)) = _DAT_00c5c554;
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x350)) = DAT_00c5c558;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0043eb10
|
|
int Entity_Familiar::GetRandomWisp(RNG *rng)
|
|
{
|
|
code *pcVar1;
|
|
RNG *pRVar2;
|
|
void *pvVar3;
|
|
int wispItemId;
|
|
uint32_t nextSeed;
|
|
int *wispItemsEnd;
|
|
uint32_t uVar4;
|
|
int *wispItemsCapacityEnd;
|
|
int *taggedItemIt;
|
|
int taggedItemsEnd;
|
|
void *wispItems;
|
|
int *local_24;
|
|
int *local_20;
|
|
RNG *local_1c;
|
|
void *wispItemsBegin;
|
|
uint32_t itemsLeft;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af2305;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_1c = rng;
|
|
pvVar3 = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetTaggedItems(0x4000000);
|
|
msvc::vector<int>::copy_constructor(pvVar3);
|
|
wispItemsEnd = GHIDRA_CAST<int *>(0x0);
|
|
wispItemsBegin = (void *)0x0;
|
|
wispItemsCapacityEnd = GHIDRA_CAST<int *>(0x0);
|
|
wispItems = (void *)0x0;
|
|
local_24 = GHIDRA_CAST<int *>(0x0);
|
|
local_20 = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 1;
|
|
itemsLeft = taggedItemsEnd - GHIDRA_INT(taggedItemIt) >> 2;
|
|
if (itemsLeft != 0) {
|
|
if (0x3fffffff < itemsLeft) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::_Xlen();
|
|
}
|
|
msvc::vector<unsigned_int>::_Reallocate(itemsLeft);
|
|
wispItemsEnd = local_24;
|
|
wispItemsCapacityEnd = local_20;
|
|
do {
|
|
if (0 < *GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>((*taggedItemIt + 0xcc)) + 400))) {
|
|
if (wispItemsEnd == wispItemsCapacityEnd) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(wispItemsEnd,taggedItemIt);
|
|
wispItemsEnd = local_24;
|
|
wispItemsCapacityEnd = local_20;
|
|
}
|
|
else {
|
|
*wispItemsEnd = *taggedItemIt;
|
|
local_24 = wispItemsEnd + 1;
|
|
wispItemsEnd = local_24;
|
|
}
|
|
}
|
|
taggedItemIt = taggedItemIt + 1;
|
|
itemsLeft = itemsLeft - 1;
|
|
} while (itemsLeft != 0);
|
|
wispItemsBegin = wispItems;
|
|
itemsLeft = 0;
|
|
}
|
|
pRVar2 = local_1c;
|
|
uVar4 = GHIDRA_INT(wispItemsEnd) - GHIDRA_INT(wispItemsBegin) >> 2;
|
|
wispItems = wispItemsBegin;
|
|
if (uVar4 == 0) {
|
|
wispItemId = 0x248;
|
|
}
|
|
else {
|
|
nextSeed = local_1c->_seed;
|
|
if (nextSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
nextSeed = pRVar2->_seed;
|
|
if (nextSeed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
wispItemId = (*pcVar1)();
|
|
return wispItemId;
|
|
}
|
|
}
|
|
nextSeed = nextSeed >> ((uint8_t)pRVar2->_shift1 & 0x1f) ^ nextSeed;
|
|
nextSeed = nextSeed << ((uint8_t)pRVar2->_shift2 & 0x1f) ^ nextSeed;
|
|
nextSeed = nextSeed >> ((uint8_t)pRVar2->_shift3 & 0x1f) ^ nextSeed;
|
|
pRVar2->_seed = nextSeed;
|
|
wispItemId = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(wispItemsBegin) + (nextSeed % uVar4) * 4)) + 4));
|
|
}
|
|
if (wispItemsBegin != (void *)0x0) {
|
|
uVar4 = GHIDRA_INT(wispItemsCapacityEnd) - GHIDRA_INT(wispItemsBegin) & 0xfffffffc;
|
|
pvVar3 = wispItemsBegin;
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)(GHIDRA_CAST<char *>(wispItemsBegin) + -4);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(wispItemsBegin) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
FID_conflict__Tidy(&taggedItemIt);
|
|
ExceptionList = local_10;
|
|
return wispItemId;
|
|
}
|
|
|
|
// 00505cf0
|
|
int Entity_Familiar::Coins()
|
|
{
|
|
return this->_coins;
|
|
}
|
|
|
|
// 005ae490
|
|
void Entity_Familiar::ai_buddy_inbox()
|
|
{
|
|
uint8_t bVar1;
|
|
char cVar2;
|
|
int backAnimOffset;
|
|
uint32_t uVar3;
|
|
uint8_t *pbVar4;
|
|
uint8_t unused;
|
|
uint8_t *pbVar5;
|
|
uint8_t *pbVar6;
|
|
char *pcVar7;
|
|
bool isLess;
|
|
float angle;
|
|
uint64_t uVar8;
|
|
Vector VStack_c0;
|
|
float savedFrame;
|
|
ProjectileParams projParams;
|
|
float securityCookie;
|
|
int headState;
|
|
|
|
securityCookie = (float)(__security_cookie ^ GHIDRA_UINT(&(&projParams)[1].CircleAngle));
|
|
switch(this->_subtype) {
|
|
case 0:
|
|
backAnimOffset = 0;
|
|
headState = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_pathfinder))) + 0x5c4))));
|
|
if ((this->_velocity).y < 0.0) {
|
|
backAnimOffset = 4;
|
|
}
|
|
if (headState != 1) {
|
|
if (headState == 2) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(*GHIDRA_CAST<uint8_t **>((GHIDRA_INT(&PTR_s_HeadFrontWiggleOpen_00b62994) + backAnimOffset)),0);
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(*GHIDRA_CAST<uint8_t **>((GHIDRA_INT(&PTR_s_HeadFrontWiggleClosed_00b6299c) + backAnimOffset)),0);
|
|
return;
|
|
}
|
|
VStack_c0.y = *GHIDRA_CAST<float *>((GHIDRA_INT(&PTR_s_HeadFrontWiggleTransition_00b6298c) + backAnimOffset));
|
|
uVar8 = _string_holder_c_str();
|
|
pbVar5 = GHIDRA_CAST<uint8_t *>(uVar8);
|
|
do {
|
|
pbVar6 = GHIDRA_CAST<uint8_t *>(((uint64_t)uVar8 >> 0x20));
|
|
pbVar4 = GHIDRA_CAST<uint8_t *>(uVar8);
|
|
bVar1 = *pbVar4;
|
|
isLess = bVar1 < *pbVar6;
|
|
if (bVar1 != *pbVar6) {
|
|
LAB_005ae518:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_005ae51d;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
isLess = bVar1 < pbVar6[1];
|
|
if (bVar1 != pbVar6[1]) goto LAB_005ae518;
|
|
uVar8 = CONCAT44(pbVar6 + 2,pbVar4 + 2);
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_005ae51d:
|
|
if (uVar3 == 0) {
|
|
LAB_005ae551:
|
|
pcVar7 = "HeadBackWiggleTransition";
|
|
do {
|
|
bVar1 = *pbVar5;
|
|
isLess = bVar1 < (uint8_t)*pcVar7;
|
|
if (bVar1 != *pcVar7) {
|
|
LAB_005ae576:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_005ae57b;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar5[1];
|
|
isLess = bVar1 < (uint8_t)pcVar7[1];
|
|
if (bVar1 != pcVar7[1]) goto LAB_005ae576;
|
|
pbVar5 = pbVar5 + 2;
|
|
pcVar7 = pcVar7 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_005ae57b:
|
|
if (uVar3 == 0) goto LAB_005ae57f;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(VStack_c0.y),0);
|
|
}
|
|
else {
|
|
pcVar7 = "HeadFrontWiggleTransition";
|
|
pbVar4 = pbVar5;
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
isLess = bVar1 < (uint8_t)*pcVar7;
|
|
if (bVar1 != *pcVar7) {
|
|
LAB_005ae548:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_005ae54d;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
isLess = bVar1 < (uint8_t)pcVar7[1];
|
|
if (bVar1 != pcVar7[1]) goto LAB_005ae548;
|
|
pbVar4 = pbVar4 + 2;
|
|
pcVar7 = pcVar7 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_005ae54d:
|
|
if (uVar3 != 0) goto LAB_005ae551;
|
|
LAB_005ae57f:
|
|
if ((this->_sprite)._animState._animData == (void *)0x0) {
|
|
savedFrame = (float)&DAT_bf800000;
|
|
}
|
|
else {
|
|
savedFrame = (this->_sprite)._animState._animFrame;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(VStack_c0.y),0);
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(savedFrame);
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::IsEventTriggered("Shoot");
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(this))))->Entity_NPC::PlaySound(0xe2,1.0,2,0,1.0);
|
|
(GHIDRA_CAST<ProjectileParams *>((&projParams)))->ProjectileParams::ProjectileParams();
|
|
cVar2 = FUN_005ae1d0();
|
|
if (cVar2 == '\0') {
|
|
uVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(unused);
|
|
projParams.Variant = (uVar3 != 0x1c) + 3;
|
|
}
|
|
VStack_c0.x = 10.0;
|
|
VStack_c0.y = 0.0;
|
|
Entity_NPC::FireProjectiles(GHIDRA_CAST<Entity_NPC *>(this),&this->_pos,&VStack_c0,6,&projParams);
|
|
}
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_pathfinder))) + 0x5c4)))) = 2;
|
|
return;
|
|
}
|
|
break;
|
|
case 1:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Body1Wiggle"),0);
|
|
return;
|
|
case 2:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Body2Wiggle"),0);
|
|
return;
|
|
case 3:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Body3Wiggle"),0);
|
|
return;
|
|
case 4:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Body4Wiggle"),0);
|
|
return;
|
|
case 5:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Body5Wiggle"),0);
|
|
return;
|
|
case 6:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Body6Wiggle"),0);
|
|
headState = this->_parent;
|
|
angle = atan2f(((*GHIDRA_CAST<float *>((headState + 0x340)) + *GHIDRA_CAST<float *>((headState + 0x350))) - (this->_pos).y
|
|
) - (this->_posOffset).y,
|
|
((*GHIDRA_CAST<float *>((headState + 0x33c)) + *GHIDRA_CAST<float *>((headState + 0x34c))) - (this->_pos).x
|
|
) - (this->_posOffset).x);
|
|
angle = normalize_angle_degrees(angle * 57.295776 - (this->_sprite)._rotation);
|
|
angle = normalize_angle_degrees(angle * 0.3 + (this->_sprite)._rotation);
|
|
(this->_sprite)._rotation = angle;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0060d0e0
|
|
int Entity_Familiar::Hearts()
|
|
{
|
|
return this->_hearts;
|
|
}
|
|
|
|
// 0060d100
|
|
int Entity_Familiar::Keys()
|
|
{
|
|
return this->_keys;
|
|
}
|
|
|
|
// 0060d180
|
|
KColor * Entity_Familiar::GetPlayerSlot(KColor *outColor, Entity_Player *player)
|
|
{
|
|
int playerColor;
|
|
std_string *psVar1;
|
|
|
|
playerColor = 0;
|
|
psVar1 = &(this->_sprite)._animDefaultName;
|
|
do {
|
|
if (*GHIDRA_CAST<int *>(psVar1->_buf) == player->_controllerIndex) goto LAB_0060d1a3;
|
|
playerColor = playerColor + 1;
|
|
psVar1 = GHIDRA_CAST<std_string *>((psVar1->_buf + 4));
|
|
} while (playerColor < 4);
|
|
playerColor = 5;
|
|
LAB_0060d1a3:
|
|
PlayerManager::GetPlayerColorValue(outColor,playerColor);
|
|
return outColor;
|
|
}
|
|
|
|
// 0060d200
|
|
void Entity_Familiar::Constructor()
|
|
{
|
|
uint32_t *slotCursor;
|
|
void *setHead;
|
|
int remaining;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6753;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::constructor();
|
|
local_8 = 0;
|
|
*GHIDRA_CAST<uint8_t ***>(this) = IsaacRepentancePlus::Entity_Familiar::vftable;
|
|
remaining = 0x3c;
|
|
slotCursor = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x418))));
|
|
do {
|
|
slotCursor[1] = 0;
|
|
*slotCursor = 0;
|
|
remaining = remaining + -1;
|
|
slotCursor = slotCursor + 2;
|
|
} while (remaining != 0);
|
|
(GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(&this->_pathfinder))))->PathFinder::Init(GHIDRA_CAST<Entity *>(this));
|
|
(this->_orbitDistance).y = 0.0;
|
|
(this->_orbitDistance).x = 0.0;
|
|
this->_isSubtype55555 = 0;
|
|
this->_isHourglassRewound = 0;
|
|
(this->_formationOffset).y = 0.0;
|
|
(this->_formationOffset).x = 0.0;
|
|
(this->_formationTargetOffset).y = 0.0;
|
|
(this->_formationTargetOffset).x = 0.0;
|
|
(this->_hitList)._begin = (void *)0x0;
|
|
(this->_hitList)._end = (void *)0x0;
|
|
(this->_hitList)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_chargeBarSprite)))->ANM2::constructor();
|
|
this->_extraData = (void *)0x0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xee4)))) = 0;
|
|
this->_sirenHelper = 0;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),5);
|
|
this->_sirenCharmFrames = 0;
|
|
(this->_dirtColor)._tint[0] = 1.0;
|
|
(this->_dirtColor)._tint[1] = 1.0;
|
|
(this->_dirtColor)._tint[2] = 1.0;
|
|
(this->_dirtColor)._tint[3] = 1.0;
|
|
(this->_dirtColor)._colorize[0] = 0.0;
|
|
(this->_dirtColor)._colorize[1] = 0.0;
|
|
(this->_dirtColor)._colorize[2] = 0.0;
|
|
(this->_dirtColor)._colorize[3] = 0.0;
|
|
(this->_dirtColor)._offset[0] = 0.0;
|
|
(this->_dirtColor)._offset[1] = 0.0;
|
|
(this->_dirtColor)._offset[2] = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf38)))) = 10;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf3c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf40)))) = 0;
|
|
setHead = operator_new(0x18);
|
|
*(void **)setHead = setHead;
|
|
*(void **)(GHIDRA_CAST<char *>(setHead) + 4) = setHead;
|
|
*(void **)(GHIDRA_CAST<char *>(setHead) + 8) = setHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(setHead) + 0xc)) = 0x101;
|
|
*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf3c))) = setHead;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0060d8c0
|
|
uint8_t Entity_Familiar::CanBeDamagedByEnemy()
|
|
{
|
|
int variant;
|
|
|
|
variant = this->_variant;
|
|
if ((((variant == 0x3e) || (variant == 0x43)) || (variant == 0xd3)) || (variant == 100)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0060d8e0
|
|
uint8_t Entity_Familiar::CanBlockProjectiles()
|
|
{
|
|
int iVar1;
|
|
uint8_t isHasTag;
|
|
void *pvVar2;
|
|
bool isBlocker;
|
|
BitSet128 itemTags;
|
|
|
|
iVar1 = this->_variant;
|
|
if (iVar1 == 0x23) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x2c) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x2d) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x21) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x41) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x20) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x2a) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x11) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x33) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x4b) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x32) {
|
|
isBlocker = this->_subtype == 0;
|
|
}
|
|
else {
|
|
if (iVar1 == 0x44) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x43) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x53) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x5f) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x45) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x46) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x67) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x68) {
|
|
LAB_0060d954:
|
|
if (this->_fireCooldown < 0) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
if (iVar1 == 0x6b) {
|
|
isBlocker = this->_subtype == 1;
|
|
}
|
|
else {
|
|
if (iVar1 == 0x79) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x80) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x82) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 900) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x74) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x75) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xcf) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe2) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe4) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xee) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe0) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xc9) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xd8) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xd9) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xce) {
|
|
if (this->_subtype == 0x2be) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xed) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe5) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xcc) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xd3) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe7) {
|
|
pvVar2 = get_item_config_entry(this);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemTags._l)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 0xc)) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagShielded._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemTags._l)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 8)) & GHIDRA_UINT(g_tearFlagShielded._l);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemTags._h)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 0x10)) & GHIDRA_UINT(g_tearFlagShielded._h);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemTags._h)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 0x14)) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagShielded._h)) + 0x4)));
|
|
isHasTag = (GHIDRA_CAST<BitSet128 *>((&itemTags)))->BitSet128::IsNonZero();
|
|
if (isHasTag == 0) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe8) goto LAB_0060d954;
|
|
if (iVar1 == 0xea) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xef) {
|
|
return 1;
|
|
}
|
|
if (iVar1 == 100) {
|
|
return 1;
|
|
}
|
|
isBlocker = iVar1 == 0xf3;
|
|
}
|
|
}
|
|
if (isBlocker) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0060dab0
|
|
uint8_t Entity_Familiar::CanShutDoors()
|
|
{
|
|
if (((this->_variant == 0xf2) && (this->_coins != 0)) && (this->_visible != 0)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0060dc40
|
|
float Entity_Familiar::apply_tear_modifiers()
|
|
{
|
|
uint8_t isOwned;
|
|
int trinketMultiplier;
|
|
int iVar1;
|
|
Entity_Player *player;
|
|
bool bVar2;
|
|
bool bVar3;
|
|
float multiplier;
|
|
uint32_t familiarFlags;
|
|
void *ownerPlayer;
|
|
void *twin;
|
|
|
|
familiarFlags = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_config) + 0xd8));
|
|
iVar1 = this->_variant;
|
|
isOwned = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if ((((isOwned == 0) || (this->_variant == 0x2b)) || (this->_variant == 0x49)) &&
|
|
(((isOwned = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf8,0), isOwned == 0 &&
|
|
(isOwned = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)),0xf8), isOwned == 0))
|
|
|| (((familiarFlags & 1) == 0 && (((familiarFlags & 2) == 0 && (iVar1 != 0xe7)))))))) {
|
|
multiplier = 1.0;
|
|
}
|
|
else {
|
|
multiplier = 2.0;
|
|
}
|
|
player = this->_player;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) != 0x59)) {
|
|
iVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x59);
|
|
bVar3 = false;
|
|
bVar2 = iVar1 == 0;
|
|
LAB_0060dd32:
|
|
if (bVar2 || bVar3 != iVar1 < 0) goto LAB_0060dd6f;
|
|
player = this->_player;
|
|
}
|
|
else if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2ef0))) == '\0') {
|
|
trinketMultiplier = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x59);
|
|
bVar3 = SBORROW4(trinketMultiplier,1);
|
|
iVar1 = trinketMultiplier + -1;
|
|
bVar2 = trinketMultiplier == 1;
|
|
goto LAB_0060dd32;
|
|
}
|
|
iVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x59);
|
|
multiplier = (float)iVar1 * 0.25 + multiplier;
|
|
LAB_0060dd6f:
|
|
ownerPlayer = this->_player;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(ownerPlayer) + 0x13c0));
|
|
if (iVar1 == 0x24) {
|
|
multiplier = multiplier * 0.75;
|
|
}
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(ownerPlayer) + 0x172)) != '\0') &&
|
|
((((iVar1 == 0x1d || (iVar1 == 0x26)) &&
|
|
(twin = *(void **)(GHIDRA_CAST<char *>(ownerPlayer) + 0x1e68), twin != (void *)0x0)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x161c)) != -1 &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twin) + 0x161c)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(ownerPlayer) + 0x161c)))))))) &&
|
|
(twin != ownerPlayer)) {
|
|
multiplier = multiplier * 0.25;
|
|
}
|
|
return multiplier;
|
|
}
|
|
|
|
// 0060ddd0
|
|
void Entity_Familiar::set_locust_config_index(int param_2)
|
|
{
|
|
void *locustEntry;
|
|
int iVar1;
|
|
float locustScale;
|
|
|
|
iVar1 = this->_variant;
|
|
if (iVar1 != 0xe7) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Trying to set locust config index on something that isn\'t a locust\n");
|
|
iVar1 = this->_variant;
|
|
}
|
|
this->_coins = param_2;
|
|
if (iVar1 == 0xe7) {
|
|
iVar1 = this->_subtype;
|
|
}
|
|
else {
|
|
iVar1 = 0x19;
|
|
param_2 = 0;
|
|
}
|
|
locustEntry = ItemConfig::get_wisp_entry(iVar1,param_2);
|
|
anm2_apply_gfx_overrides
|
|
(GHIDRA_CAST<std_string *>((GHIDRA_INT(locustEntry) + 0x84)),GHIDRA_CAST<std_string *>((GHIDRA_INT(locustEntry) + 0x9c)),
|
|
&this->_sprite);
|
|
this->_size = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_config) + 0x38)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(locustEntry) + 0x78));
|
|
locustScale = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(locustEntry) + 0x78));
|
|
(this->_sprite)._scale.x = locustScale;
|
|
(this->_sprite)._scale.y = locustScale;
|
|
return;
|
|
}
|
|
|
|
// 00610470
|
|
void Entity_Familiar::Remove()
|
|
{
|
|
void *player;
|
|
int *playerCounter;
|
|
int variant;
|
|
float zeroY;
|
|
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Remove();
|
|
if (-1 < this->_orbitLayer) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
this->_orbitLayer = -1;
|
|
}
|
|
RemoveFromFollowers(this);
|
|
RemoveFromDelayed(this);
|
|
if (this->_variant == 0x2b) {
|
|
if (this->_subtype == 0) {
|
|
playerCounter = GHIDRA_CAST<int *>((GHIDRA_INT(this->_player) + 0x136c));
|
|
*playerCounter = *playerCounter + -1;
|
|
}
|
|
}
|
|
else if (this->_variant == 0x49) {
|
|
playerCounter = GHIDRA_CAST<int *>((GHIDRA_INT(this->_player) + 0x1370));
|
|
*playerCounter = *playerCounter + -1;
|
|
}
|
|
zeroY = g_vectorZero.y;
|
|
variant = this->_variant;
|
|
if (((variant == 0x44) || (variant == 0x4e)) || (variant == 0xf3)) {
|
|
player = this->_player;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x164c)) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x1650)) = zeroY;
|
|
}
|
|
ResolveOrbitConflict(this);
|
|
return;
|
|
}
|
|
|
|
// 00610540
|
|
void Entity_Familiar::Kill(EntityRef *source)
|
|
{
|
|
code *pcVar1;
|
|
int64_t lVar2;
|
|
int64_t lVar3;
|
|
int64_t lVar4;
|
|
ANM2 *pAVar5;
|
|
char cVar6;
|
|
uint8_t bVar7;
|
|
ColorMod *color;
|
|
uint32_t uVar8;
|
|
Entity *tmpEntity;
|
|
Entity *orbitParent;
|
|
ColorMod *color_00;
|
|
ColorMod *color_01;
|
|
int orbitLayerClamped;
|
|
ColorMod *color_02;
|
|
int *piVar9;
|
|
Vector *posPtr;
|
|
uint32_t uVar10;
|
|
uint32_t uVar11;
|
|
LayerState *layer;
|
|
EntityRef *killSourcePtr;
|
|
int iVar12;
|
|
int unusedArg;
|
|
void *pvVar13;
|
|
uint64_t *allocatedBytes;
|
|
Sprite *player;
|
|
Sprite *this_01;
|
|
Entity_Familiar *pEVar14;
|
|
PlayerManager *playerManager;
|
|
uint32_t *ptrSlot;
|
|
bool bVar15;
|
|
float fVar16;
|
|
uint64_t uVar17;
|
|
uint64_t uVar18;
|
|
EntityRef killSource;
|
|
Vector freePickupPos;
|
|
uint8_t itemFindResult [8];
|
|
int itemNode;
|
|
uint8_t anyVariantFind [4];
|
|
EntityRef nullKillSource;
|
|
Vector spawnPos;
|
|
uint64_t rngShifts;
|
|
uint32_t rngShift3;
|
|
int triggerKeyType;
|
|
uint32_t triggerKeyAnyVariant;
|
|
int triggerKeyTypeVariant;
|
|
int triggerKeyVariant;
|
|
int *spawnerPtr;
|
|
uint32_t collectibleKey;
|
|
Vector pickupVelocity;
|
|
char wispMates [4];
|
|
int wispMatesData;
|
|
uint8_t *wispMatesCapacity;
|
|
Entity_Familiar *wispMatesCount;
|
|
char itemWispMates [4];
|
|
int itemWispMatesData;
|
|
uint8_t *itemWispMatesCapacity;
|
|
Entity_Familiar *itemWispMatesCount;
|
|
Vector local_198;
|
|
Vector local_190;
|
|
EntityList_EL itemWispQuery;
|
|
EntityList_EL wispQuery;
|
|
Vector pickupPos;
|
|
uint32_t pickupSeed;
|
|
int soundId;
|
|
Vector local_158;
|
|
Vector local_150;
|
|
void *local_148;
|
|
uint32_t pickupType;
|
|
uint32_t local_140;
|
|
uint32_t *local_13c;
|
|
Game *local_138;
|
|
Entity *local_134;
|
|
uint32_t pickupSubtype;
|
|
Entity_Familiar *local_12c;
|
|
uint32_t local_128;
|
|
Entity_Familiar *local_124;
|
|
uint64_t local_120;
|
|
Entity_Familiar *local_118;
|
|
char isUnicornWisp;
|
|
Color tearPoofColor;
|
|
Color poofColor;
|
|
Color particleColor;
|
|
Color particleColor2;
|
|
RNG cardRng;
|
|
ColorMod splatColor;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float local_14;
|
|
Game *game;
|
|
Manager *manager;
|
|
uint64_t oldAllocated;
|
|
Entity_Familiar *otherFamiliar;
|
|
Entity_Player *player;
|
|
void **spiderCount;
|
|
|
|
manager = g_manager;
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00af68e1;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
local_12c = this;
|
|
if (this->_dead == 0) {
|
|
iVar12 = this->_variant;
|
|
if (iVar12 == 0x80) {
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
uVar8 = Random();
|
|
Game::SpawnParticles
|
|
(g_game,&this->_pos,0x23,8,
|
|
(float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0,color,-12.0,0);
|
|
uVar8 = Random();
|
|
manager = g_manager;
|
|
local_120 = CONCAT44(0xb5,(float)local_120);
|
|
local_124 = (Entity_Familiar *)
|
|
((float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 1.0);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>((GHIDRA_INT(&local_120) + 4)));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_120))) + 0x4))),0.5,2,0,(float)local_124,0.0);
|
|
}
|
|
else if ((iVar12 == 0xd8) || (iVar12 == 0xd9)) {
|
|
soundId = 0x1e;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
splatColor._tint[0] = 0.2;
|
|
splatColor._tint[1] = 0.2;
|
|
splatColor._tint[2] = 0.2;
|
|
splatColor._tint[3] = 1.0;
|
|
splatColor._offset[0] = 0.0;
|
|
splatColor._colorize[0] = 1.0;
|
|
splatColor._colorize[1] = 1.0;
|
|
splatColor._colorize[2] = 1.0;
|
|
splatColor._colorize[3] = 1.0;
|
|
splatColor._offset[1] = 0.0;
|
|
splatColor._offset[2] = 0.0;
|
|
uVar8 = Random();
|
|
posPtr = &this->_pos;
|
|
local_198.y = (float)posPtr;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,posPtr,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),3,uVar8,0);
|
|
tmpEntity->SetColor(&splatColor,0xffffffff,0xff,0,1);
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,7,posPtr,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar8,0);
|
|
tmpEntity->SetColor(&splatColor,0xffffffff,0xff,0,1);
|
|
tmpEntity->Update();
|
|
uVar8 = Random();
|
|
for (local_124 = GHIDRA_CAST<Entity_Familiar *>((uVar8 % 5 + 3)); local_124 != GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_124[-1])) + 0xf47))))) {
|
|
uVar8 = Random();
|
|
fVar16 = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_134 = GHIDRA_CAST<Entity *>((fVar16 + fVar16));
|
|
fVar16 = cos((float)local_134);
|
|
pickupPos.x = fVar16 * 0.5 * this->_size + (this->_pos).x;
|
|
fVar16 = sin((float)local_134);
|
|
pickupPos.y = fVar16 * 0.5 * this->_size + (this->_pos).y;
|
|
uVar8 = Random();
|
|
fVar16 = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))) = GHIDRA_CAST<Entity_Familiar *>((fVar16 + fVar16));
|
|
uVar8 = Random();
|
|
local_120 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))),
|
|
(float)((double)GHIDRA_INT(uVar8) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) * 2.3283064e-10 *
|
|
4.0 + 2.0);
|
|
pickupVelocity.x = cos((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_120)) + 0x4))));
|
|
pickupVelocity.x = pickupVelocity.x * (float)local_120;
|
|
local_150.y = pickupVelocity.x;
|
|
fVar16 = sin((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_120)) + 0x4))));
|
|
pickupVelocity.y = fVar16 * (float)local_120;
|
|
local_13c = GHIDRA_CAST<uint32_t *>(pickupVelocity.y);
|
|
pickupSeed = Random();
|
|
local_138 = g_game;
|
|
pickupSubtype = 0;
|
|
local_140 = 5;
|
|
pickupType = 1000;
|
|
lua_callback_run_pre_entity_spawn
|
|
(GHIDRA_CAST<int *>(&pickupType),GHIDRA_CAST<int *>(&local_140),&pickupPos,&pickupVelocity,GHIDRA_CAST<Entity *>(0x0),
|
|
GHIDRA_CAST<int *>(&pickupSubtype),&pickupSeed);
|
|
uVar8 = local_140;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
LAB_00611aa8:
|
|
local_128 = pickupSubtype;
|
|
}
|
|
else {
|
|
local_118 = *GHIDRA_CAST<Entity_Familiar **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_deathmatchManager))) + 0xc))));
|
|
uVar11 = Random();
|
|
pEVar14 = local_118;
|
|
uVar10 = pickupSubtype;
|
|
rngShifts = 0x900000005;
|
|
local_120 = CONCAT44(uVar11,7);
|
|
rngShift3 = 7;
|
|
if (pickupType != 5) goto LAB_00611aa8;
|
|
if (uVar8 < 0x12d) {
|
|
if (uVar8 == 300) {
|
|
while ((local_128 = pickupSubtype, pickupSubtype == 0 ||
|
|
(cVar6 = local_118->Kill(pickupSubtype), cVar6 != '\0')
|
|
)) {
|
|
if (uVar11 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar11 = uVar11 >> ((uint8_t)rngShifts & 0x1f) ^ uVar11;
|
|
uVar11 = uVar11 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar11;
|
|
uVar11 = uVar11 >> ((uint8_t)local_120 & 0x1f) ^ uVar11;
|
|
iVar12 = ItemPool::GetCardEx(uVar11,0x19,10,10,1);
|
|
cardRng._shift1 = 5;
|
|
cardRng._shift2 = 9;
|
|
cardRng._shift3 = 7;
|
|
cardRng._seed = uVar11;
|
|
pickupSubtype = lua_callback_run_get_card(&cardRng,iVar12,1,1,0);
|
|
}
|
|
}
|
|
else {
|
|
if (uVar8 == 0x46) {
|
|
local_134 = GHIDRA_CAST<Entity *>((pickupSubtype >> 0xb));
|
|
do {
|
|
local_128 = pickupSubtype;
|
|
if (pickupSubtype != 0) {
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(local_118) + 0x28);
|
|
iVar12 = ItemPool::GetPillEffect
|
|
(&g_game->_itemPool,pickupSubtype,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
cVar6 = (*pcVar1)(iVar12);
|
|
if (cVar6 == '\0') goto LAB_00611ab4;
|
|
uVar11 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_120))) + 0x4)));
|
|
}
|
|
if (uVar11 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar11 = uVar11 >> ((uint8_t)rngShifts & 0x1f) ^ uVar11;
|
|
uVar11 = uVar11 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar11;
|
|
uVar11 = uVar11 >> ((uint8_t)local_120 & 0x1f) ^ uVar11;
|
|
local_120 = CONCAT44(uVar11,(float)local_120);
|
|
pickupSubtype = ItemPool::GetPill(uVar11);
|
|
pickupSubtype = pickupSubtype | (GHIDRA_UINT(local_134) & 1) << 0xb;
|
|
} while( true );
|
|
}
|
|
if (uVar8 != 100) goto LAB_00611aa8;
|
|
local_128 = pickupSubtype;
|
|
if (pickupSubtype == 0x19) {
|
|
LAB_006118d4:
|
|
bVar15 = false;
|
|
}
|
|
else {
|
|
collectibleKey = pickupSubtype;
|
|
msvc::set<int>::find_node(itemFindResult,&collectibleKey);
|
|
if (((*GHIDRA_CAST<char *>((itemNode + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((itemNode + 0x10)) <= GHIDRA_INT(uVar10))) && (itemNode != pEVar14->_index))
|
|
goto LAB_006118d4;
|
|
bVar15 = true;
|
|
}
|
|
if ((uVar10 == 0) || (bVar15)) {
|
|
pickupSubtype = (**(code **)(*GHIDRA_CAST<int *>(pEVar14) + 0x84))(0);
|
|
local_128 = pickupSubtype;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (uVar8 != 0x15e) goto LAB_00611aa8;
|
|
while ((local_128 = pickupSubtype, pickupSubtype == 0 ||
|
|
(cVar6 = local_118->guard_check_icall(pickupSubtype), cVar6 != '\0')))
|
|
{
|
|
pickupSubtype = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetTrinket(0);
|
|
}
|
|
}
|
|
}
|
|
LAB_00611ab4:
|
|
local_134 = (GHIDRA_CAST<EntityFactory *>((local_138->_entityFactory)))->EntityFactory::Create(pickupType,0);
|
|
lVar2 = CONCAT44(local_138,local_158.y);
|
|
if (local_134 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
uVar17 = GetTimeNs();
|
|
tmpEntity = local_134;
|
|
lVar2 = (uVar17 & 0xffffffff) * 0x431bde82;
|
|
local_158.y = (float)((uint64_t)lVar2 >> 0x20);
|
|
lVar3 = (uVar17 >> 0x20) * 0xd7b634db;
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(((uint64_t)lVar3 >> 0x20));
|
|
uVar18 = lVar3 + ((uVar17 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar10 = GHIDRA_UINT((uVar18 >> 0x20));
|
|
lVar2 = lVar2 + (uVar18 & 0xffffffff);
|
|
local_190.x = (float)lVar2;
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
lVar2 = (uVar17 >> 0x20) * 0x431bde82 +
|
|
(uint64_t)CONCAT14(CARRY4(uVar10,uVar8),uVar10 + uVar8);
|
|
local_134->_spawnerType = 0;
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
local_134->_spawnerVariant = 0;
|
|
ptrSlot = &local_134->_spawnerEntity;
|
|
local_120 = CONCAT44(uVar8 >> 0x12,GHIDRA_UINT(lVar2) >> 0x12 | uVar8 * 0x4000);
|
|
if (*ptrSlot != 0) {
|
|
spawnerPtr = ptrSlot;
|
|
msvc::multiset<unsigned_int>::erase(&spawnerPtr);
|
|
}
|
|
iVar12 = *GHIDRA_CAST<int *>(tmpEntity);
|
|
*ptrSlot = 0;
|
|
(tmpEntity->_pos).x = pickupPos.x;
|
|
(tmpEntity->_pos).y = pickupPos.y;
|
|
(tmpEntity->_velocity).x = local_150.y;
|
|
(tmpEntity->_velocity).y = (float)local_13c;
|
|
(**(code **)(iVar12 + 4))(pickupType,local_140,local_128,pickupSeed);
|
|
game = local_138;
|
|
pvVar13 = local_138->_room;
|
|
iVar12 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar13) + 0x1214));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar13) + 0x1214)) = iVar12 + 1;
|
|
tmpEntity->_index = iVar12;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar13) + 0x1218)))))->EntityList::AddEntity(tmpEntity);
|
|
bVar7 = Game::ShouldEraseEnemy(tmpEntity);
|
|
if (bVar7 != 0) {
|
|
Entity::RemoveWithPoof(tmpEntity,unusedArg);
|
|
}
|
|
if ((tmpEntity->_exists != 0) &&
|
|
((game->_proceduralItemManager)._proceduralItems._begin !=
|
|
(game->_proceduralItemManager)._proceduralItems._end)) {
|
|
triggerKeyTypeVariant = tmpEntity->_type;
|
|
triggerKeyVariant = tmpEntity->_variant;
|
|
msvc::map<unsigned_long_long>::find(&local_148,&triggerKeyTypeVariant);
|
|
if (local_148 == (game->_proceduralItemManager)._spawnTriggerTargets._head) {
|
|
triggerKeyType = tmpEntity->_type;
|
|
triggerKeyAnyVariant = 0xffffffff;
|
|
piVar9 = GHIDRA_CAST<int *>(std)::map<unsigned_long_long>::find(anyVariantFind,&triggerKeyType);
|
|
local_148 = (void *)*piVar9;
|
|
if (local_148 == (game->_proceduralItemManager)._spawnTriggerTargets._head)
|
|
goto LAB_00611d87;
|
|
}
|
|
playerManager = &g_game->_playerManager;
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar13 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar13) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n");
|
|
pvVar13 = (playerManager->_playerList)._end;
|
|
}
|
|
piVar9 = (playerManager->_playerList)._begin;
|
|
if (local_118 < GHIDRA_CAST<Entity_Familiar *>((GHIDRA_INT(pvVar13) - GHIDRA_INT(piVar9) >> 2))) {
|
|
piVar9 = piVar9 + GHIDRA_INT(local_118);
|
|
}
|
|
trigger_set_dispatch
|
|
((void *)(*piVar9 + 0x1fc8),6,tmpEntity,&pickupPos,&pickupVelocity);
|
|
playerManager = &g_game->_playerManager;
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
} while (local_118 <
|
|
(uint8_t *)
|
|
(GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2));
|
|
}
|
|
}
|
|
LAB_00611d87:
|
|
uVar18 = GetTimeNs();
|
|
uVar8 = GHIDRA_UINT((uVar18 >> 0x20));
|
|
lVar3 = (uVar18 & 0xffffffff) * 0x431bde82;
|
|
local_150.y = (float)((uint64_t)lVar3 >> 0x20);
|
|
lVar4 = (uint64_t)uVar8 * 0xd7b634db;
|
|
local_13c = GHIDRA_CAST<uint32_t *>(((uint64_t)lVar4 >> 0x20));
|
|
lVar2 = (uint64_t)uVar8 * 0x431bde82;
|
|
uVar18 = lVar4 + ((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar10 = GHIDRA_UINT((uVar18 >> 0x20));
|
|
lVar3 = lVar3 + (uVar18 & 0xffffffff);
|
|
local_190.x = (float)lVar3;
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
lVar3 = lVar2 + (uint64_t)CONCAT14(CARRY4(uVar10,uVar8),uVar10 + uVar8);
|
|
uVar11 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
uVar8 = GHIDRA_UINT(lVar3) >> 0x12 | uVar11 * 0x4000;
|
|
uVar10 = uVar8 - GHIDRA_INT((float)local_120);
|
|
bVar15 = CARRY4(GHIDRA_UINT(g_entitySpawnTimeMs),uVar10);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x0))) = GHIDRA_UINT(g_entitySpawnTimeMs) + uVar10;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) =
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) +
|
|
(((uVar11 >> 0x12) - (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_120))) + 0x4)))) - GHIDRA_UINT((uVar8 < GHIDRA_UINT((float)local_120))))
|
|
+ GHIDRA_UINT(bVar15);
|
|
}
|
|
tmpEntity = local_134;
|
|
local_138 = GHIDRA_CAST<Game *>(((uint64_t)lVar2 >> 0x20));
|
|
local_158.y = (float)lVar2;
|
|
local_134->SetColor(&splatColor,0xffffffff,0xff,0,1);
|
|
if (&tmpEntity->_splatColor != &splatColor) {
|
|
(tmpEntity->_splatColor)._tint[0] = splatColor._tint[0];
|
|
(tmpEntity->_splatColor)._tint[1] = splatColor._tint[1];
|
|
(tmpEntity->_splatColor)._tint[2] = splatColor._tint[2];
|
|
(tmpEntity->_splatColor)._tint[3] = splatColor._tint[3];
|
|
(tmpEntity->_splatColor)._colorize[0] = splatColor._colorize[0];
|
|
(tmpEntity->_splatColor)._colorize[1] = splatColor._colorize[1];
|
|
(tmpEntity->_splatColor)._colorize[2] = splatColor._colorize[2];
|
|
(tmpEntity->_splatColor)._colorize[3] = splatColor._colorize[3];
|
|
*GHIDRA_CAST<uint64_t *>((tmpEntity->_splatColor)._offset) =
|
|
CONCAT44(splatColor._offset[1],splatColor._offset[0]);
|
|
(tmpEntity->_splatColor)._offset[2] = splatColor._offset[2];
|
|
}
|
|
tmpEntity->Update();
|
|
this = local_12c;
|
|
}
|
|
if (this->_variant == 0xd8) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(layer->_size).x = g_vectorZero.x;
|
|
(layer->_size).y = g_vectorZero.y;
|
|
this->_state = 0x1c2;
|
|
this->_entityCollisionClass = 0;
|
|
this->_shadowSize = 0.0;
|
|
if (-1 < this->_orbitLayer) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
this->_orbitLayer = -1;
|
|
}
|
|
local_150.y = (float)this->_player;
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>(0x2);
|
|
do {
|
|
uVar8 = Random();
|
|
uVar10 = Random();
|
|
fVar16 = (float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_13c = GHIDRA_CAST<uint32_t *>((fVar16 + fVar16));
|
|
fVar16 = cos((float)local_13c);
|
|
spawnPos.x = fVar16 * 10.0 + (this->_pos).x;
|
|
fVar16 = sin((float)local_13c);
|
|
spawnPos.y = fVar16 * 10.0 + (this->_pos).y;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(3,0xd9,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_150.y),0,
|
|
uVar8,0);
|
|
tmpEntity->Update();
|
|
ptrSlot = &tmpEntity->_parent;
|
|
if (tmpEntity->_parent != 0) {
|
|
local_13c = ptrSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_13c);
|
|
}
|
|
*ptrSlot = this;
|
|
msvc::multiset<unsigned_int>::insert(ptrSlot);
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_INT(local_124) + -1));
|
|
} while (local_124 != GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
nullKillSource._type = 0;
|
|
nullKillSource._variant = 0;
|
|
nullKillSource._spawnerType = 0;
|
|
nullKillSource._spawnerVariant = 0;
|
|
nullKillSource._position.x = g_vectorZero.x;
|
|
nullKillSource._position.y = g_vectorZero.y;
|
|
nullKillSource._velocity.x = g_vectorZero.x;
|
|
nullKillSource._velocity.y = g_vectorZero.y;
|
|
nullKillSource._flags = 0;
|
|
nullKillSource._entity = (void *)0x0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Kill(&nullKillSource);
|
|
this->_dead = 0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
uVar8 = Random();
|
|
fVar16 = local_198.y;
|
|
iVar12 = (uVar8 & 1) + 2;
|
|
if ((this->_flags & 0x100) == 0) {
|
|
do {
|
|
tmpEntity = this->_player;
|
|
spiderCount = &tmpEntity[4]._config;
|
|
*spiderCount = (void *)(GHIDRA_INT(*spiderCount) + 1);
|
|
spawn_blue_spider(&this->_pos,tmpEntity,&g_vectorZero);
|
|
iVar12 = iVar12 + -1;
|
|
} while (iVar12 != 0);
|
|
}
|
|
else {
|
|
do {
|
|
posPtr = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,&freePickupPos,GHIDRA_CAST<Vector *>(fVar16),40.0,0,0,0);
|
|
Entity_NPC::ThrowSpider(GHIDRA_CAST<Vector *>(fVar16),GHIDRA_CAST<Entity *>(0x0),*posPtr,0,-30.0);
|
|
iVar12 = iVar12 + -1;
|
|
} while (iVar12 != 0);
|
|
this = local_12c;
|
|
}
|
|
}
|
|
else if (iVar12 == 0xce) {
|
|
cVar6 = wisp_kill(this,__security_cookie ^ GHIDRA_UINT(((&splatColor)[1]._colorize + 1)));
|
|
if (cVar6 == '\0') {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
local_140 = this->_orbitLayer;
|
|
if (-1 < GHIDRA_INT(local_140)) {
|
|
if (this->_isSubtype55555 == 0) {
|
|
if ((this->_type == 3) &&
|
|
(((this->_variant == 0xce && (this->_subtype == 0x4d)) ||
|
|
((this->_variant == 0xce && (this->_subtype == 0x12a)))))) {
|
|
isUnicornWisp = '\x01';
|
|
}
|
|
else {
|
|
isUnicornWisp = '\0';
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&wispQuery,3,-1,-1,0,0);
|
|
iVar12 = wispQuery._size;
|
|
local_14 = 0.0;
|
|
buffer_init(wispMates,wispQuery._size + 1);
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x0))) = 0.0;
|
|
pEVar14 = wispMatesCount;
|
|
if (iVar12 != 0) {
|
|
local_118 = wispMatesCount;
|
|
iVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(wispQuery)) + 0x4)));
|
|
uVar8 = wispQuery._size;
|
|
do {
|
|
otherFamiliar = *GHIDRA_CAST<Entity_Familiar **>((iVar12 + GHIDRA_INT((float)local_120) * 4));
|
|
if (otherFamiliar->_exists != 0) {
|
|
if (otherFamiliar != this) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))) =
|
|
(Entity_Familiar *)
|
|
__RTDynamicCast(otherFamiliar,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0
|
|
);
|
|
if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))))->_orbitLayer == local_140) {
|
|
tmpEntity = get_orbit_parent(this);
|
|
orbitParent = get_orbit_parent((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))));
|
|
pEVar14 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4)));
|
|
if (orbitParent == tmpEntity) {
|
|
if (((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))))->_type == 3) && (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))))->_variant == 0xce))
|
|
&& ((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))))->_subtype == 0x4d ||
|
|
(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))))->_subtype == 0x12a)))) {
|
|
isUnicornWisp = '\x01';
|
|
}
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
if (wispMatesCapacity < local_124) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>((wispMatesData + GHIDRA_INT(local_118) * 4)) = pEVar14;
|
|
local_118 = local_124;
|
|
wispMatesCount = local_124;
|
|
pEVar14 = local_124;
|
|
}
|
|
else {
|
|
pEVar14 = local_118;
|
|
}
|
|
}
|
|
iVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(wispQuery)) + 0x4)));
|
|
uVar8 = wispQuery._size;
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x0))) = (float)(GHIDRA_INT((float)local_120) + 1);
|
|
} while (GHIDRA_UINT((float)local_120) < uVar8);
|
|
}
|
|
local_12c = GHIDRA_CAST<Entity_Familiar *>(0x3f800000);
|
|
if (isUnicornWisp != '\0') {
|
|
local_12c = GHIDRA_CAST<Entity_Familiar *>(0x40000000);
|
|
}
|
|
bVar7 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x117,0);
|
|
if (bVar7 != 0) {
|
|
local_12c = GHIDRA_CAST<Entity_Familiar *>(0x3eaaaaab);
|
|
}
|
|
uVar8 = local_140;
|
|
if (GHIDRA_INT(local_140) < 1) {
|
|
uVar8 = 0;
|
|
}
|
|
uVar10 = 10;
|
|
if (GHIDRA_INT(uVar8) < 10) {
|
|
uVar10 = uVar8;
|
|
}
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
local_120 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))),uVar10 * 0x14);
|
|
if (pEVar14 != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
local_134 = (Entity *)
|
|
(float)((double)GHIDRA_INT(pEVar14) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(pEVar14) >> 0x1f)]);
|
|
local_138 = GHIDRA_CAST<Game *>(0x40400000);
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>(0x40c90fdb);
|
|
do {
|
|
local_148 = (void *)__RTDynamicCast(*(uint32_t *)
|
|
(wispMatesData + GHIDRA_INT(local_118) * 4),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
|
|
,&IsaacRepentancePlus::Entity_Familiar::
|
|
RTTI_Type_Descriptor,0);
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_148) + 0xd60)) =
|
|
((float)GHIDRA_INT(local_118) * (float)local_124) / (float)local_134;
|
|
bVar7 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x70,0);
|
|
if (bVar7 == 0) {
|
|
fVar16 = *GHIDRA_CAST<float *>((&DAT_00c34138 + GHIDRA_INT((float)local_120)));
|
|
}
|
|
else {
|
|
fVar16 = *GHIDRA_CAST<float *>((&DAT_00c3413c + GHIDRA_INT((float)local_120))) *
|
|
*GHIDRA_CAST<float *>((&DAT_00c34138 + GHIDRA_INT((float)local_120)));
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_148) + 0xd6c)) = fVar16 * (float)local_12c;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_148) + 0x2c)) == 0x3c) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_148) + 0xd6c)) = fVar16 * (float)local_12c * (float)local_138;
|
|
}
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
} while (local_118 < pEVar14);
|
|
}
|
|
if (wispMates[0] == '\0') {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (wispMatesData != 0) {
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>((wispMatesData + -4));
|
|
oldAllocated = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar8;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar8));
|
|
free(GHIDRA_CAST<uint32_t *>((wispMatesData + -4)));
|
|
}
|
|
}
|
|
local_14 = -NAN;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(wispQuery)) + 0x0))) == '\0') {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(wispQuery)) + 0x4))) != 0) {
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(wispQuery)) + 0x4))) + -4));
|
|
oldAllocated = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar8;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar8));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(wispQuery)) + 0x4))) + -4)));
|
|
}
|
|
local_14 = -NAN;
|
|
}
|
|
}
|
|
this->_orbitLayer = -1;
|
|
}
|
|
}
|
|
else {
|
|
posPtr = &this->_pos;
|
|
if (iVar12 == 0xed) {
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,posPtr,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar8,0);
|
|
(tmpEntity->_posOffset).x = 0.0;
|
|
(tmpEntity->_posOffset).y = -6.0;
|
|
local_12c = GHIDRA_CAST<Entity_Familiar *>(0x3f800000);
|
|
(GHIDRA_CAST<Color *>((&poofColor)))->Color::Color(1.4,0.7,1.6,1.0);
|
|
(GHIDRA_CAST<Sprite *>((player)))->Sprite::SetColor(color_00);
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xc,posPtr,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar8,0);
|
|
(tmpEntity->_posOffset).x = 0.0;
|
|
(tmpEntity->_posOffset).y = -6.0;
|
|
(GHIDRA_CAST<Color *>((&tearPoofColor)))->Color::Color(1.4,0.7,1.6,1.0);
|
|
(GHIDRA_CAST<Sprite *>((this_01)))->Sprite::SetColor(color_01);
|
|
manager = g_manager;
|
|
local_128 = 0x105;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_128));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_128,1.0,2,0,1.0,0.0);
|
|
local_120 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))),this->_orbitLayer);
|
|
if (-1 < this->_orbitLayer) {
|
|
if (this->_isSubtype55555 == 0) {
|
|
if ((this->_type == 3) &&
|
|
(((this->_variant == 0xce && (this->_subtype == 0x4d)) ||
|
|
((this->_variant == 0xce && (this->_subtype == 0x12a)))))) {
|
|
isUnicornWisp = '\x01';
|
|
}
|
|
else {
|
|
isUnicornWisp = '\0';
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&itemWispQuery,3,-1,-1,0,0);
|
|
iVar12 = itemWispQuery._size;
|
|
local_14 = 5.60519e-45;
|
|
buffer_init(itemWispMates,itemWispQuery._size + 1);
|
|
uVar8 = 0;
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),5);
|
|
local_120 = local_120 & 0xffffffff;
|
|
pEVar14 = itemWispMatesCount;
|
|
if (iVar12 != 0) {
|
|
local_118 = itemWispMatesCount;
|
|
iVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemWispQuery)) + 0x4)));
|
|
uVar10 = itemWispQuery._size;
|
|
do {
|
|
otherFamiliar = *GHIDRA_CAST<Entity_Familiar **>((iVar12 + uVar8 * 4));
|
|
if (otherFamiliar->_exists != 0) {
|
|
if (otherFamiliar != this) {
|
|
local_124 = (Entity_Familiar *)
|
|
__RTDynamicCast(otherFamiliar,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::
|
|
RTTI_Type_Descriptor,0);
|
|
if ((float)local_124->_orbitLayer == (float)local_120) {
|
|
tmpEntity = get_orbit_parent(local_124);
|
|
orbitParent = get_orbit_parent(this);
|
|
pEVar14 = local_124;
|
|
if (tmpEntity == orbitParent) {
|
|
if (((local_124->_type == 3) && (local_124->_variant == 0xce)) &&
|
|
((local_124->_subtype == 0x4d || (local_124->_subtype == 0x12a)))) {
|
|
isUnicornWisp = '\x01';
|
|
}
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
if (itemWispMatesCapacity < local_124) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>((itemWispMatesData + GHIDRA_INT(local_118) * 4)) = pEVar14;
|
|
local_118 = local_124;
|
|
itemWispMatesCount = local_124;
|
|
pEVar14 = local_124;
|
|
}
|
|
else {
|
|
pEVar14 = local_118;
|
|
}
|
|
}
|
|
iVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemWispQuery)) + 0x4)));
|
|
uVar10 = itemWispQuery._size;
|
|
}
|
|
}
|
|
uVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_120))) + 0x4))) + 1;
|
|
local_120 = CONCAT44(uVar8,(float)local_120);
|
|
} while (uVar8 < uVar10);
|
|
}
|
|
if (isUnicornWisp != '\0') {
|
|
local_12c = GHIDRA_CAST<Entity_Familiar *>(0x40000000);
|
|
}
|
|
bVar7 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x117,0);
|
|
if (bVar7 != 0) {
|
|
local_12c = GHIDRA_CAST<Entity_Familiar *>(0x3eaaaaab);
|
|
}
|
|
iVar12 = GHIDRA_INT((float)local_120);
|
|
if (GHIDRA_INT((float)local_120) < 1) {
|
|
iVar12 = 0;
|
|
}
|
|
orbitLayerClamped = 10;
|
|
if (iVar12 < 10) {
|
|
orbitLayerClamped = iVar12;
|
|
}
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
local_120 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_120)) + 0x4))),orbitLayerClamped * 0x14);
|
|
if (pEVar14 != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
local_124 = (Entity_Familiar *)
|
|
(float)((double)GHIDRA_INT(pEVar14) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(pEVar14) >> 0x1f)]);
|
|
do {
|
|
local_134 = (Entity *)
|
|
__RTDynamicCast(*GHIDRA_CAST<uint32_t *>((itemWispMatesData + GHIDRA_INT(local_118) * 4)),
|
|
0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::
|
|
RTTI_Type_Descriptor,0);
|
|
local_134[3]._sprite._championColor._colorize[1] =
|
|
((float)GHIDRA_INT(local_118) * 6.2831855) / (float)local_124;
|
|
bVar7 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x70,0);
|
|
if (bVar7 == 0) {
|
|
fVar16 = *GHIDRA_CAST<float *>((&DAT_00c34138 + GHIDRA_INT((float)local_120)));
|
|
}
|
|
else {
|
|
fVar16 = *GHIDRA_CAST<float *>((&DAT_00c3413c + GHIDRA_INT((float)local_120))) *
|
|
*GHIDRA_CAST<float *>((&DAT_00c34138 + GHIDRA_INT((float)local_120)));
|
|
}
|
|
local_134[3]._sprite._championColor._offset[0] = fVar16 * (float)local_12c;
|
|
if (local_134->_variant == 0x3c) {
|
|
local_134[3]._sprite._championColor._offset[0] = fVar16 * (float)local_12c * 3.0;
|
|
}
|
|
local_118 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
} while (local_118 < pEVar14);
|
|
}
|
|
if (itemWispMates[0] == '\0') {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (itemWispMatesData != 0) {
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>((itemWispMatesData + -4));
|
|
oldAllocated = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar8;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar8));
|
|
free(GHIDRA_CAST<uint32_t *>((itemWispMatesData + -4)));
|
|
}
|
|
}
|
|
local_14 = -NAN;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(itemWispQuery)) + 0x0))) == '\0') {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemWispQuery)) + 0x4))) != 0) {
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemWispQuery)) + 0x4))) + -4));
|
|
oldAllocated = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar8;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar8));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemWispQuery)) + 0x4))) + -4)));
|
|
}
|
|
local_14 = -NAN;
|
|
}
|
|
}
|
|
this->_orbitLayer = -1;
|
|
}
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&this->_sirenHelper))))->EntityPtr::Set(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
else if (iVar12 == 0xe5) {
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBlueFlies(1,posPtr,GHIDRA_CAST<Entity *>(this->_target));
|
|
}
|
|
else if (iVar12 == 0xea) {
|
|
(GHIDRA_CAST<Color *>((&particleColor2)))->Color::Color();
|
|
uVar8 = Random();
|
|
Game::SpawnParticles
|
|
(g_game,&this->_pos,0x23,8,
|
|
(float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0,color_02,-12.0,0);
|
|
uVar8 = Random();
|
|
SoundEffects::PlayWithFartOverride
|
|
(0xb5,0.5,2,0,
|
|
(float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 1.0);
|
|
}
|
|
else if (iVar12 == 0xc9) {
|
|
if (this->_subtype != 0xc) {
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,posPtr,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar8,0);
|
|
piVar9 = GHIDRA_CAST<int *>(__RTDynamicCast(tmpEntity,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,
|
|
0));
|
|
piVar9[0xd3] = 0;
|
|
piVar9[0xd4] = -0x3ee00000;
|
|
(**(code **)(*piVar9 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1);
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::BloodExplode();
|
|
switch(this->_subtype) {
|
|
case 2:
|
|
case 0x14:
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBlueFlies(1,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
break;
|
|
case 3:
|
|
uVar8 = Random();
|
|
local_120 = CONCAT44((uVar8 & 1) + 2,(float)local_120);
|
|
do {
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
uVar10 = Random();
|
|
fVar16 = (float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>((fVar16 + fVar16));
|
|
local_198.x = cos((float)local_124);
|
|
local_198.x = local_198.x * 5.0;
|
|
fVar16 = sin((float)local_124);
|
|
local_198.y = fVar16 * 5.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,0x14,&this->_pos,&local_198,GHIDRA_CAST<Entity *>(this),0,uVar8,0);
|
|
iVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_120))) + 0x4))) + -1;
|
|
local_120 = CONCAT44(iVar12,(float)local_120);
|
|
} while (iVar12 != 0);
|
|
break;
|
|
case 4:
|
|
uVar8 = Random();
|
|
iVar12 = (uVar8 & 3) + 2;
|
|
local_120 = CONCAT44(iVar12,(float)local_120);
|
|
while (iVar12 != 0) {
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
uVar10 = Random();
|
|
fVar16 = (float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_124 = GHIDRA_CAST<Entity_Familiar *>((fVar16 + fVar16));
|
|
local_150.x = cos((float)local_124);
|
|
local_150.x = local_150.x * 5.0;
|
|
fVar16 = sin((float)local_124);
|
|
local_150.y = fVar16 * 5.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(5,10,&this->_pos,&local_150,GHIDRA_CAST<Entity *>(this),2,uVar8,0);
|
|
iVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_120))) + 0x4))) + -1;
|
|
local_120 = CONCAT44(iVar12,(float)local_120);
|
|
}
|
|
break;
|
|
case 0xd:
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x34,&this->_pos,&g_vectorZero,this->_player,0,uVar8);
|
|
tmpEntity->SetCollisionDamage(0x41000000);
|
|
iVar12 = *GHIDRA_CAST<int *>(tmpEntity);
|
|
pAVar5 = &tmpEntity[1]._sprite;
|
|
(pAVar5->_filename)._buf[4] = ',';
|
|
(pAVar5->_filename)._buf[5] = '\x01';
|
|
(pAVar5->_filename)._buf[6] = '\0';
|
|
(pAVar5->_filename)._buf[7] = '\0';
|
|
pAVar5 = &tmpEntity[1]._sprite;
|
|
(pAVar5->_filename)._buf[8] = ',';
|
|
(pAVar5->_filename)._buf[9] = '\x01';
|
|
(pAVar5->_filename)._buf[10] = '\0';
|
|
(pAVar5->_filename)._buf[0xb] = '\0';
|
|
(**(code **)(iVar12 + 0xc))();
|
|
break;
|
|
case 0xe:
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x8d,&this->_pos,&g_vectorZero,this->_player,0,uVar8);
|
|
iVar12 = *GHIDRA_CAST<int *>(tmpEntity);
|
|
pAVar5 = &tmpEntity[1]._sprite;
|
|
(pAVar5->_filename)._buf[4] = '\x0e';
|
|
(pAVar5->_filename)._buf[5] = '\x01';
|
|
(pAVar5->_filename)._buf[6] = '\0';
|
|
(pAVar5->_filename)._buf[7] = '\0';
|
|
pAVar5 = &tmpEntity[1]._sprite;
|
|
(pAVar5->_filename)._buf[8] = '\x0e';
|
|
(pAVar5->_filename)._buf[9] = '\x01';
|
|
(pAVar5->_filename)._buf[10] = '\0';
|
|
(pAVar5->_filename)._buf[0xb] = '\0';
|
|
(**(code **)(iVar12 + 0x40))(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x157c)) * 0.5);
|
|
tmpEntity->Update();
|
|
}
|
|
}
|
|
else {
|
|
uVar8 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,posPtr,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar8,0);
|
|
piVar9 = GHIDRA_CAST<int *>(__RTDynamicCast(tmpEntity,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0))
|
|
;
|
|
piVar9[0xd3] = 0;
|
|
piVar9[0xd4] = -0x3ee00000;
|
|
(**(code **)(*piVar9 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1);
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::BloodExplode();
|
|
if ((((this->_variant == 0xee) && (this->_player->_playerType == 0x1a)) &&
|
|
(bVar7 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x26b,0), bVar7 != 0)) &&
|
|
(this->_subtype == 0)) {
|
|
uVar8 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
posPtr = MusicManager::RandomVector(&local_190);
|
|
uVar10 = Random();
|
|
this = local_12c;
|
|
local_158.x = (float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]
|
|
) * 2.3283064e-10 * 3.0 + 2.0;
|
|
local_158.y = local_158.x * posPtr->y;
|
|
local_158.x = local_158.x * posPtr->x;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,&local_12c->_pos,&local_158,GHIDRA_CAST<Entity *>(local_12c),2,
|
|
uVar8);
|
|
iVar12 = *GHIDRA_CAST<int *>(tmpEntity);
|
|
tmpEntity[1]._sprite._championColor._colorize[1] = 8.40779e-44;
|
|
(**(code **)(iVar12 + 0xc))();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
killSourcePtr = (GHIDRA_CAST<EntityRef *>((&killSource)))->EntityRef::EntityRef();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Kill(killSourcePtr);
|
|
this->Remove();
|
|
iVar12 = this->_variant;
|
|
if (iVar12 == 0xed) {
|
|
if (this->_player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RecomputeWispCollectibles(GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
iVar12 = this->_variant;
|
|
}
|
|
if (((iVar12 == 0xee) && (player = this->_player, player != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(player->_playerType == 0x1a)) {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::UpdateHeartDependentEffects();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 006121d0
|
|
void Entity_Familiar::ClearReferences()
|
|
{
|
|
int variant;
|
|
void *pvVar1;
|
|
uint32_t size;
|
|
int local_14 [3];
|
|
uint32_t *linkedEntityRef;
|
|
int gridIndex;
|
|
std_vector *hitList;
|
|
void *hitListBegin;
|
|
uint32_t *playerFlags;
|
|
|
|
variant = this->_variant;
|
|
if (variant == 900) {
|
|
gridIndex = (this->_pathfinder)._gridIndex;
|
|
if (-1 < gridIndex) {
|
|
variant = 900;
|
|
if ((gridIndex < 0x1c0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + gridIndex * 4 + 0x76c)) < 0x3b7)) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_game->_room) + gridIndex * 4 + 0x76c)) = 900;
|
|
variant = this->_variant;
|
|
goto LAB_0061221c;
|
|
}
|
|
}
|
|
LAB_00612223:
|
|
if (variant != 0xed) goto LAB_00612253;
|
|
}
|
|
else {
|
|
LAB_0061221c:
|
|
if (variant != 0xce) goto LAB_00612223;
|
|
}
|
|
if (this->_subtype == 0x22d) {
|
|
playerFlags = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_player) + 0x1574));
|
|
*playerFlags = *playerFlags | 0x400;
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_player) + 0x1518)) = 1;
|
|
variant = this->_variant;
|
|
}
|
|
LAB_00612253:
|
|
if ((variant == 0xf0) && (GHIDRA_CAST<int *>(this->_linkedEntity) != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_linkedEntity) + 0x28))();
|
|
}
|
|
if (this->_linkedEntity != 0) {
|
|
linkedEntityRef = &this->_linkedEntity;
|
|
msvc::multiset<unsigned_int>::erase(&linkedEntityRef);
|
|
}
|
|
this->_linkedEntity = 0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearReferences();
|
|
hitList = &this->_hitList;
|
|
if (GHIDRA_CAST<std_vector *>(local_14) != hitList) {
|
|
hitListBegin = hitList->_begin;
|
|
pvVar1 = (this->_hitList)._capacity;
|
|
hitList->_begin = (void *)0x0;
|
|
(this->_hitList)._end = (void *)0x0;
|
|
(this->_hitList)._capacity = (void *)0x0;
|
|
if (hitListBegin != (void *)0x0) {
|
|
size = GHIDRA_INT(pvVar1) - GHIDRA_INT(hitListBegin) & 0xfffffffc;
|
|
pvVar1 = hitListBegin;
|
|
if (0xfff < size) {
|
|
pvVar1 = *(void **)(GHIDRA_CAST<char *>(hitListBegin) + -4);
|
|
size = size + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(hitListBegin) + (-4 - GHIDRA_INT(pvVar1))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar1,size);
|
|
}
|
|
}
|
|
set_extra_data(&this->_extraData,(void *)0x0);
|
|
if (this->_weapon != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_weapon) + 0x14))();
|
|
if (this->_weapon != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_weapon))(1);
|
|
}
|
|
this->_weapon = (void *)0x0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00612330
|
|
Entity * Entity_Familiar::get_orbit_parent()
|
|
{
|
|
uint8_t isHasItem;
|
|
Entity *orbitParent;
|
|
uint8_t queryResult [12];
|
|
int iStack_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6910;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (((this->_variant != 0x2b) && (this->_variant != 0xce)) ||
|
|
(orbitParent = GHIDRA_CAST<Entity *>(this->_parent), orbitParent == GHIDRA_CAST<Entity *>(0x0))) {
|
|
isHasItem = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x248,0);
|
|
if (isHasItem != 0) {
|
|
isHasItem = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x2d8,0);
|
|
if (isHasItem != 0) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(queryResult),3,0xf0,
|
|
-1,1,0);
|
|
if (iStack_14 != 0) {
|
|
orbitParent = *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity **>(queryResult))) + 0x4)));
|
|
if (queryResult[0] == '\0') {
|
|
local_8 = 0;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)queryResult)) + 0x4))),0);
|
|
}
|
|
ExceptionList = local_10;
|
|
return orbitParent;
|
|
}
|
|
if (queryResult[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)queryResult)) + 0x4))),0);
|
|
}
|
|
}
|
|
}
|
|
orbitParent = this->_player;
|
|
}
|
|
ExceptionList = local_10;
|
|
return orbitParent;
|
|
}
|
|
|
|
// 00612440
|
|
int Entity_Familiar::RecalculateOrbitOffset(int layer, uint8_t isAdd)
|
|
{
|
|
double dVar1;
|
|
uint8_t isHasCollectible;
|
|
uint32_t uVar2;
|
|
Entity_Familiar *familiar;
|
|
Entity *otherParent;
|
|
Entity *ownParent;
|
|
int iVar3;
|
|
uint64_t *heapBytes;
|
|
uint32_t prevCount;
|
|
uint32_t orbiterCount;
|
|
uint32_t uVar4;
|
|
float orbitDistance;
|
|
EntityList_EL familiarQuery;
|
|
char orbiterBuffer [4];
|
|
int local_30;
|
|
uint32_t orbiterCapacity;
|
|
uint32_t orbiterSize;
|
|
uint32_t local_24;
|
|
int familiarData;
|
|
Entity_Familiar *local_1c;
|
|
int orbiters;
|
|
char isUnicornWisp;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint64_t prevBytes;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6945;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((orbiterBuffer + 0x30));
|
|
if ((this->_isSubtype55555 != 0) || (layer < 0)) {
|
|
return 0;
|
|
}
|
|
if (((this->_type == 3) && (this->_variant == 0xce)) &&
|
|
((this->_subtype == 0x4d || (this->_subtype == 0x12a)))) {
|
|
isUnicornWisp = '\x01';
|
|
}
|
|
else {
|
|
isUnicornWisp = '\0';
|
|
}
|
|
ExceptionList = &local_10;
|
|
local_1c = this;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiarQuery,3,-1,-1,0,0);
|
|
iVar3 = familiarQuery._size;
|
|
local_8 = 0;
|
|
buffer_init(orbiterBuffer,familiarQuery._size + 1);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
local_24 = 0;
|
|
familiarData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiarQuery)) + 0x4)));
|
|
orbiters = local_30;
|
|
orbiterCount = orbiterSize;
|
|
if (iVar3 != 0) {
|
|
uVar4 = familiarQuery._size;
|
|
prevCount = orbiterSize;
|
|
do {
|
|
familiar = *GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiarQuery)) + 0x4))) + local_24 * 4));
|
|
orbiterCount = prevCount;
|
|
if (familiar->_exists != 0) {
|
|
if (familiar != this) {
|
|
familiar = (Entity_Familiar *)
|
|
__RTDynamicCast(familiar,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0,
|
|
uVar2);
|
|
if (familiar->_orbitLayer == layer) {
|
|
otherParent = get_orbit_parent(familiar);
|
|
ownParent = get_orbit_parent(local_1c);
|
|
if (otherParent == ownParent) {
|
|
if (((familiar->_type == 3) && (familiar->_variant == 0xce)) &&
|
|
((familiar->_subtype == 0x4d || (familiar->_subtype == 0x12a)))) {
|
|
isUnicornWisp = '\x01';
|
|
}
|
|
orbiterCount = prevCount + 1;
|
|
if (orbiterCapacity < orbiterCount) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>((orbiters + prevCount * 4)) = familiar;
|
|
orbiterSize = orbiterCount;
|
|
}
|
|
}
|
|
uVar4 = familiarQuery._size;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiarQuery)) + 0x4))) = familiarData;
|
|
this = local_1c;
|
|
}
|
|
}
|
|
local_24 = local_24 + 1;
|
|
prevCount = orbiterCount;
|
|
} while (local_24 < uVar4);
|
|
}
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(0x3f800000);
|
|
if (isUnicornWisp != '\0') {
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(0x40000000);
|
|
}
|
|
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x117,0);
|
|
if (isHasCollectible != 0) {
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(0x3eaaaaab);
|
|
}
|
|
if (isAdd != 0) {
|
|
uVar2 = orbiterCount + 1;
|
|
if (orbiterCapacity < uVar2) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>((orbiters + orbiterCount * 4)) = this;
|
|
orbiterCount = uVar2;
|
|
orbiterSize = uVar2;
|
|
}
|
|
if (layer < 1) {
|
|
layer = 0;
|
|
}
|
|
uVar2 = 10;
|
|
if (GHIDRA_UINT(layer) < 10) {
|
|
uVar2 = layer;
|
|
}
|
|
uVar4 = 0;
|
|
iVar3 = uVar2 * 0x14;
|
|
if (orbiterCount != 0) {
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(orbiterCount) >> 0x1f)];
|
|
do {
|
|
local_24 = __RTDynamicCast(*GHIDRA_CAST<uint32_t *>((orbiters + uVar4 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
*GHIDRA_CAST<float *>((local_24 + 0xd60)) =
|
|
((float)GHIDRA_INT(uVar4) * 6.2831855) / (float)((double)GHIDRA_INT(orbiterCount) + dVar1);
|
|
isHasCollectible = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x70,0);
|
|
if (isHasCollectible == 0) {
|
|
orbitDistance = *GHIDRA_CAST<float *>((&DAT_00c34138 + iVar3));
|
|
}
|
|
else {
|
|
orbitDistance = *GHIDRA_CAST<float *>((&DAT_00c3413c + iVar3)) * *GHIDRA_CAST<float *>((&DAT_00c34138 + iVar3));
|
|
}
|
|
*GHIDRA_CAST<float *>((local_24 + 0xd6c)) = orbitDistance * (float)local_1c;
|
|
if (*GHIDRA_CAST<int *>((local_24 + 0x2c)) == 0x3c) {
|
|
*GHIDRA_CAST<float *>((local_24 + 0xd6c)) = orbitDistance * (float)local_1c * 3.0;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < orbiterCount);
|
|
}
|
|
if (orbiterBuffer[0] == '\0') {
|
|
heapBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (orbiters != 0) {
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((orbiters + -4));
|
|
prevBytes = *heapBytes;
|
|
*GHIDRA_CAST<uint32_t *>(heapBytes) = GHIDRA_UINT(*heapBytes) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevBytes) < uVar2));
|
|
free((void *)(orbiters + -4));
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(familiarQuery)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (familiarData != 0) {
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((familiarData + -4));
|
|
prevBytes = *heapBytes;
|
|
*GHIDRA_CAST<uint32_t *>(heapBytes) = GHIDRA_UINT(*heapBytes) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevBytes) < uVar2));
|
|
free((void *)(familiarData + -4));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return orbiterCount;
|
|
}
|
|
|
|
// 006127b0
|
|
void Entity_Familiar::AddToOrbit(int orbitLayer)
|
|
{
|
|
int clampedLayer;
|
|
int nonNegativeLayer;
|
|
float orbitDistanceY;
|
|
|
|
if (-1 < this->_orbitLayer) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
}
|
|
this->_orbitLayer = orbitLayer;
|
|
nonNegativeLayer = orbitLayer;
|
|
if (orbitLayer < 1) {
|
|
nonNegativeLayer = 0;
|
|
}
|
|
clampedLayer = 10;
|
|
if (nonNegativeLayer < 10) {
|
|
clampedLayer = nonNegativeLayer;
|
|
}
|
|
orbitDistanceY = (float)(&DAT_00c34134)[clampedLayer * 5];
|
|
(this->_orbitDistance).x = (float)(&DAT_00c34130)[clampedLayer * 5];
|
|
(this->_orbitDistance).y = orbitDistanceY;
|
|
RecalculateOrbitOffset(this,orbitLayer,1);
|
|
return;
|
|
}
|
|
|
|
// 00612820
|
|
void Entity_Familiar::RemoveFromOrbit()
|
|
{
|
|
if (-1 < this->_orbitLayer) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
this->_orbitLayer = -1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00612850
|
|
Vector * Entity_Familiar::GetOrbitDistance(Vector *outDistance, int layer)
|
|
{
|
|
int orbitLayer;
|
|
float orbitDistanceY;
|
|
|
|
if (layer < 1) {
|
|
layer = 0;
|
|
}
|
|
orbitLayer = 10;
|
|
if (layer < 10) {
|
|
orbitLayer = layer;
|
|
}
|
|
orbitDistanceY = (float)(&DAT_00c34134)[orbitLayer * 5];
|
|
outDistance->x = (float)(&DAT_00c34130)[orbitLayer * 5];
|
|
outDistance->y = orbitDistanceY;
|
|
return outDistance;
|
|
}
|
|
|
|
// 00612890
|
|
uint8_t Entity_Familiar::is_detached_from_follow()
|
|
{
|
|
int iVar1;
|
|
bool isDetached;
|
|
|
|
if (this->_isFollower == 0) {
|
|
return 0;
|
|
}
|
|
iVar1 = this->_variant;
|
|
if (iVar1 == 3) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else if (iVar1 == 0x3b) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else if (iVar1 == 0x19) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else if (iVar1 == 0x5d) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else {
|
|
if (iVar1 == 100) {
|
|
if (this->_subtype == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf38))))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x68) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else {
|
|
if ((iVar1 == 0x7c) || (iVar1 == 0x81)) {
|
|
if (this->_visible == 0) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0x82) {
|
|
if (this->_fireCooldown < 0) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
if (iVar1 == 0xe8) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else if (iVar1 == 0xdf) {
|
|
isDetached = this->_fireCooldown == 0;
|
|
}
|
|
else {
|
|
if (iVar1 != 0xf2) {
|
|
return 1;
|
|
}
|
|
if (this->_visible == 0) {
|
|
return 0;
|
|
}
|
|
isDetached = this->_coins == 0;
|
|
}
|
|
}
|
|
}
|
|
if (isDetached) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00612970
|
|
int Entity_Familiar::GetFollowerPriority()
|
|
{
|
|
switch(this->_variant) {
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 9:
|
|
case 10:
|
|
case 0xb:
|
|
case 0xc:
|
|
case 0x19:
|
|
case 0x3b:
|
|
case 0x4c:
|
|
case 0x51:
|
|
case 0x5c:
|
|
case 0x5d:
|
|
case 0x61:
|
|
case 0x68:
|
|
case 0x77:
|
|
case 0x7d:
|
|
case 0xd1:
|
|
case 0xdc:
|
|
case 0xdf:
|
|
return 1;
|
|
default:
|
|
return 0;
|
|
case 0x33:
|
|
case 0x4a:
|
|
case 0x59:
|
|
case 0xe6:
|
|
return 2;
|
|
case 0x3d:
|
|
case 0x6c:
|
|
return 3;
|
|
case 0x50:
|
|
case 0xeb:
|
|
return 10;
|
|
case 100:
|
|
return 9;
|
|
case 0x6d:
|
|
return 9999;
|
|
case 0xe8:
|
|
return 5;
|
|
}
|
|
}
|
|
|
|
// 00612af0
|
|
uint8_t Entity_Familiar::IsLilithBirthrightIncubus()
|
|
{
|
|
Entity_Player *this_00;
|
|
uint8_t isHasBirthright;
|
|
void *weapon;
|
|
|
|
this_00 = this->_player;
|
|
weapon = this_00->_weapons[0];
|
|
if (weapon == (void *)0x0) {
|
|
weapon = this_00->_weapons[1];
|
|
}
|
|
if (this_00->_playerType == 0x20) {
|
|
isHasBirthright = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::HasCollectible(0x26b,0);
|
|
if ((((isHasBirthright != 0) && (weapon != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(weapon) + 0x30)) == 0xf)) &&
|
|
((this->_isFollower != 0 && (this->_isNotCountedAsFollower == 0)))) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00612b50
|
|
Entity * Entity_Familiar::get_incubus_umbilical_whip()
|
|
{
|
|
uint8_t isBirthrightIncubus;
|
|
int weapon;
|
|
int *umbilicalWhip;
|
|
Entity *whipEntity;
|
|
|
|
isBirthrightIncubus = IsLilithBirthrightIncubus(this);
|
|
if (isBirthrightIncubus != 0) {
|
|
weapon = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13dc));
|
|
if (weapon == 0) {
|
|
weapon = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13e0));
|
|
}
|
|
umbilicalWhip =
|
|
GHIDRA_CAST<int *>(__RTDynamicCast(weapon,0,&IsaacRepentancePlus::Weapon::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Weapon_UmbilicalWhip::RTTI_Type_Descriptor,0));
|
|
if (((umbilicalWhip != GHIDRA_CAST<int *>(0x0)) &&
|
|
(whipEntity = GHIDRA_CAST<Entity *>((**(code **)(*umbilicalWhip + 0x28))()), whipEntity != GHIDRA_CAST<Entity *>(0x0))
|
|
) && (whipEntity->_type == 3)) {
|
|
return whipEntity;
|
|
}
|
|
}
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
|
|
// 00612bb0
|
|
void Entity_Familiar::FollowParent()
|
|
{
|
|
uint8_t *puVar1;
|
|
code *pcVar2;
|
|
uint8_t bVar3;
|
|
char cVar4;
|
|
uint32_t uVar5;
|
|
Entity *umbilicalWhip;
|
|
Entity_Player *player;
|
|
int iVar6;
|
|
Vector *facingDir;
|
|
Entity_Familiar *parentFamiliar;
|
|
Entity_Familiar *extraout_ECX;
|
|
Entity_Familiar *parentFamiliar;
|
|
Entity_Familiar *extraout_ECX_00;
|
|
Entity_Familiar *this_01;
|
|
Entity_Familiar *extraout_ECX_01;
|
|
Entity_Familiar *this_02;
|
|
Entity_Familiar *extraout_ECX_02;
|
|
Entity_Familiar *this_03;
|
|
Entity_Familiar *extraout_ECX_03;
|
|
Entity_Familiar *this_04;
|
|
int extraout_ECX_04;
|
|
char extraout_DL;
|
|
char extraout_DL_00;
|
|
int iVar7;
|
|
int extraout_EDX;
|
|
float extraout_EDX_00;
|
|
float extraout_EDX_01;
|
|
float extraout_EDX_02;
|
|
float extraout_EDX_03;
|
|
uint32_t *childSlot;
|
|
Entity_NPC *player;
|
|
float fVar9;
|
|
float fVar10;
|
|
float fVar11;
|
|
Entity_NPC *local_48;
|
|
uint8_t query [8];
|
|
Vector VStack_3c;
|
|
Entity_Familiar *local_34;
|
|
float local_30;
|
|
float local_2c;
|
|
float local_28;
|
|
char isOverrideParent;
|
|
char isLilithBirthright;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Entity_NPC *chainNext;
|
|
void *playerRaw;
|
|
|
|
puStack_20 = query + 0x40;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af697d;
|
|
local_1c = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_UINT((query + 0x34));
|
|
if (this->_isSubtype55555 != 0) {
|
|
(this->_pos).x = (this->_formationOffset).x;
|
|
(this->_pos).y = (this->_formationOffset).y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
return;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
bVar3 = IsLilithBirthrightIncubus(this);
|
|
if (bVar3 != 0) {
|
|
umbilicalWhip = get_incubus_umbilical_whip(this);
|
|
player = this->_player;
|
|
local_34 = GHIDRA_CAST<Entity_Familiar *>((player->_pos).x);
|
|
VStack_3c.y = (player->_pos).y;
|
|
if (umbilicalWhip != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_30 = (float)this->_initSeed;
|
|
iVar7 = 0;
|
|
VStack_3c.y = 9.80909e-45;
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(this->_child);
|
|
if (parentFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
do {
|
|
if (parentFamiliar->_type == 3) {
|
|
bVar3 = is_detached_from_follow(parentFamiliar);
|
|
parentFamiliar = extraout_ECX;
|
|
iVar7 = extraout_EDX;
|
|
if (bVar3 != 0) {
|
|
iVar7 = extraout_EDX + 1;
|
|
}
|
|
}
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(parentFamiliar->_child);
|
|
} while (parentFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
player = this->_player;
|
|
}
|
|
local_2c = (float)iVar7 + 5.0;
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar3 != 0) {
|
|
local_2c = local_2c * 1.5;
|
|
}
|
|
if (local_30 == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar5 = GHIDRA_UINT(local_30) >> 5 ^ GHIDRA_UINT(local_30);
|
|
uVar5 = uVar5 << 9 ^ uVar5;
|
|
VStack_3c.y = (float)(uVar5 >> (SUB41(VStack_3c.y,0) & 0x1f) ^ uVar5);
|
|
local_34 = GHIDRA_CAST<Entity_Familiar *>(0xe);
|
|
if (VStack_3c.y == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar5 = GHIDRA_UINT(VStack_3c.y) >> 3 ^ GHIDRA_UINT(VStack_3c.y);
|
|
uVar5 = uVar5 << 1 ^ uVar5;
|
|
uVar5 = uVar5 >> 0xe ^ uVar5;
|
|
local_34 = GHIDRA_CAST<Entity_Familiar *>((umbilicalWhip->_size * 0.3));
|
|
VStack_3c.y = (float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283062e-10 * 3.14;
|
|
local_30 = (float)local_34 + local_2c;
|
|
VStack_3c.y = VStack_3c.y + VStack_3c.y;
|
|
local_2c = cos(VStack_3c.y);
|
|
local_2c = local_2c * local_30;
|
|
fVar9 = sin(VStack_3c.y);
|
|
local_30 = fVar9 * local_30;
|
|
iVar7 = this->_variant;
|
|
if (((iVar7 == 0xd5) || (iVar7 == 0xd6)) || (iVar7 == 0xdf)) {
|
|
local_2c = (float)local_34;
|
|
local_30 = 0.0;
|
|
}
|
|
local_28 = (umbilicalWhip->_pos).x;
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>((umbilicalWhip->_pos).y);
|
|
iVar7 = __RTDynamicCast(umbilicalWhip[3]._entityRef3._flags,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor
|
|
,&IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor,0);
|
|
if (iVar7 == 0) {
|
|
VStack_3c.y = 0.0;
|
|
}
|
|
else {
|
|
VStack_3c.y = *GHIDRA_CAST<float *>((iVar7 + 0x154));
|
|
}
|
|
VStack_3c.y = VStack_3c.y * 0.017453292;
|
|
local_34 = GHIDRA_CAST<Entity_Familiar *>(cos(VStack_3c.y));
|
|
fVar9 = sin(VStack_3c.y);
|
|
fVar10 = (float)local_34 * local_30;
|
|
local_34 = GHIDRA_CAST<Entity_Familiar *>((((float)local_34 * local_2c - fVar9 * local_30) + local_28));
|
|
VStack_3c.y = fVar9 * local_2c + fVar10 + (float)local_48;
|
|
if ((umbilicalWhip->_type == 3) && (this->_parent == 0)) {
|
|
childSlot = &umbilicalWhip->_child;
|
|
if (umbilicalWhip->_child != 0) {
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>(childSlot);
|
|
msvc::multiset<unsigned_int>::erase(&local_48);
|
|
}
|
|
*childSlot = this;
|
|
msvc::multiset<unsigned_int>::insert(childSlot);
|
|
}
|
|
}
|
|
fVar9 = (this->_pos).y;
|
|
(this->_velocity).x = (float)local_34 - (this->_pos).x;
|
|
(this->_velocity).y = VStack_3c.y - fVar9;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
player = this->_player;
|
|
if (((player != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(local_48 = GHIDRA_CAST<Entity_NPC *>(player->_spawnerEntity), local_48 != GHIDRA_CAST<Entity_NPC *>(0x0))) &&
|
|
((local_48->_type == 0x388 &&
|
|
((local_48->_variant == 0 &&
|
|
(bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(player))))->Entity::HasEntityFlags(0x400000), bVar3 != 0)))))) {
|
|
NpcHelper::siren_familiar_orbit(local_48,this);
|
|
goto LAB_006138df;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0xb3,0);
|
|
if (bVar3 != 0) {
|
|
predict_player_movement(this);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x6d,0);
|
|
if (bVar3 != 0) {
|
|
move_to_parent_offset(this);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (((this->_formationOffset).x != g_vectorZero.x) ||
|
|
((this->_formationOffset).y != g_vectorZero.y)) {
|
|
reset_follow_target(this,uVar5);
|
|
}
|
|
player = GHIDRA_CAST<Entity_NPC *>(this->_parent);
|
|
isOverrideParent = '\0';
|
|
if ((g_game->_challenge == 0x1e) && (this->_variant == 0x3e)) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(query),3,0x43,-1,0,0);
|
|
if (VStack_3c.y != 0.0) {
|
|
isOverrideParent = '\x01';
|
|
player = *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_NPC **>(query))) + 0x4)));
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((query)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
local_48 = player;
|
|
if ((this->_player->_playerType == 0xd) &&
|
|
(bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x26b,0), bVar3 != 0)) {
|
|
isLilithBirthright = '\x01';
|
|
cVar4 = FUN_00612ad0();
|
|
if (cVar4 != '\0') {
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(this->_parent);
|
|
fVar9 = 0.0;
|
|
local_34 = this->_player;
|
|
iVar7 = 0;
|
|
local_30 = 0.0;
|
|
for (; parentFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(parentFamiliar->_parent)) {
|
|
if (parentFamiliar->_type == 3) {
|
|
if (parentFamiliar->_variant == 0x6d) {
|
|
local_34 = parentFamiliar;
|
|
break;
|
|
}
|
|
bVar3 = is_detached_from_follow(parentFamiliar);
|
|
parentFamiliar = parentFamiliar;
|
|
fVar9 = extraout_EDX_00;
|
|
if (bVar3 != 0) {
|
|
iVar6 = GetFollowerPriority(parentFamiliar);
|
|
parentFamiliar = extraout_ECX_00;
|
|
fVar9 = extraout_EDX_01;
|
|
if ((0 < iVar6) &&
|
|
(extraout_ECX_00->_isNotCountedAsFollower == SUB41(extraout_EDX_01,0))) {
|
|
iVar7 = iVar7 + 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(this->_child);
|
|
if (parentFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
do {
|
|
if (parentFamiliar->_type == 3) {
|
|
bVar3 = is_detached_from_follow(parentFamiliar);
|
|
parentFamiliar = this_01;
|
|
fVar9 = extraout_EDX_02;
|
|
if (bVar3 != 0) {
|
|
iVar6 = GetFollowerPriority(this_01);
|
|
parentFamiliar = extraout_ECX_01;
|
|
fVar9 = extraout_EDX_03;
|
|
if ((0 < iVar6) && (extraout_ECX_01->_isNotCountedAsFollower == 0)) {
|
|
fVar9 = (float)(GHIDRA_INT(extraout_EDX_03) + 1);
|
|
}
|
|
}
|
|
}
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(parentFamiliar->_child);
|
|
} while (parentFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
local_30 = fVar9;
|
|
}
|
|
playerRaw = this->_player;
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>((iVar7 + GHIDRA_INT(fVar9)));
|
|
puVar1 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_48)) + 0x1)));
|
|
local_28 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(playerRaw) + 0x1630));
|
|
local_2c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(playerRaw) + 0x1634));
|
|
if ((local_28 == g_vectorZero.x) && (local_2c == g_vectorZero.y)) {
|
|
facingDir = Isaac::GetAxisAlignedUnitVectorFromDir
|
|
(&VStack_3c,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerRaw) + 0x1628)));
|
|
local_28 = facingDir->x;
|
|
local_2c = facingDir->y;
|
|
fVar9 = local_30;
|
|
}
|
|
if (1 < GHIDRA_INT(puVar1)) {
|
|
fVar11 = (float)GHIDRA_INT(puVar1) * 5.0 + 15.0;
|
|
fVar10 = 179.0;
|
|
if (fVar11 <= 179.0) {
|
|
fVar10 = fVar11;
|
|
}
|
|
if ((GHIDRA_UINT(local_30) & 1) != 0) {
|
|
fVar10 = -fVar10;
|
|
}
|
|
local_30 = ((fVar10 * (float)GHIDRA_INT((puVar1 + (-1 - (GHIDRA_INT(fVar9) - (GHIDRA_INT(fVar9) >> 0x1f) &
|
|
0xfffffffeU))))) / (float)GHIDRA_INT(local_48)) *
|
|
0.017453292;
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>(cos(local_30));
|
|
fVar9 = sin(local_30);
|
|
fVar10 = fVar9 * local_28;
|
|
local_28 = (float)local_48 * local_28 - fVar9 * local_2c;
|
|
local_2c = (float)local_48 * local_2c + fVar10;
|
|
}
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>((local_34->_pos).x);
|
|
VStack_3c.y = (local_34->_pos).y;
|
|
fVar9 = sqrtf(local_28 * local_28 + local_2c * local_2c);
|
|
if (0.0 < fVar9) {
|
|
fVar9 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x370)) + 20.0) / fVar9;
|
|
local_2c = fVar9 * local_2c;
|
|
local_28 = fVar9 * local_28;
|
|
}
|
|
fVar9 = (this->_pos).y;
|
|
(this->_velocity).x = (((float)local_48 + local_28) - (this->_pos).x) * 0.4;
|
|
(this->_velocity).y = ((VStack_3c.y + local_2c) - fVar9) * 0.4;
|
|
goto LAB_006138df;
|
|
}
|
|
}
|
|
else {
|
|
isLilithBirthright = '\0';
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x94,0);
|
|
if ((bVar3 != 0) && (this->_variant != 0x6d)) {
|
|
local_34 = this->_player;
|
|
iVar7 = 0;
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(this->_parent);
|
|
local_30 = 0.0;
|
|
for (; parentFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(parentFamiliar->_parent)) {
|
|
if (parentFamiliar->_type == 3) {
|
|
if (parentFamiliar->_variant == 0x6d) {
|
|
local_34 = parentFamiliar;
|
|
break;
|
|
}
|
|
bVar3 = is_detached_from_follow(parentFamiliar);
|
|
parentFamiliar = this_02;
|
|
if (bVar3 != 0) {
|
|
if (extraout_DL != '\0') {
|
|
iVar6 = GetFollowerPriority(this_02);
|
|
parentFamiliar = extraout_ECX_02;
|
|
if ((0 < iVar6) && (extraout_ECX_02->_isNotCountedAsFollower == 0)) goto LAB_00613385;
|
|
}
|
|
local_30 = (float)(GHIDRA_INT(local_30) + 1);
|
|
}
|
|
}
|
|
LAB_00613385:
|
|
}
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(this->_child);
|
|
do {
|
|
if (parentFamiliar == GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>((GHIDRA_INT(local_30) + 1 + iVar7));
|
|
this->_orbitSpeed = 3.5;
|
|
iVar6 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetTrinketMultiplier(0x94);
|
|
fVar9 = this->_orbitSpeed;
|
|
if (2 < iVar6) {
|
|
fVar9 = fVar9 * 1.5;
|
|
this->_orbitSpeed = fVar9;
|
|
}
|
|
iVar6 = g_game->_frameCount;
|
|
(this->_orbitDistance).x = 65.0;
|
|
(this->_orbitDistance).y = 60.0;
|
|
local_30 = (((float)iVar7 * 360.0) / (float)GHIDRA_INT(local_48) + (float)iVar6 * fVar9) -
|
|
this->_orbitAngleOffset;
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x59,0);
|
|
if (bVar3 != 0) {
|
|
(this->_orbitDistance).x = (this->_orbitDistance).x * 0.5;
|
|
(this->_orbitDistance).y = (this->_orbitDistance).y * 0.5;
|
|
}
|
|
local_30 = local_30 * 0.017453292;
|
|
fVar9 = cos(local_30);
|
|
parentFamiliar = local_34;
|
|
local_34 = (Entity_Familiar *)
|
|
((fVar9 * (this->_orbitDistance).x + (local_34->_pos).x) - (this->_pos).x);
|
|
fVar9 = sin(local_30);
|
|
local_48 = (Entity_NPC *)
|
|
((fVar9 * (this->_orbitDistance).y + (parentFamiliar->_pos).y) - (this->_pos).y);
|
|
fVar9 = sqrtf((float)local_48 * (float)local_48 + (float)local_34 * (float)local_34);
|
|
if (fVar9 <= 20.0) {
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
}
|
|
else {
|
|
fVar9 = ((fVar9 - 20.0) * 0.1) / fVar9;
|
|
fVar10 = fVar9 * (float)local_48;
|
|
fVar9 = fVar9 * (float)local_34;
|
|
if ((this->_flags & 0x20000000000) != 0) {
|
|
fVar9 = fVar9 * 5.0;
|
|
fVar10 = fVar10 * 5.0;
|
|
}
|
|
(this->_velocity).x = fVar9;
|
|
(this->_velocity).y = fVar10;
|
|
}
|
|
if (parentFamiliar->_type == 1) {
|
|
fVar9 = 1.5;
|
|
}
|
|
else {
|
|
fVar9 = 1.0;
|
|
}
|
|
fVar10 = (parentFamiliar->_velocity).x;
|
|
(this->_velocity).y = fVar9 * (parentFamiliar->_velocity).y + (this->_velocity).y;
|
|
(this->_velocity).x = fVar9 * fVar10 + (this->_velocity).x;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (parentFamiliar->_type == 3) {
|
|
bVar3 = is_detached_from_follow(parentFamiliar);
|
|
parentFamiliar = this_03;
|
|
if (bVar3 != 0) {
|
|
if (extraout_DL_00 != '\0') {
|
|
iVar6 = GetFollowerPriority(this_03);
|
|
parentFamiliar = extraout_ECX_03;
|
|
if ((0 < iVar6) && (extraout_ECX_03->_isNotCountedAsFollower == 0)) goto LAB_006133c6;
|
|
}
|
|
iVar7 = iVar7 + 1;
|
|
}
|
|
}
|
|
LAB_006133c6:
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(parentFamiliar->_child);
|
|
} while( true );
|
|
}
|
|
(this->_orbitDistance).x = g_vectorZero.x;
|
|
(this->_orbitDistance).y = g_vectorZero.y;
|
|
if (isOverrideParent == '\0') {
|
|
for (; player != GHIDRA_CAST<Entity_NPC *>(0x0); player = GHIDRA_CAST<Entity_NPC *>(player->_parent)) {
|
|
parentFamiliar =
|
|
(Entity_Familiar *)
|
|
__RTDynamicCast(player,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
if (parentFamiliar == GHIDRA_CAST<Entity_Familiar *>(0x0)) goto LAB_0061378a;
|
|
bVar3 = is_detached_from_follow(parentFamiliar);
|
|
if ((bVar3 != 0) ||
|
|
(((isLilithBirthright != '\0' && (iVar7 = GetFollowerPriority(this_04), 0 < iVar7)) &&
|
|
(*GHIDRA_CAST<char *>((extraout_ECX_04 + 0xd76)) == '\0')))) goto LAB_0061378a;
|
|
}
|
|
LAB_00613692:
|
|
if (this->_variant != 0x6d) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(query),3,0x6d,-1,1,0);
|
|
local_14 = 0;
|
|
local_30 = 0.0;
|
|
if (VStack_3c.y != 0.0) {
|
|
LAB_006136d5:
|
|
iVar7 = __RTDynamicCast(*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(query)) + 0x4))) + local_30 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
if (((*GHIDRA_CAST<char *>((iVar7 + 0x172)) == '\0') || (*(void **)(iVar7 + 0x410) != this->_player)) ||
|
|
(*GHIDRA_CAST<int *>((iVar7 + 0x3bc)) != this->_parent)) goto LAB_00613716;
|
|
player = *GHIDRA_CAST<Entity_NPC **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(query)) + 0x4))) + local_30 * 4));
|
|
for (chainNext = GHIDRA_CAST<Entity_NPC *>((*GHIDRA_CAST<Entity_NPC **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(query)) + 0x4))) + local_30 * 4)))->_child);
|
|
((chainNext != GHIDRA_CAST<Entity_NPC *>(0x0) && (chainNext->_type == 3)) &&
|
|
(chainNext->_variant == 0x6d)); chainNext = GHIDRA_CAST<Entity_NPC *>(chainNext->_child)) {
|
|
player = chainNext;
|
|
}
|
|
}
|
|
LAB_0061375a:
|
|
local_14 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((query)))->EntityList_Query::~EntityList_Query();
|
|
if (player != GHIDRA_CAST<Entity_NPC *>(0x0)) goto LAB_0061378a;
|
|
}
|
|
local_30 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_28 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
}
|
|
else {
|
|
player = local_48;
|
|
if (local_48 == GHIDRA_CAST<Entity_NPC *>(0x0)) goto LAB_00613692;
|
|
LAB_0061378a:
|
|
local_30 = (player->_pos).x;
|
|
local_28 = (player->_pos).y;
|
|
}
|
|
local_2c = 20.0;
|
|
if (this->_variant == 100) {
|
|
local_2c = 10.0;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x59,0);
|
|
if (bVar3 != 0) {
|
|
local_2c = 5.0;
|
|
}
|
|
VStack_3c.y = (this->_pos).y - local_28;
|
|
local_34 = GHIDRA_CAST<Entity_Familiar *>(((this->_pos).x - local_30));
|
|
fVar9 = sqrtf(VStack_3c.y * VStack_3c.y + (float)local_34 * (float)local_34);
|
|
if (fVar9 <= 0.0) {
|
|
parentFamiliar = local_34;
|
|
}
|
|
else {
|
|
VStack_3c.y = (local_2c / fVar9) * VStack_3c.y;
|
|
parentFamiliar = GHIDRA_CAST<Entity_Familiar *>(((local_2c / fVar9) * (float)local_34));
|
|
}
|
|
fVar10 = local_30 - (this->_pos).x;
|
|
local_48 = GHIDRA_CAST<Entity_NPC *>((local_30 + (float)parentFamiliar));
|
|
fVar9 = local_28 - (this->_pos).y;
|
|
VStack_3c.y = local_28 + VStack_3c.y;
|
|
fVar9 = sqrtf(fVar9 * fVar9 + fVar10 * fVar10);
|
|
if (local_2c < fVar9) {
|
|
fVar10 = (this->_pos).y;
|
|
fVar9 = ((fVar9 - local_2c) / fVar9) * 0.2;
|
|
(this->_velocity).x = ((float)local_48 - (this->_pos).x) * fVar9;
|
|
(this->_velocity).y = (VStack_3c.y - fVar10) * fVar9;
|
|
}
|
|
LAB_006138df:
|
|
this->_friction = this->_friction * 0.8;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
LAB_00613716:
|
|
local_30 = (float)(GHIDRA_INT(local_30) + 1);
|
|
if (GHIDRA_UINT(VStack_3c.y) <= GHIDRA_UINT(local_30)) goto LAB_0061375a;
|
|
goto LAB_006136d5;
|
|
}
|
|
|
|
// 00613910
|
|
void Entity_Familiar::FollowPosition(Vector *position)
|
|
{
|
|
float posX;
|
|
float posY;
|
|
float targetX;
|
|
float targetY;
|
|
|
|
if (this->_isSubtype55555 == 0) {
|
|
targetX = position->x;
|
|
targetY = position->y;
|
|
posX = (this->_pos).x;
|
|
posY = (this->_pos).y;
|
|
this->_friction = this->_friction * 0.8;
|
|
(this->_velocity).x = (targetX - posX) * 0.1;
|
|
(this->_velocity).y = (targetY - posY) * 0.1;
|
|
return;
|
|
}
|
|
(this->_pos).x = (this->_formationOffset).x;
|
|
(this->_pos).y = (this->_formationOffset).y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
return;
|
|
}
|
|
|
|
// 006139b0
|
|
Vector * Entity_Familiar::GetOrbitPosition(Vector *outPosition, Vector *offset)
|
|
{
|
|
uint8_t bVar1;
|
|
Vector *followPos;
|
|
uint32_t framePhase;
|
|
LayerState *layer;
|
|
int clampedLayer;
|
|
int iVar2;
|
|
float fVar3;
|
|
float cosAngle;
|
|
Vector scratchVec;
|
|
float layerAngleOffset;
|
|
|
|
if (this->_isSubtype55555 != 0) {
|
|
fVar3 = (this->_formationOffset).y;
|
|
outPosition->x = (this->_formationOffset).x;
|
|
outPosition->y = fVar3;
|
|
return outPosition;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x6d,0);
|
|
if ((bVar1 != 0) && (this->_variant != 0x2b)) {
|
|
followPos = UpdateFollowPosition(this,&scratchVec);
|
|
outPosition->x = followPos->x + offset->x;
|
|
outPosition->y = followPos->y + offset->y;
|
|
return outPosition;
|
|
}
|
|
if (((this->_formationOffset).x != g_vectorZero.x) ||
|
|
((this->_formationOffset).y != g_vectorZero.y)) {
|
|
reset_follow_target(this);
|
|
}
|
|
framePhase = g_manager->_framecount & 0x80000001;
|
|
if (GHIDRA_INT(framePhase) < 0) {
|
|
framePhase = (framePhase - 1 | 0xfffffffe) + 1;
|
|
}
|
|
fVar3 = fmodf(this->_orbitAngleOffset -
|
|
((float)GHIDRA_INT(framePhase) * 0.5 + (float)g_game->_frameCount) * this->_orbitSpeed *
|
|
3.1415927 * 0.5,6.2831855);
|
|
iVar2 = this->_variant;
|
|
if (iVar2 == 0x23) {
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Rotation"),1);
|
|
if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(6.0),
|
|
(this->_sprite)._animState._animData != (void *)0x0)) {
|
|
(this->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
scratchVec.x = (fVar3 * 180.0) / 3.1415927;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_rotation = scratchVec.x;
|
|
iVar2 = this->_variant;
|
|
}
|
|
if (iVar2 == 0x7e) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_rotation = (fVar3 * 180.0) / 3.1415927;
|
|
}
|
|
iVar2 = this->_orbitLayer;
|
|
if (iVar2 < 0) {
|
|
fVar3 = offset->y;
|
|
outPosition->x = offset->x;
|
|
outPosition->y = fVar3;
|
|
return outPosition;
|
|
}
|
|
if (iVar2 < 1) {
|
|
iVar2 = 0;
|
|
}
|
|
clampedLayer = 10;
|
|
if (iVar2 < 10) {
|
|
clampedLayer = iVar2;
|
|
}
|
|
layerAngleOffset = (float)(&DAT_00c34140)[clampedLayer * 5];
|
|
cosAngle = cos(fVar3 + layerAngleOffset);
|
|
outPosition->x = cosAngle * (this->_orbitDistance).x + offset->x;
|
|
fVar3 = sin(fVar3 + layerAngleOffset);
|
|
outPosition->y = fVar3 * (this->_orbitDistance).y + offset->y;
|
|
return outPosition;
|
|
}
|
|
|
|
// 00613c20
|
|
Entity_Laser * Entity_Familiar::fire_robo_baby_laser(Vector *direction)
|
|
{
|
|
uint8_t bVar1;
|
|
Entity_Tear *tear;
|
|
float fVar2;
|
|
float offsetY;
|
|
int timeout;
|
|
Vector *posOffset;
|
|
Entity_Familiar *source;
|
|
Vector laserOffset;
|
|
Color laserColor;
|
|
uint32_t local_c;
|
|
uint8_t auStack_8 [4];
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x173)) != '\0') {
|
|
return GHIDRA_CAST<Entity_Laser *>(0x0);
|
|
}
|
|
fVar2 = direction->x;
|
|
laserOffset.y = -23.0;
|
|
laserOffset.x = (fVar2 + fVar2) - direction->y * 9.0;
|
|
offsetY = -8.0 - (fVar2 + fVar2);
|
|
if (this->_variant == 0xce) {
|
|
laserOffset.y = -18.0;
|
|
laserOffset.x = g_vectorZero.x;
|
|
offsetY = g_vectorZero.y;
|
|
}
|
|
laserOffset.y = laserOffset.y + offsetY;
|
|
bVar1 = 0;
|
|
laserOffset.x = laserOffset.x + 0.0;
|
|
posOffset = &laserOffset;
|
|
timeout = 3;
|
|
source = this;
|
|
fVar2 = atan2f(direction->y,fVar2);
|
|
tear = (Entity_Tear *)
|
|
Entity_Laser::ShootAngle
|
|
(2,&this->_pos,fVar2 * 57.295776,timeout,posOffset,GHIDRA_CAST<Entity *>(source),bVar1);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(tear->_tearHaloANM2)._overlayAnimState._currentlyTriggeredEvents) + 1)) = 1;
|
|
*GHIDRA_CAST<uint8_t *>(&(tear->_tearHaloANM2)._animState._layerFrames) = 1;
|
|
fVar2 = apply_tear_modifiers(this);
|
|
tear->SetCollisionDamage(fVar2 * 3.5);
|
|
if ((direction->y <= -0.5 && direction->y != -0.5) ||
|
|
(direction->x <= -0.5 && direction->x != -0.5)) {
|
|
fVar2 = -10.0;
|
|
}
|
|
else {
|
|
fVar2 = 3000.0;
|
|
}
|
|
tear->_renderDepthOffset = fVar2;
|
|
(GHIDRA_CAST<Color *>((&laserColor)))->Color::Color();
|
|
if (this->_isLilDelirium != 0) {
|
|
laserColor._tint[0] = 0.2;
|
|
laserColor._tint[1] = 1.0;
|
|
laserColor._tint[2] = 0.0;
|
|
laserColor._tint[3] = 1.0;
|
|
laserColor._offset[2] = 0.0;
|
|
laserColor._colorize[0] = 0.0;
|
|
laserColor._colorize[1] = 0.0;
|
|
laserColor._colorize[2] = 0.0;
|
|
laserColor._colorize[3] = 0.0;
|
|
laserColor._offset[0] = 1.0;
|
|
laserColor._offset[1] = 1.0;
|
|
}
|
|
if (this->_player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IsHologram();
|
|
if (bVar1 != 0) {
|
|
laserColor._tint[3] = 0.25;
|
|
}
|
|
}
|
|
tear->SetColor(&laserColor,0xffffffff,0xff,0,1);
|
|
tear->Update();
|
|
apply_baby_bender(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
return GHIDRA_CAST<Entity_Laser *>(tear);
|
|
}
|
|
|
|
// 00613df0
|
|
void Entity_Familiar::PlayFloatAnim(int direction)
|
|
{
|
|
char cVar1;
|
|
uint32_t uVar2;
|
|
LayerState *layer;
|
|
int *texture;
|
|
uint8_t *anim;
|
|
char *anim_00;
|
|
uint8_t textureRef [4];
|
|
int *textureImage;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int variant;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af69ad;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((textureRef + 0x18));
|
|
variant = this->_variant;
|
|
if (variant == 0x58) {
|
|
return;
|
|
}
|
|
if (variant == 0xce) {
|
|
ExceptionList = &local_10;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
texture = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(textureRef);
|
|
local_8 = 0;
|
|
anim = s_Idle2;
|
|
if (*GHIDRA_CAST<uint32_t *>((*texture + 0x10)) < 0x81) {
|
|
anim = s_Idle;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(anim,0);
|
|
local_8 = 1;
|
|
if (textureImage == GHIDRA_CAST<int *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
cVar1 = (**(code **)(*textureImage + 0xc))(uVar2);
|
|
if (cVar1 == '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (g_imageReleaseFn == (void *)0x0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(*g_imageReleaseFn)(textureRef);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (variant == 0xed) {
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (variant == 0xee) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
(this->_sprite)._flipX = 0;
|
|
if (variant == 0x4c) {
|
|
anim_00 = "Float";
|
|
}
|
|
else if ((variant == 6) || (variant == 0x35)) {
|
|
switch(direction) {
|
|
case 0:
|
|
anim_00 = "FloatSide2";
|
|
break;
|
|
case 1:
|
|
switchD_00613f56_caseD_1:
|
|
anim_00 = "FloatUp";
|
|
break;
|
|
case 2:
|
|
goto switchD_00613f56_caseD_2;
|
|
case 3:
|
|
switchD_00613f56_caseD_3:
|
|
anim_00 = "FloatDown";
|
|
break;
|
|
default:
|
|
goto switchD_00613f25_default;
|
|
}
|
|
}
|
|
else if ((variant == 0x6d) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x162c)) != -1)) {
|
|
switch(direction) {
|
|
case 0:
|
|
(this->_sprite)._flipX = 1;
|
|
case 2:
|
|
anim_00 = "StoppedSide";
|
|
break;
|
|
case 1:
|
|
anim_00 = "StoppedUp";
|
|
break;
|
|
case 3:
|
|
anim_00 = "StoppedDown";
|
|
break;
|
|
default:
|
|
goto switchD_00613f25_default;
|
|
}
|
|
}
|
|
else {
|
|
switch(direction) {
|
|
case 0:
|
|
(this->_sprite)._flipX = 1;
|
|
break;
|
|
case 1:
|
|
goto switchD_00613f56_caseD_1;
|
|
case 2:
|
|
break;
|
|
case 3:
|
|
goto switchD_00613f56_caseD_3;
|
|
default:
|
|
goto switchD_00613f25_default;
|
|
}
|
|
switchD_00613f56_caseD_2:
|
|
anim_00 = "FloatSide";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim_00),0);
|
|
switchD_00613f25_default:
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00613fe0
|
|
void Entity_Familiar::AddToDelayed()
|
|
{
|
|
int *piVar1;
|
|
int iVar2;
|
|
uint32_t uVar3;
|
|
Entity_Familiar *otherFamiliar;
|
|
int familiarData;
|
|
uint64_t *allocatedBytes;
|
|
uint32_t i;
|
|
uint32_t *parentSlot;
|
|
bool isSameOwner;
|
|
EntityList_EL familiars;
|
|
int *erasedSlot;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Game *game;
|
|
uint64_t prevAllocatedBytes;
|
|
void *tmpEntity;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af69dd;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
if (this->_isSubtype55555 != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
if ((this->_isDelayed != 0) && (tmpEntity = (void *)this->_parent, tmpEntity != (void *)0x0)) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(tmpEntity) + 0x28)) == 3) {
|
|
familiarData = __RTDynamicCast(tmpEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0,
|
|
uVar3);
|
|
if ((familiarData == 0) || (*GHIDRA_CAST<char *>((familiarData + 0xd75)) == '\0')) goto LAB_00614095;
|
|
isSameOwner = this->_player == *(void **)(familiarData + 0x410);
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(tmpEntity) + 0x28)) != 1) goto LAB_00614095;
|
|
isSameOwner = tmpEntity == this->_player;
|
|
}
|
|
if (isSameOwner) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] Tried to add familiar %d to delayed again!\n"));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
LAB_00614095:
|
|
game = g_game;
|
|
this->_isDelayed = 1;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),&familiars,3,-1,-1,0,0);
|
|
i = 0;
|
|
local_8 = 0;
|
|
if (familiars._size != 0) {
|
|
familiarData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4)));
|
|
do {
|
|
iVar2 = *GHIDRA_CAST<int *>((familiarData + i * 4));
|
|
if (((*GHIDRA_CAST<int *>((iVar2 + 0x28)) == 3) && (*GHIDRA_CAST<char *>((iVar2 + 0x172)) != '\0')) &&
|
|
(*GHIDRA_CAST<int *>((iVar2 + 0x3c0)) == 0)) {
|
|
otherFamiliar =
|
|
(Entity_Familiar *)
|
|
__RTDynamicCast(iVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0,uVar3);
|
|
if (((otherFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0)) && (otherFamiliar->_isDelayed != 0)) &&
|
|
((this->_player == otherFamiliar->_player && (otherFamiliar != this)))) {
|
|
piVar1 = GHIDRA_CAST<int *>((iVar2 + 0x3c0));
|
|
if (*GHIDRA_CAST<int *>((iVar2 + 0x3c0)) != 0) {
|
|
erasedSlot = piVar1;
|
|
msvc::multiset<unsigned_int>::erase(&erasedSlot);
|
|
}
|
|
*piVar1 = GHIDRA_INT(this);
|
|
msvc::multiset<unsigned_int>::insert(piVar1);
|
|
parentSlot = &this->_parent;
|
|
if (this->_parent != 0) {
|
|
erasedSlot = parentSlot;
|
|
msvc::multiset<unsigned_int>::erase(&erasedSlot);
|
|
}
|
|
*parentSlot = iVar2;
|
|
msvc::multiset<unsigned_int>::insert(parentSlot);
|
|
break;
|
|
}
|
|
familiarData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4)));
|
|
}
|
|
i = i + 1;
|
|
} while (i < GHIDRA_UINT(familiars._size));
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) != 0) {
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar3;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar3));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + -4)));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006141e0
|
|
void Entity_Familiar::RemoveFromDelayed()
|
|
{
|
|
int iVar1;
|
|
int *parentChildSlot;
|
|
int *local_10;
|
|
int *local_c;
|
|
int *local_8;
|
|
uint32_t *childSlot;
|
|
uint32_t *parentSlot;
|
|
|
|
if (this->_isDelayed != 0) {
|
|
iVar1 = this->_parent;
|
|
parentSlot = &this->_parent;
|
|
if (iVar1 != 0) {
|
|
parentChildSlot = GHIDRA_CAST<int *>((iVar1 + 0x3c0));
|
|
local_c = GHIDRA_CAST<int *>(this->_child);
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x3c0)) != 0) {
|
|
local_8 = parentChildSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_8);
|
|
}
|
|
*parentChildSlot = GHIDRA_INT(local_c);
|
|
if (local_c != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(parentChildSlot);
|
|
}
|
|
}
|
|
iVar1 = this->_child;
|
|
childSlot = &this->_child;
|
|
if (iVar1 != 0) {
|
|
local_8 = GHIDRA_CAST<int *>((iVar1 + 0x3bc));
|
|
local_10 = GHIDRA_CAST<int *>(*parentSlot);
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x3bc)) != 0) {
|
|
local_c = local_8;
|
|
msvc::multiset<unsigned_int>::erase(&local_c);
|
|
}
|
|
*local_8 = GHIDRA_INT(local_10);
|
|
if (local_10 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(local_8);
|
|
}
|
|
}
|
|
if (*parentSlot != 0) {
|
|
local_10 = parentSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_10);
|
|
}
|
|
*parentSlot = 0;
|
|
if (*childSlot != 0) {
|
|
local_10 = childSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_10);
|
|
}
|
|
*childSlot = 0;
|
|
}
|
|
this->_isDelayed = 0;
|
|
return;
|
|
}
|
|
|
|
// 006142e0
|
|
void Entity_Familiar::PlayChargeAnim(int direction)
|
|
{
|
|
uint8_t bVar1;
|
|
int iVar2;
|
|
uint8_t *****animNameBuf;
|
|
uint32_t size;
|
|
int chargeFrame;
|
|
float chargeFrameFloat;
|
|
char *anim;
|
|
uint8_t auStack_44 [4];
|
|
int *fireCooldown;
|
|
uint32_t chargeNamePos;
|
|
uint8_t *****local_38;
|
|
uint32_t uStack_34;
|
|
uint32_t uStack_30;
|
|
uint32_t uStack_2c;
|
|
uint32_t local_28;
|
|
uint32_t uStack_24;
|
|
uint32_t uStack_20;
|
|
uint32_t uStack_1c;
|
|
uint32_t local_18;
|
|
int frameMod5;
|
|
int local_10;
|
|
uint32_t local_c;
|
|
void *animData;
|
|
uint8_t *****animNameBuf;
|
|
Game *game;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(auStack_44);
|
|
fireCooldown = &this->_fireCooldown;
|
|
(this->_sprite)._flipX = 0;
|
|
animData = (this->_sprite)._animState._animData;
|
|
chargeFrameFloat = 1.0 - (float)*fireCooldown / 30.0;
|
|
if (animData == (void *)0x0) {
|
|
chargeFrameFloat = chargeFrameFloat * 0.0;
|
|
local_38 = GHIDRA_CAST<uint8_t *****>(0x0);
|
|
uStack_24 = 0xf;
|
|
local_28 = 0;
|
|
}
|
|
else {
|
|
chargeFrameFloat = chargeFrameFloat * (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x30));
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&local_38))))->msvc::string::string(animData);
|
|
}
|
|
animNameBuf = local_38;
|
|
chargeFrame = GHIDRA_INT(chargeFrameFloat);
|
|
animNameBuf = GHIDRA_CAST<uint8_t *****>(&local_38);
|
|
if (0xf < uStack_24) {
|
|
animNameBuf = local_38;
|
|
}
|
|
chargeNamePos = msvc::string::find(GHIDRA_CAST<uint8_t *>(animNameBuf),local_28,0,GHIDRA_CAST<uint8_t *>("Charge"),6);
|
|
if (0xf < uStack_24) {
|
|
size = uStack_24 + 1;
|
|
animNameBuf = animNameBuf;
|
|
if (0xfff < size) {
|
|
animNameBuf = GHIDRA_CAST<uint8_t *****>(animNameBuf[-1]);
|
|
size = uStack_24 + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(animNameBuf) + (-4 - GHIDRA_INT(animNameBuf))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(animNameBuf,size);
|
|
}
|
|
local_28 = 0;
|
|
uStack_24 = 0xf;
|
|
if (chargeNamePos == 0xffffffff) {
|
|
chargeFrame = 0;
|
|
}
|
|
local_38 = GHIDRA_CAST<uint8_t *****>((GHIDRA_UINT(local_38) & 0xffffff00));
|
|
switch(direction) {
|
|
case 0:
|
|
(this->_sprite)._flipX = 1;
|
|
case 2:
|
|
anim = "FloatChargeSide";
|
|
break;
|
|
case 1:
|
|
anim = "FloatChargeUp";
|
|
break;
|
|
case 3:
|
|
anim = "FloatChargeDown";
|
|
break;
|
|
default:
|
|
goto switchD_006143f4_default;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(anim),1);
|
|
if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)chargeFrame),
|
|
(this->_sprite)._animState._animData != (void *)0x0)) {
|
|
(this->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
switchD_006143f4_default:
|
|
game = g_game;
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == (void *)0x0) {
|
|
iVar2 = 0;
|
|
}
|
|
else {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x30));
|
|
}
|
|
if (((iVar2 <= chargeFrame) && (*fireCooldown < 0)) &&
|
|
(((this->_flags & 0x4000) == 0 &&
|
|
((bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar1 == 0 &&
|
|
(frameMod5 = game->_frameCount % 5, frameMod5 == 0)))))) {
|
|
local_18 = 0x3e48c8ca;
|
|
local_28 = 0;
|
|
uStack_24 = 0;
|
|
uStack_20 = 0;
|
|
uStack_1c = 0;
|
|
local_38 = GHIDRA_CAST<uint8_t *****>(0x3f800000);
|
|
uStack_34 = 0x3f000000;
|
|
uStack_30 = 0x3f000000;
|
|
uStack_2c = 0x3f800000;
|
|
local_10 = frameMod5;
|
|
this->SetColor(&local_38,2,0,1,1);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00614500
|
|
void Entity_Familiar::PlayShootAnim(int direction)
|
|
{
|
|
char cVar1;
|
|
uint8_t isAnimSet;
|
|
uint32_t uVar2;
|
|
LayerState *layer;
|
|
int *texture;
|
|
char *animName;
|
|
uint8_t textureRef [4];
|
|
int *textureImage;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int variant;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af69ad;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((textureRef + 0x18));
|
|
variant = this->_variant;
|
|
if (variant == 0xce) {
|
|
ExceptionList = &local_10;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
texture = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(textureRef);
|
|
local_8 = 0;
|
|
animName = "Shoot2";
|
|
if (*GHIDRA_CAST<uint32_t *>((*texture + 0x10)) < 0x81) {
|
|
animName = "Shoot";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(animName),0);
|
|
local_8 = 1;
|
|
if (textureImage == GHIDRA_CAST<int *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
cVar1 = (**(code **)(*textureImage + 0xc))(uVar2);
|
|
if (cVar1 == '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (g_imageReleaseFn == (void *)0x0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(*g_imageReleaseFn)(textureRef);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (variant == 0xed) {
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Shoot"),0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (variant == 0xee) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
(this->_sprite)._flipX = 0;
|
|
if (variant == 0x4c) {
|
|
animName = "Shoot";
|
|
}
|
|
else if ((variant == 6) || (variant == 0x35)) {
|
|
switch(direction) {
|
|
case 0:
|
|
animName = "FloatShootSide2";
|
|
break;
|
|
case 1:
|
|
goto switchD_00614663_caseD_1;
|
|
case 2:
|
|
goto switchD_00614663_caseD_2;
|
|
case 3:
|
|
goto switchD_00614663_caseD_3;
|
|
default:
|
|
goto switchD_00614663_default;
|
|
}
|
|
}
|
|
else {
|
|
if (variant == 0x58) {
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Level3Shoot"),1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
if (direction == 0) {
|
|
(this->_sprite)._flipX = 1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
switch(direction) {
|
|
case 0:
|
|
(this->_sprite)._flipX = 1;
|
|
case 2:
|
|
switchD_00614663_caseD_2:
|
|
animName = "FloatShootSide";
|
|
break;
|
|
case 1:
|
|
switchD_00614663_caseD_1:
|
|
animName = "FloatShootUp";
|
|
break;
|
|
case 3:
|
|
switchD_00614663_caseD_3:
|
|
animName = "FloatShootDown";
|
|
break;
|
|
default:
|
|
goto switchD_00614663_default;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(animName),0);
|
|
switchD_00614663_default:
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00614b10
|
|
void Entity_Familiar::Shoot()
|
|
{
|
|
uint8_t bVar1;
|
|
char isLastRef;
|
|
uint32_t uVar2;
|
|
Vector *AimDirection;
|
|
int iVar3;
|
|
LayerState *layer;
|
|
int *texturePtr;
|
|
Entity *pEVar4;
|
|
uint8_t *anim;
|
|
int iVar5;
|
|
float sinAngle;
|
|
Vector local_4c;
|
|
Vector aimDir;
|
|
Vector local_3c;
|
|
uint8_t texture [4];
|
|
Entity *local_30;
|
|
float local_2c;
|
|
int fireDirection;
|
|
int fireDelay;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
char *floatAnim;
|
|
void *player;
|
|
|
|
puStack_20 = texture + 0x30;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af6a0d;
|
|
local_1c = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((texture + 0x24));
|
|
if (this->_player->_dead != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x8d,0);
|
|
if ((bVar1 != 0) && (0 < this->_fireCooldown)) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
iVar5 = this->_variant;
|
|
fireDelay = 0x16;
|
|
if (iVar5 == 0x4a) {
|
|
fireDelay = 0xb;
|
|
}
|
|
if ((iVar5 == 1) || (iVar5 == 8)) {
|
|
fireDelay = 0x10;
|
|
}
|
|
if (iVar5 == 0x51) {
|
|
fireDelay = 0x2c;
|
|
}
|
|
if ((this->_flags & 0x100) != 0) {
|
|
fireDelay = GHIDRA_INT(((float)fireDelay * 1.4));
|
|
}
|
|
local_2c = -NAN;
|
|
if (iVar5 == 0xf4) {
|
|
fireDelay = 0xb;
|
|
}
|
|
else if (iVar5 == 0x4a) {
|
|
local_2c = (float)this->_subtype;
|
|
}
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (iVar5 == 0x36)) {
|
|
fireDelay = 0x21;
|
|
}
|
|
iVar3 = fireDelay;
|
|
player = this->_player;
|
|
fireDirection = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x162c));
|
|
if (fireDirection == -1) {
|
|
if (((-1 < this->_headFrameDelay) &&
|
|
(iVar3 = this->_headFrameDelay + -1, this->_headFrameDelay = iVar3, iVar3 < 0)) &&
|
|
(iVar5 != 0x58)) {
|
|
if (iVar5 == 0xce) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
texturePtr = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(texture);
|
|
local_14 = 0;
|
|
anim = s_Idle2;
|
|
if (*GHIDRA_CAST<uint32_t *>((*texturePtr + 0x10)) < 0x81) {
|
|
anim = s_Idle;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(anim,0);
|
|
local_14 = 1;
|
|
if (((local_30 != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(isLastRef = local_30->Update(uVar2), isLastRef != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(texture);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 == 0xed) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,0);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (iVar5 != 0xee) {
|
|
(this->_sprite)._flipX = 0;
|
|
if (iVar5 == 0x4c) {
|
|
floatAnim = "Float";
|
|
}
|
|
else if (((iVar5 == 6) || (iVar5 == 0x35)) ||
|
|
((iVar5 != 0x6d || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x162c)) == -1)))) {
|
|
floatAnim = "FloatDown";
|
|
}
|
|
else {
|
|
floatAnim = "StoppedDown";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(floatAnim),0);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
local_4c.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x33c)) - (this->_pos).x;
|
|
local_4c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x340)) - (this->_pos).y;
|
|
if ((iVar5 == 8) || (iVar5 == 0xf4)) {
|
|
if (ABS(local_4c.x) <= ABS(local_4c.y)) {
|
|
fireDirection = GHIDRA_UINT((0.0 <= local_4c.y)) * 2 + 1;
|
|
}
|
|
else {
|
|
fireDirection = 2;
|
|
if (local_4c.x < 0.0) {
|
|
fireDirection = 0;
|
|
}
|
|
}
|
|
}
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&aimDir,fireDirection);
|
|
bVar1 = TryAimAtMarkedTarget(this,&aimDir,&fireDirection,GHIDRA_CAST<Vector *>(0x0));
|
|
local_30 = GHIDRA_CAST<Entity *>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_30)) + 0x1))),bVar1));
|
|
(this->_sprite)._flipX = fireDirection == 0;
|
|
if (0 < this->_fireCooldown) goto LAB_00614e92;
|
|
iVar5 = this->_variant;
|
|
if (iVar5 == 0x61) {
|
|
iVar5 = 0;
|
|
do {
|
|
local_2c = (float)iVar5 * 90.0 * 0.017453292;
|
|
local_3c.y = cos(local_2c);
|
|
sinAngle = sin(local_2c);
|
|
local_4c.x = aimDir.x * local_3c.y - aimDir.y * sinAngle;
|
|
local_4c.y = aimDir.y * local_3c.y + aimDir.x * sinAngle;
|
|
FireProjectile(this,&local_4c,(uint8_t)local_30);
|
|
iVar5 = iVar5 + 1;
|
|
} while (iVar5 < 4);
|
|
iVar3 = fireDelay;
|
|
LAB_00614e78:
|
|
this->_fireCooldown = iVar3;
|
|
this->_headFrameDelay = 0x12;
|
|
}
|
|
else {
|
|
if ((iVar5 == 6) || (local_2c == 5.60519e-45)) {
|
|
fire_robo_baby_laser(this,&aimDir);
|
|
goto LAB_00614e78;
|
|
}
|
|
if ((iVar5 != 0x36) && (local_2c != 1.26117e-44)) {
|
|
if ((iVar5 == 8) || (iVar5 == 0xf4)) {
|
|
pEVar4 = local_30;
|
|
AimDirection = (GHIDRA_CAST<Vector *>((&local_4c)))->Vector::Normalized(&local_3c);
|
|
FireProjectile(this,AimDirection,(uint8_t)pEVar4);
|
|
}
|
|
else {
|
|
FireProjectile(this,&aimDir,bVar1);
|
|
}
|
|
goto LAB_00614e78;
|
|
}
|
|
if (this->_linkedEntity == 0) {
|
|
PickEnemyTarget(this,200.0,1,0,&g_vectorZero,15.0);
|
|
local_30 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBlueFlies(1,&this->_pos,GHIDRA_CAST<Entity *>(this->_target));
|
|
if (this->_linkedEntity != 0) {
|
|
local_3c.y = (float)&this->_linkedEntity;
|
|
msvc::multiset<unsigned_int>::erase(&local_3c.y);
|
|
}
|
|
this->_linkedEntity = local_30;
|
|
pEVar4 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (local_30 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(&this->_linkedEntity);
|
|
pEVar4 = GHIDRA_CAST<Entity *>(this->_linkedEntity);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(pEVar4);
|
|
goto LAB_00614e78;
|
|
}
|
|
}
|
|
mongo_baby_pick_next_mimic(this);
|
|
LAB_00614e92:
|
|
if (this->_headFrameDelay < 9) {
|
|
PlayFloatAnim(this,fireDirection);
|
|
this->_headFrameDelay = 8;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
PlayShootAnim(this,fireDirection);
|
|
this->_headFrameDelay = this->_headFrameDelay + -1;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00615d80
|
|
void Entity_Familiar::ai_blue_fly()
|
|
{
|
|
uint32_t rngResult;
|
|
Entity *orbitParent;
|
|
Vector *orbitPosition;
|
|
float fVar1;
|
|
float fVar2;
|
|
Vector local_18;
|
|
Vector local_10;
|
|
uint32_t *parentRef;
|
|
int tmpEntity;
|
|
|
|
if (0 < this->_state) {
|
|
tmpEntity = this->_state + -1;
|
|
this->_state = tmpEntity;
|
|
this->_entityCollisionClass = 0;
|
|
this->_friction = this->_friction * 0.96;
|
|
if (tmpEntity == 0) {
|
|
this->_entityCollisionClass = 4;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
local_18.x = 200.0;
|
|
if (this->_subtype == 1) {
|
|
local_18.x = 400.0;
|
|
if ((*GHIDRA_CAST<char *>(g_game->_room) == '\0') ||
|
|
(g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f0)) < 0x3c)) {
|
|
this->_target = 0;
|
|
tmpEntity = 0;
|
|
goto LAB_00615e6a;
|
|
}
|
|
}
|
|
rngResult = Random();
|
|
if ((rngResult % 3 == 0) || (this->_subtype == 1)) {
|
|
PickEnemyTarget(this,local_18.x,0xd,0,&g_vectorZero,15.0);
|
|
}
|
|
tmpEntity = 4;
|
|
LAB_00615e6a:
|
|
parentRef = &this->_parent;
|
|
this->_entityCollisionClass = tmpEntity;
|
|
tmpEntity = *parentRef;
|
|
if ((tmpEntity != 0) &&
|
|
((*GHIDRA_CAST<char *>((tmpEntity + 0x173)) != '\0' || (*GHIDRA_CAST<int *>((tmpEntity + 0x188)) == 0)))) {
|
|
local_18.x = (float)parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
*parentRef = 0;
|
|
if (-1 < this->_orbitLayer) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
this->_orbitLayer = -1;
|
|
}
|
|
}
|
|
tmpEntity = this->_target;
|
|
if (tmpEntity == 0) {
|
|
if (this->_orbitLayer == -1) {
|
|
this->_orbitLayer = 1;
|
|
fVar1 = DAT_00c34148;
|
|
(this->_orbitDistance).x = DAT_00c34144;
|
|
(this->_orbitDistance).y = fVar1;
|
|
RecalculateOrbitOffset(this,1,1);
|
|
}
|
|
orbitParent = get_orbit_parent(this);
|
|
local_10.x = (orbitParent->_pos).x;
|
|
local_10.y = (orbitParent->_pos).y;
|
|
orbitPosition = GetOrbitPosition(this,&local_18,&local_10);
|
|
fVar1 = orbitPosition->x;
|
|
(this->_targetPosition).x = fVar1;
|
|
(this->_targetPosition).y = orbitPosition->y;
|
|
}
|
|
else {
|
|
fVar1 = *GHIDRA_CAST<float *>((tmpEntity + 0x33c));
|
|
fVar2 = *GHIDRA_CAST<float *>((tmpEntity + 0x340));
|
|
(this->_targetPosition).x = fVar1;
|
|
(this->_targetPosition).y = fVar2;
|
|
if (-1 < this->_orbitLayer) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
this->_orbitLayer = -1;
|
|
fVar1 = (this->_targetPosition).x;
|
|
}
|
|
}
|
|
local_10.x = (this->_targetPosition).y - (this->_pos).y;
|
|
local_18.x = fVar1 - (this->_pos).x;
|
|
fVar1 = sqrtf(local_10.x * local_10.x + local_18.x * local_18.x);
|
|
if (fVar1 < 0.1) {
|
|
fVar2 = 0.0;
|
|
}
|
|
else {
|
|
fVar2 = fVar1 * 0.15;
|
|
if (2.0 <= fVar2) {
|
|
fVar2 = 2.0;
|
|
}
|
|
fVar2 = fVar2 / fVar1;
|
|
}
|
|
(this->_velocity).x = local_18.x * fVar2 + (this->_velocity).x;
|
|
(this->_velocity).y = local_10.x * fVar2 + (this->_velocity).y;
|
|
this->_friction = this->_friction * 0.8;
|
|
return;
|
|
}
|
|
|
|
// 00616db0
|
|
void Entity_Familiar::ai_walker()
|
|
{
|
|
int iVar1;
|
|
uint8_t bVar2;
|
|
int *piVar3;
|
|
uint32_t *puVar4;
|
|
Entity *bloodSplat;
|
|
uint8_t *animNameChar;
|
|
uint8_t *pbVar5;
|
|
uint8_t *animNameChar;
|
|
char *animName;
|
|
uint32_t uVar7;
|
|
bool bVar8;
|
|
float fVar9;
|
|
float deltaX;
|
|
float fVar10;
|
|
uint32_t uVar11;
|
|
TypeDescriptor *pTVar12;
|
|
TypeDescriptor *pTVar13;
|
|
uint32_t uVar14;
|
|
uint8_t sameVariantList [12];
|
|
uint32_t uStack_2c;
|
|
Vector targetPos;
|
|
uint32_t targetIndex;
|
|
uint8_t *local_1c;
|
|
uint8_t *local_18;
|
|
bool isChasingTarget;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6a5d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
targetPos.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
targetPos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
if (this->_variant == 0x38) {
|
|
iVar1 = this->_parent;
|
|
if (iVar1 == 0) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(sameVariantList),
|
|
this->_type,0x38,-1,0,0);
|
|
local_8 = 0;
|
|
uVar7 = 0;
|
|
if (uStack_2c != 0) {
|
|
do {
|
|
pbVar5 = *GHIDRA_CAST<uint8_t **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sameVariantList)) + 0x4))) + uVar7 * 4));
|
|
if (((pbVar5[0x172] != 0) && (*GHIDRA_CAST<int *>((pbVar5 + 0x3bc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((pbVar5 + 0x3c0)) == 0)) {
|
|
local_1c = pbVar5;
|
|
if (this->_parent != 0) {
|
|
local_18 = GHIDRA_CAST<uint8_t *>(&this->_parent);
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
this->_parent = local_1c;
|
|
if (local_1c != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(&this->_parent);
|
|
}
|
|
local_18 = GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sameVariantList)) + 0x4))) + uVar7 * 4)) + 0x3c0));
|
|
if (*GHIDRA_CAST<int *>(local_18) != 0) {
|
|
local_1c = local_18;
|
|
msvc::multiset<unsigned_int>::erase(&local_1c);
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>(local_18) = this;
|
|
msvc::multiset<unsigned_int>::insert(local_18);
|
|
iVar1 = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sameVariantList)) + 0x4))) + uVar7 * 4));
|
|
targetPos.x = *GHIDRA_CAST<float *>((iVar1 + 0x33c));
|
|
targetPos.y = *GHIDRA_CAST<float *>((iVar1 + 0x340));
|
|
break;
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < uStack_2c);
|
|
}
|
|
if ((this->_parent == 0) && (this->_parent = this->_player, this->_player != (void *)0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(&this->_parent);
|
|
}
|
|
if (sameVariantList[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)sameVariantList)) + 0x4))),0);
|
|
}
|
|
}
|
|
else {
|
|
targetPos.x = *GHIDRA_CAST<float *>((iVar1 + 0x33c));
|
|
targetPos.y = *GHIDRA_CAST<float *>((iVar1 + 0x340));
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (this->_target != 0)) {
|
|
local_1c = *GHIDRA_CAST<uint8_t **>((this->_target + 0x20));
|
|
piVar3 = map_find_value(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf3c))),GHIDRA_UINT(&local_1c));
|
|
if (0x1c1 < *piVar3) {
|
|
targetIndex = *GHIDRA_CAST<uint32_t *>((this->_target + 0x20));
|
|
puVar4 = map_find_value(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf3c))),GHIDRA_UINT(&targetIndex));
|
|
*puVar4 = 0xfffffc7c;
|
|
}
|
|
}
|
|
PickEnemyTarget(this,this->_collisionDamage * 15.0 + 65.0,8,0,&g_vectorZero,15.0);
|
|
iVar1 = this->_target;
|
|
isChasingTarget = false;
|
|
if (iVar1 == 0) {
|
|
fVar10 = 6400.0;
|
|
}
|
|
else {
|
|
targetPos.x = *GHIDRA_CAST<float *>((iVar1 + 0x33c));
|
|
fVar10 = 0.0;
|
|
targetPos.y = *GHIDRA_CAST<float *>((iVar1 + 0x340));
|
|
}
|
|
fVar9 = targetPos.y - (this->_pos).y;
|
|
deltaX = targetPos.x - (this->_pos).x;
|
|
if (fVar10 < fVar9 * fVar9 + deltaX * deltaX) {
|
|
iVar1 = this->_variant;
|
|
if ((iVar1 == 0x2f) || (iVar1 == 0x38)) {
|
|
fVar10 = 2.2;
|
|
}
|
|
else {
|
|
fVar10 = 1.8;
|
|
}
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (iVar1 == 0x2f)) {
|
|
fVar10 = 2.0;
|
|
}
|
|
PathFinder::FindGridPath(GHIDRA_CAST<PathFinder *>(&this->_pathfinder),&targetPos,fVar10 * 0.83,0,1);
|
|
isChasingTarget = this->_target != 0;
|
|
}
|
|
if (((this->_variant == 0x2e) || (this->_variant == 0x2f)) && (uVar7 = Random(), (uVar7 & 3) == 0)
|
|
) {
|
|
uVar7 = Random();
|
|
uVar14 = 0;
|
|
pTVar13 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar12 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar11 = 0;
|
|
bloodSplat = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,7,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
piVar3 = GHIDRA_CAST<int *>(__RTDynamicCast(bloodSplat,uVar11,pTVar12,pTVar13,uVar14));
|
|
uVar7 = Random();
|
|
fVar10 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.3 + 0.1;
|
|
piVar3[0x39] = GHIDRA_INT(fVar10);
|
|
piVar3[0x3a] = GHIDRA_INT(fVar10);
|
|
(**(code **)(*piVar3 + 0xc))();
|
|
}
|
|
local_1c = GHIDRA_CAST<uint8_t *>(this->_variant);
|
|
this->_friction = this->_friction * 0.85;
|
|
fVar10 = (this->_velocity).x;
|
|
fVar9 = (this->_velocity).y;
|
|
fVar10 = sqrtf(fVar10 * fVar10 + fVar9 * fVar9);
|
|
if (fVar10 < 2.0) {
|
|
if (local_1c == GHIDRA_CAST<uint8_t *>(0x38)) {
|
|
if ((this->_sprite)._animState._animData == (void *)0x0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameChar = pbVar5;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
animNameChar = s_Idle;
|
|
do {
|
|
bVar2 = *animNameChar;
|
|
bVar8 = bVar2 < *animNameChar;
|
|
if (bVar2 != *animNameChar) {
|
|
LAB_00617225:
|
|
uVar7 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_0061722a;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameChar[1];
|
|
bVar8 = bVar2 < animNameChar[1];
|
|
if (bVar2 != animNameChar[1]) goto LAB_00617225;
|
|
animNameChar = animNameChar + 2;
|
|
animNameChar = animNameChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar7 = 0;
|
|
LAB_0061722a:
|
|
if (uVar7 == 0) {
|
|
if (pbVar5[0x34] == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_sprite)._animState._isPlaying != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
pbVar5 = s_Idle;
|
|
goto LAB_0061748d;
|
|
}
|
|
fVar10 = (this->_velocity).y;
|
|
if (ABS(fVar10) < ABS((this->_velocity).x)) {
|
|
if (this->_variant == 0x38) {
|
|
animName = "Attack Hori";
|
|
if (isChasingTarget == false) {
|
|
animName = "Move Hori";
|
|
}
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
animNameChar = GHIDRA_CAST<uint8_t *>(animName);
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
bVar8 = bVar2 < *animNameChar;
|
|
if (bVar2 != *animNameChar) {
|
|
LAB_006172c4:
|
|
uVar7 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_006172c9;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar5[1];
|
|
bVar8 = bVar2 < animNameChar[1];
|
|
if (bVar2 != animNameChar[1]) goto LAB_006172c4;
|
|
pbVar5 = pbVar5 + 2;
|
|
animNameChar = animNameChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar7 = 0;
|
|
LAB_006172c9:
|
|
if ((uVar7 == 0) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' ||
|
|
((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00617356;
|
|
}
|
|
local_18 = GHIDRA_CAST<uint8_t *>(animName);
|
|
}
|
|
else {
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
animName = "WalkHori";
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
bVar8 = bVar2 < (uint8_t)*animName;
|
|
if (bVar2 != *animName) {
|
|
LAB_00617320:
|
|
uVar7 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_00617325;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar5[1];
|
|
bVar8 = bVar2 < (uint8_t)animName[1];
|
|
if (bVar2 != animName[1]) goto LAB_00617320;
|
|
pbVar5 = pbVar5 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar2 != 0);
|
|
uVar7 = 0;
|
|
LAB_00617325:
|
|
if ((uVar7 == 0) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' ||
|
|
((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00617356;
|
|
}
|
|
animName = "WalkHori";
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_00617356:
|
|
(this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (this->_variant != 0x38) {
|
|
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameChar = pbVar5;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
animName = "WalkVert";
|
|
do {
|
|
bVar2 = *animNameChar;
|
|
bVar8 = bVar2 < (uint8_t)*animName;
|
|
if (bVar2 != *animName) {
|
|
LAB_00617473:
|
|
uVar7 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_00617478;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameChar[1];
|
|
bVar8 = bVar2 < (uint8_t)animName[1];
|
|
if (bVar2 != animName[1]) goto LAB_00617473;
|
|
animNameChar = animNameChar + 2;
|
|
animName = animName + 2;
|
|
} while (bVar2 != 0);
|
|
uVar7 = 0;
|
|
LAB_00617478:
|
|
if (uVar7 == 0) {
|
|
if (pbVar5[0x34] == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_sprite)._animState._isPlaying != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
pbVar5 = GHIDRA_CAST<uint8_t *>("WalkVert");
|
|
goto LAB_0061748d;
|
|
}
|
|
if (isChasingTarget == false) {
|
|
local_18 = GHIDRA_CAST<uint8_t *>(0xb605fc);
|
|
if (fVar10 <= 0.0) {
|
|
local_18 = GHIDRA_CAST<uint8_t *>(0xb60608);
|
|
}
|
|
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameChar = pbVar5;
|
|
animNameChar = local_18;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
do {
|
|
bVar2 = *animNameChar;
|
|
bVar8 = bVar2 < *animNameChar;
|
|
if (bVar2 != *animNameChar) goto LAB_006173d2;
|
|
if (bVar2 == 0) goto LAB_006173ce;
|
|
bVar2 = animNameChar[1];
|
|
bVar8 = bVar2 < animNameChar[1];
|
|
if (bVar2 != animNameChar[1]) goto LAB_006173d2;
|
|
animNameChar = animNameChar + 2;
|
|
animNameChar = animNameChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar7 = 0;
|
|
goto LAB_006173d7;
|
|
}
|
|
}
|
|
else {
|
|
local_18 = GHIDRA_CAST<uint8_t *>(0xb60574);
|
|
if (fVar10 <= 0.0) {
|
|
local_18 = GHIDRA_CAST<uint8_t *>(0xb605b8);
|
|
}
|
|
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameChar = pbVar5;
|
|
animNameChar = local_18;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
do {
|
|
bVar2 = *animNameChar;
|
|
bVar8 = bVar2 < *animNameChar;
|
|
if (bVar2 != *animNameChar) goto LAB_006173d2;
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameChar[1];
|
|
bVar8 = bVar2 < animNameChar[1];
|
|
if (bVar2 != animNameChar[1]) goto LAB_006173d2;
|
|
animNameChar = animNameChar + 2;
|
|
animNameChar = animNameChar + 2;
|
|
} while (bVar2 != 0);
|
|
LAB_006173ce:
|
|
uVar7 = 0;
|
|
LAB_006173d7:
|
|
if (uVar7 == 0) {
|
|
if (pbVar5[0x34] == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_sprite)._animState._isPlaying != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pbVar5 = local_18;
|
|
LAB_0061748d:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(pbVar5,1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
LAB_006173d2:
|
|
uVar7 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_006173d7;
|
|
}
|
|
|
|
// 006174c0
|
|
void Entity_Familiar::ai_charger()
|
|
{
|
|
void *pvVar1;
|
|
uint8_t bVar2;
|
|
char isFiring;
|
|
Entity *umbilicalWhip;
|
|
Vector *pVVar3;
|
|
uint8_t *currentAnimName;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
int iVar6;
|
|
Entity_Player *player;
|
|
RNG *collectibleRng;
|
|
float *chargeLevelPtr;
|
|
Vector *pVVar7;
|
|
float *collisionPoint;
|
|
float *extraout_ECX;
|
|
uint32_t *puVar8;
|
|
int iVar9;
|
|
bool bVar10;
|
|
float fVar11;
|
|
uint8_t in_XMM0 [16];
|
|
float fVar12;
|
|
Entity_Familiar *pEVar13;
|
|
Entity_Familiar *pEVar14;
|
|
float velocityX;
|
|
EntityRef sourceRef;
|
|
uint8_t entityList [12];
|
|
uint8_t *puStack_4c;
|
|
Vector scratchVec;
|
|
uint8_t local_40 [8];
|
|
Vector local_38;
|
|
Entity_Familiar *local_30;
|
|
Vector local_2c;
|
|
uint32_t *local_24;
|
|
Entity_Familiar *local_20;
|
|
Vector local_1c;
|
|
char isNoOtherCharging;
|
|
uint8_t isLilithIncubus;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
char *animName;
|
|
GridEntity_Door *door;
|
|
Game *game;
|
|
Manager *manager;
|
|
int *queriedEntity;
|
|
Room *room;
|
|
RoomDescriptor *roomDesc;
|
|
ANM2 *sprite;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6aa9;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_20 = this;
|
|
isLilithIncubus = IsLilithBirthrightIncubus(this);
|
|
if (this->_subtype != 0) {
|
|
this->_entityCollisionClass = 0;
|
|
if (((this->_variant == 0x19) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
this->_friction = this->_friction * 0.3;
|
|
if (isLilithIncubus == 0) goto LAB_006189fb;
|
|
}
|
|
else {
|
|
this->_visible = 0;
|
|
}
|
|
FollowParent(this);
|
|
LAB_006189fb:
|
|
uVar4 = this->_subtype;
|
|
if (3 < uVar4) {
|
|
this->_subtype = 0;
|
|
iVar6 = 0x3c;
|
|
if (this->_variant != 0x3b) {
|
|
iVar6 = 0;
|
|
}
|
|
this->_fireCooldown = iVar6;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Appear"),0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (((this->_variant != 0xe8) && (uVar4 != 0)) &&
|
|
(iVar6 = this->_state, this->_state = iVar6 + 1, 300 < iVar6)) {
|
|
if (uVar4 == 1) {
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
uVar4 = this->_subtype;
|
|
}
|
|
this->_subtype = uVar4 + 1;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_visible = 1;
|
|
this->_state = 0;
|
|
local_24 = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(this->_player) + 0x162c));
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&local_1c,GHIDRA_INT(local_24));
|
|
TryAimAtMarkedTarget(this,&local_1c,GHIDRA_CAST<int *>(&local_24),GHIDRA_CAST<Vector *>(0x0));
|
|
if (this->_fireCooldown < 0) {
|
|
if (((isLilithIncubus != 0) &&
|
|
(umbilicalWhip = get_incubus_umbilical_whip(this), umbilicalWhip != GHIDRA_CAST<Entity *>(0x0))) &&
|
|
(fVar11 = umbilicalWhip[3]._sprite._championColor._tint[3], fVar11 != -NAN)) {
|
|
pVVar3 = Isaac::GetAxisAlignedUnitVectorFromDir(&scratchVec,GHIDRA_INT(fVar11));
|
|
(this->_velocity).x = pVVar3->x;
|
|
(this->_velocity).y = pVVar3->y;
|
|
}
|
|
iVar6 = this->_variant;
|
|
if (iVar6 == 0x82) {
|
|
animName = "Throw";
|
|
}
|
|
else {
|
|
if (iVar6 == 0xe8) {
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
local_24 = GHIDRA_CAST<uint32_t *>(0x3);
|
|
uVar4 = (g_game->_stage + 1) * 100;
|
|
if (0x4b0 < GHIDRA_INT(uVar4)) {
|
|
uVar4 = 0x4b0;
|
|
}
|
|
local_2c.y = (float)(this->_coins / GHIDRA_INT((uVar4 >> 2)));
|
|
collisionPoint = GHIDRA_CAST<float *>(&local_30);
|
|
if (-1 < GHIDRA_INT(local_2c.y)) {
|
|
collisionPoint = &local_2c.y;
|
|
}
|
|
chargeLevelPtr = GHIDRA_CAST<float *>(&local_24);
|
|
if (GHIDRA_INT(*collisionPoint) < 4) {
|
|
chargeLevelPtr = collisionPoint;
|
|
}
|
|
fVar11 = *chargeLevelPtr;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play((&PTR_s_Charge0_00b648f0)[GHIDRA_INT(fVar11)],0);
|
|
fVar11 = (float)GHIDRA_INT(fVar11);
|
|
this->SetCollisionDamage(fVar11 + fVar11 + 2.0);
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(entityList),
|
|
&this->_pos,this->_size,0x10);
|
|
local_8 = 0;
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
if (puStack_4c != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
iVar6 = g_forceCollideDepth;
|
|
do {
|
|
queriedEntity = *GHIDRA_CAST<int **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entityList)) + 0x4))) + GHIDRA_INT(local_30) * 4));
|
|
if (((queriedEntity != GHIDRA_CAST<int *>(0x0)) && (queriedEntity[10] == 5)) &&
|
|
((((iVar9 = queriedEntity[0xb], iVar9 == 10 ||
|
|
(((((iVar9 == 0x14 || (iVar9 == 0x5a)) || (iVar9 == 0x28)) ||
|
|
((iVar9 == 0x1e || (iVar9 == 0x46)))) || (iVar9 == 300)))) ||
|
|
((((iVar9 == 0x15e || (iVar9 == 0x45)) || (iVar9 == 0x29)) || (iVar9 == 0x2a)))) &&
|
|
(queriedEntity[0x14d] == 0)))) {
|
|
g_forceCollideDepth = iVar6 + 1;
|
|
this->HandleCollision(queriedEntity,1);
|
|
(**(code **)(*queriedEntity + 0x5c))(this,0);
|
|
iVar6 = g_forceCollideDepth + -1;
|
|
g_forceCollideDepth = iVar6;
|
|
}
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x1))));
|
|
} while (local_30 < puStack_4c);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (entityList[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)entityList)) + 0x4))),0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
goto LAB_006177c3;
|
|
}
|
|
fVar11 = (this->_velocity).x;
|
|
fVar12 = (this->_velocity).y;
|
|
if (ABS(fVar12) < ABS(fVar11)) {
|
|
if (((iVar6 == 3) || (iVar6 == 0x68)) || ((iVar6 == 0xdf && (this->_fireCooldown == -1)))) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatShootSide"),0);
|
|
fVar11 = (this->_velocity).x;
|
|
}
|
|
(this->_sprite)._flipX = fVar11 < 0.0;
|
|
goto LAB_006177c3;
|
|
}
|
|
if (((iVar6 != 3) && (iVar6 != 0x68)) && ((iVar6 != 0xdf || (this->_fireCooldown != -1))))
|
|
goto LAB_006177c3;
|
|
animName = "FloatShootUp";
|
|
if (0.0 <= fVar12) {
|
|
animName = "FloatShootDown";
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(animName),0);
|
|
LAB_006177c3:
|
|
if (this->_variant == 0x82) {
|
|
iVar6 = this->_target;
|
|
pEVar13 = GHIDRA_CAST<Entity_Familiar *>(&this->_target);
|
|
pVVar3 = &this->_pos;
|
|
local_30 = pEVar13;
|
|
if (iVar6 == 0) {
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_40),pVVar3,
|
|
this->_size,0x10);
|
|
pEVar14 = local_30;
|
|
local_8 = 2;
|
|
local_24 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
if (GHIDRA_CAST<uint32_t *>(local_38.y) != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
do {
|
|
puVar8 = *GHIDRA_CAST<uint32_t **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) + GHIDRA_INT(local_24) * 4));
|
|
local_1c.y = (float)puVar8;
|
|
if ((((puVar8 != GHIDRA_CAST<uint32_t *>(0x0)) && (puVar8[10] == 5)) &&
|
|
(((((iVar6 = puVar8[0xb], iVar6 == 10 ||
|
|
(((iVar6 == 0x14 || (iVar6 == 0x5a)) || (iVar6 == 0x28)))) ||
|
|
(((iVar6 == 0x1e || (iVar6 == 0x46)) || (iVar6 == 300)))) ||
|
|
((iVar6 == 0x15e || (iVar6 == 0x45)))) || ((iVar6 == 0x29 || (iVar6 == 0x2a))))))
|
|
&& (puVar8[0x14d] == 0)) {
|
|
if ((iVar6 == 0x14) && (puVar8[0xc] == 6)) {
|
|
if ((puVar8[0x1f] != 0) && (*GHIDRA_CAST<char *>((puVar8 + 0x23)) != '\0')) {
|
|
currentAnimName = GHIDRA_CAST<uint8_t *>(puVar8[0x1f]);
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((currentAnimName + 0x14))) {
|
|
currentAnimName = *GHIDRA_CAST<uint8_t **>(currentAnimName);
|
|
}
|
|
animName = "Touched";
|
|
do {
|
|
bVar2 = *currentAnimName;
|
|
bVar10 = bVar2 < (uint8_t)*animName;
|
|
if (bVar2 != *animName) {
|
|
LAB_00617920:
|
|
uVar4 = -GHIDRA_UINT(bVar10) | 1;
|
|
goto LAB_00617925;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = currentAnimName[1];
|
|
bVar10 = bVar2 < (uint8_t)animName[1];
|
|
if (bVar2 != animName[1]) goto LAB_00617920;
|
|
currentAnimName = currentAnimName + 2;
|
|
animName = animName + 2;
|
|
} while (bVar2 != 0);
|
|
uVar4 = 0;
|
|
LAB_00617925:
|
|
if (uVar4 == 0) goto LAB_006179e0;
|
|
}
|
|
local_2c.y = (float)(puVar8 + 0x12);
|
|
currentAnimName = GHIDRA_CAST<uint8_t *>(puVar8[0x1f]);
|
|
if (currentAnimName == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00617990:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((puVar8 + 0x12)))))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Touched"),1);
|
|
fVar11 = local_2c.y;
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(local_2c.y) + 0x30)))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(fVar11) + 0x44)) = 1;
|
|
puVar8 = GHIDRA_CAST<uint32_t *>(local_1c.y);
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((currentAnimName + 0x14))) {
|
|
currentAnimName = *GHIDRA_CAST<uint8_t **>(currentAnimName);
|
|
}
|
|
animName = "Touched";
|
|
do {
|
|
bVar2 = *currentAnimName;
|
|
bVar10 = bVar2 < (uint8_t)*animName;
|
|
if (bVar2 != *animName) {
|
|
LAB_00617970:
|
|
uVar4 = -GHIDRA_UINT(bVar10) | 1;
|
|
goto LAB_00617975;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = currentAnimName[1];
|
|
bVar10 = bVar2 < (uint8_t)animName[1];
|
|
if (bVar2 != animName[1]) goto LAB_00617970;
|
|
currentAnimName = currentAnimName + 2;
|
|
animName = animName + 2;
|
|
} while (bVar2 != 0);
|
|
uVar4 = 0;
|
|
LAB_00617975:
|
|
if ((uVar4 != 0) ||
|
|
((*GHIDRA_CAST<char *>((puVar8[0x1f] + 0x34)) != '\0' && (*GHIDRA_CAST<char *>((puVar8 + 0x23)) == '\0'))
|
|
)) goto LAB_00617990;
|
|
}
|
|
puVar8[0x153] = 10;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<uint32_t *>(pEVar14) != 0) {
|
|
local_2c.y = (float)pEVar14;
|
|
msvc::multiset<unsigned_int>::erase(&local_2c.y);
|
|
}
|
|
*GHIDRA_CAST<uint32_t **>(pEVar14) = puVar8;
|
|
msvc::multiset<unsigned_int>::insert(pEVar14);
|
|
}
|
|
}
|
|
LAB_006179e0:
|
|
local_24 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_24) + 1));
|
|
} while (local_24 < GHIDRA_UINT(local_38.y));
|
|
pEVar13 = local_30;
|
|
this = local_20;
|
|
}
|
|
if (local_40[0] == '\0') {
|
|
local_8 = 3;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_40)) + 0x4))),0);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
pVVar3 = &this->_pos;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>((iVar6 + 0x33c)) = pVVar3->x;
|
|
*GHIDRA_CAST<float *>((iVar6 + 0x340)) = (this->_pos).y;
|
|
iVar6 = *GHIDRA_CAST<int *>(pEVar13);
|
|
*GHIDRA_CAST<float *>((iVar6 + 0x360)) = (this->_velocity).x;
|
|
*GHIDRA_CAST<float *>((iVar6 + 0x364)) = (this->_velocity).y;
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(pEVar13) + 0x184)) = 0;
|
|
}
|
|
if (this->_fireCooldown == -2) {
|
|
local_2c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - pVVar3->y;
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - pVVar3->x));
|
|
local_24 = GHIDRA_CAST<uint32_t *>((local_2c.y * local_2c.y + (float)local_30 * (float)local_30));
|
|
if ((float)local_24 < 1600.0) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>(pEVar13);
|
|
this->_fireCooldown = 0x1e;
|
|
if (uVar4 != 0) {
|
|
uVar5 = 3;
|
|
if (isLilithIncubus != 0) {
|
|
uVar5 = 0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((uVar4 + 0x184)) = uVar5;
|
|
if (*GHIDRA_CAST<uint32_t *>(pEVar13) != 0) {
|
|
local_20 = pEVar13;
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(pEVar13) = 0;
|
|
}
|
|
iVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::get_velocity_direction();
|
|
sprite = &this->_sprite;
|
|
if (iVar6 == 3) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
}
|
|
else if (iVar6 == 1) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatUp"),0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatSide"),0);
|
|
(this->_sprite)._flipX = iVar6 == 0;
|
|
}
|
|
}
|
|
fVar11 = sqrtf((float)local_24);
|
|
pEVar13 = local_30;
|
|
pEVar14 = GHIDRA_CAST<Entity_Familiar *>(local_2c.y);
|
|
if (0.0 < fVar11) {
|
|
pEVar13 = GHIDRA_CAST<Entity_Familiar *>(((float)local_30 * (1.0 / fVar11)));
|
|
pEVar14 = GHIDRA_CAST<Entity_Familiar *>((local_2c.y * (1.0 / fVar11)));
|
|
}
|
|
(this->_velocity).x = (float)pEVar13 * 10.0;
|
|
(this->_velocity).y = (float)pEVar14 * 10.0;
|
|
this->_entityCollisionClass = 4;
|
|
}
|
|
else {
|
|
if ((((this->_collidesWithGrid != 0) ||
|
|
(bVar2 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsPositionInRoom(pVVar3,-100.0), bVar2 == 0)) ||
|
|
(*GHIDRA_CAST<uint32_t *>(pEVar13) != 0)) && (bVar2 = IsLilithBirthrightIncubus(this), bVar2 == 0)) {
|
|
this->_entityGridCollisionClass = 0;
|
|
(this->_velocity).x = (this->_velocity).x * 0.5;
|
|
(this->_velocity).y = (this->_velocity).y * 0.5;
|
|
this->_fireCooldown = -2;
|
|
}
|
|
this->_entityCollisionClass = 4;
|
|
}
|
|
}
|
|
else if (this->_variant == 0xdf) {
|
|
iVar6 = this->_fireCooldown;
|
|
if (iVar6 == -3) {
|
|
fVar11 = (this->_sprite)._color._tint[3] - 0.1;
|
|
if (fVar11 <= 0.0) {
|
|
fVar11 = 0.0;
|
|
}
|
|
(this->_sprite)._color._tint[3] = fVar11;
|
|
if (fVar11 <= 0.0) {
|
|
this->Remove();
|
|
uVar4 = 0;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar4);
|
|
if (player->_variant == 0) {
|
|
player->_cacheFlags = player->_cacheFlags | 0x200;
|
|
(player->_temporaryeffects)._shouldEvaluateCache = 1;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
}
|
|
}
|
|
else if (iVar6 == -2) {
|
|
fVar11 = (this->_targetPosition).y;
|
|
fVar12 = (this->_pos).y;
|
|
(this->_velocity).x = (this->_targetPosition).x - (this->_pos).x;
|
|
(this->_velocity).y = fVar11 - fVar12;
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
this->_fireCooldown = 0x1e;
|
|
}
|
|
}
|
|
else if (iVar6 == -1) {
|
|
iVar6 = 0x194;
|
|
this->_entityCollisionClass = 3;
|
|
if (isLilithIncubus != 0) {
|
|
iVar6 = 0x360;
|
|
}
|
|
local_38.x = *GHIDRA_CAST<float *>((GHIDRA_INT((&(this->_sprite)._filename + -3)) + iVar6));
|
|
local_38.y = *GHIDRA_CAST<float *>(((this->_sprite)._filename._buf + iVar6 + -0x44));
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(local_38.y);
|
|
local_24 = GHIDRA_CAST<uint32_t *>(local_38.x);
|
|
if ((isLilithIncubus == 0) &&
|
|
((this->_collidesWithGrid == 0 ||
|
|
(pVVar3 = (GHIDRA_CAST<Vector *>((&local_38)))->Vector::Normalized(&local_2c),
|
|
pVVar3->y * (this->_gridCollisionNormal).y + (this->_gridCollisionNormal).x * pVVar3->x
|
|
<= 0.45)))) {
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>((this->_velocity).x);
|
|
local_2c.y = (this->_velocity).y;
|
|
fVar11 = sqrtf((float)local_30 * (float)local_30 + local_2c.y * local_2c.y);
|
|
if (17.0 <= fVar11) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (0.0 < fVar11) {
|
|
(this->_velocity).x = (float)local_30 * (17.0 / fVar11);
|
|
(this->_velocity).y = local_2c.y * (17.0 / fVar11);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
pEVar13 = local_20;
|
|
collisionPoint = (this->_collisionPoints)._begin;
|
|
local_38.y = (float)(GHIDRA_INT((this->_collisionPoints)._end) - GHIDRA_INT(collisionPoint) >> 3);
|
|
local_1c.y = 0.0;
|
|
if (GHIDRA_CAST<uint32_t *>(local_38.y) != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
pVVar7 = &this->_pos;
|
|
pVVar3 = &this->_pos;
|
|
local_2c.y = (float)g_game->_room;
|
|
do {
|
|
iVar9 = GHIDRA_INT(((((float)local_24 + pVVar3->x + *collisionPoint) - 40.0) / 40.0 + 0.5));
|
|
iVar6 = GHIDRA_INT(((((float)local_30 + pVVar7->y + collisionPoint[1]) - 120.0) / 40.0 + 0.5));
|
|
if (-1 < iVar9) {
|
|
if (((((iVar9 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Familiar *>(local_2c.y)))) + 0xc))))) && (-1 < iVar6))
|
|
&& (this = local_20, iVar6 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Familiar *>(local_2c.y)))) + 0x10))))
|
|
)) && ((uVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Familiar *>(local_2c.y)))) + 0xc)))) * iVar6 +
|
|
iVar9, uVar4 < 0x1c0 &&
|
|
(door = *(GridEntity_Door **)
|
|
(((GHIDRA_CAST<Entity_Familiar *>(local_2c.y))->_sprite)._filename._buf +
|
|
uVar4 * 4 + -0x24), door != GHIDRA_CAST<GridEntity_Door *>(0x0))))) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) == 0x10)) {
|
|
this = pEVar13;
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x8)))) == 3) &&
|
|
(iVar6 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::get_secret_exit_kind(), iVar6 == 4)) &&
|
|
(bVar2 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryBlowOpen(0,GHIDRA_CAST<Entity *>(pEVar13)), bVar2 != 0)) {
|
|
pEVar13->_entityGridCollisionClass = 0;
|
|
pEVar13->_fireCooldown = -3;
|
|
(pEVar13->_velocity).x = (float)local_24;
|
|
(pEVar13->_velocity).y = (float)local_30;
|
|
fVar11 = pEVar13->_speedMultiplier;
|
|
fVar12 = (pEVar13->_velocity).x;
|
|
(pEVar13->_pos).y = (float)local_30 * fVar11 + (pEVar13->_pos).y;
|
|
(pEVar13->_pos).x = fVar11 * fVar12 + (pEVar13->_pos).x;
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((pEVar13->_player)))->Entity_Player::HasCollectible(0x272,0);
|
|
if (bVar2 == 0) {
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x272,
|
|
GHIDRA_CAST<RNG **>(&g_game->_playerManager),0);
|
|
}
|
|
else {
|
|
player = pEVar13->_player;
|
|
}
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::RemoveCollectible(0x272,0,0,1);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((pEVar13->_player)))->Entity_Player::HasCollectible(0x273,0);
|
|
if (bVar2 == 0) {
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x273,
|
|
GHIDRA_CAST<RNG **>(&g_game->_playerManager),0);
|
|
}
|
|
else {
|
|
player = pEVar13->_player;
|
|
}
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::RemoveCollectible(0x273,0,0,1);
|
|
}
|
|
goto LAB_00618228;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
local_1c.y = (float)(GHIDRA_INT(local_1c.y) + 1);
|
|
collisionPoint = collisionPoint + 2;
|
|
} while (GHIDRA_UINT(local_1c.y) < GHIDRA_UINT(local_38.y));
|
|
}
|
|
bVar2 = IsLilithBirthrightIncubus(this);
|
|
if (bVar2 == 0) {
|
|
this->_entityCollisionClass = 0;
|
|
this->_entityGridCollisionClass = 0;
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&this->_gridCollisionNormal)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar2 == 0) {
|
|
if (ABS((float)local_30) < ABS((float)local_24)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("HitSide"),0);
|
|
(this->_sprite)._flipX = (float)local_24 < 0.0;
|
|
}
|
|
else {
|
|
animName = "HitDown";
|
|
if ((float)local_30 < 0.0) {
|
|
animName = "HitUp";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(animName),0);
|
|
}
|
|
manager = g_manager;
|
|
(this->_targetPosition).x = (this->_pos).x;
|
|
(this->_targetPosition).y = (this->_pos).y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0xcd);
|
|
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);
|
|
this->_fireCooldown = -2;
|
|
}
|
|
else {
|
|
this->_fireCooldown = 0x1e;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (((this->_collidesWithGrid != 0) || (this->_fireCooldown < -1)) ||
|
|
(bVar2 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsPositionInRoom(&this->_pos,-100.0), bVar2 == 0)) {
|
|
bVar2 = IsLilithBirthrightIncubus(this);
|
|
game = g_game;
|
|
if (bVar2 == 0) {
|
|
this->_entityGridCollisionClass = 0;
|
|
room = game->_room;
|
|
iVar6 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&local_20->_pos);
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(local_20->_player);
|
|
(GHIDRA_CAST<Room *>((room)))->Room::DamageGridWithSource(iVar6,1,&sourceRef);
|
|
(local_20->_velocity).x = (local_20->_velocity).x * 0.5;
|
|
(local_20->_velocity).y = (local_20->_velocity).y * 0.5;
|
|
local_20->_fireCooldown = local_20->_fireCooldown + -1;
|
|
this = local_20;
|
|
if (local_20->_fireCooldown < -10) {
|
|
local_20->_fireCooldown = 0x1e;
|
|
}
|
|
}
|
|
}
|
|
this->_entityCollisionClass = (this->_variant == 0x68) + 3;
|
|
}
|
|
LAB_00618228:
|
|
if (isLilithIncubus == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
FollowParent(this);
|
|
umbilicalWhip = get_incubus_umbilical_whip(this);
|
|
if (umbilicalWhip == GHIDRA_CAST<Entity *>(0x0)) {
|
|
this->_fireCooldown = 0x1e;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
FollowParent(this);
|
|
iVar6 = this->_variant;
|
|
if (iVar6 == 0x82) {
|
|
fVar11 = (this->_velocity).y;
|
|
fVar12 = (this->_velocity).x;
|
|
if (4.0 < fVar12 * fVar12 + fVar11 * fVar11) {
|
|
iVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::get_velocity_direction();
|
|
sprite = &this->_sprite;
|
|
if (iVar6 == 3) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
}
|
|
else {
|
|
if (iVar6 != 1) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatSide"),0);
|
|
bVar10 = iVar6 == 0;
|
|
goto LAB_006185e8;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatUp"),0);
|
|
}
|
|
}
|
|
}
|
|
else if (iVar6 == 0xe8) {
|
|
iVar6 = (g_game->_stage + 1) * 100;
|
|
if (0x4b0 < iVar6) {
|
|
iVar6 = 0x4b0;
|
|
}
|
|
if ((((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0) ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_game)) + 0x188f8))) != '\0')) ||
|
|
((this->_coins < iVar6 ||
|
|
(fVar11 = (this->_velocity).y, fVar12 = (this->_velocity).x,
|
|
400.0 <= fVar12 * fVar12 + fVar11 * fVar11)))) {
|
|
pvVar1 = (this->_sprite)._animState._animData;
|
|
if (((pvVar1 == (void *)0x0) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x34)) != '\0')) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
uVar4 = g_game->_stage * 200;
|
|
local_38.y = 0.0;
|
|
local_2c.y = 4.2039e-45;
|
|
if (0x4b0 < GHIDRA_INT(uVar4)) {
|
|
uVar4 = 0x4b0;
|
|
}
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>((this->_coins / GHIDRA_INT((uVar4 >> 2))));
|
|
collisionPoint = &local_38.y;
|
|
if (-1 < GHIDRA_INT(local_30)) {
|
|
collisionPoint = GHIDRA_CAST<float *>(&local_30);
|
|
}
|
|
chargeLevelPtr = &local_2c.y;
|
|
if (GHIDRA_INT(*collisionPoint) < 4) {
|
|
chargeLevelPtr = collisionPoint;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play((&PTR_DAT_00b648e0)[GHIDRA_INT(*chargeLevelPtr)],0);
|
|
}
|
|
}
|
|
else {
|
|
iVar6 = g_game->_currentRoomIdx;
|
|
if ((((iVar6 != -0x14) && (iVar6 != -0x12)) && (iVar6 != -0xd)) &&
|
|
(((iVar6 != -4 && (iVar6 != -6)) && (iVar6 != -0x13)))) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Spawn,0);
|
|
bVar2 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::IsEventTriggered("Shoot");
|
|
if (bVar2 != 0) {
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&local_2c,&this->_pos,0.0,0,0,1);
|
|
manager = g_manager;
|
|
this->_coins = 0;
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x10c);
|
|
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);
|
|
game = g_game;
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1
|
|
)) {
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = 0xffffffff;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
roomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(game->_currentDimensionIdx) < 3) {
|
|
roomDesc = game->_roomList + 0x20e;
|
|
}
|
|
roomDesc->Flags = roomDesc->Flags | 0x20000;
|
|
collectibleRng = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetCollectibleRNG(0x2a9);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((collectibleRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xa1,&local_2c,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x3d4,uVar4);
|
|
game = g_game;
|
|
this->_subtype = 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x188f8))) = 1;
|
|
}
|
|
}
|
|
}
|
|
if ((this->_fireCooldown < 1) &&
|
|
(bVar2 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_ne(&g_vectorZero), bVar2 != 0)) {
|
|
local_1c.x = *extraout_ECX;
|
|
local_1c.y = extraout_ECX[1];
|
|
local_24 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
}
|
|
}
|
|
else if (((iVar6 == 0xd5) || (iVar6 == 0xd6)) || (iVar6 == 0xdf)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
fVar11 = (this->_velocity).x;
|
|
FUN_0058e210();
|
|
if ((*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(in_XMM0)) + 0x0))) != 0.0) {
|
|
bVar10 = fVar11 < 0.0;
|
|
LAB_006185e8:
|
|
(this->_sprite)._flipX = bVar10;
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("Float"));
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Float"),0);
|
|
}
|
|
}
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
if (isLilithIncubus != 0) {
|
|
this->_fireCooldown = 0;
|
|
}
|
|
if (((local_24 != GHIDRA_CAST<uint32_t *>(0xffffffff)) && (iVar6 = this->_variant, iVar6 != 0xd5)) &&
|
|
(iVar6 != 0xd6)) {
|
|
if (iVar6 != 0x82) {
|
|
(this->_sprite)._flipX = local_24 == GHIDRA_CAST<uint32_t *>(0x0);
|
|
}
|
|
isNoOtherCharging = '\x01';
|
|
if (iVar6 == 0x3b) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(entityList),3,0x3b,-1,1
|
|
,0);
|
|
uVar4 = 0;
|
|
local_8 = 5;
|
|
if (puStack_4c != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
do {
|
|
iVar6 = __RTDynamicCast(*GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entityList)) + 0x4))) + uVar4 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
if (((*GHIDRA_CAST<char *>((iVar6 + 0x172)) != '\0') && (*GHIDRA_CAST<int *>((iVar6 + 0xd4c)) < 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar6 + 0x30)) == 0)) {
|
|
isNoOtherCharging = '\0';
|
|
break;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < puStack_4c);
|
|
}
|
|
if (entityList[0] == '\0') {
|
|
local_8 = 6;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)entityList)) + 0x4))),0);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
if (this->_variant == 0xe8) {
|
|
if (((this->_targetPosition).x == g_vectorZero.x) &&
|
|
((this->_targetPosition).y == g_vectorZero.y)) {
|
|
isFiring = '\0';
|
|
}
|
|
else {
|
|
if (0 < this->_fireCooldown) goto LAB_00618988;
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
isFiring = '\x01';
|
|
}
|
|
}
|
|
else {
|
|
isFiring = isNoOtherCharging;
|
|
}
|
|
if ((this->_fireCooldown < 1) && (isFiring != '\0')) {
|
|
iVar6 = this->_variant;
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x41200000);
|
|
if (iVar6 == 0x68) {
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x40400000);
|
|
}
|
|
else if (iVar6 == 0xdf) {
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x41880000);
|
|
}
|
|
this->_fireCooldown = -1;
|
|
if (isLilithIncubus == 0) {
|
|
if ((iVar6 == 0x82) || (iVar9 = 4, iVar6 == 0xdf)) {
|
|
iVar9 = 3;
|
|
}
|
|
}
|
|
else {
|
|
iVar9 = 0;
|
|
}
|
|
this->_entityGridCollisionClass = iVar9;
|
|
pVVar3 = &this->_velocity;
|
|
pvVar1 = this->_player;
|
|
velocityX = local_1c.x * (float)local_30;
|
|
pVVar3->x = velocityX;
|
|
(this->_velocity).y = local_1c.y * (float)local_30;
|
|
fVar11 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x360));
|
|
fVar12 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x364));
|
|
if ((local_24 == GHIDRA_CAST<uint32_t *>(0x0)) || (local_24 == GHIDRA_CAST<uint32_t *>(0x2))) {
|
|
fVar11 = 0.0;
|
|
}
|
|
else {
|
|
fVar12 = 0.0;
|
|
}
|
|
if (this->_variant == 0x68) {
|
|
fVar12 = fVar12 * 0.2;
|
|
velocityX = fVar11 * 0.2 + fVar11 * 0.2 + velocityX;
|
|
pVVar3->x = velocityX;
|
|
}
|
|
else {
|
|
fVar12 = fVar12 * 0.6;
|
|
velocityX = fVar11 * 0.6 + fVar11 * 0.6 + velocityX;
|
|
pVVar3->x = velocityX;
|
|
}
|
|
fVar11 = fVar12 + fVar12 + local_1c.y * (float)local_30;
|
|
(this->_velocity).y = fVar11;
|
|
if (fVar11 * fVar11 + velocityX * velocityX < (float)local_30 * (float)local_30) {
|
|
pVVar7 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::Normalized(&scratchVec);
|
|
fVar11 = pVVar7->y;
|
|
pVVar3->x = (float)local_30 * pVVar7->x;
|
|
(this->_velocity).y = (float)local_30 * fVar11;
|
|
}
|
|
iVar6 = this->_variant;
|
|
this->_friction = 1.0;
|
|
if (iVar6 == 0x82) {
|
|
if (this->_target != 0) {
|
|
local_38.y = (float)&this->_target;
|
|
msvc::multiset<unsigned_int>::erase(&local_38.y);
|
|
iVar6 = this->_variant;
|
|
}
|
|
this->_target = 0;
|
|
}
|
|
manager = g_manager;
|
|
if (iVar6 == 0x68) {
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x343);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_30));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_30),1.0,0x1c2,0,1.0,0.0);
|
|
iVar6 = this->_variant;
|
|
}
|
|
manager = g_manager;
|
|
if (iVar6 == 3) {
|
|
local_30 = GHIDRA_CAST<Entity_Familiar *>(0x351);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_30));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_30),1.0,0x1c2,0,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
LAB_00618988:
|
|
iVar6 = 0;
|
|
if (this->_variant == 0x82) {
|
|
iVar6 = 4;
|
|
}
|
|
this->_entityCollisionClass = iVar6;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00619270
|
|
void Entity_Familiar::ai_auto_shooter()
|
|
{
|
|
Vector *pVVar1;
|
|
uint64_t qVar2;
|
|
uint8_t bVar3;
|
|
char isLastRef;
|
|
int iVar4;
|
|
Entity_Tear *tear;
|
|
LayerState *layer;
|
|
int *texture;
|
|
uint64_t *allocCounter;
|
|
uint8_t *anim;
|
|
float fVar5;
|
|
Entity *pEVar6;
|
|
uint32_t uVar7;
|
|
TypeDescriptor *pTVar8;
|
|
TypeDescriptor *pTVar9;
|
|
char *anim_00;
|
|
uint32_t uVar10;
|
|
EntityList_EL enemyList;
|
|
Vector local_24;
|
|
Vector local_1c;
|
|
Entity *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t blockSize;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6b15;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
FollowParent(this);
|
|
iVar4 = apply_forgotten_lullaby(this,10);
|
|
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(iVar4,0);
|
|
if (bVar3 != 0) {
|
|
local_14 = GHIDRA_CAST<Entity *>(0x0);
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&enemyList,&this->_pos,150.0,8);
|
|
local_8 = 0;
|
|
local_1c.y = 0.0;
|
|
if ((float)enemyList._size != 0.0) {
|
|
do {
|
|
pEVar6 = *GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(enemyList)) + 0x4))) + GHIDRA_INT(local_1c.y) * 4));
|
|
bVar3 = (GHIDRA_CAST<Entity *>((pEVar6)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar3 != 0) &&
|
|
(((GHIDRA_CAST<Entity *>(this->_spawnerEntity) == GHIDRA_CAST<Entity *>(0x0) ||
|
|
(bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_spawnerEntity))))->Entity::IsDescendantOf(pEVar6), bVar3 == 0)) &&
|
|
((pEVar6->_flags & 0x20000010) == 0)))) {
|
|
local_24.y = (pEVar6->_pos).y;
|
|
local_24.x = (pEVar6->_pos).x;
|
|
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&this->_pos,&local_24,3,900,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar3 != 0) {
|
|
local_14 = pEVar6;
|
|
}
|
|
}
|
|
local_1c.y = (float)(GHIDRA_INT(local_1c.y) + 1);
|
|
} while (GHIDRA_UINT(local_1c.y) < GHIDRA_UINT(enemyList._size));
|
|
if (local_14 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
iVar4 = 0;
|
|
local_1c.y = (local_14->_pos).x - (this->_pos).x;
|
|
local_14 = GHIDRA_CAST<Entity *>(((local_14->_pos).y - (this->_pos).y));
|
|
if (ABS(local_1c.y) <= ABS((float)local_14)) {
|
|
iVar4 = GHIDRA_UINT((0.0 < (float)local_14)) * 2 + 1;
|
|
}
|
|
else if (0.0 < local_1c.y) {
|
|
iVar4 = 2;
|
|
}
|
|
this->_headFrameDelay = 0xc;
|
|
PlayShootAnim(this,iVar4);
|
|
local_24.y = (float)Random();
|
|
fVar5 = sqrtf(local_1c.y * local_1c.y + (float)local_14 * (float)local_14);
|
|
pEVar6 = local_14;
|
|
if (0.0 < fVar5) {
|
|
local_1c.y = local_1c.y * (1.0 / fVar5);
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((float)local_14 * (1.0 / fVar5)));
|
|
}
|
|
local_1c.x = local_1c.y * 8.0;
|
|
local_1c.y = (float)pEVar6 * 8.0;
|
|
uVar10 = 0;
|
|
pTVar9 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor;
|
|
pTVar8 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar7 = 0;
|
|
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&this->_pos,&local_1c,GHIDRA_CAST<Entity *>(this),0,GHIDRA_UINT(local_24.y));
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast(pEVar6,uVar7,pTVar8,pTVar9,uVar10));
|
|
tear->_fallingSpeed = 1.2;
|
|
local_24.y = apply_tear_modifiers(this);
|
|
fVar5 = apply_tear_modifiers(this);
|
|
local_1c.y = fVar5 * 0.35 + 0.55;
|
|
tear->SetCollisionDamage(local_24.y * 3.0);
|
|
local_24.y = local_1c.y;
|
|
local_1c.y = 0.01;
|
|
pVVar1 = &local_24;
|
|
if (local_24.y <= 0.01) {
|
|
pVVar1 = &local_1c;
|
|
}
|
|
fVar5 = pVVar1->y;
|
|
tear->_baseScale = fVar5;
|
|
tear->_fScale = fVar5;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
TryFireTear(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
}
|
|
}
|
|
mongo_baby_pick_next_mimic(this);
|
|
local_8 = 0xffffffff;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(enemyList)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(enemyList)) + 0x4))) != 0) {
|
|
blockSize = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(enemyList)) + 0x4))) + -4));
|
|
qVar2 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < blockSize));
|
|
free((void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(enemyList)) + 0x4))) + -4));
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
}
|
|
if (0 < this->_headFrameDelay) {
|
|
this->_headFrameDelay = this->_headFrameDelay + -1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar4 = this->_variant;
|
|
if (iVar4 != 0x58) {
|
|
if (iVar4 == 0xce) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
texture = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(&local_24);
|
|
local_8 = 2;
|
|
anim = s_Idle2;
|
|
if (*GHIDRA_CAST<uint32_t *>((*texture + 0x10)) < 0x81) {
|
|
anim = s_Idle;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(anim,0);
|
|
local_8 = 3;
|
|
if (((GHIDRA_CAST<int *>(local_24.y) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*GHIDRA_CAST<int *>(local_24.y) + 0xc))(), isLastRef != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(&local_24);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 == 0xed) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (iVar4 != 0xee) {
|
|
(this->_sprite)._flipX = 0;
|
|
if (iVar4 == 0x4c) {
|
|
anim_00 = "Float";
|
|
}
|
|
else if (((iVar4 == 6) || (iVar4 == 0x35)) ||
|
|
((iVar4 != 0x6d || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x162c)) == -1)))) {
|
|
anim_00 = "FloatDown";
|
|
}
|
|
else {
|
|
anim_00 = "StoppedDown";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim_00),0);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0061a240
|
|
void Entity_Familiar::ai_blue_babys_only_friend()
|
|
{
|
|
Vector *pVVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
float fVar4;
|
|
Vector local_18;
|
|
Vector local_10;
|
|
Game *game;
|
|
float velX;
|
|
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetShootingJoystick(&local_10);
|
|
fVar2 = local_10.x;
|
|
if (this->_collidesWithGrid != 0) {
|
|
(this->_velocity).x = (this->_velocity).x * 0.88;
|
|
(this->_velocity).y = (this->_velocity).y * 0.88;
|
|
}
|
|
fVar4 = 0.0;
|
|
if (local_10.x == 0.0) {
|
|
if (local_10.y == 0.0) goto LAB_0061a315;
|
|
LAB_0061a2e5:
|
|
if (local_10.x != 0.0) goto LAB_0061a315;
|
|
fVar4 = (this->_velocity).y;
|
|
(this->_velocity).x = (this->_velocity).x * 0.5;
|
|
}
|
|
else {
|
|
if (local_10.y != 0.0) goto LAB_0061a2e5;
|
|
fVar4 = (this->_velocity).x;
|
|
(this->_velocity).y = (this->_velocity).y * 0.5;
|
|
}
|
|
fVar4 = ABS(fVar4);
|
|
LAB_0061a315:
|
|
game = g_game;
|
|
fVar3 = (this->_velocity).y;
|
|
velX = (this->_velocity).x;
|
|
local_18.x = 0.0;
|
|
local_10.x = -(fVar3 * local_10.y + velX * local_10.x) * 0.2;
|
|
pVVar1 = &local_10;
|
|
if (local_10.x <= 0.0) {
|
|
pVVar1 = &local_18;
|
|
}
|
|
fVar4 = (fVar4 * 0.3 * 0.1 + pVVar1->x + 3.0) * 0.8;
|
|
(this->_velocity).y = (fVar4 * local_10.y + fVar3) * 0.775;
|
|
(this->_velocity).x = (fVar4 * fVar2 + velX) * 0.775;
|
|
Room::GetClampedPositionImpl(game->_room,&local_18,&this->_pos,0.0,0.0,0.0,0.0);
|
|
local_10.x = local_18.x - (this->_pos).x;
|
|
local_18.x = local_18.y - (this->_pos).y;
|
|
if ((local_10.x != g_vectorZero.x) || (local_18.x != g_vectorZero.y)) {
|
|
fVar2 = sqrtf(local_18.x * local_18.x + local_10.x * local_10.x);
|
|
if (0.0 < fVar2) {
|
|
local_10.x = local_10.x * (1.0 / fVar2);
|
|
local_18.x = local_18.x * (1.0 / fVar2);
|
|
}
|
|
fVar2 = (this->_velocity).x;
|
|
fVar4 = this->_speedMultiplier;
|
|
fVar3 = -(local_18.x * (this->_velocity).y + fVar2 * local_10.x);
|
|
if (fVar3 <= 1.0) {
|
|
fVar3 = 1.0;
|
|
}
|
|
if (10.0 <= fVar3) {
|
|
fVar3 = 10.0;
|
|
}
|
|
(this->_velocity).x = local_10.x * fVar3 * fVar4 + fVar2;
|
|
(this->_velocity).y = local_18.x * fVar3 * fVar4 + (this->_velocity).y;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0061a4e0
|
|
void Entity_Familiar::ai_pickup_sack()
|
|
{
|
|
uint32_t *puVar1;
|
|
void **ppvVar2;
|
|
code *pcVar3;
|
|
Vector targetPos;
|
|
uint8_t bVar4;
|
|
Entity *pEVar5;
|
|
uint8_t *curAnimName;
|
|
uint32_t uVar6;
|
|
int *piVar7;
|
|
Entity *shot;
|
|
int spawnsLeft;
|
|
int iVar8;
|
|
uint32_t variantRoll;
|
|
uint8_t *curAnimNameChar;
|
|
char *targetAnimNameChar;
|
|
uint8_t *spawnAnimNameChar;
|
|
uint64_t *allocatedBytes;
|
|
RNG *dropRng;
|
|
bool bVar9;
|
|
float fVar10;
|
|
float fVar11;
|
|
int *dirY;
|
|
Vector dropPos;
|
|
Vector heartPos;
|
|
Vector cardPos;
|
|
Vector pillPos;
|
|
Vector pickupPos;
|
|
EntityList_EL familiars;
|
|
EntityList_EL nearbyPickups;
|
|
Vector dropMidpoint;
|
|
Vector heartMidpoint;
|
|
Vector cardMidpoint;
|
|
Vector pillMidpoint;
|
|
Vector spiderMidpoint;
|
|
Vector pickupMidpoint;
|
|
Vector local_30;
|
|
float local_28 [2];
|
|
ItemPool *local_20;
|
|
float local_1c;
|
|
int *local_18;
|
|
int *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
float local_8;
|
|
Game *game;
|
|
Manager *manager;
|
|
Entity_Familiar *otherFamiliar;
|
|
uint64_t prevAllocatedBytes;
|
|
int target;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00af6b95;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
target = this->_target;
|
|
puVar1 = &this->_target;
|
|
if ((target == 0) || (*GHIDRA_CAST<char *>((target + 0x173)) != '\0')) {
|
|
local_18 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_14 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
local_1c = 80.0;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,-1,-1,1,0);
|
|
local_8 = 0.0;
|
|
uVar6 = 0;
|
|
if (familiars._size != 0) {
|
|
do {
|
|
otherFamiliar = *GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + uVar6 * 4));
|
|
if (otherFamiliar->_exists != 0) {
|
|
target = otherFamiliar->_variant;
|
|
if ((((target == 0x18) || (target == 0x40)) || (target == 0x5a)) ||
|
|
((target == 0x66 || (target == 0x58)))) {
|
|
if (otherFamiliar == this) break;
|
|
local_18 = GHIDRA_CAST<int *>((otherFamiliar->_pos).x);
|
|
local_14 = GHIDRA_CAST<int *>((otherFamiliar->_pos).y);
|
|
local_1c = 50.0;
|
|
}
|
|
else if (otherFamiliar == this) break;
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < GHIDRA_UINT(familiars._size));
|
|
}
|
|
local_28[0] = (this->_pos).y;
|
|
local_14 = GHIDRA_CAST<int *>(((float)local_14 - local_28[0]));
|
|
local_18 = GHIDRA_CAST<int *>(((float)local_18 - (this->_pos).x));
|
|
local_28[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - local_28[0];
|
|
local_30.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - (this->_pos).x;
|
|
local_20 = (ItemPool *)
|
|
sqrtf((float)local_14 * (float)local_14 + (float)local_18 * (float)local_18);
|
|
fVar11 = sqrtf(local_28[0] * local_28[0] + local_30.y * local_30.y);
|
|
if (80.0 <= fVar11) {
|
|
if (local_1c < (float)local_20) {
|
|
(this->_velocity).x = ((float)local_18 / (float)local_20) * 0.8 + (this->_velocity).x;
|
|
(this->_velocity).y = ((float)local_14 / (float)local_20) * 0.8 + (this->_velocity).y;
|
|
}
|
|
}
|
|
else if ((((5 < this->_coins) || (2 < this->_hearts)) || (this->_state < this->_keys)) &&
|
|
(((this->_sprite)._animState._animData != (void *)0x0 &&
|
|
((this->_sprite)._animState._isPlaying != 0)))) {
|
|
curAnimName = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((curAnimName + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(curAnimName);
|
|
}
|
|
targetAnimNameChar = "FloatDown";
|
|
do {
|
|
bVar4 = *curAnimName;
|
|
bVar9 = bVar4 < (uint8_t)*targetAnimNameChar;
|
|
if (bVar4 != *targetAnimNameChar) {
|
|
LAB_0061a861:
|
|
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_0061a866;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimName[1];
|
|
bVar9 = bVar4 < (uint8_t)targetAnimNameChar[1];
|
|
if (bVar4 != targetAnimNameChar[1]) goto LAB_0061a861;
|
|
curAnimName = curAnimName + 2;
|
|
targetAnimNameChar = targetAnimNameChar + 2;
|
|
} while (bVar4 != 0);
|
|
uVar6 = 0;
|
|
LAB_0061a866:
|
|
if ((uVar6 == 0) &&
|
|
(bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("PreSpawn"),1), bVar4 != 0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
local_8 = -NAN;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) != 0) {
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar6;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar6));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + -4)));
|
|
}
|
|
local_8 = -NAN;
|
|
}
|
|
LAB_0061a925:
|
|
this->_friction = this->_friction * 0.8;
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(5,0);
|
|
if (bVar4 != 0) goto LAB_0061a950;
|
|
}
|
|
else {
|
|
local_18 = GHIDRA_CAST<int *>((*GHIDRA_CAST<float *>((target + 0x340)) - (this->_pos).y));
|
|
local_14 = GHIDRA_CAST<int *>((*GHIDRA_CAST<float *>((target + 0x33c)) - (this->_pos).x));
|
|
fVar11 = (float)local_18 * (float)local_18 + (float)local_14 * (float)local_14;
|
|
if (100.0 <= fVar11) {
|
|
fVar11 = sqrtf(fVar11);
|
|
piVar7 = local_14;
|
|
dirY = local_18;
|
|
if (0.0 < fVar11) {
|
|
dirY = GHIDRA_CAST<int *>(((float)local_18 * (1.0 / fVar11)));
|
|
piVar7 = GHIDRA_CAST<int *>(((float)local_14 * (1.0 / fVar11)));
|
|
}
|
|
(this->_velocity).x = (float)piVar7 * 1.1 + (this->_velocity).x;
|
|
(this->_velocity).y = (float)dirY * 1.1 + (this->_velocity).y;
|
|
goto LAB_0061a925;
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::collide_with_entity(__security_cookie ^ GHIDRA_UINT((local_28 + 9)));
|
|
pEVar5 = GHIDRA_CAST<Entity *>(*puVar1);
|
|
if (pEVar5->_dead == 0) {
|
|
if ((((pEVar5 != GHIDRA_CAST<Entity *>(0x0)) && (pEVar5->_type == 5)) && (pEVar5->_variant == 0x14)) &&
|
|
(pEVar5->_subtype == 6)) {
|
|
uVar6 = (GHIDRA_CAST<Entity *>((pEVar5)))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(&this->_hitList,uVar6);
|
|
if (*puVar1 != 0) {
|
|
local_18 = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
*puVar1 = 0;
|
|
}
|
|
goto LAB_0061a925;
|
|
}
|
|
if (pEVar5 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_14 = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*puVar1 = 0;
|
|
this->_friction = this->_friction * 0.8;
|
|
LAB_0061a950:
|
|
if (this->_target == 0) {
|
|
local_1c = 40000.0;
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&nearbyPickups,&this->_pos,200.0,0x10);
|
|
local_8 = 2.8026e-45;
|
|
local_14 = GHIDRA_CAST<int *>(0x0);
|
|
if (GHIDRA_CAST<int *>(nearbyPickups._size) != GHIDRA_CAST<int *>(0x0)) {
|
|
do {
|
|
target = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyPickups)) + 0x4))) + GHIDRA_INT(local_14) * 4));
|
|
if (*GHIDRA_CAST<int *>((target + 0x28)) == 5) {
|
|
pEVar5 = (Entity *)
|
|
__RTDynamicCast(target,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0);
|
|
target = this->_variant;
|
|
if (((((target == 0x18) || (target == 0x66)) && (pEVar5->_variant == 0x14)) ||
|
|
(((((target == 0x40 || (target == 0x66)) && (pEVar5->_variant == 10)) &&
|
|
((((iVar8 = pEVar5->_subtype, iVar8 == 1 || (iVar8 == 2)) || (iVar8 == 5)) ||
|
|
(iVar8 == 9)))) ||
|
|
(((target == 0x5a || (target == 0x66)) &&
|
|
((pEVar5->_variant == 0x1e && (pEVar5->_subtype != 2)))))))) &&
|
|
(((pEVar5->_dead == 0 && (pEVar5[1]._sprite._championColor._tint[2] == 0.0)) &&
|
|
(((bVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(&this->_hitList))))->EntityList::HitListContains(pEVar5),
|
|
bVar4 == 0 || ((pEVar5->_variant == 0x14 && (pEVar5->_subtype == 2)))) &&
|
|
(fVar11 = (pEVar5->_pos).x - (this->_pos).x,
|
|
fVar10 = (pEVar5->_pos).y - (this->_pos).y,
|
|
local_30.y = fVar10 * fVar10 + fVar11 * fVar11, local_30.y < local_1c)))))) {
|
|
puVar1 = &this->_target;
|
|
if (this->_target != 0) {
|
|
local_20 = GHIDRA_CAST<ItemPool *>(puVar1);
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*puVar1 = pEVar5;
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
local_1c = local_30.y;
|
|
}
|
|
}
|
|
local_14 = GHIDRA_CAST<int *>((GHIDRA_INT(local_14) + 1));
|
|
} while (local_14 < GHIDRA_UINT(nearbyPickups._size));
|
|
}
|
|
local_8 = -NAN;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(nearbyPickups)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyPickups)) + 0x4))) != 0) {
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyPickups)) + 0x4))) + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar6;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar6));
|
|
free((void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyPickups)) + 0x4))) + -4));
|
|
}
|
|
local_8 = -NAN;
|
|
}
|
|
}
|
|
}
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
LAB_0061b7e0:
|
|
curAnimName = (this->_sprite)._animState._animData;
|
|
if ((curAnimName != GHIDRA_CAST<uint8_t *>(0x0)) && ((this->_sprite)._animState._isPlaying == 0)) {
|
|
curAnimNameChar = curAnimName;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((curAnimName + 0x14))) {
|
|
curAnimNameChar = *GHIDRA_CAST<uint8_t **>(curAnimName);
|
|
}
|
|
spawnAnimNameChar = s_Spawn;
|
|
do {
|
|
bVar4 = *curAnimNameChar;
|
|
bVar9 = bVar4 < *spawnAnimNameChar;
|
|
if (bVar4 != *spawnAnimNameChar) {
|
|
LAB_0061b827:
|
|
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_0061b82c;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimNameChar[1];
|
|
bVar9 = bVar4 < spawnAnimNameChar[1];
|
|
if (bVar4 != spawnAnimNameChar[1]) goto LAB_0061b827;
|
|
curAnimNameChar = curAnimNameChar + 2;
|
|
spawnAnimNameChar = spawnAnimNameChar + 2;
|
|
} while (bVar4 != 0);
|
|
uVar6 = 0;
|
|
LAB_0061b82c:
|
|
if (uVar6 == 0) {
|
|
curAnimNameChar = curAnimName;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((curAnimName + 0x14))) {
|
|
curAnimNameChar = *GHIDRA_CAST<uint8_t **>(curAnimName);
|
|
}
|
|
targetAnimNameChar = "FloatDown";
|
|
do {
|
|
bVar4 = *curAnimNameChar;
|
|
bVar9 = bVar4 < (uint8_t)*targetAnimNameChar;
|
|
if (bVar4 != *targetAnimNameChar) {
|
|
LAB_0061b860:
|
|
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_0061b865;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimNameChar[1];
|
|
bVar9 = bVar4 < (uint8_t)targetAnimNameChar[1];
|
|
if (bVar4 != targetAnimNameChar[1]) goto LAB_0061b860;
|
|
curAnimNameChar = curAnimNameChar + 2;
|
|
targetAnimNameChar = targetAnimNameChar + 2;
|
|
} while (bVar4 != 0);
|
|
uVar6 = 0;
|
|
LAB_0061b865:
|
|
if (((uVar6 != 0) || (curAnimName[0x34] != 0)) &&
|
|
(bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("FloatDown"),1), bVar4 != 0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
curAnimName = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((curAnimName + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(curAnimName);
|
|
}
|
|
targetAnimNameChar = "PreSpawn";
|
|
do {
|
|
bVar4 = *curAnimName;
|
|
bVar9 = bVar4 < (uint8_t)*targetAnimNameChar;
|
|
if (bVar4 != *targetAnimNameChar) {
|
|
LAB_0061ab77:
|
|
uVar6 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_0061ab7c;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimName[1];
|
|
bVar9 = bVar4 < (uint8_t)targetAnimNameChar[1];
|
|
if (bVar4 != targetAnimNameChar[1]) goto LAB_0061ab77;
|
|
curAnimName = curAnimName + 2;
|
|
targetAnimNameChar = targetAnimNameChar + 2;
|
|
} while (bVar4 != 0);
|
|
uVar6 = 0;
|
|
LAB_0061ab7c:
|
|
if (uVar6 != 0) goto LAB_0061b7e0;
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Spawn,1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
local_28[0] = 0.0;
|
|
target = this->_variant;
|
|
if (target == 0x66) {
|
|
if (this->_coins < 6) {
|
|
if (this->_hearts < 3) goto LAB_0061b57f;
|
|
goto LAB_0061b0d0;
|
|
}
|
|
}
|
|
else if (target != 0x18) {
|
|
if (target != 0x40) {
|
|
if (target != 0x5a) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
LAB_0061b57f:
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (bVar4 == 0) {
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
(this->_dropRNG)._seed = uVar6;
|
|
iVar8 = this->_keys + -4;
|
|
target = 0;
|
|
if (0 < iVar8) {
|
|
target = iVar8;
|
|
}
|
|
uVar6 = uVar6 & 3;
|
|
}
|
|
else {
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
(this->_dropRNG)._seed = uVar6;
|
|
iVar8 = this->_keys + -3;
|
|
target = 0;
|
|
if (0 < iVar8) {
|
|
target = iVar8;
|
|
}
|
|
uVar6 = uVar6 % 3;
|
|
}
|
|
this->_state = uVar6 + 2;
|
|
this->_keys = target;
|
|
target = (this->_variant == 0x66) + 1;
|
|
while( true ) {
|
|
dropMidpoint.x = (this->_pos).x * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) * 0.5;
|
|
dropMidpoint.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) * 0.5 + (this->_pos).y * 0.5;
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&dropPos,&dropMidpoint,0.0,0,0,0);
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
(this->_dropRNG)._seed = uVar6;
|
|
variantRoll = uVar6;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
variantRoll = (this->_dropRNG)._seed;
|
|
}
|
|
if (variantRoll == 0) break;
|
|
variantRoll = variantRoll >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ variantRoll;
|
|
variantRoll = variantRoll << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ variantRoll;
|
|
variantRoll = variantRoll >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ variantRoll;
|
|
(this->_dropRNG)._seed = variantRoll;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,*GHIDRA_CAST<uint32_t *>((&DAT_00b62fd0 + (variantRoll % 3) * 4)),&dropPos,&g_vectorZero
|
|
,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
|
|
target = target + -1;
|
|
if (target == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
LAB_0061b0d0:
|
|
this->_hearts = this->_hearts + -3;
|
|
dropRng = &this->_dropRNG;
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
if ((uVar6 % 10 == 0) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0), bVar4 == 0)) {
|
|
this->_hearts = this->_hearts + -1;
|
|
}
|
|
manager = g_manager;
|
|
local_28[0] = 1.19531e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_28));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_28[0]),1.0,2,0,1.0,0.0);
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
local_20 = GHIDRA_CAST<ItemPool *>((uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f)));
|
|
uVar6 = GHIDRA_UINT(local_20) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
uVar6 = uVar6 % 5;
|
|
if (uVar6 != 0) {
|
|
if (uVar6 == 1) {
|
|
pillMidpoint.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) * 0.5 + (this->_pos).x * 0.5;
|
|
pillMidpoint.y = (this->_pos).y * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) * 0.5;
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&pillPos,&pillMidpoint,0.0,0,0,0);
|
|
uVar6 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x46,&pillPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar6);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (uVar6 == 2) {
|
|
cardMidpoint.x = (this->_pos).x * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) * 0.5;
|
|
cardMidpoint.y = (this->_pos).y * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) * 0.5;
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&cardPos,&cardMidpoint,0.0,0,0,0);
|
|
uVar6 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,300,&cardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar6);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
spawnsLeft = (this->_variant == 0x66) + 1;
|
|
local_20 = GHIDRA_CAST<ItemPool *>(spawnsLeft);
|
|
do {
|
|
heartMidpoint.x = (this->_pos).x * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) * 0.5;
|
|
heartMidpoint.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) * 0.5 + (this->_pos).y * 0.5;
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&heartPos,&heartMidpoint,0.0,0,0,0);
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
game = g_game;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::Spawn(5,10,&heartPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),6,uVar6);
|
|
spawnsLeft = spawnsLeft + -1;
|
|
} while (spawnsLeft != 0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
spiderMidpoint.x = (this->_pos).x * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) * 0.5;
|
|
spiderMidpoint.y = (this->_pos).y * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) * 0.5;
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&local_30,&spiderMidpoint,0.0,0,0,0);
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
if ((uVar6 & 1) == 0) {
|
|
pEVar5 = this->_player;
|
|
ppvVar2 = &pEVar5[4]._config;
|
|
*ppvVar2 = (void *)(GHIDRA_INT(*ppvVar2) + 1);
|
|
spawn_blue_spider(&local_30,pEVar5,&g_vectorZero);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(shot);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
targetPos.y = local_30.y;
|
|
targetPos.x = local_30.x;
|
|
Entity_NPC::ThrowSpider(&this->_pos,GHIDRA_CAST<Entity *>(this),targetPos,0,-30.0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar4 == 0) {
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
(this->_dropRNG)._seed = uVar6;
|
|
local_18 = GHIDRA_CAST<int *>(((uVar6 & 1) + 3));
|
|
}
|
|
else {
|
|
local_18 = GHIDRA_CAST<int *>(0x3);
|
|
}
|
|
if ((this->_coins < 10) || (this->_subtype != 0)) {
|
|
LAB_0061acb1:
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
dropRng = &this->_dropRNG;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
if (uVar6 != (uVar6 / 100) * 100) {
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
piVar7 = GHIDRA_CAST<int *>((uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6));
|
|
dropRng->_seed = GHIDRA_INT(piVar7);
|
|
local_14 = piVar7;
|
|
if ((GHIDRA_UINT(piVar7) & 1) == 0) {
|
|
if (piVar7 == GHIDRA_CAST<int *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
piVar7 = GHIDRA_CAST<int *>(dropRng->_seed);
|
|
if (piVar7 == GHIDRA_CAST<int *>(0x0)) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = GHIDRA_UINT(piVar7) >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ GHIDRA_UINT(piVar7);
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
local_14 = GHIDRA_CAST<int *>((uVar6 % 3));
|
|
piVar7 = local_14;
|
|
if (local_14 == GHIDRA_CAST<int *>(0x0)) {
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x16,0);
|
|
if ((bVar4 == 0) || (uVar6 = Random(), uVar6 % 5 == 0)) {
|
|
piVar7 = local_14;
|
|
}
|
|
else {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((dropRng)))->RNG::RandomInt(2);
|
|
piVar7 = GHIDRA_CAST<int *>((uVar6 + 1));
|
|
}
|
|
}
|
|
if (piVar7 == GHIDRA_CAST<int *>(0x0)) {
|
|
fVar11 = 1.4013e-44;
|
|
}
|
|
else if (piVar7 == GHIDRA_CAST<int *>(0x1)) {
|
|
fVar11 = 4.2039e-44;
|
|
}
|
|
else if (piVar7 == GHIDRA_CAST<int *>(0x2)) {
|
|
fVar11 = 5.60519e-44;
|
|
}
|
|
else {
|
|
fVar11 = 0.0;
|
|
}
|
|
}
|
|
else {
|
|
if (piVar7 == GHIDRA_CAST<int *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
local_14 = GHIDRA_CAST<int *>(dropRng->_seed);
|
|
if (local_14 == GHIDRA_CAST<int *>(0x0)) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = GHIDRA_UINT(local_14) >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ GHIDRA_UINT(local_14);
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
if (uVar6 == (uVar6 / 3) * 3) {
|
|
fVar11 = 4.90454e-43;
|
|
}
|
|
else {
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
switch(uVar6 & 3) {
|
|
case 0:
|
|
fVar11 = 9.80909e-44;
|
|
break;
|
|
case 1:
|
|
fVar11 = 4.2039e-43;
|
|
break;
|
|
default:
|
|
fVar11 = 1.26117e-43;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_0061af9a;
|
|
}
|
|
}
|
|
else {
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
(this->_dropRNG)._seed = uVar6;
|
|
if (uVar6 != (uVar6 / 3) * 3) goto LAB_0061acb1;
|
|
}
|
|
local_20 = &g_game->_itemPool;
|
|
local_30.y = 1.4013e-43;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = (this->_dropRNG)._seed;
|
|
}
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
(this->_dropRNG)._seed = uVar6;
|
|
local_28[0] = (float)ItemPool::GetCollectible(local_20,10,uVar6,0,0,0);
|
|
manager = g_manager;
|
|
local_18 = GHIDRA_CAST<int *>(0xa);
|
|
this->_subtype = 1;
|
|
local_1c = 3.75548e-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);
|
|
fVar11 = local_30.y;
|
|
LAB_0061af9a:
|
|
dropRng = &this->_dropRNG;
|
|
iVar8 = this->_coins - GHIDRA_INT(local_18);
|
|
target = 0;
|
|
if (0 < iVar8) {
|
|
target = iVar8;
|
|
}
|
|
this->_coins = target;
|
|
local_1c = (float)((this->_variant == 0x66) + 1);
|
|
do {
|
|
pickupMidpoint.x = (this->_pos).x * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) * 0.5;
|
|
pickupMidpoint.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) * 0.5 + (this->_pos).y * 0.5;
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&pickupPos,&pickupMidpoint,0.0,0,0,0);
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = dropRng->_seed;
|
|
if (uVar6 == 0) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
}
|
|
game = g_game;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar6;
|
|
dropRng->_seed = uVar6;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::Spawn(5,GHIDRA_UINT(fVar11),&pickupPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(local_28[0]),uVar6)
|
|
;
|
|
local_1c = (float)(GHIDRA_INT(local_1c) + -1);
|
|
} while (local_1c != 0.0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0061b8c0
|
|
void Entity_Familiar::ai_flying_bird()
|
|
{
|
|
uint8_t bVar1;
|
|
int *mapEntry;
|
|
uint8_t *curAnimName;
|
|
uint32_t uVar2;
|
|
char *animName;
|
|
uint8_t *idleAnimName;
|
|
bool isLess;
|
|
float fVar3;
|
|
float fVar4;
|
|
float acceleration;
|
|
float local_44 [2];
|
|
float local_3c;
|
|
float friction;
|
|
Color color;
|
|
uint8_t *animData;
|
|
Manager *manager;
|
|
int target;
|
|
|
|
acceleration = 1.0;
|
|
friction = 0.9;
|
|
if (this->_variant == 0xd2) {
|
|
PickEnemyTarget(this,360.0,0xd,4,&g_vectorZero,15.0);
|
|
acceleration = 0.8;
|
|
friction = 0.8;
|
|
LAB_0061b99b:
|
|
if (((this->_variant == 0x3f) && (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager))) &&
|
|
(this->_target != 0)) {
|
|
local_3c = *GHIDRA_CAST<float *>((this->_target + 0x20));
|
|
mapEntry = GHIDRA_CAST<int *>(std)::map<unsigned_int_4byte>::try_emplace(local_44,&local_3c);
|
|
if (599 < *GHIDRA_CAST<int *>((*mapEntry + 0x14))) {
|
|
local_3c = *GHIDRA_CAST<float *>((this->_target + 0x20));
|
|
mapEntry = GHIDRA_CAST<int *>(std)::map<unsigned_int_4byte>::try_emplace(local_44,&local_3c);
|
|
*GHIDRA_CAST<uint32_t *>((*mapEntry + 0x14)) = 0xfffffc7c;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
target = this->_target;
|
|
PickEnemyTarget(this,300.0,0xd,0,&g_vectorZero,15.0);
|
|
manager = g_manager;
|
|
if ((target != 0) || (this->_target == 0)) goto LAB_0061b99b;
|
|
if (this->_variant == 0x3f) {
|
|
local_44[0] = 1.20372e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_44));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_44[0]),1.0,0x1c2,0,1.0,0.0);
|
|
goto LAB_0061b99b;
|
|
}
|
|
}
|
|
target = this->_target;
|
|
if (target == 0) {
|
|
local_44[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - (this->_pos).y;
|
|
local_3c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - (this->_pos).x;
|
|
fVar4 = local_44[0] * local_44[0] + local_3c * local_3c;
|
|
if (6400.0 < fVar4) {
|
|
fVar4 = sqrtf(fVar4);
|
|
if (fVar4 <= 0.0) {
|
|
fVar4 = local_3c;
|
|
fVar3 = local_44[0];
|
|
}
|
|
else {
|
|
fVar3 = local_44[0] * (1.0 / fVar4);
|
|
fVar4 = (1.0 / fVar4) * local_3c;
|
|
}
|
|
goto LAB_0061bb14;
|
|
}
|
|
}
|
|
else {
|
|
local_44[0] = *GHIDRA_CAST<float *>((target + 0x33c)) - (this->_pos).x;
|
|
local_3c = *GHIDRA_CAST<float *>((target + 0x340)) - (this->_pos).y;
|
|
fVar3 = sqrtf(local_44[0] * local_44[0] + local_3c * local_3c);
|
|
if (fVar3 <= 0.0) {
|
|
fVar4 = local_44[0];
|
|
fVar3 = local_3c;
|
|
}
|
|
else {
|
|
fVar4 = local_44[0] * (1.0 / fVar3);
|
|
fVar3 = local_3c * (1.0 / fVar3);
|
|
}
|
|
LAB_0061bb14:
|
|
(this->_velocity).y = fVar3 * acceleration + (this->_velocity).y;
|
|
(this->_velocity).x = fVar4 * acceleration + (this->_velocity).x;
|
|
}
|
|
target = this->_variant;
|
|
if ((target == 0xe) || (target == 0xd2)) {
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
animName = "Flying";
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
isLess = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_0061bcd3:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0061bcd8;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
isLess = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_0061bcd3;
|
|
curAnimName = curAnimName + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_0061bcd8:
|
|
if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0061bd0b;
|
|
}
|
|
animName = "Flying";
|
|
}
|
|
else if (target == 0xf) {
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
animName = "FlyingTransparent";
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
isLess = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_0061bb92:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0061bb97;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
isLess = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_0061bb92;
|
|
curAnimName = curAnimName + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_0061bb97:
|
|
if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0061bd0b;
|
|
}
|
|
animName = "FlyingTransparent";
|
|
}
|
|
else {
|
|
if (target != 0x3c) {
|
|
if (target == 0x3f) {
|
|
animName = "FloatChase";
|
|
if (this->_target == 0) {
|
|
animName = "Float";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(animName),0);
|
|
(GHIDRA_CAST<Color *>((&color)))->Color::operator_assign(&(this->_sprite)._color);
|
|
if (this->_target == 0) {
|
|
fVar4 = 0.5;
|
|
}
|
|
else {
|
|
fVar4 = 1.0;
|
|
}
|
|
color._tint[3] = (fVar4 - color._tint[3]) * 0.15 + color._tint[3];
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(&color));
|
|
}
|
|
goto LAB_0061bd0b;
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
idleAnimName = s_Idle;
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
isLess = bVar1 < *idleAnimName;
|
|
if (bVar1 != *idleAnimName) {
|
|
LAB_0061bbf7:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0061bbfc;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
isLess = bVar1 < idleAnimName[1];
|
|
if (bVar1 != idleAnimName[1]) goto LAB_0061bbf7;
|
|
curAnimName = curAnimName + 2;
|
|
idleAnimName = idleAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_0061bbfc:
|
|
if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0061bd0b;
|
|
}
|
|
animName = GHIDRA_CAST<char *>(s_Idle);
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_0061bd0b:
|
|
fVar4 = (this->_velocity).x;
|
|
fVar3 = (this->_velocity).y;
|
|
(this->_sprite)._flipX = 0.0 < fVar4;
|
|
(this->_velocity).x = fVar4 * friction;
|
|
(this->_velocity).y = friction * fVar3;
|
|
return;
|
|
}
|
|
|
|
// 0061bd50
|
|
void Entity_Familiar::ai_daddy_longlegs()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *pbVar2;
|
|
uint32_t uVar3;
|
|
uint32_t rngResult;
|
|
char *anim;
|
|
uint8_t *pbVar4;
|
|
uint8_t *idleName;
|
|
bool bVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
float toTargetX;
|
|
float toTargetY;
|
|
float fVar8;
|
|
float chaseDirX;
|
|
double dVar9;
|
|
int target;
|
|
|
|
if (this->_fireCooldown == 0) {
|
|
PickEnemyTarget(this,365.0,0xd,0,&g_vectorZero,15.0);
|
|
target = this->_target;
|
|
if (target != 0) {
|
|
toTargetX = *GHIDRA_CAST<float *>((target + 0x33c)) - (this->_pos).x;
|
|
toTargetY = *GHIDRA_CAST<float *>((target + 0x340)) - (this->_pos).y;
|
|
fVar7 = (this->_velocity).x;
|
|
chaseDirX = (*GHIDRA_CAST<float *>((target + 0x360)) * 5.0 - fVar7 * 5.0) + toTargetX;
|
|
fVar8 = (*GHIDRA_CAST<float *>((target + 0x364)) * 5.0 - (this->_velocity).y * 5.0) + toTargetY;
|
|
fVar6 = sqrtf(chaseDirX * chaseDirX + fVar8 * fVar8);
|
|
if (0.0 < fVar6) {
|
|
chaseDirX = chaseDirX * (1.0 / fVar6);
|
|
fVar8 = fVar8 * (1.0 / fVar6);
|
|
}
|
|
(this->_velocity).y = fVar8 + (this->_velocity).y;
|
|
(this->_velocity).x = fVar7 + chaseDirX;
|
|
if (((toTargetY * toTargetY + toTargetX * toTargetX < 900.0) &&
|
|
((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
pbVar2 = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pbVar4 = s_Idle;
|
|
do {
|
|
bVar1 = *pbVar2;
|
|
bVar5 = bVar1 < *pbVar4;
|
|
if (bVar1 != *pbVar4) {
|
|
LAB_0061bee3:
|
|
uVar3 = -GHIDRA_UINT(bVar5) | 1;
|
|
goto LAB_0061bee8;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar2[1];
|
|
bVar5 = bVar1 < pbVar4[1];
|
|
if (bVar1 != pbVar4[1]) goto LAB_0061bee3;
|
|
pbVar2 = pbVar2 + 2;
|
|
pbVar4 = pbVar4 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_0061bee8:
|
|
if (uVar3 == 0) {
|
|
rngResult = Random();
|
|
anim = "StompArm";
|
|
if ((rngResult & 1) == 0) {
|
|
anim = "StompLeg";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim),(uint8_t)uVar3);
|
|
uVar3 = Random();
|
|
(this->_sprite)._flipX = ~(uint8_t)uVar3 & 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ((this->_target == 0) || (this->_fireCooldown - 1U < 0x62)) {
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - (this->_pos).y;
|
|
fVar6 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - (this->_pos).x;
|
|
fVar8 = fVar7 * fVar7 + fVar6 * fVar6;
|
|
if (6400.0 < fVar8) {
|
|
fVar8 = sqrtf(fVar8);
|
|
if (0.0 < fVar8) {
|
|
fVar6 = fVar6 * (1.0 / fVar8);
|
|
fVar7 = fVar7 * (1.0 / fVar8);
|
|
}
|
|
(this->_velocity).x = fVar6 + (this->_velocity).x;
|
|
(this->_velocity).y = fVar7 + (this->_velocity).y;
|
|
}
|
|
}
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
pbVar2 = (this->_sprite)._animState._animData;
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = pbVar2;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
idleName = s_Idle;
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar5 = bVar1 < *idleName;
|
|
if (bVar1 != *idleName) {
|
|
LAB_0061c020:
|
|
uVar3 = -GHIDRA_UINT(bVar5) | 1;
|
|
goto LAB_0061c025;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar5 = bVar1 < idleName[1];
|
|
if (bVar1 != idleName[1]) goto LAB_0061c020;
|
|
pbVar4 = pbVar4 + 2;
|
|
idleName = idleName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_0061c025:
|
|
if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0061c058;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_0061c058:
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
dVar9 = floor((double)(this->_sprite)._animState._animFrame);
|
|
if ((9 < GHIDRA_INT(dVar9)) && (GHIDRA_INT(dVar9) < 0x20)) {
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) ||
|
|
(target = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame(), target < 0x11)) {
|
|
target = 3;
|
|
}
|
|
else {
|
|
target = 0;
|
|
}
|
|
this->_entityCollisionClass = target;
|
|
fVar7 = (this->_velocity).x;
|
|
this->_fireCooldown = 100;
|
|
(this->_velocity).x = fVar7 * 0.5;
|
|
(this->_velocity).y = (this->_velocity).y * 0.5;
|
|
return;
|
|
}
|
|
}
|
|
fVar7 = (this->_velocity).x;
|
|
this->_entityCollisionClass = 0;
|
|
(this->_velocity).x = fVar7 * 0.9;
|
|
(this->_velocity).y = (this->_velocity).y * 0.9;
|
|
return;
|
|
}
|
|
|
|
// 0061c150
|
|
void Entity_Familiar::ai_orbital_variant_50()
|
|
{
|
|
int *damageEntry;
|
|
Vector *orbitPos;
|
|
float fVar1;
|
|
float speedScale;
|
|
Vector local_18;
|
|
Vector local_10;
|
|
int target;
|
|
|
|
if (this->_subtype == 1) {
|
|
PickEnemyTarget(this,200.0,0xd,0,&g_vectorZero,15.0);
|
|
}
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (this->_target != 0)) {
|
|
local_18.x = *GHIDRA_CAST<float *>((this->_target + 0x20));
|
|
damageEntry = GHIDRA_CAST<int *>(std)::map<unsigned_int_4byte>::try_emplace(&local_10,&local_18);
|
|
if (599 < *GHIDRA_CAST<int *>((*damageEntry + 0x14))) {
|
|
local_18.x = *GHIDRA_CAST<float *>((this->_target + 0x20));
|
|
damageEntry = GHIDRA_CAST<int *>(std)::map<unsigned_int_4byte>::try_emplace(&local_10,&local_18);
|
|
*GHIDRA_CAST<uint32_t *>((*damageEntry + 0x14)) = 0xfffffb50;
|
|
}
|
|
}
|
|
target = this->_target;
|
|
if (target == 0) {
|
|
if (this->_orbitLayer == -1) {
|
|
this->_orbitLayer = 1;
|
|
fVar1 = DAT_00c34148;
|
|
(this->_orbitDistance).x = DAT_00c34144;
|
|
(this->_orbitDistance).y = fVar1;
|
|
RecalculateOrbitOffset(this,1,1);
|
|
}
|
|
local_10.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_10.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
orbitPos = GetOrbitPosition(this,&local_18,&local_10);
|
|
local_18.x = orbitPos->x;
|
|
(this->_targetPosition).x = local_18.x;
|
|
local_10.x = orbitPos->y;
|
|
(this->_targetPosition).y = local_10.x;
|
|
local_10.x = local_10.x - (this->_pos).y;
|
|
local_18.x = local_18.x - (this->_pos).x;
|
|
fVar1 = sqrtf(local_10.x * local_10.x + local_18.x * local_18.x);
|
|
if (fVar1 < 20.0) {
|
|
(this->_velocity).x = local_18.x * 0.9;
|
|
(this->_velocity).y = local_10.x * 0.9;
|
|
}
|
|
}
|
|
else {
|
|
local_10.x = *GHIDRA_CAST<float *>((target + 0x33c));
|
|
fVar1 = *GHIDRA_CAST<float *>((target + 0x340));
|
|
(this->_targetPosition).x = local_10.x;
|
|
(this->_targetPosition).y = fVar1;
|
|
if (this->_orbitLayer < 0) goto LAB_0061c32f;
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
this->_orbitLayer = -1;
|
|
}
|
|
local_10.x = (this->_targetPosition).x;
|
|
LAB_0061c32f:
|
|
local_18.x = (this->_targetPosition).y - (this->_pos).y;
|
|
local_10.x = local_10.x - (this->_pos).x;
|
|
fVar1 = sqrtf(local_18.x * local_18.x + local_10.x * local_10.x);
|
|
if (fVar1 < 0.1) {
|
|
speedScale = 0.0;
|
|
}
|
|
else {
|
|
speedScale = fVar1 * 0.15;
|
|
if (2.0 <= speedScale) {
|
|
speedScale = 2.0;
|
|
}
|
|
speedScale = speedScale / fVar1;
|
|
}
|
|
(this->_velocity).x = local_10.x * speedScale + (this->_velocity).x;
|
|
(this->_velocity).y = local_18.x * speedScale + (this->_velocity).y;
|
|
this->_friction = this->_friction * 0.8;
|
|
return;
|
|
}
|
|
|
|
// 0061d6b0
|
|
void Entity_Familiar::ai_key_full()
|
|
{
|
|
uint32_t *puVar1;
|
|
GridEntity_Door *this_00;
|
|
int iVar2;
|
|
uint64_t qVar3;
|
|
uint8_t bVar4;
|
|
uint32_t uVar5;
|
|
LayerState *pLVar6;
|
|
uint8_t *pbVar7;
|
|
uint8_t *pbVar8;
|
|
Entity_Player *keyPieceOwner;
|
|
char *floatNameChar;
|
|
bool isLess;
|
|
float distY;
|
|
float local_18;
|
|
float doorTargetY;
|
|
Vector followTarget;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) != 0) {
|
|
uVar5 = 0;
|
|
do {
|
|
this_00 = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(g_game->_room) + uVar5 * 4 + 0x724));
|
|
if ((this_00 != GHIDRA_CAST<GridEntity_Door *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8)))) == 5)) {
|
|
if (this->_isFollower != 0) {
|
|
RemoveFromFollowers(this);
|
|
}
|
|
pbVar8 = (this->_sprite)._animState._animData;
|
|
if (pbVar8 == GHIDRA_CAST<uint8_t *>(0x0)) goto LAB_0061d7bc;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pbVar7 = s_Idle;
|
|
goto LAB_0061d784;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < 8);
|
|
}
|
|
if (this->_isFollower == 0) {
|
|
AddToFollowers(this);
|
|
}
|
|
pLVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
pLVar6->_rotation = 0.0;
|
|
pbVar8 = (this->_sprite)._animState._animData;
|
|
if (pbVar8 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar7 = pbVar8;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar7 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
floatNameChar = "Float";
|
|
do {
|
|
bVar4 = *pbVar7;
|
|
isLess = bVar4 < (uint8_t)*floatNameChar;
|
|
if (bVar4 != *floatNameChar) {
|
|
LAB_0061d9bd:
|
|
uVar5 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0061d9c2;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = pbVar7[1];
|
|
isLess = bVar4 < (uint8_t)floatNameChar[1];
|
|
if (bVar4 != floatNameChar[1]) goto LAB_0061d9bd;
|
|
pbVar7 = pbVar7 + 2;
|
|
floatNameChar = floatNameChar + 2;
|
|
} while (bVar4 != 0);
|
|
uVar5 = 0;
|
|
LAB_0061d9c2:
|
|
if ((uVar5 == 0) && ((pbVar8[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0061d9f5;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Float"),1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_0061d9f5:
|
|
FollowParent(this);
|
|
return;
|
|
while( true ) {
|
|
bVar4 = pbVar8[1];
|
|
isLess = bVar4 < pbVar7[1];
|
|
if (bVar4 != pbVar7[1]) goto LAB_0061d7a4;
|
|
pbVar8 = pbVar8 + 2;
|
|
pbVar7 = pbVar7 + 2;
|
|
if (bVar4 == 0) break;
|
|
LAB_0061d784:
|
|
bVar4 = *pbVar8;
|
|
isLess = bVar4 < *pbVar7;
|
|
if (bVar4 != *pbVar7) {
|
|
LAB_0061d7a4:
|
|
uVar5 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0061d7a9;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
}
|
|
uVar5 = 0;
|
|
LAB_0061d7a9:
|
|
if ((uVar5 != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((this->_sprite)._animState._isPlaying == 0)))) {
|
|
LAB_0061d7bc:
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
local_18 = ((float)(this_00->_gridIndex % iVar2) * 40.0 + 40.0) - 13.846154;
|
|
doorTargetY = ((float)(this_00->_gridIndex / iVar2) * 40.0 + 120.0) - 7.692308;
|
|
followTarget.x = local_18;
|
|
followTarget.y = doorTargetY;
|
|
FollowPosition(this,&followTarget);
|
|
pLVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
manager = g_manager;
|
|
if (pLVar6->_rotation < 90.0) {
|
|
local_18 = pLVar6->_rotation + 2.0;
|
|
if (90.0 <= local_18) {
|
|
local_18 = 90.0;
|
|
}
|
|
pLVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
pLVar6->_rotation = local_18;
|
|
return;
|
|
}
|
|
local_18 = (this->_pos).x - local_18;
|
|
distY = (this->_pos).y - doorTargetY;
|
|
if (9.0 <= distY * distY + local_18 * local_18) {
|
|
return;
|
|
}
|
|
local_18 = 2.85865e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_18));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18),1.0,2,0,1.0,0.0);
|
|
game = g_game;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8)))) != 4) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8)))) == 5) {
|
|
qVar3 = g_game->_gameStateFlags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 | 0x20000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar3);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8)))) = 8;
|
|
(GHIDRA_CAST<GridEntity_Door *>((this_00)))->GridEntity_Door::UpdateAnimation();
|
|
}
|
|
(GHIDRA_CAST<GridEntity_Door *>((this_00)))->GridEntity_Door::Open();
|
|
this->Remove();
|
|
keyPieceOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xee,GHIDRA_CAST<RNG **>(&g_game->_playerManager),0);
|
|
if (keyPieceOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Entity_Player *>((keyPieceOwner)))->Entity_Player::RemoveCollectible(0xee,0,0,1);
|
|
}
|
|
keyPieceOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xef,GHIDRA_CAST<RNG **>(&g_game->_playerManager),0);
|
|
if (keyPieceOwner == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((keyPieceOwner)))->Entity_Player::RemoveCollectible(0xef,0,0,1);
|
|
return;
|
|
}
|
|
|
|
// 0061da10
|
|
void Entity_Familiar::Update()
|
|
{
|
|
ColorMod color;
|
|
BitSet128 flags;
|
|
uint8_t bVar1;
|
|
char cVar2;
|
|
void *pvVar3;
|
|
int *otherFamiliar;
|
|
uint32_t uVar4;
|
|
RNG *rng;
|
|
ColorMod *fartColor;
|
|
ItemOverlay *itemOverlay;
|
|
Entity_Effect *effect;
|
|
KColor *spriteColor;
|
|
Entity_Laser *techLaser;
|
|
TearParams *pTVar5;
|
|
BitSet128 *scratchFlags;
|
|
uint32_t uVar6;
|
|
Entity_Bomb *bomb;
|
|
LayerState *layer;
|
|
EntityRef *sourceRef;
|
|
SoundEffects *sfx;
|
|
Entity_Tear *tear;
|
|
Entity_Player *listSize;
|
|
AnimationState *animState;
|
|
Entity_Familiar *local_EAX_25497;
|
|
char *animName;
|
|
EntityList *entityList;
|
|
uint32_t *puVar7;
|
|
TemporaryEffects *playerEffects;
|
|
int iVar8;
|
|
Vector *scratchVec2;
|
|
Vector *scratchVec;
|
|
Room *room;
|
|
GridEntity *gridEntity;
|
|
Vector *pVVar9;
|
|
float *pfVar10;
|
|
Game *game;
|
|
Entity *followTarget;
|
|
int *piVar11;
|
|
uint8_t *nextIndex;
|
|
code *virtualFn;
|
|
Entity_Player *sourceRef;
|
|
bool isEveryFourthState;
|
|
long double floatResult;
|
|
Entity_Familiar *in_XMM0_Da;
|
|
float fallVelocity;
|
|
float fVar13;
|
|
uint64_t projectileFlags;
|
|
uint32_t in_stack_fffffd0c;
|
|
uint32_t in_stack_fffffd10;
|
|
uint32_t in_stack_fffffd14;
|
|
uint32_t in_stack_fffffd18;
|
|
uint32_t in_stack_fffffd1c;
|
|
uint32_t in_stack_fffffd20;
|
|
EntityList_EL *in_stack_fffffd24;
|
|
void *in_stack_fffffd28;
|
|
uint32_t uVar14;
|
|
uint32_t uVar15;
|
|
int green;
|
|
int blue;
|
|
uint8_t addEnemyKillScore;
|
|
float fVar16;
|
|
BitSet128 notLudovicoFlags;
|
|
BitSet128 bombFlags;
|
|
BitSet128 flagsWithoutLudovico;
|
|
BitSet128 sourceTearFlagsCopy;
|
|
BitSet128 sourceLudovicoBits;
|
|
BitSet128 sourceTearFlags;
|
|
BitSet128 local_258;
|
|
BitSet128 local_248;
|
|
Vector local_238;
|
|
Vector local_230;
|
|
Vector local_228;
|
|
Vector local_220;
|
|
Vector local_218;
|
|
Vector local_210;
|
|
BitSet128 local_208;
|
|
Vector local_1f0;
|
|
Vector local_1e8;
|
|
Vector local_1e0;
|
|
Vector local_1d8;
|
|
Vector local_1d0;
|
|
Vector local_1c8;
|
|
Vector local_1c0;
|
|
BitSet128 local_1b8;
|
|
uint8_t local_1a4 [16];
|
|
Vector local_194;
|
|
Vector local_18c;
|
|
Vector local_184;
|
|
Vector local_17c;
|
|
Vector local_174;
|
|
Vector local_16c;
|
|
EntityList *local_164;
|
|
Vector local_160;
|
|
Vector local_158;
|
|
Vector local_150;
|
|
Vector local_148;
|
|
Vector local_140;
|
|
uint32_t local_134;
|
|
Vector local_130;
|
|
Vector local_128;
|
|
Entity_Familiar *local_120;
|
|
Entity_Familiar *local_11c;
|
|
Entity_Player *local_118;
|
|
Entity_Familiar *self;
|
|
TearParams local_110;
|
|
uint8_t local_a8 [12];
|
|
uint8_t idleAnimName [12];
|
|
BitSet128 local_90;
|
|
uint8_t local_78 [12];
|
|
char *pcStack_6c;
|
|
uint8_t local_68 [8];
|
|
Vector local_60;
|
|
uint8_t animNameBuf [4];
|
|
Color local_54;
|
|
uint32_t local_24;
|
|
float *pfStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float local_14;
|
|
Entity_Projectile *deflectedShot;
|
|
BitSet128 *flagsOperand;
|
|
uint8_t *gridIndexCounts;
|
|
ANM2 *sprite;
|
|
|
|
pfStack_20 = (&local_54)[1]._offset + 1;
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00af6c90;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT(((&local_54)[1]._colorize + 2));
|
|
ExceptionList = &local_1c;
|
|
self = this;
|
|
pfVar10 = (&local_54)[1]._offset + 1;
|
|
if (this->_variant != 900) {
|
|
fVar13 = 1.0;
|
|
pfVar10 = (&local_54)[1]._offset + 1;
|
|
if (this->_variant == 0xe7) {
|
|
in_stack_fffffd28 = this->_extraData;
|
|
in_stack_fffffd24 = GHIDRA_CAST<EntityList_EL *>(0x61da92);
|
|
__RTDynamicCast();
|
|
pvVar3 = get_item_config_entry(this);
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x78));
|
|
pfVar10 = pfStack_20;
|
|
if ((fVar13 == 1.0) && (piVar11 = this->_item, piVar11 != GHIDRA_CAST<int *>(0x0))) {
|
|
if ((*piVar11 == 2) && (piVar11[1] == 0xba)) {
|
|
bVar1 = 3;
|
|
}
|
|
else {
|
|
bVar1 = (uint8_t)piVar11[0x30];
|
|
}
|
|
if (bVar1 < 5) {
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_INT((&(g_manager->_itemConfig)._wispGfxRoot + 1)) + GHIDRA_UINT(bVar1) * 4));
|
|
}
|
|
else {
|
|
fVar13 = 1.0;
|
|
}
|
|
}
|
|
}
|
|
pfStack_20 = pfVar10;
|
|
in_XMM0_Da = GHIDRA_CAST<Entity_Familiar *>((fVar13 * g_vectorOne.x));
|
|
(this->_sprite)._scale.y = fVar13 * g_vectorOne.y;
|
|
(this->_sprite)._scale.x = (float)in_XMM0_Da;
|
|
pfVar10 = pfStack_20;
|
|
}
|
|
pfStack_20 = pfVar10;
|
|
game = g_game;
|
|
if (g_game->_frameCount - this->_spawnFrame < 2) {
|
|
iVar8 = this->_variant;
|
|
if ((((iVar8 == 0x62) || (iVar8 == 99)) || (iVar8 == 0x65)) ||
|
|
((iVar8 == 0x83 || (iVar8 == 0x6a)))) {
|
|
in_XMM0_Da = *GHIDRA_CAST<Entity_Familiar **>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = (float)in_XMM0_Da;
|
|
(this->_pos).y = fVar13;
|
|
}
|
|
if (this->_orbitLayer == 0) {
|
|
in_stack_fffffd24 = GHIDRA_CAST<EntityList_EL *>(local_68);
|
|
piVar11 = GHIDRA_CAST<int *>(0x0);
|
|
local_130.y = 0.0;
|
|
in_stack_fffffd28 = (void *)0x3;
|
|
in_stack_fffffd20 = 0x61dbab;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),in_stack_fffffd24,3,-1,-1,1,0);
|
|
local_14 = 0.0;
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (GHIDRA_CAST<char *>(local_60.y) != GHIDRA_CAST<char *>(0x0)) {
|
|
do {
|
|
in_stack_fffffd28 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))) + GHIDRA_INT(local_118) * 4);
|
|
in_stack_fffffd24 = GHIDRA_CAST<EntityList_EL *>(0x61dbd9);
|
|
otherFamiliar = GHIDRA_CAST<int *>(__RTDynamicCast());
|
|
if (((otherFamiliar != GHIDRA_CAST<int *>(0x0)) && ((void *)otherFamiliar[0x104] == this->_player)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(otherFamiliar) + 0x172)) != '\0' && (otherFamiliar[0x35c] == 0)))) {
|
|
local_130.y = (float)(GHIDRA_INT(local_130.y) + 1);
|
|
if ((piVar11 == GHIDRA_CAST<int *>(0x0)) && (otherFamiliar[0xb] == 0x21)) {
|
|
piVar11 = otherFamiliar;
|
|
}
|
|
}
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
} while (local_118 < GHIDRA_UINT(local_60.y));
|
|
if (3 < GHIDRA_INT(local_130.y)) {
|
|
if (this->_variant == 0x21) {
|
|
iVar8 = *GHIDRA_CAST<int *>(this);
|
|
}
|
|
else {
|
|
if (piVar11 == GHIDRA_CAST<int *>(0x0)) goto LAB_0061dc46;
|
|
iVar8 = *piVar11;
|
|
}
|
|
(**(code **)(iVar8 + 0x28))();
|
|
}
|
|
}
|
|
LAB_0061dc46:
|
|
if (this->_exists == 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
|
|
if (local_68[0] == '\0') {
|
|
local_14 = 1.4013e-45;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_68)) + 0x4))),0);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (local_68[0] == '\0') {
|
|
local_14 = 2.8026e-45;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_68)) + 0x4))),0);
|
|
}
|
|
local_14 = -NAN;
|
|
game = g_game;
|
|
}
|
|
}
|
|
if ((0 < this->_appearTimer) && ((this->_flags & 4) != 0)) {
|
|
iVar8 = this->_appearTimer + -1;
|
|
this->_appearTimer = iVar8;
|
|
if (iVar8 == 3) {
|
|
uVar4 = Random();
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
followTarget->Update();
|
|
iVar8 = this->_appearTimer;
|
|
game = g_game;
|
|
}
|
|
this->_visible = iVar8 == 0;
|
|
if (((this->_variant == 0xce) || (this->_variant == 0xed)) &&
|
|
(game->_frameCount == this->_spawnFrame)) {
|
|
ai_wisp(this);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (0 < this->_sirenCharmFrames) {
|
|
this->_sirenCharmFrames = this->_sirenCharmFrames + 1;
|
|
}
|
|
if (this->_isLilDelirium != 0) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(300,this->_index);
|
|
if (bVar1 != 0) {
|
|
delirium_morph(this);
|
|
}
|
|
game = g_game;
|
|
}
|
|
if (this->_state == 0) {
|
|
in_XMM0_Da = GHIDRA_CAST<Entity_Familiar *>(this->_updateTime);
|
|
if ((float)in_XMM0_Da == 0.0) {
|
|
ResolveOrbitConflict(this);
|
|
game = g_game;
|
|
}
|
|
}
|
|
uVar4 = this->_variant;
|
|
if (900 < uVar4) goto switchD_0061ddf2_caseD_12;
|
|
if (uVar4 == 900) {
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
animName = "FlyingIdle";
|
|
if (this->_entityGridCollisionClass != 3) {
|
|
animName = GHIDRA_CAST<char *>(s_Idle);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(animName),0);
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar1 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(&this->_pathfinder))))->PathFinder::UpdateGridIndex();
|
|
(GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_assign(&this->_pos);
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_78 + 8)),&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar8 = (GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(&this->_pathfinder))))->PathFinder::GetGridIndex();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SetGridPath(iVar8,0x3b6);
|
|
}
|
|
else {
|
|
in_XMM0_Da = GHIDRA_CAST<Entity_Familiar *>((this->_friction * 0.95));
|
|
this->_friction = (float)in_XMM0_Da;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_1a4),&this->_pos,30.0,2);
|
|
local_14 = 1.82169e-44;
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_1a4))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::HasEntityFlags(0x20000000);
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
(GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_60);
|
|
FUN_00a0ff70();
|
|
sourceRef = local_118;
|
|
local_148.y = (float)in_XMM0_Da;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(GHIDRA_CAST<Vector *>(&local_1b8._h));
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_140,scratchVec);
|
|
local_150.y = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::LengthSquared();
|
|
in_XMM0_Da = GHIDRA_CAST<Entity_Familiar *>(local_148.y);
|
|
if (local_150.y < local_148.y) {
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(local_148.y);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(GHIDRA_CAST<Vector *>(&local_208._h));
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Normalized(&local_16c);
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::Normalized(&local_17c);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(&local_1f0);
|
|
local_160.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Length();
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::__mul(&local_130,&local_160.y);
|
|
FUN_00a10160();
|
|
FUN_0060cc20();
|
|
local_148.y = (float)local_EAX_25497 / 3.1415927;
|
|
local_150.y = 0.99;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::min<float>();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(*puVar7);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>(*puVar7);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(GHIDRA_CAST<Vector *>(&local_258._h));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_248._h),GHIDRA_CAST<float *>(&local_11c));
|
|
in_XMM0_Da = GHIDRA_CAST<Entity_Familiar *>((1.0 - (float)local_11c));
|
|
local_128.y = (float)in_XMM0_Da;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_130)))->Vector::__mul(&local_238,&local_128.y);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_230,pVVar9);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetVelocity(scratchVec);
|
|
sourceRef = local_118;
|
|
this = self;
|
|
}
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_118 = sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_1a4))))->EntityList)::Size();
|
|
} while (sourceRef < gridIndexCounts);
|
|
}
|
|
gridIndexCounts = local_1a4;
|
|
goto LAB_006241ee;
|
|
}
|
|
switch(uVar4) {
|
|
case 2:
|
|
switchD_0061ddf2_caseD_2:
|
|
ai_auto_shooter(this);
|
|
break;
|
|
case 3:
|
|
case 0x19:
|
|
case 0x3b:
|
|
case 0x68:
|
|
case 0x82:
|
|
case 0xd5:
|
|
case 0xd6:
|
|
case 0xdf:
|
|
case 0xe8:
|
|
ai_charger(this);
|
|
break;
|
|
case 8:
|
|
case 0xf4:
|
|
(GHIDRA_CAST<Level *>(()))->Level::GetCurrentRoom();
|
|
FUN_0043eed0();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_150);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_148,&local_140);
|
|
if (this->_variant == 0xf4) {
|
|
scratchVec = RandomVector(&local_150,this->_initSeed);
|
|
(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_78))))->RNG::game_constructor(this->_initSeed,0x13);
|
|
local_14 = 4.2039e-45;
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<RNG *>((rng)))->RNG)::RandomFloat();
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_160,GHIDRA_CAST<float *>(&local_11c));
|
|
local_16c.y = 30.0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_128,&local_16c.y);
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::operator_add_assign(scratchVec);
|
|
local_14 = -NAN;
|
|
guard_check_icall();
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__sub(&local_150,&local_148);
|
|
FollowPosition(this,scratchVec);
|
|
Shoot(this);
|
|
break;
|
|
case 0xd:
|
|
MoveDiagonally(this,1.0);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x3f4ccccd);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_mul_assign(GHIDRA_CAST<float *>(&local_11c));
|
|
Shoot(this);
|
|
break;
|
|
case 0xe:
|
|
case 0xf:
|
|
case 0x3f:
|
|
ai_flying_bird(this);
|
|
break;
|
|
case 0x10:
|
|
ai_daddy_longlegs(this);
|
|
break;
|
|
case 0x11:
|
|
case 0xcf:
|
|
MoveDiagonally(this,1.0);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Float"),0);
|
|
break;
|
|
case 0x14:
|
|
case 0x15:
|
|
case 0x16:
|
|
case 0x17:
|
|
case 0x39:
|
|
case 0x52:
|
|
case 0x5b:
|
|
case 0x72:
|
|
FollowParent(this);
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(s_Spawn);
|
|
if (bVar1 != 0) {
|
|
if (this->_variant != 0x17) goto LAB_00623343;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Float"),0);
|
|
}
|
|
break;
|
|
case 0x18:
|
|
case 0x40:
|
|
case 0x5a:
|
|
case 0x66:
|
|
ai_pickup_sack(this);
|
|
break;
|
|
case 0x1c:
|
|
ai_key_full(this);
|
|
break;
|
|
case 0x2a:
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>((this->_subtype + 1));
|
|
local_11c = local_EAX_25497;
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::LengthSquared();
|
|
if (1.0 <= local_128.y) {
|
|
animName = "Idle%u";
|
|
}
|
|
else {
|
|
animName = "Float%u";
|
|
}
|
|
sprintf_s(animNameBuf,0x32,GHIDRA_CAST<uint8_t *>(animName));
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animNameBuf,0);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_140,scratchVec);
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::LengthSquared();
|
|
if (local_128.y <= 900.0) {
|
|
local_130.y = (float)((double)GHIDRA_INT(local_EAX_25497) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_EAX_25497) >> 0x1f)]);
|
|
}
|
|
else {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Normalized(&local_158);
|
|
local_130.y = (float)((double)GHIDRA_INT(local_11c) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_11c) >> 0x1f)]);
|
|
local_128.y = local_130.y + local_130.y + 15.0;
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Length();
|
|
local_16c.y = local_128.y - fVar13;
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(0x3fb33333);
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_174,pfVar10);
|
|
local_164 = GHIDRA_CAST<EntityList *>(0x3d8f5c29);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_184,GHIDRA_CAST<float *>(&local_164));
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_add_assign(scratchVec);
|
|
}
|
|
local_128.y = local_130.y * 0.01 + 0.87;
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_mul_assign(&local_128.y);
|
|
game = g_game;
|
|
this->_mass = local_130.y * 3.0 + 3.0;
|
|
this->_collisionDamage = local_130.y + local_130.y + 3.0;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),3,this->_variant,-1,0,0);
|
|
local_14 = 8.40779e-45;
|
|
uVar4 = 0;
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
cVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Exists();
|
|
if ((cVar2 != '\0') &&
|
|
(piVar11 = GHIDRA_CAST<int *>(std)::vector<int>::operator_index(), GHIDRA_CAST<Entity_Familiar *>(*piVar11) != this
|
|
)) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(&local_158);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_17c,scratchVec);
|
|
local_128.y = 0.0;
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Length();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((20.0 - fVar13));
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Resize(*pfVar10 * 0.1);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_add_assign(&local_17c);
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
uVar6 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
} while (uVar4 < uVar6);
|
|
}
|
|
LAB_0061f2a8:
|
|
gridIndexCounts = local_78;
|
|
goto LAB_006241ee;
|
|
case 0x2b:
|
|
ai_blue_fly(this);
|
|
break;
|
|
case 0x2d:
|
|
case 0x46:
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
scratchVec = GetOrbitPosition(this,&local_174,scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_184,&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
Shoot(this);
|
|
break;
|
|
case 0x2e:
|
|
case 0x2f:
|
|
case 0x38:
|
|
ai_walker(this);
|
|
break;
|
|
case 0x30:
|
|
FamiliarAI::bobs_brain(this);
|
|
break;
|
|
case 0x32:
|
|
ai_orbital_variant_50(this);
|
|
break;
|
|
case 0x33:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&DAT_00b1d3b0);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
Entity_Player::UseActiveItem(this->_player,GHIDRA_CAST<short *>((GHIDRA_INT(&local_134) + 2)),0x23,1,-1,0);
|
|
itemOverlay = GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetItemOverlay();
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(1,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
goto LAB_0061f886;
|
|
case 0x34:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
FollowParent(this);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(4,0);
|
|
if (bVar1 != 0) {
|
|
uVar4 = Random();
|
|
uVar6 = 0x2c;
|
|
LAB_0061f94f:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,uVar6,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
followTarget = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
fVar13 = random_float();
|
|
pfVar10 = &local_128.y;
|
|
scratchVec = &local_158;
|
|
local_128.y = fVar13 * 0.5 + 0.2;
|
|
LAB_0061dea4:
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(scratchVec,pfVar10);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetSpriteScale(scratchVec);
|
|
followTarget->Update();
|
|
}
|
|
break;
|
|
case 0x35:
|
|
FamiliarAI::variant_53(this);
|
|
break;
|
|
case 0x37:
|
|
FollowParent(this);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(3,0);
|
|
if (bVar1 != 0) {
|
|
fVar13 = random_float();
|
|
local_128.y = fVar13 * 0.5 + 0.2;
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,7,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
followTarget = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_158)))->Vector::Vector(local_128.y,local_128.y);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetSpriteScale(scratchVec);
|
|
followTarget->Update();
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
if ((bVar1 != 0) && (uVar4 = Isaac::Random(5), 1 < uVar4)) {
|
|
uVar4 = Random();
|
|
uVar6 = 0x2e;
|
|
goto LAB_0061f94f;
|
|
}
|
|
break;
|
|
case 0x3a:
|
|
this->_entityGridCollisionClass = 3;
|
|
if (this->_subtype == 0) {
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
local_130.y = (layer->_size).x;
|
|
if (1.0 <= local_130.y) {
|
|
this->_entityCollisionClass = 3;
|
|
}
|
|
else {
|
|
local_130.y = local_130.y + 0.05;
|
|
if (1.0 <= local_130.y) {
|
|
local_130.y = 1.0;
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_158,&local_130.y);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(GHIDRA_CAST<Vector *>((&layer->_size)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
this->_visible = 1;
|
|
MoveDiagonally(this,1.0);
|
|
}
|
|
else {
|
|
scratchVec = &g_vectorZero;
|
|
this->_entityCollisionClass = 0;
|
|
this->_visible = 0;
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(GHIDRA_CAST<Vector *>((&layer->_size)))->Vector::operator_assign(scratchVec);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(&g_vectorZero);
|
|
if ((0 < this->_counter) && (iVar8 = this->_counter + -1, this->_counter = iVar8, iVar8 < 1))
|
|
{
|
|
this->_subtype = 0;
|
|
if (this->_player != GHIDRA_CAST<Entity *>(0x0)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0x3d:
|
|
case 0x6c:
|
|
case 0xe6:
|
|
FollowParent(this);
|
|
ai_incubus_shot();
|
|
break;
|
|
case 0x3e:
|
|
followTarget = this->_player;
|
|
iVar8 = (GHIDRA_CAST<Game *>(()))->Game::Challenge();
|
|
if (iVar8 == 0x1e) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),3,0x43,-1,0,0);
|
|
local_14 = 1.12104e-44;
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>(*puVar7);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else {
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetPlayerType();
|
|
if ((iVar8 == 0x23) && (iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetOtherTwin(), iVar8 != 0)) {
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetOtherTwin();
|
|
}
|
|
}
|
|
if (this->_state == 0) {
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::Position(&local_148);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::is_player();
|
|
if (bVar1 != 0) {
|
|
scratchVec = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetAimDirection();
|
|
local_128.y = 60.0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_158,&local_128.y);
|
|
(GHIDRA_CAST<Vector *>((&local_148)))->Vector::operator__(scratchVec);
|
|
}
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_16c.y = (float)&this->_pos;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_16c.y))))->Vector::__sub(&local_174,&local_148);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Resized(&local_184,40.0);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_148)))->Vector::__add(&local_18c,scratchVec);
|
|
(GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&local_150,scratchVec,6.0);
|
|
scratchVec = &this->_pos;
|
|
local_128.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Distance(&local_148);
|
|
if (40.0 < local_128.y) {
|
|
local_128.y = ((local_128.y - 40.0) / local_128.y) * 0.4;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_150)))->Vector::__sub(&local_158,scratchVec);
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_174,&local_128.y);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(pVVar9);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector)::Length();
|
|
if (15.0 < (float)local_11c) {
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::Resize(15.0);
|
|
}
|
|
}
|
|
this->_friction = this->_friction * 0.8;
|
|
if ((this->_fireCooldown < 1) &&
|
|
(bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar1 != 0)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
}
|
|
local_130.y = (float)(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetFireDirection();
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_160))))->EntityPtr::clear();
|
|
bVar1 = TryAimAtMarkedTarget(this,&local_160,&this->_lastDirection,GHIDRA_CAST<Vector *>(0x0));
|
|
if ((bVar1 != 0) && (0x1d < this->_fireCooldown)) {
|
|
local_130.y = -NAN;
|
|
}
|
|
bVar1 = CanPlayerFire(this);
|
|
if (bVar1 != 0) {
|
|
iVar8 = this->_fireCooldown;
|
|
if (GHIDRA_CAST<Entity_Player *>(local_130.y) == GHIDRA_CAST<Entity_Player *>(0xffffffff)) {
|
|
if (0 < iVar8) {
|
|
if (iVar8 < 0x1e) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("ChargeAttack"),1);
|
|
this->_fireCooldown = 0;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(CONCAT13(bVar1,(undefined3)local_134));
|
|
if (bVar1 == 0) {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x42f00000);
|
|
}
|
|
else {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x43340000);
|
|
}
|
|
Game::ButterBeanFart(g_game,scratchVec,(float)local_118,this->_player,0,0);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius
|
|
(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),scratchVec,(float)local_118,8);
|
|
local_14 = 1.26117e-44;
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(*puVar7);
|
|
local_11c = local_EAX_25497;
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar1 != 0) {
|
|
bVar1 = Entity::IsDescendantOf
|
|
(GHIDRA_CAST<Entity *>(local_EAX_25497),GHIDRA_CAST<Entity *>(this->_spawnerEntity));
|
|
if (bVar1 == 0) {
|
|
floatResult = (long double)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Mass();
|
|
local_128.y = (float)floatResult;
|
|
if (0.0 < local_128.y) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::HasEntityFlags(0x4000000);
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::HasEntityFlags(0x20000000);
|
|
if (bVar1 == 0) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Position(&local_158);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_140,&this->_pos);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((&local_140)))->Vector)::Length();
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::__div_assign(GHIDRA_CAST<float *>(&local_118));
|
|
floatResult = (long double)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Mass();
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>((float)floatResult);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) != '\0') {
|
|
local_130.y = (float)sourceRef;
|
|
FUN_00431260();
|
|
}
|
|
local_130.y = (float)sourceRef;
|
|
FUN_00417340();
|
|
local_118 = (Entity_Player *)
|
|
((float)local_118 - ((float)sourceRef + this->_size));
|
|
fVar13 = assert_lerp_range(local_130.y + (float)local_118,10.0,120.0,
|
|
20.0,1.0,1);
|
|
FUN_00407140();
|
|
local_128.y = 16.0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__mul(&local_174,&local_128.y);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(self));
|
|
Entity::AddKnockback
|
|
(GHIDRA_CAST<Entity *>(local_11c),GHIDRA_CAST<EntityRef *>((local_a8 + 4)),scratchVec,
|
|
GHIDRA_INT(fVar13),1);
|
|
this = self;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
nextIndex = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_120)) + 0x1)));
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(nextIndex);
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
} while (nextIndex < gridIndexCounts);
|
|
scratchVec = &this->_pos;
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x45,2.0,2,0,1.0);
|
|
SoundEffects::PlayWithFartOverride(0xb2,1.0,2,0,1.0);
|
|
uVar4 = Random();
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(this),
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) != '\0') + 3,uVar4);
|
|
followTarget->Update();
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) != '\0') {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x3);
|
|
do {
|
|
MusicManager::RandomVector(&local_140);
|
|
uVar4 = Random();
|
|
fVar13 = random_float();
|
|
local_128.y = fVar13 * 4.0 + 8.0;
|
|
scratchVec = Vector::operator_mul(&local_158,&local_128.y,&local_140);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x41200000);
|
|
pVVar9 = Vector::operator_mul(&local_174,GHIDRA_CAST<float *>(&local_11c),&local_140);
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_16c.y))))->Vector::__add(&local_184,pVVar9);
|
|
this = self;
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,pVVar9,scratchVec,GHIDRA_CAST<Entity *>(self),3,uVar4)
|
|
;
|
|
followTarget->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_118[-1])) + 0x2eff))));
|
|
} while (local_118 != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
scratchVec = &this->_pos;
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
uVar4 = Random();
|
|
effect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4)
|
|
;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) == '\0') {
|
|
local_128.y = 1.2;
|
|
}
|
|
else {
|
|
local_128.y = 3.0;
|
|
}
|
|
scratchVec = Vector::operator_mul(&local_158,&local_128.y,&g_vectorOne);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetSpriteScale(scratchVec);
|
|
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(0x1c2);
|
|
effect->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
do {
|
|
Vector::FromAngle(&local_140,
|
|
(float)((double)GHIDRA_INT(local_118) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_118) >> 0x1f)]) * 360.0
|
|
* 0.125);
|
|
uVar4 = Random();
|
|
local_128.y = 12.0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__mul(&local_158,&local_128.y);
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&this->_pos,scratchVec,GHIDRA_CAST<Entity *>(this),0,uVar4)
|
|
;
|
|
followTarget->SetCollisionDamage();
|
|
followTarget->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
} while (local_118 < &DAT_00000008);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) != '\0') {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0xa);
|
|
do {
|
|
MusicManager::RandomVector(&local_140);
|
|
local_128.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::operator_mul_assign(&local_128.y);
|
|
fVar13 = random_float();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((fVar13 * 0.2 + 0.7));
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::operator_mul_assign(GHIDRA_CAST<float *>(&local_11c));
|
|
uVar4 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&this->_pos,&local_140,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::set_falling_accel(0.8);
|
|
random_float();
|
|
FUN_00444c70();
|
|
iVar8 = Isaac::Random(2);
|
|
if (iVar8 == 0) {
|
|
fVar13 = random_float();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale(fVar13 * 0.05 + 0.9);
|
|
}
|
|
else {
|
|
fVar13 = random_float();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale(fVar13 * 0.05 + 1.3);
|
|
}
|
|
tear->SetCollisionDamage();
|
|
tear->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_118[-1])) + 0x2eff))));
|
|
} while (local_118 != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
scratchVec = &this->_pos;
|
|
}
|
|
this->_fireCooldown = 0;
|
|
}
|
|
}
|
|
else {
|
|
if ((iVar8 < 1) && (bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar1 == 0)) {
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::IsLoopingAnimation();
|
|
if (bVar1 == 0) goto LAB_00620a2e;
|
|
}
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((this->_fireCooldown + 1));
|
|
local_128.y = 4.2039e-44;
|
|
piVar11 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
iVar8 = *piVar11;
|
|
this->_fireCooldown = iVar8;
|
|
if (0x12 < iVar8) {
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("FloatDown"));
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("ChargeStart"),0);
|
|
goto LAB_00620a2e;
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("ChargeLoop"),0);
|
|
}
|
|
}
|
|
}
|
|
LAB_00620a2e:
|
|
cVar2 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::IsDead();
|
|
if (cVar2 != '\0') {
|
|
this->_state = 1;
|
|
this->_visible = 0;
|
|
this->_shadowSize = 0.0;
|
|
this->_entityCollisionClass = 0;
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar4);
|
|
followTarget = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_158)))->Vector::Vector(0.0,-10.0);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetPositionOffset(scratchVec);
|
|
followTarget->SetColor();
|
|
followTarget->Update();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::BloodExplode();
|
|
}
|
|
}
|
|
else {
|
|
cVar2 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::IsDead();
|
|
if (cVar2 == '\0') {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::Vector(0.0,10.0);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_184,pVVar9);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::operator_assign(scratchVec);
|
|
uVar4 = Random();
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(self),0,uVar4)
|
|
;
|
|
followTarget->Update();
|
|
self->_state = 0;
|
|
self->_visible = 1;
|
|
self->_shadowSize = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(self->_config) + 0x24));
|
|
self->_entityCollisionClass = 4;
|
|
goto LAB_00624200;
|
|
}
|
|
}
|
|
break;
|
|
case 0x42:
|
|
FamiliarAI::variant_66(this);
|
|
break;
|
|
case 0x43:
|
|
FamiliarAI::punching_bag(this);
|
|
break;
|
|
case 0x44:
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
GetOrbitPosition(this,&local_148,scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_148)))->Vector::__sub(&local_158,&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetEffects();
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::HasCollectibleEffect(0x2d9);
|
|
if (bVar1 == 0) {
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IsFullSpriteRendering();
|
|
this->_entityCollisionClass = 4;
|
|
this->_visible = bVar1 == 0;
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
scratchVec = &local_148;
|
|
goto LAB_0061ef12;
|
|
}
|
|
this->_visible = 0;
|
|
this->_entityCollisionClass = 0;
|
|
break;
|
|
case 0x47:
|
|
case 0x48:
|
|
ai_walker(this);
|
|
Shoot(this);
|
|
break;
|
|
case 0x49:
|
|
FamiliarAI::blue_spider(this);
|
|
break;
|
|
case 0x4a:
|
|
if ((this->_subtype == 1) ||
|
|
((bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x71,0), bVar1 != 0 &&
|
|
(iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetFireDirection(), iVar8 == -1))))
|
|
goto switchD_0061ddf2_caseD_2;
|
|
case 1:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 9:
|
|
case 10:
|
|
case 0xb:
|
|
case 0xc:
|
|
case 0x36:
|
|
case 0x51:
|
|
case 0x5c:
|
|
case 0x61:
|
|
case 0xd1:
|
|
case 0xdc:
|
|
FollowParent(this);
|
|
Shoot(this);
|
|
break;
|
|
case 0x4b:
|
|
ai_samsons_chains(this);
|
|
break;
|
|
case 0x4c:
|
|
case 0x50:
|
|
FollowParent(this);
|
|
update_weapon(this,0);
|
|
break;
|
|
case 0x4d:
|
|
ai_blue_babys_only_friend(this);
|
|
break;
|
|
case 0x4e:
|
|
this->_friction = this->_friction * 0.8;
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(&g_vectorZero);
|
|
if (this->_state == 0) {
|
|
this->_state = 1;
|
|
}
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
scratchVec = &this->_pos;
|
|
LAB_0061ef12:
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_174,pVVar9);
|
|
local_140.x = scratchVec->x;
|
|
local_140.y = scratchVec->y;
|
|
FUN_007792f0();
|
|
break;
|
|
case 0x4f:
|
|
FamiliarAI::lil_haunt(this,0);
|
|
break;
|
|
case 0x53:
|
|
uVar4 = 2;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if (cVar2 != '\0') {
|
|
uVar4 = 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_78),&this->_pos,30.0,uVar4);
|
|
local_14 = 7.00649e-45;
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_130.y = 0.0;
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::HasEntityFlags(0x20000000);
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(this->_spawnerEntity));
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(&local_160);
|
|
(GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_220);
|
|
FUN_00a0ff70();
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(local_130.y);
|
|
local_11c = in_XMM0_Da;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(&local_218);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_17c,scratchVec);
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((&local_17c)))->Vector)::LengthSquared();
|
|
in_XMM0_Da = local_11c;
|
|
if ((float)local_120 < (float)local_11c) {
|
|
local_EAX_25497 = local_11c;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(&local_210);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Normalized(&local_150);
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Normalized(&local_148);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x41700000);
|
|
(GHIDRA_CAST<Vector *>((&local_148)))->Vector::__mul(&local_140,GHIDRA_CAST<float *>(&local_11c));
|
|
FUN_00a10160();
|
|
FUN_0060cc20();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(((float)local_EAX_25497 / 3.1415927));
|
|
local_16c.y = 0.99;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::min<float>();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(*puVar7);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>(*puVar7);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(&local_228);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_1e0,GHIDRA_CAST<float *>(&local_118));
|
|
local_164 = GHIDRA_CAST<EntityList *>((1.0 - (float)local_118));
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__mul(&local_1e8,GHIDRA_CAST<float *>(&local_164));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_1c0,pVVar9);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetVelocity(scratchVec);
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(local_130.y);
|
|
if ((float)local_120 < 400.0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsProjectile();
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsTear();
|
|
if (bVar1 == 0) goto LAB_0061ebc3;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
deflectedShot = GHIDRA_CAST<Entity_Projectile *>(*puVar7);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(&local_18c);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_184,GHIDRA_CAST<float *>(&local_118));
|
|
local_128.y = 1.0 - (float)local_118;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__mul(&local_174,&local_128.y);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_158,pVVar9);
|
|
(GHIDRA_CAST<Entity_Projectile *>((deflectedShot)))->Entity_Projectile::Deflect(GHIDRA_CAST<Entity *>(self),scratchVec);
|
|
}
|
|
else {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
deflectedShot = GHIDRA_CAST<Entity_Projectile *>(*puVar7);
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Velocity(&local_1c8);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_1d0,GHIDRA_CAST<float *>(&local_118));
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>((1.0 - (float)local_118));
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__mul(&local_1d8,GHIDRA_CAST<float *>(&local_134));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_194,pVVar9);
|
|
(GHIDRA_CAST<Entity_Projectile *>((deflectedShot)))->Entity_Projectile::Reflect(GHIDRA_CAST<Entity *>(self),scratchVec);
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(local_130.y);
|
|
}
|
|
LAB_0061ebc3:
|
|
in_XMM0_Da = local_120;
|
|
if ((float)local_120 < 64.0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Die();
|
|
}
|
|
this = self;
|
|
}
|
|
}
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_130.y = (float)sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
} while (sourceRef < gridIndexCounts);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
case 0x1e:
|
|
case 0x1f:
|
|
case 0x20:
|
|
case 0x21:
|
|
case 0x23:
|
|
case 0x2c:
|
|
case 0x3c:
|
|
case 0x41:
|
|
case 0x45:
|
|
case 0x54:
|
|
case 0x75:
|
|
case 0x79:
|
|
case 0x7e:
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
pVVar9 = GetOrbitPosition(this,&local_174,scratchVec);
|
|
scratchVec = &this->_pos;
|
|
LAB_0061ec34:
|
|
scratchVec = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_184,scratchVec);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
break;
|
|
case 0x55:
|
|
FamiliarAI::lost_fly(this);
|
|
break;
|
|
case 0x56:
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>(()))->Level)::GetCurrentRoom();
|
|
bVar1 = (GHIDRA_CAST<Room *>((room)))->Room::IsClear();
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if (cVar2 == '\0') goto switchD_0061ddf2_caseD_70;
|
|
}
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
if ((0 < iVar8) &&
|
|
(((iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount(), iVar8 % 900 == 0 &&
|
|
(iVar8 = Isaac::Random(2), iVar8 == 0)) ||
|
|
(iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount(), iVar8 % 0x708 == 0)))) {
|
|
if (this->_coins < 2) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(3);
|
|
if (uVar4 == 2) goto LAB_0061e0cf;
|
|
LAB_0061e0e9:
|
|
if (uVar4 == 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
Room::FindFreePickupSpawnPosition(room,&local_140,&this->_pos,0.0,0,0,0);
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x5a,&local_140,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Spawn,1);
|
|
iVar8 = 0x3f3;
|
|
}
|
|
else {
|
|
if (uVar4 != 1) {
|
|
if (uVar4 == 2) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_130.y = (float)(GHIDRA_CAST<Room *>((room)))->Room::GetEntities();
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_130.y))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar1 != 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>(*puVar7);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::AddFreeze(GHIDRA_CAST<EntityRef *>((local_a8 + 4)),-0x28,0);
|
|
local_EAX_25497 = local_120;
|
|
}
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_EAX_25497)) + 0x1))));
|
|
local_120 = local_EAX_25497;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_130.y))))->EntityList)::Size();
|
|
} while (local_EAX_25497 < gridIndexCounts);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b63f60,1);
|
|
SoundEffects::PlayWithFartOverride(0x3f5,1.0,2,0,1.0);
|
|
}
|
|
else if (uVar4 != 2) goto LAB_0061e295;
|
|
goto switchD_0061ddf2_caseD_70;
|
|
}
|
|
Entity_Player::AddActiveCharge(this->_player,1,-1,0,0,0);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b63f60,1);
|
|
iVar8 = 0x3f4;
|
|
}
|
|
SoundEffects::PlayWithFartOverride(iVar8,1.0,2,0,1.0);
|
|
}
|
|
else {
|
|
uVar4 = 2;
|
|
LAB_0061e0cf:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if (cVar2 == '\0') goto LAB_0061e0e9;
|
|
}
|
|
LAB_0061e295:
|
|
this->_coins = this->_coins + 1;
|
|
}
|
|
case 0x70:
|
|
switchD_0061ddf2_caseD_70:
|
|
FollowParent(this);
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
}
|
|
break;
|
|
case 0x57:
|
|
ai_lil_gurdy(this);
|
|
break;
|
|
case 0x58:
|
|
FamiliarAI::bumbo(this);
|
|
break;
|
|
case 0x59:
|
|
uVar4 = 10;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if (cVar2 != '\0') {
|
|
uVar4 = 0xe;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
uVar14 = 0x61e536;
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),&this->_pos,150.0,uVar4);
|
|
local_14 = 5.60519e-45;
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
uVar15 = 0x61e56c;
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::HasEntityFlags(0x20000000);
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Type();
|
|
if (iVar8 == 9) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
uVar14 = 0;
|
|
in_stack_fffffd28 = (void *)*puVar7;
|
|
in_stack_fffffd24 = GHIDRA_CAST<EntityList_EL *>(0x61e61e);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast());
|
|
if ((local_118 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(projectileFlags =
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_118))))->Entity_Projectile::ProjectileFlags(),
|
|
(projectileFlags & 0x1000000) == 0)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_118))))->Entity::Velocity(&local_140);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x3f000000);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_17c,GHIDRA_CAST<float *>(&local_11c));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_118))))->Entity::SetVelocity(scratchVec);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_118))))->Entity_Projectile::AddProjectileFlags(0x1000000);
|
|
}
|
|
}
|
|
else {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsTear();
|
|
if (bVar1 != 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
uVar14 = 0;
|
|
in_stack_fffffd28 = (void *)*puVar7;
|
|
in_stack_fffffd24 = GHIDRA_CAST<EntityList_EL *>(0x61e6cb);
|
|
local_130.y = (float)__RTDynamicCast();
|
|
if (GHIDRA_CAST<Entity_Player *>(local_130.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
scratchFlags = GHIDRA_CAST<BitSet128 *>(FUN_00435bc0());
|
|
flagsOperand = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_130.y))))->Entity_Tear::TearFlags(&local_1b8);
|
|
scratchFlags = BitSet128::operator_and(&local_208,flagsOperand,scratchFlags);
|
|
bVar1 = (GHIDRA_CAST<BitSet128 *>((scratchFlags)))->BitSet128::IsZero();
|
|
fVar13 = local_130.y;
|
|
if ((bVar1 != 0) &&
|
|
(bVar1 = Entity::IsDescendantOf
|
|
(GHIDRA_CAST<Entity *>(local_130.y),GHIDRA_CAST<Entity *>(this->_spawnerEntity)),
|
|
bVar1 == 0)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Velocity(&local_150);
|
|
local_16c.y = 0.5;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_160,&local_16c.y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::SetVelocity(scratchVec);
|
|
scratchFlags = GHIDRA_CAST<BitSet128 *>(FUN_00435bc0());
|
|
flagsOperand = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_130.y))))->Entity_Tear::TearFlags(&local_258);
|
|
scratchFlags = BitSet128::operator_or(&local_248,flagsOperand,scratchFlags);
|
|
uVar14 = (uint32_t)scratchFlags->_l;
|
|
in_stack_fffffd28 = (void *)0x61e7b5;
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_130.y))))->Entity_Tear::SetTearFlags(*scratchFlags);
|
|
}
|
|
goto LAB_0061e7b5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>(*puVar7);
|
|
fVar13 = 8.990418e-39;
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
bVar1 = 0;
|
|
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x28,0x28,0x28);
|
|
color._tint[1] = (float)in_stack_fffffd10;
|
|
color._tint[0] = (float)in_stack_fffffd0c;
|
|
color._tint[2] = (float)in_stack_fffffd14;
|
|
color._tint[3] = (float)in_stack_fffffd18;
|
|
color._colorize[0] = (float)in_stack_fffffd1c;
|
|
color._colorize[1] = (float)in_stack_fffffd20;
|
|
color._colorize[2] = (float)in_stack_fffffd24;
|
|
color._colorize[3] = (float)in_stack_fffffd28;
|
|
color._offset[0] = (float)uVar14;
|
|
color._offset[1] = (float)uVar15;
|
|
color._offset[2] = fVar13;
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::AddSlowing(GHIDRA_CAST<EntityRef *>((local_a8 + 4)),2,0.9,color,bVar1);
|
|
LAB_0061e7b5:
|
|
sourceRef = local_118;
|
|
}
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_118 = sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
} while (sourceRef < gridIndexCounts);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
case 0x1a:
|
|
case 0x1b:
|
|
case 0x28:
|
|
case 0x29:
|
|
case 0x67:
|
|
FollowParent(this);
|
|
break;
|
|
case 0x5d:
|
|
FamiliarAI::gb_bug(this);
|
|
break;
|
|
case 0x5e:
|
|
case 0x71:
|
|
FamiliarAI::spider_mod(this);
|
|
break;
|
|
case 0x5f:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&DAT_00b1d3b0);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
iVar8 = Isaac::Random(3);
|
|
if (iVar8 == 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_a8))))->Color::Color();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(&this->_pos,85.0,GHIDRA_CAST<Entity *>(this),1.0,0,fartColor);
|
|
Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,0,0);
|
|
}
|
|
else if (iVar8 == 1) {
|
|
Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,1,0);
|
|
}
|
|
else if (iVar8 == 2) {
|
|
Game::CharmFart(&this->_pos,100.0,GHIDRA_CAST<Entity *>(this));
|
|
}
|
|
}
|
|
LAB_0061f886:
|
|
FollowParent(this);
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
goto LAB_00624200;
|
|
case 0x60:
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(7,this->_index);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),&this->_pos,150.0,8);
|
|
local_14 = 9.80909e-45;
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar1 != 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(*puVar7));
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::HasEntityFlags(0x20000010);
|
|
if (bVar1 == 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(*puVar7) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(self));
|
|
(*virtualFn)();
|
|
sourceRef = local_118;
|
|
this = self;
|
|
}
|
|
}
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_118 = sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
} while (sourceRef < gridIndexCounts);
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
uVar4 = 0;
|
|
iVar8 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
local_130.y = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar4);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if ((cVar2 == '\0') ||
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(local_130.y)), bVar1 != 0)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_130.y))))->Entity::Position(&local_158);
|
|
local_128.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::DistanceSquared(&this->_pos);
|
|
if (local_128.y < 10000.0) {
|
|
FUN_0060d0c0();
|
|
}
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
uVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNumPlayers();
|
|
} while (uVar4 < uVar6);
|
|
}
|
|
MoveDiagonally(this,1.0);
|
|
break;
|
|
case 0x62:
|
|
goto switchD_0061ddf2_caseD_62;
|
|
case 99:
|
|
ai_lil_monstro(this);
|
|
goto switchD_0061ddf2_caseD_62;
|
|
case 100:
|
|
if (GHIDRA_UINT(this->_subtype) < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xf38))))) {
|
|
FollowParent(this);
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::IsEventTriggered(&DAT_00b63f64);
|
|
if (bVar1 == 0) {
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(&this->_pos);
|
|
}
|
|
else {
|
|
this->_shadowSize = 0.0;
|
|
SoundEffects::PlayWithFartOverride(0x35,1.0,2,0,1.0);
|
|
SoundEffects::PlayWithFartOverride(0x33,1.0,2,0,1.0);
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetEffects();
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::AddCollectibleEffect(0x1b4,1,1);
|
|
uVar4 = Random();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(&this->_pos);
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xd,GHIDRA_CAST<Vector *>(local_11c),&g_vectorZero,GHIDRA_CAST<Entity *>(this),
|
|
0,uVar4);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(followTarget) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*virtualFn)();
|
|
followTarget->Update();
|
|
uVar4 = Random();
|
|
local_EAX_25497 = local_11c;
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x5a,GHIDRA_CAST<Vector *>(local_11c),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
0,uVar4);
|
|
followTarget->Update();
|
|
this = self;
|
|
}
|
|
this->_friction = this->_friction * 0.5;
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
this->_visible = 0;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_EAX_25497))))->Vector::operator_assign(&g_vectorZero);
|
|
goto LAB_0061e4de;
|
|
}
|
|
}
|
|
break;
|
|
case 0x65:
|
|
MoveDelayed(this,0x14);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),&this->_pos,this->_size,4);
|
|
local_14 = 1.4013e-44;
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
cVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsDead();
|
|
if (cVar2 == '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if (cVar2 != '\0') {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity)::SpawnerEntity();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDescendantOf(followTarget);
|
|
if (bVar1 == 0) goto LAB_006213fc;
|
|
}
|
|
msvc::vector<int>::operator_index();
|
|
cVar2 = FUN_004d7760();
|
|
if (cVar2 == '\0') {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsTear();
|
|
if (bVar1 != 0) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
tear = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::ToTear();
|
|
local_16c.y = (float)tear;
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Variant();
|
|
if (iVar8 != 9) {
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Variant();
|
|
if (iVar8 != 0x2d) {
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Variant();
|
|
if (iVar8 != 0x28) {
|
|
flagsOperand = &g_tearFlagLudovico;
|
|
scratchFlags = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::TearFlags(GHIDRA_CAST<BitSet128 *>(local_68));
|
|
scratchFlags = BitSet128::operator_and(&local_1b8,scratchFlags,flagsOperand);
|
|
bVar1 = (GHIDRA_CAST<BitSet128 *>((scratchFlags)))->BitSet128::IsNonZero();
|
|
if (bVar1 != 0) {
|
|
FUN_005cd750();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::GetIntervalTicks((float)in_XMM0_Da,0.0);
|
|
if (iVar8 == 0) goto LAB_006213f6;
|
|
}
|
|
cVar2 = FUN_0060cd60();
|
|
if (cVar2 == '\0') {
|
|
FUN_0060cd70();
|
|
iVar8 = FUN_0060cd10();
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(CONCAT13(0 < iVar8,(undefined3)local_134));
|
|
if (iVar8 < 1) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Velocity(&local_158);
|
|
}
|
|
else {
|
|
pfVar10 = GHIDRA_CAST<float *>(FUN_0060cd40());
|
|
local_140.y = pfVar10[1];
|
|
scratchVec = &local_140;
|
|
local_140.x = *pfVar10;
|
|
}
|
|
local_17c.x = scratchVec->x;
|
|
local_17c.y = scratchVec->y;
|
|
local_128.y = 1.333;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) == '\0') {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::__mul(&local_184,&local_128.y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetVelocity(scratchVec);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::__mul(&local_174,&local_128.y);
|
|
FUN_0060cd20();
|
|
}
|
|
floatResult = (long double)(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::Height();
|
|
Entity_Projectile::SetHeight
|
|
(GHIDRA_CAST<Entity_Projectile *>(tear),(float)(floatResult * (long double)1.5));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::Rotated(&local_18c,90.0);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Normalized(&local_194);
|
|
(GHIDRA_CAST<Vector *>((&local_17c)))->Vector::operator_assign(scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Position(&local_1d8);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x40a00000);
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::__mul(&local_1d0,GHIDRA_CAST<float *>(&local_11c));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_1c8,pVVar9);
|
|
fVar13 = local_16c.y;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_16c.y))))->Entity::SetPosition(scratchVec);
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Variant();
|
|
if (((iVar8 != 0x23) &&
|
|
(iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Variant(), iVar8 != 0x25)) &&
|
|
(iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Variant(), iVar8 != 0x26)) {
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(fVar13))))->Entity_Tear::ChangeVariant(0x15);
|
|
}
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity)::SpawnerEntity();
|
|
tear = Entity_Tear::MakeMultidimensionalCopy
|
|
(GHIDRA_CAST<Entity_Tear *>(fVar13),followTarget);
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity)::Parent();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetParent(followTarget);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Position(&local_1c0);
|
|
local_130.y = 10.0;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((&local_17c)))->Vector::__mul(&local_1e8,&local_130.y);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_1e0,pVVar9);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetPosition(scratchVec);
|
|
tear->Update();
|
|
this = self;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_006213f6:
|
|
sourceRef = local_118;
|
|
}
|
|
}
|
|
else {
|
|
msvc::vector<int>::operator_index();
|
|
local_128.y = (float)FUN_0060cc90();
|
|
cVar2 = (GHIDRA_CAST<Entity_Knife *>((GHIDRA_CAST<Entity_Knife *>(local_128.y))))->Entity_Knife::IsFlying();
|
|
if (cVar2 != '\0') {
|
|
multidimensional_baby_copy_knife(GHIDRA_CAST<Entity_Knife *>(local_128.y),GHIDRA_CAST<Entity *>(this));
|
|
}
|
|
}
|
|
}
|
|
LAB_006213fc:
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_118 = sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
} while (sourceRef < gridIndexCounts);
|
|
}
|
|
PlayFloatAnim(this,3);
|
|
gridIndexCounts = local_78;
|
|
LAB_006241ee:
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((gridIndexCounts)))->EntityList_Query::~EntityList_Query();
|
|
break;
|
|
case 0x69:
|
|
FollowParent(this);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(3,0);
|
|
if ((bVar1 != 0) && (iVar8 = Isaac::Random(5), iVar8 != 0)) {
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x36,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
followTarget = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
fVar13 = random_float();
|
|
pfVar10 = GHIDRA_CAST<float *>(&local_11c);
|
|
scratchVec = &local_140;
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((fVar13 * 0.5 + 0.2));
|
|
goto LAB_0061dea4;
|
|
}
|
|
break;
|
|
case 0x6a:
|
|
if (this->_subtype != 0) {
|
|
if (this->_visible == 0) {
|
|
LAB_00620f26:
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(&g_vectorZero);
|
|
followTarget = this->_player;
|
|
if (GHIDRA_CAST<Entity *>(this->_parent) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
followTarget = GHIDRA_CAST<Entity *>(this->_parent);
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::Position(&local_158);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
else {
|
|
this->_visible = 0;
|
|
iVar8 = Isaac::Random(2);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>((iVar8 + 3));
|
|
if (0 < GHIDRA_INT(local_118)) {
|
|
do {
|
|
uVar4 = Random();
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
scratchVec = Room::FindFreePickupSpawnPosition(room,&local_158,&this->_pos,40.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(0x17,0,scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(this),1,uVar4);
|
|
followTarget = GHIDRA_CAST<Entity *>(__RTDynamicCast());
|
|
addEnemyKillScore = 0;
|
|
bVar1 = 0;
|
|
iVar8 = -1;
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::EntityRef();
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::AddCharmed(sourceRef,iVar8,bVar1,addEnemyKillScore);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetVisibleFlag(0);
|
|
followTarget->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_118[-1])) + 0x2eff))));
|
|
} while (local_118 != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
if (this->_visible == 0) goto LAB_00620f26;
|
|
}
|
|
this->_friction = this->_friction * 0.7;
|
|
break;
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))) = "WalkDown";
|
|
local_60.x = (float)&DAT_00b1e020;
|
|
local_60.y = 1.633423e-38;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_78)) + 0x4))) = "FlyDown";
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_78)) + 0x8))) = &DAT_00b1ddc0;
|
|
pcStack_6c = "FlyHori";
|
|
bVar1 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::IsFlying();
|
|
gridIndexCounts = local_78;
|
|
if (bVar1 == 0) {
|
|
gridIndexCounts = local_68;
|
|
}
|
|
local_130.y = (float)(gridIndexCounts + 4);
|
|
MoveDelayed(this,0x14);
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity)::get_velocity_direction();
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::LengthSquared();
|
|
if (1.0 <= local_128.y) {
|
|
sprite = &this->_sprite;
|
|
if (local_120 == GHIDRA_CAST<Entity_Familiar *>(0x3)) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(*GHIDRA_CAST<uint8_t **>(local_130.y),0);
|
|
}
|
|
else if (local_120 == GHIDRA_CAST<Entity_Familiar *>(0x1)) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(local_130.y) + 4)),0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(local_130.y) + 8)),0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::set_flip_x(local_120 == GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
}
|
|
}
|
|
else {
|
|
local_130.y = *GHIDRA_CAST<float *>(local_130.y);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::IsFlying();
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>(local_130.y),0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(local_130.y),0);
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(&s_empty);
|
|
if (bVar1 != 0) {
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::Length();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>((fVar13 * 0.5));
|
|
fVar13 = 1.0;
|
|
if ((float)local_118 < 2.3) {
|
|
fVar13 = assert_lerp_range((float)local_118,1.0,2.3,0.5,1.0,1);
|
|
}
|
|
if (6.0 < (float)local_118) {
|
|
fVar13 = assert_lerp_range((float)local_118,6.0,10.0,1.0,2.0,1);
|
|
}
|
|
set_PlaybackSpeed(&this->_sprite,fVar13);
|
|
}
|
|
if (this->_variant == 0x6a) {
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetPlayerType();
|
|
if (iVar8 == 0xc) {
|
|
spriteColor = GHIDRA_CAST<KColor *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
|
|
blue = 0x24;
|
|
green = 0x1c;
|
|
iVar8 = 0xee;
|
|
}
|
|
else {
|
|
spriteColor = GHIDRA_CAST<KColor *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
|
|
blue = 0xff;
|
|
green = 0xff;
|
|
iVar8 = 0xff;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((spriteColor)))->KColor::FromRGBA255(iVar8,green,blue,0xff);
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
iVar8 = 0x29a;
|
|
if (cVar2 != '\0') {
|
|
iVar8 = 100;
|
|
}
|
|
if (iVar8 < this->_state) {
|
|
this->_subtype = 1;
|
|
}
|
|
goto LAB_00624200;
|
|
case 0x6b:
|
|
if (this->_subtype == 0) {
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Phase2"),0);
|
|
}
|
|
MoveDiagonally(this,1.3);
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetFireDirection();
|
|
if (iVar8 != -1) {
|
|
this->_subtype = 1;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("RevertToPhase1"),0);
|
|
this->_fireCooldown = 0x1e;
|
|
}
|
|
}
|
|
else if (this->_subtype == 1) {
|
|
sprite = &this->_sprite;
|
|
local_128.y = (float)sprite;
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(s_Idle,0);
|
|
}
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetFireDirection();
|
|
if (iVar8 == -1) {
|
|
this->_subtype = 0;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Phase2Start"),0);
|
|
}
|
|
game = g_game;
|
|
this->_friction = this->_friction * 0.85;
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level)::GetCurrentRoom();
|
|
scratchVec = (GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&local_158,&this->_pos,this->_size);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::operator_assign(scratchVec);
|
|
iVar8 = this->_fireCooldown;
|
|
this->_fireCooldown = iVar8 + -1;
|
|
if (iVar8 < 1) {
|
|
this->_fireCooldown = 0x1e;
|
|
iVar8 = 0;
|
|
do {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_158)))->Vector::Vector(0.0,1.0);
|
|
bVar1 = 0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(&local_174,(float)iVar8 * 45.0);
|
|
FireProjectile(this,scratchVec,bVar1);
|
|
iVar8 = iVar8 + 1;
|
|
} while (iVar8 < 8);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_128.y))))->ANM2::Play(GHIDRA_CAST<uint8_t *>("RevertToPhase1"),0);
|
|
}
|
|
}
|
|
break;
|
|
case 0x6d:
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetFireDirection();
|
|
if (iVar8 == -1) {
|
|
FollowParent(this);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
else {
|
|
bVar1 = IsLilithBirthrightIncubus(this);
|
|
game = g_game;
|
|
if (bVar1 == 0) {
|
|
this->_friction = this->_friction * 0.7;
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level)::GetCurrentRoom();
|
|
scratchVec = (GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&local_158,&this->_pos,0.0);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
else {
|
|
FollowParent(this);
|
|
}
|
|
PickEnemyTarget(this,800.0,8,0x13,&g_vectorZero,15.0);
|
|
}
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::get_velocity_direction();
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::LengthSquared();
|
|
if (local_128.y < 1.0) {
|
|
iVar8 = 3;
|
|
}
|
|
PlayFloatAnim(this,iVar8);
|
|
break;
|
|
case 0x6e:
|
|
pfVar10 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetAimDirection();
|
|
local_150.x = *pfVar10;
|
|
local_150.y = pfVar10[1];
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&local_150)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetHeadDirection();
|
|
scratchVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_158,iVar8);
|
|
(GHIDRA_CAST<Vector *>((&local_150)))->Vector::operator_assign(scratchVec);
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&local_150)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_158)))->Vector::Vector(0.0,1.0);
|
|
(GHIDRA_CAST<Vector *>((&local_150)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
}
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&local_150)))->Vector::GetAngleDegrees();
|
|
fVar13 = LerpAngleDeg(this->_orbitAngleOffset,local_128.y,0.3);
|
|
this->_orbitAngleOffset = fVar13;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
pVVar9 = Vector::FromAngle(&local_174,this->_orbitAngleOffset);
|
|
local_128.y = 50.0;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_184,&local_128.y);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_160,pVVar9);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::__sub(&local_18c,&this->_pos);
|
|
local_128.y = 0.3;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_158,&local_128.y);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_add_assign(scratchVec);
|
|
this->_friction = this->_friction * 0.7;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_194);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_140,scratchVec);
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::GetAngleDegrees();
|
|
local_128.y = fVar13 - 90.0;
|
|
fVar13 = normalize_angle_degrees(local_128.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetRotation(fVar13);
|
|
floatResult = (long double)(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Rotation();
|
|
local_128.y = (float)floatResult;
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(CONCAT13(1.0 < local_128.y,(undefined3)local_134));
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_flipX = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3)));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
iVar8 = 3;
|
|
if (cVar2 != '\0') {
|
|
iVar8 = 0x3c;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(iVar8,0);
|
|
if (bVar1 != 0) {
|
|
sourceRef = this->_player;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Normalized(&local_158);
|
|
techLaser = Entity_Player::FireTechLaser
|
|
(sourceRef,&this->_pos,2,scratchVec,0,1,GHIDRA_CAST<Entity *>(this),1.0);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::Vector(0.0,-10.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(techLaser))))->Entity::SetPositionOffset(scratchVec);
|
|
FUN_0044bf90();
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(techLaser) + 0x40);
|
|
pTVar5 = Entity_Player::GetTearHitParams(self->_player,&local_110,3,1.0,1,GHIDRA_CAST<Entity *>(self));
|
|
local_128.y = pTVar5->_tearDamage * 0.1;
|
|
apply_tear_modifiers(self);
|
|
(*virtualFn)();
|
|
FUN_0044bfa0();
|
|
FUN_00435bc0();
|
|
FUN_00456830();
|
|
FUN_0060cf00();
|
|
set_field_0x37c();
|
|
techLaser->Update();
|
|
}
|
|
break;
|
|
case 0x6f:
|
|
ai_variant_111(this);
|
|
break;
|
|
case 0x73:
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_assign(&this->_pos);
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Fly,0);
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x1e,this->_index);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),&this->_pos,150.0,8);
|
|
local_14 = 1.54143e-44;
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_130.y = 0.0;
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(0x471c4000);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(this));
|
|
if (bVar1 != 0) {
|
|
piVar11 = GHIDRA_CAST<int *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SpawnerEntity();
|
|
sourceRef = local_118;
|
|
if (*piVar11 != iVar8) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(&local_158);
|
|
local_128.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::DistanceSquared(&this->_pos);
|
|
if (local_128.y < (float)local_120) {
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(local_128.y);
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::vector<int>::operator_index();
|
|
local_130.y = *pfVar10;
|
|
}
|
|
}
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_118 = sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
fVar13 = local_130.y;
|
|
} while (sourceRef < gridIndexCounts);
|
|
if (GHIDRA_CAST<Entity_Player *>(local_130.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Attack"),1);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Position(&local_158);
|
|
fVar16 = (this->_pos).x;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::set_flip_x(scratchVec->x <= fVar16 && fVar16 != scratchVec->x);
|
|
uVar4 = Random();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Position(&local_158);
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_130.y))))->Entity::Velocity(&local_174);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_184,pVVar9);
|
|
pVVar9 = &self->_pos;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_18c,pVVar9);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Resized(&local_194,10.0);
|
|
this = self;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,pVVar9,scratchVec,GHIDRA_CAST<Entity *>(self),0,uVar4);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
local_128.y = apply_tear_modifiers(this);
|
|
fVar13 = apply_tear_modifiers(this);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((fVar13 * 0.2 + 0.6));
|
|
tear->SetCollisionDamage();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale((float)local_11c);
|
|
FUN_00444c70();
|
|
TryFireTear(this,tear);
|
|
tear->Update();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
}
|
|
}
|
|
local_14 = -NAN;
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if ((cVar2 != '\0') && (this->_counter = this->_counter + 1, 0x2ed < this->_counter)) {
|
|
iVar8 = Player(this);
|
|
if (iVar8 != 0) {
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(Player(this));
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((sourceRef)))->Entity_Player)::GetEffects();
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x1f8,1);
|
|
}
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(this) + 0x24);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::EntityRef();
|
|
(*virtualFn)();
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::__sub(&local_158,&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
this->_friction = this->_friction * 0.8;
|
|
break;
|
|
case 0x74:
|
|
scratchVec = &this->_pos;
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(scratchVec);
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_140,pVVar9);
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::GetAngleDegrees();
|
|
local_128.y = fVar13 + 45.0;
|
|
fVar13 = normalize_angle_degrees(local_128.y);
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(GHIDRA_INT(((1.0 - (fVar13 + 180.0) / 360.0) * 8.0)));
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
local_164 = GHIDRA_CAST<EntityList *>(apply_forgotten_lullaby(this,0xc));
|
|
if (this->_fireCooldown < 1) {
|
|
local_130.y = 0.0;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),scratchVec,200.0,8);
|
|
local_14 = 1.68156e-44;
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 == 0) {
|
|
LAB_00621e31:
|
|
entityList = GHIDRA_CAST<EntityList *>(&DAT_00000004);
|
|
}
|
|
else {
|
|
uVar4 = 0;
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(*puVar7);
|
|
local_118 = sourceRef;
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(sourceRef))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar1 != 0) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(sourceRef))))->Entity::HasEntityFlags(0x20000010), bVar1 == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_118))))->Entity::Position(&local_158);
|
|
bVar1 = (GHIDRA_CAST<Room *>((room)))->Room::CheckLine(GHIDRA_CAST<Vector *>(local_120),scratchVec,3,900,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar1 != 0) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_118))))->Entity::Position(&local_174);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_184,GHIDRA_CAST<Vector *>(local_120));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Normalized(&local_18c);
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::GetAngleDegrees();
|
|
pVVar9 = Vector::FromAngle(&local_194,fVar13 - 45.0);
|
|
local_128.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Dot(pVVar9);
|
|
if (0.9 < local_128.y) {
|
|
local_130.y = (float)local_118;
|
|
}
|
|
}
|
|
}
|
|
fVar13 = local_130.y;
|
|
uVar4 = uVar4 + 1;
|
|
uVar6 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
this = self;
|
|
} while (uVar4 < uVar6);
|
|
if (GHIDRA_CAST<Entity_Player *>(fVar13) == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00621e31;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar13))))->Entity::Position(&local_158);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_174,&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::operator_assign(scratchVec);
|
|
uVar4 = Random();
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Normalized(&local_158);
|
|
local_128.y = 10.0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_174,&local_128.y);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&this->_pos,scratchVec,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
FUN_00444c70();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(apply_tear_modifiers(this));
|
|
fVar13 = apply_tear_modifiers(this);
|
|
local_16c.y = fVar13 * 0.35 + 0.7;
|
|
tear->SetCollisionDamage();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale(local_16c.y);
|
|
TryFireTear(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
entityList = local_164;
|
|
}
|
|
local_14 = -NAN;
|
|
this->_fireCooldown = GHIDRA_INT(entityList);
|
|
(GHIDRA_CAST<EntityList_Query *>((local_78)))->EntityList_Query::~EntityList_Query();
|
|
scratchVec = &this->_pos;
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(GHIDRA_INT(local_134));
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
pVVar9 = GetOrbitPosition(this,&local_174,pVVar9);
|
|
goto LAB_0061ec34;
|
|
case 0x76:
|
|
update_angry_fly(this);
|
|
break;
|
|
case 0x77:
|
|
ai_lil_spewer(this);
|
|
break;
|
|
case 0x78:
|
|
FamiliarAI::sprinkler(this);
|
|
break;
|
|
case 0x7a:
|
|
ai_lil_harbingers(this);
|
|
break;
|
|
case 0x7b:
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c7fc58) &&
|
|
(_Init_thread_header(), DAT_00c7fc58 == -1)) {
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
_Init_thread_footer();
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
scratchVec = GetOrbitPosition(this,&local_174,scratchVec);
|
|
local_128.y = (float)&this->_pos;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(&local_184,GHIDRA_CAST<Vector *>(local_128.y));
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_164 = (GHIDRA_CAST<Room *>((room)))->Room::GetEntities();
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_130.y = 0.0;
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((local_164)))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
cVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::IsDead();
|
|
if (cVar2 != '\0') goto LAB_006223ba;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Type();
|
|
if (iVar8 == 2) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(&local_158);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Vector *>((scratchVec)))->Vector)::DistanceSquared(GHIDRA_CAST<Vector *>(local_128.y));
|
|
fVar13 = 625.0;
|
|
if (625.0 <= (float)local_11c) goto LAB_006223d9;
|
|
msvc::vector<int>::operator_index();
|
|
local_120 = GHIDRA_CAST<Entity_Familiar *>(__RTDynamicCast());
|
|
cVar2 = FUN_0060cd80();
|
|
if (cVar2 == '\0') {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
|
|
cVar2 = DeathmatchManager::is_active();
|
|
if (cVar2 != '\0') {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(this->_spawnerEntity));
|
|
if (bVar1 == 0) goto LAB_006223ba;
|
|
}
|
|
flagsOperand = &g_tearFlagLudovico;
|
|
scratchFlags = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_120))))->Entity_Tear::TearFlags(&sourceTearFlags);
|
|
scratchFlags = BitSet128::operator_and(&sourceLudovicoBits,scratchFlags,flagsOperand);
|
|
bVar1 = (GHIDRA_CAST<BitSet128 *>((scratchFlags)))->BitSet128::IsNonZero();
|
|
local_EAX_25497 = local_120;
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(CONCAT13(bVar1,(undefined3)local_134));
|
|
if (bVar1 == 0) {
|
|
local_120->Remove();
|
|
}
|
|
else {
|
|
FUN_005cd750();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::GetIntervalTicks(fVar13,0.0);
|
|
if (iVar8 == 0) goto LAB_006223ba;
|
|
local_EAX_25497 = local_120;
|
|
}
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(&DAT_00c7fc60);
|
|
do {
|
|
local_16c.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::InitSeed();
|
|
local_160.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SubType();
|
|
local_150.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SpawnerEntity();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Velocity(&local_174);
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Position(&local_184);
|
|
uVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Variant();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,uVar4,pVVar9,scratchVec,GHIDRA_CAST<Entity *>(local_150.y),GHIDRA_UINT(local_160.y),
|
|
GHIDRA_UINT(local_16c.y));
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
local_EAX_25497 = local_120;
|
|
floatResult = (long double)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_120))))->Entity_Tear::Height();
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight((float)floatResult);
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_EAX_25497))))->Entity_Tear::FallingSpeed();
|
|
FUN_00444c70();
|
|
floatResult = (long double)Entity_Tear::FallingAcceleration
|
|
(GHIDRA_CAST<Entity_Tear *>(local_EAX_25497));
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::set_falling_accel((float)floatResult);
|
|
FUN_0060cca0();
|
|
FUN_00676bd0();
|
|
floatResult = (long double)(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_EAX_25497))))->Entity_Tear::BaseScale();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale((float)floatResult);
|
|
scratchFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagLudovico)))->BitSet128::__bnot(¬LudovicoFlags);
|
|
flagsOperand = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_120))))->Entity_Tear::TearFlags(&sourceTearFlagsCopy);
|
|
scratchFlags = BitSet128::operator_and
|
|
(&flagsWithoutLudovico,flagsOperand,scratchFlags);
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(*scratchFlags);
|
|
FUN_0060cd10();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetWaitFrames();
|
|
iVar8 = (GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_120))))->Entity_Tear::TearIndex();
|
|
(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(tear))))->Entity_Effect::set_state(iVar8);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(tear) + 0x40);
|
|
floatResult = (long double)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::CollisionDamage();
|
|
fVar13 = (float)floatResult;
|
|
local_150.y = fVar13;
|
|
(*virtualFn)();
|
|
local_EAX_25497 = local_120;
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(local_120))))->Entity_Tear::Rotation();
|
|
FUN_004aadb0();
|
|
FUN_0060ccf0();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetKnockbackMultiplier();
|
|
FUN_0060cd50();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetDeadEyeIntensity(fVar13);
|
|
FUN_0060cd60();
|
|
FUN_0060cd70();
|
|
FUN_0060cda0();
|
|
FUN_0060cd90();
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity)::Parent();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetParent(followTarget);
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity)::SpawnerEntity();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetSpawnerEntity(followTarget);
|
|
local_16c.y = (float)GHIDRA_INT(local_118);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) == '\0') {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Velocity(&local_1c8);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(&local_1c0,30.0 - local_16c.y * 20.0);
|
|
}
|
|
else {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Velocity(&local_18c);
|
|
pVVar9 = Vector::FromAngle(&local_194,local_16c.y * 90.0);
|
|
local_148.y = 10.0;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1d8,&local_148.y);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_1d0,pVVar9);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SetVelocity(scratchVec);
|
|
local_EAX_25497 = local_11c;
|
|
tear->SetColor();
|
|
tear->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(&local_EAX_25497->_variant);
|
|
local_EAX_25497 = local_120;
|
|
} while (GHIDRA_INT(local_11c) < 0xc7fd10);
|
|
LAB_006223ae:
|
|
this = self;
|
|
goto LAB_006223b4;
|
|
}
|
|
}
|
|
else {
|
|
LAB_006223d9:
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Type();
|
|
if (iVar8 == 4) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Position(&local_1e8);
|
|
local_150.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::DistanceSquared(&this->_pos);
|
|
if (625.0 <= local_150.y) goto LAB_00622693;
|
|
msvc::vector<int>::operator_index();
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(__RTDynamicCast());
|
|
local_120 = local_EAX_25497;
|
|
cVar2 = FUN_0060cdd0();
|
|
if ((cVar2 == '\0') &&
|
|
(cVar2 = (GHIDRA_CAST<Entity_Bomb *>((GHIDRA_CAST<Entity_Bomb *>(local_EAX_25497))))->Entity_Bomb::IsFetus(), cVar2 != '\0')) {
|
|
local_EAX_25497->Remove();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(&DAT_00c7fc60);
|
|
do {
|
|
local_150.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::InitSeed();
|
|
local_160.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SubType();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity)::SpawnerEntity();
|
|
local_16c.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Velocity(&local_1e0);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Position(&local_228);
|
|
uVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Variant();
|
|
uVar6 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Type();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(uVar6,uVar4,scratchVec,GHIDRA_CAST<Vector *>(local_16c.y),GHIDRA_CAST<Entity *>(local_11c),
|
|
GHIDRA_UINT(local_160.y),GHIDRA_UINT(local_150.y));
|
|
bomb = GHIDRA_CAST<Entity_Bomb *>(__RTDynamicCast());
|
|
local_EAX_25497 = local_120;
|
|
(GHIDRA_CAST<Entity_Bomb *>((GHIDRA_CAST<Entity_Bomb *>(local_120))))->Entity_Bomb::IsFetus();
|
|
FUN_0060cdb0();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(bomb))))->Entity::AddEntityFlags(0x4000000);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::GridCollisionClass();
|
|
FUN_0044bfa0();
|
|
FUN_0060cde0();
|
|
(GHIDRA_CAST<Entity_Bomb *>((GHIDRA_CAST<Entity_Bomb *>(local_EAX_25497))))->Entity_Bomb::Flags(&bombFlags);
|
|
FUN_006a6910();
|
|
floatResult = (long double)Entity_Tear::FallingAcceleration
|
|
(GHIDRA_CAST<Entity_Tear *>(local_EAX_25497));
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(bomb))))->Entity_Projectile::set_falling_accel((float)floatResult);
|
|
iVar8 = Player(local_EAX_25497);
|
|
(GHIDRA_CAST<Entity_Bomb *>((bomb)))->Entity_Bomb::SetExplosionCountdown(iVar8);
|
|
(GHIDRA_CAST<Entity_Bomb *>((GHIDRA_CAST<Entity_Bomb *>(local_EAX_25497))))->Entity_Bomb::RadiusMultiplier();
|
|
FUN_00435e70();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((30.0 - (float)GHIDRA_INT(local_118) * 20.0));
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(bomb))))->Entity::Velocity(&local_210);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(&local_218,(float)local_11c);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(bomb))))->Entity::SetVelocity(scratchVec);
|
|
FUN_0060cdf0();
|
|
FUN_00456820();
|
|
FUN_0060ce00();
|
|
FUN_0060ce10();
|
|
bomb->SetColor();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(local_134) + 0x2c));
|
|
} while (GHIDRA_INT(local_134) < 0xc7fd10);
|
|
goto LAB_006223ae;
|
|
}
|
|
LAB_006223b4:
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(local_130.y);
|
|
}
|
|
else {
|
|
LAB_00622693:
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Type();
|
|
if (iVar8 == 7) {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::SubType();
|
|
if (iVar8 == 2) {
|
|
msvc::vector<int>::operator_index();
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
|
|
local_134 = tear;
|
|
cVar2 = FUN_0060cef0();
|
|
if (cVar2 == '\0') {
|
|
floatResult = (long double)(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(tear))))->Entity_Laser::Radius();
|
|
local_160.y = (float)(floatResult * (long double)0.5);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Position(&local_220);
|
|
local_150.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::DistanceSquared(&this->_pos);
|
|
if (local_150.y <= local_160.y * local_160.y) {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
LAB_00622760:
|
|
local_150.y = (float)Random();
|
|
local_160.y = (float)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::SubType();
|
|
local_11c = this->_player;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Velocity(&local_140);
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Position(GHIDRA_CAST<Vector *>((local_1a4 + 8)));
|
|
uVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::Variant();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(7,uVar4,pVVar9,scratchVec,GHIDRA_CAST<Entity *>(local_11c),
|
|
GHIDRA_UINT(local_160.y),GHIDRA_UINT(local_150.y));
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>(__RTDynamicCast());
|
|
local_120 = local_EAX_25497;
|
|
scratchVec = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity)::PositionOffset();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetPositionOffset(scratchVec);
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_134))))->Entity_Laser::Radius();
|
|
FUN_0060ce80();
|
|
this = self;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetSpawnerEntity(self->_player);
|
|
FUN_00435f70();
|
|
scratchFlags = (GHIDRA_CAST<Entity_Tear *>((local_134)))->Entity_Tear::TearFlags(&local_90);
|
|
fVar13 = *GHIDRA_CAST<float *>(&scratchFlags->_l);
|
|
FUN_00456830();
|
|
FUN_0060ce70();
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_EAX_25497))))->Entity_Laser::SetMaxDistance(fVar13);
|
|
FUN_0060ced0();
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_EAX_25497))))->Entity_Laser::SetBlackHpDropChance();
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(local_EAX_25497) + 0x40);
|
|
floatResult = (long double)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::CollisionDamage();
|
|
local_150.y = (float)floatResult;
|
|
(*virtualFn)();
|
|
floatResult = (long double)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::DepthOffset();
|
|
local_EAX_25497 = local_120;
|
|
set_field_358(local_120,(float)floatResult);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::InitSeed();
|
|
FUN_005b15a0();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::GridCollisionClass();
|
|
FUN_0044bfa0();
|
|
FUN_0060ce60();
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_EAX_25497))))->Entity_Laser::SetHomingType();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::SpawnerType();
|
|
FUN_004316b0();
|
|
scratchVec = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity)::TargetPosition();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetTargetPosition(*scratchVec);
|
|
FUN_0060cee0();
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_EAX_25497))))->Entity_Laser::SetMultidimensionalTouched();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetParent(this->_player);
|
|
FUN_00579760();
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_EAX_25497))))->Entity_Laser::SetTimeout();
|
|
FUN_0060ce30();
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_EAX_25497))))->Entity_Laser::SetOneHit();
|
|
FUN_0060ce50();
|
|
FUN_0060ce40();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_134))))->Entity::Visible();
|
|
FUN_0044bf90();
|
|
if (local_118 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Velocity(&local_230);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(&local_238,-30.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetVelocity(scratchVec);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(local_EAX_25497) + 0x3c);
|
|
(GHIDRA_CAST<Color *>((&local_54)))->Color::Color();
|
|
LAB_00622a96:
|
|
(*virtualFn)();
|
|
local_EAX_25497 = local_120;
|
|
LAB_00622ab7:
|
|
FUN_005cd5a0();
|
|
local_EAX_25497->Update();
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
if (3 < GHIDRA_INT(local_118)) goto LAB_00622b6f;
|
|
tear = local_134;
|
|
goto LAB_00622760;
|
|
}
|
|
if (local_118 == GHIDRA_CAST<Entity_Player *>(0x1)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Velocity(GHIDRA_CAST<Vector *>(&local_248._h));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(GHIDRA_CAST<Vector *>(&local_258._h),-10.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetVelocity(scratchVec);
|
|
LAB_00622a6e:
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(local_EAX_25497) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
goto LAB_00622a96;
|
|
}
|
|
if (local_118 == GHIDRA_CAST<Entity_Player *>(0x2)) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Velocity(&local_1f0);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(GHIDRA_CAST<Vector *>(&local_208._h),10.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetVelocity(scratchVec);
|
|
goto LAB_00622a6e;
|
|
}
|
|
if (local_118 != GHIDRA_CAST<Entity_Player *>(0x3)) goto LAB_00622ab7;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Velocity(GHIDRA_CAST<Vector *>(&local_1b8._h))
|
|
;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Rotated(&local_60,30.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::SetVelocity(scratchVec);
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(local_EAX_25497) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*virtualFn)();
|
|
local_EAX_25497 = local_120;
|
|
FUN_005cd5a0();
|
|
local_EAX_25497->Update();
|
|
LAB_00622b6f:
|
|
(**(code **)(*GHIDRA_CAST<int *>(local_134) + 0x28))();
|
|
}
|
|
}
|
|
goto LAB_006223b4;
|
|
}
|
|
}
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar7))))->Entity::Type();
|
|
if (iVar8 == 8) {
|
|
msvc::vector<int>::operator_index();
|
|
local_130.y = (float)FUN_0060cc90();
|
|
cVar2 = FUN_0060cfd0();
|
|
if ((cVar2 == '\0') &&
|
|
(cVar2 = (GHIDRA_CAST<Entity_Knife *>((GHIDRA_CAST<Entity_Knife *>(local_130.y))))->Entity_Knife::IsFlying(), cVar2 != '\0')) {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_130.y))))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
local_150.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::DistanceSquared(&this->_pos);
|
|
if (local_150.y <= 625.0) {
|
|
(GHIDRA_CAST<Entity_Knife *>((GHIDRA_CAST<Entity_Knife *>(local_130.y))))->Entity_Knife::spawn_child_knife();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_006223ba:
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sourceRef)) + 0x1))));
|
|
local_130.y = (float)sourceRef;
|
|
gridIndexCounts = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<EntityList *>((local_164)))->EntityList)::Size();
|
|
} while (sourceRef < gridIndexCounts);
|
|
}
|
|
break;
|
|
case 0x7c:
|
|
FamiliarAI::mystery_egg(this);
|
|
break;
|
|
case 0x7d:
|
|
FamiliarAI::lil_spewer(this);
|
|
break;
|
|
case 0x7f:
|
|
pfVar10 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetAimDirection();
|
|
local_160.x = *pfVar10;
|
|
local_160.y = pfVar10[1];
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetHeadDirection();
|
|
scratchVec = Isaac::GetAxisAlignedUnitVectorFromDir(GHIDRA_CAST<Vector *>((local_78 + 8)),iVar8);
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_78 + 8)))))->Vector::Vector(0.0,1.0);
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
}
|
|
fVar16 = 120.0;
|
|
iVar8 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetFrameCount();
|
|
fVar13 = sinf_wrapper(((float)iVar8 / 30.0) * 3.1415927);
|
|
local_150.y = assert_lerp_range(fVar13,-1.0,1.0,20.0,fVar16,1);
|
|
local_148.y = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::GetAngleDegrees();
|
|
fVar13 = LerpAngleDeg(this->_orbitAngleOffset,local_148.y,0.4);
|
|
this->_orbitAngleOffset = fVar13;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_60);
|
|
pVVar9 = Vector::FromAngle(GHIDRA_CAST<Vector *>((local_78 + 8)),this->_orbitAngleOffset);
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_1b8._h),&local_150.y);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_140,pVVar9);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_208._h),&this->_pos);
|
|
local_148.y = 0.8;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_78 + 8)),&local_148.y);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
this->_friction = this->_friction * 0.7;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_1f0);
|
|
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_128,scratchVec);
|
|
fVar13 = (GHIDRA_CAST<Vector *>((&local_128)))->Vector::GetAngleDegrees();
|
|
local_148.y = fVar13 - 90.0;
|
|
local_148.y = normalize_angle_degrees(local_148.y);
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_rotation = local_148.y;
|
|
floatResult = (long double)(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Rotation();
|
|
local_148.y = (float)floatResult;
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(CONCAT13(1.0 < local_148.y,(undefined3)local_134));
|
|
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_flipX = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3)));
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(7,0);
|
|
if (bVar1 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar8 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&this->_pos);
|
|
if (-1 < iVar8) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_a8 + 4)))))->EntityRef::EntityRef();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::DamageGridWithSource(iVar8,1,sourceRef);
|
|
}
|
|
}
|
|
break;
|
|
case 0x80:
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::IsLoopingAnimation();
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::MultiplyFriction();
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
sprintf_s(idleAnimName,0x20,GHIDRA_CAST<uint8_t *>("Idle%d"));
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(idleAnimName,0);
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
iVar8 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
|
|
iVar8 = Isaac::Random(iVar8);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(iVar8);
|
|
}
|
|
}
|
|
else {
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
GetOrbitPosition(this,&local_150,scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Velocity(&local_158);
|
|
local_128.y = 2.0;
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_148,&local_128.y);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_158,&local_148);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_150)))->Vector::__sub(&local_174,scratchVec);
|
|
local_128.y = 0.5;
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_140,&local_128.y);
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
if (iVar8 < 0x28) {
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
fVar13 = Math::clamp((float)(iVar8 + -10) / 30.0,0.06,1.0);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>((1.0 / fVar13 + 4.0));
|
|
}
|
|
else {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x40a00000);
|
|
}
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Length();
|
|
if ((float)local_118 < local_128.y) {
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::Resize((float)local_118 - 1.0);
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_148)))->Vector::__add(&local_158,&local_140);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__div(&local_174,&this->_friction);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
break;
|
|
case 0x81:
|
|
cVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Visible();
|
|
if (cVar2 == '\0') {
|
|
LAB_0061e4de:
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(&g_vectorZero);
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 == 0) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_78 + 8)),&this->_pos);
|
|
local_148.y = 0.5;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_60,&local_148.y);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
bVar1 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::IsEventTriggered(s_Spawn);
|
|
if (bVar1 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Room *>((room)))->Room)::GetGridIndex(&this->_pos);
|
|
local_148.y = (float)local_EAX_25497;
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
gridEntity = (GHIDRA_CAST<Room *>((room)))->Room::GetGridEntity(GHIDRA_UINT(local_EAX_25497));
|
|
if (((gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) ||
|
|
(iVar8 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType(), iVar8 == 1)) ||
|
|
(iVar8 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType(), iVar8 == 10)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar1 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
|
|
if (bVar1 == 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
(GHIDRA_CAST<Room *>((room)))->Room::SpawnGridEntity(GHIDRA_INT(local_148.y),0xe,6,uVar4,0);
|
|
Game::ButterBeanFart(g_game,&this->_pos,120.0,this->_player,0,0);
|
|
}
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x25,1.0,2,0,1.0);
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty);
|
|
if (bVar1 != 0) {
|
|
FUN_0044bf90();
|
|
}
|
|
}
|
|
else {
|
|
FollowParent(this);
|
|
}
|
|
}
|
|
break;
|
|
case 0x83:
|
|
update_idle_anim_by_size(this);
|
|
MoveDelayed(this,5);
|
|
break;
|
|
case 200:
|
|
ai_boiled_baby(this);
|
|
break;
|
|
case 0xc9:
|
|
zhl_misfit_006414c0(this);
|
|
break;
|
|
case 0xca:
|
|
ai_shadow_intruder_damocles(this,0);
|
|
break;
|
|
case 0xcb:
|
|
ai_blood_oath(this);
|
|
break;
|
|
case 0xcc:
|
|
FamiliarAI::variant_204(this);
|
|
break;
|
|
case 0xce:
|
|
case 0xed:
|
|
ai_wisp(this);
|
|
break;
|
|
case 0xd0:
|
|
FollowParent(this);
|
|
sprite = &this->_sprite;
|
|
local_148.y = (float)sprite;
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
if (iVar8 == 0) {
|
|
LAB_00623343:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("FloatDown"));
|
|
if ((bVar1 == 0) && (bVar1 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar1 == 0)) {
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::IsPlaying(s_Spawn);
|
|
if ((bVar1 != 0) && (bVar1 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(sprite))))->Sprite::IsEventTriggered("Shoot"), bVar1 != 0)
|
|
) {
|
|
SoundEffects::PlayWithFartOverride(0xb2,1.0,2,0,1.0);
|
|
iVar8 = Isaac::Random(3);
|
|
local_16c.y = (float)(iVar8 + 4);
|
|
fVar13 = apply_tear_modifiers(this);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((fVar13 * 3.5));
|
|
if (0 < GHIDRA_INT((iVar8 + 4))) {
|
|
do {
|
|
MusicManager::RandomVector(&local_140);
|
|
local_148.y = 10.0;
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::operator_mul_assign(&local_148.y);
|
|
fVar13 = random_float();
|
|
local_150.y = fVar13 * 0.2 + 0.7;
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::operator_mul_assign(&local_150.y);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x100);
|
|
if (bVar1 == 0) {
|
|
FUN_00431270();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_a8))))->Color::Color();
|
|
if (this->_isLilDelirium != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_a8))))->Color::SetColorize(2.4,2.4,2.4,1.0);
|
|
}
|
|
uVar4 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,1,&this->_pos,&local_140,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::set_falling_accel(0.8);
|
|
random_float();
|
|
FUN_00444c70();
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_78)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_78)) + 0x0)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_78)) + 0x8)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = pcStack_6c;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
|
tear->SetColor();
|
|
iVar8 = Isaac::Random(2);
|
|
if (iVar8 == 0) {
|
|
fVar13 = random_float();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale((fVar13 * 0.05 + 0.9) * 0.8);
|
|
}
|
|
else {
|
|
fVar13 = random_float();
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetScale((fVar13 * 0.05 + 1.3) * 0.8);
|
|
}
|
|
tear->SetCollisionDamage();
|
|
TryFireTear(this,tear);
|
|
}
|
|
else {
|
|
uVar4 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(9,0,&this->_pos,&local_140,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::set_falling_accel(0.8);
|
|
random_float();
|
|
FUN_00444c70();
|
|
iVar8 = Isaac::Random(2);
|
|
if (iVar8 == 0) {
|
|
random_float();
|
|
}
|
|
else {
|
|
random_float();
|
|
}
|
|
FUN_004508a0();
|
|
}
|
|
tear->Update();
|
|
local_16c.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(local_16c.y) + -0x848))))) + 0x847)));
|
|
} while (GHIDRA_CAST<uint8_t *>(local_16c.y) != GHIDRA_CAST<uint8_t *>(0x0));
|
|
local_16c.y = 0.0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
iVar8 = apply_forgotten_lullaby(this,4);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(iVar8,0);
|
|
if (bVar1 != 0) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar8 = (GHIDRA_CAST<Room *>((room)))->Room::GetAliveEnemiesCount();
|
|
if (0 < iVar8) {
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x42a00000);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x100);
|
|
if (bVar1 != 0) {
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x43340000);
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_130.y = 0.0;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
|
|
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
|
|
EntityList::QueryRadius
|
|
(entityList,GHIDRA_CAST<EntityList_EL *>(local_78),&this->_pos,(float)local_11c,8);
|
|
local_14 = 1.96182e-44;
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
iVar8 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList::Size();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::vector<int>::operator_index();
|
|
followTarget = GHIDRA_CAST<Entity *>(*puVar7);
|
|
if (followTarget != GHIDRA_CAST<Entity *>(0x0)) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x100);
|
|
if ((bVar1 == 0) ||
|
|
((bVar1 = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::is_player(), bVar1 == 0 &&
|
|
((bVar1 = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::IsFamiliar(), bVar1 == 0 ||
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::HasEntityFlags(0x100), bVar1 != 0)))))) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x100);
|
|
if ((bVar1 == 0) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar1 != 0))
|
|
{
|
|
local_130.y = (float)(GHIDRA_INT(local_130.y) + 1);
|
|
}
|
|
}
|
|
else {
|
|
local_130.y = (float)(GHIDRA_INT(local_130.y) + 1);
|
|
}
|
|
}
|
|
sourceRef = GHIDRA_CAST<Entity_Player *>(local_130.y);
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_118)) + 0x1))));
|
|
listSize = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_78))))->EntityList)::Size();
|
|
} while (local_118 < listSize);
|
|
}
|
|
iVar8 = 5;
|
|
if (GHIDRA_INT(sourceRef) < 1) {
|
|
iVar8 = 0x14;
|
|
}
|
|
iVar8 = Isaac::Random(iVar8);
|
|
if (iVar8 != 0) goto LAB_0061f2a8;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_148.y))))->ANM2::Play(s_Spawn,1);
|
|
gridIndexCounts = local_78;
|
|
goto LAB_006241ee;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 0xd2:
|
|
ai_bird_cage(this);
|
|
break;
|
|
case 0xd3:
|
|
FamiliarAI::lost_soul(this);
|
|
break;
|
|
case 0xd4:
|
|
FamiliarAI::lil_dumpy(this);
|
|
break;
|
|
case 0xd8:
|
|
case 0xd9:
|
|
FamiliarAI::tinytoma(this);
|
|
break;
|
|
case 0xda:
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
scratchVec = GetOrbitPosition(this,&local_60,scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_1b8._h),&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
ai_bot_fly(this);
|
|
break;
|
|
case 0xdd:
|
|
FUN_006401d0();
|
|
break;
|
|
case 0xde:
|
|
ai_stitches(this);
|
|
break;
|
|
case 0xe0:
|
|
FUN_0063e180();
|
|
break;
|
|
case 0xe1:
|
|
FUN_006403f0();
|
|
break;
|
|
case 0xe2:
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
scratchVec = GetOrbitPosition(this,&local_60,scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_1b8._h),&this->_pos);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x20000000000);
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
local_160.y = (float)(this->_chargeLevel + -1);
|
|
local_128.y = 0.0;
|
|
piVar11 = GHIDRA_CAST<int *>(std)::max<int>();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b602e8,0);
|
|
local_148.y = (float)(this->_chargeLevel + 1);
|
|
local_150.y = 7.00649e-45;
|
|
piVar11 = GHIDRA_CAST<int *>(std)::min<int>();
|
|
}
|
|
this->_chargeLevel = *piVar11;
|
|
local_148.y = 1.0;
|
|
local_150.y = (float)this->_chargeLevel * 0.2;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(std)::min<float>();
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(*puVar7);
|
|
local_150.y = 0.3;
|
|
local_148.y = (float)this->_chargeLevel * 0.06;
|
|
pfVar10 = GHIDRA_CAST<float *>(std)::min<float>();
|
|
local_16c.y = *pfVar10 + 0.7;
|
|
sfx = MusicManager::SFXManager();
|
|
bVar1 = (GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::IsPlaying(0x393);
|
|
if (bVar1 == 0) {
|
|
if (0 < this->_chargeLevel) {
|
|
SoundEffects::PlayWithFartOverride(0x393,(float)local_11c,0,1,local_16c.y);
|
|
}
|
|
}
|
|
else if (this->_chargeLevel < 1) {
|
|
sfx = MusicManager::SFXManager();
|
|
(GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::Stop(0x393);
|
|
}
|
|
else {
|
|
sfx = MusicManager::SFXManager();
|
|
(GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::AdjustVolume(0x393,(float)local_11c);
|
|
sfx = MusicManager::SFXManager();
|
|
(GHIDRA_CAST<SFXManager *>((sfx)))->SFXManager::AdjustPitch(0x393,local_16c.y);
|
|
}
|
|
break;
|
|
case 0xe4:
|
|
ai_minisaac(this);
|
|
break;
|
|
case 0xe5:
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
GetOrbitPosition(this,&local_160,scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Velocity(&local_60);
|
|
local_148.y = 2.0;
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_150,&local_148.y);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(GHIDRA_CAST<Vector *>(&local_1b8._h),&local_150);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::__sub(GHIDRA_CAST<Vector *>((local_78 + 8)),scratchVec);
|
|
local_148.y = 0.5;
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(&local_140,&local_148.y);
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
if (iVar8 < 0x28) {
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
|
|
fVar13 = Math::clamp((float)(iVar8 + -10) / 30.0,0.06,1.0);
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>((1.0 / fVar13 + 4.0));
|
|
}
|
|
else {
|
|
local_11c = GHIDRA_CAST<Entity_Familiar *>(0x40a00000);
|
|
}
|
|
local_148.y = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Length();
|
|
if ((float)local_11c < local_148.y) {
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::Resize((float)local_11c - 1.0);
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_150)))->Vector::__add(GHIDRA_CAST<Vector *>((local_78 + 8)),&local_140);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__div(&local_60,&this->_friction);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
break;
|
|
case 0xe7:
|
|
FamiliarAI::apollyons_best_friend(this);
|
|
break;
|
|
case 0xe9:
|
|
FamiliarAI::worm_friend(this);
|
|
break;
|
|
case 0xea:
|
|
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::IsLoopingAnimation();
|
|
if (bVar1 != 0) {
|
|
fVar13 = assert_lerp_range(this->_updateTime,0.0,15.0,1.0,0.8,1);
|
|
this->_friction = fVar13 * this->_friction;
|
|
}
|
|
break;
|
|
case 0xeb:
|
|
local_EAX_25497 = this->_player;
|
|
local_120 = local_EAX_25497;
|
|
update_weapon(this,0);
|
|
pfVar10 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetAimDirection();
|
|
local_160.x = *pfVar10;
|
|
local_160.y = pfVar10[1];
|
|
if ((((0 < this->_headFrameDelay) || (0 < this->_counter)) &&
|
|
(bVar1 = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_eq(&g_vectorZero), bVar1 != 0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_ne(&g_vectorZero), bVar1 != 0)) {
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(&this->_targetPosition);
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_eq(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_78 + 8)))))->Vector::Vector(0.0,1.0);
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
(GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_assign(&local_160);
|
|
local_130.y = 0.4;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x94,0);
|
|
local_134 = GHIDRA_CAST<Entity_Tear *>(CONCAT13(bVar1,(undefined3)local_134));
|
|
if (bVar1 != 0) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_78 + 8)))))->Vector::Vector(26.0,26.0);
|
|
(GHIDRA_CAST<Vector *>((&this->_orbitDistance)))->Vector::operator_assign(scratchVec);
|
|
game = g_game;
|
|
this->_orbitSpeed = 3.5;
|
|
iVar8 = (GHIDRA_CAST<Game *>((game)))->Game::GetFrameCount();
|
|
scratchVec = Vector::FromAngle(&local_60,
|
|
(float)iVar8 * this->_orbitSpeed - this->_orbitAngleOffset);
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
local_130.y = 0.8;
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::Rotated(GHIDRA_CAST<Vector *>((local_78 + 8)),-90.0);
|
|
local_148.y = 26.0;
|
|
scratchVec = Vector::operator_mul(&local_60,&local_148.y,scratchVec);
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_134)) + 0x3))) == '\0') {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
iVar8 = (GHIDRA_CAST<Room *>((room)))->Room::GetFrameCount();
|
|
if (0x1e < iVar8) {
|
|
local_11c = this;
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Parent();
|
|
if (iVar8 != 0) {
|
|
do {
|
|
followTarget = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity)::Parent();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::IsFamiliar();
|
|
if (bVar1 == 0) break;
|
|
this = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity)::Parent();
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Parent();
|
|
} while (iVar8 != 0);
|
|
local_11c = this;
|
|
}
|
|
scratchVec = GHIDRA_CAST<Vector *>(FUN_004172b0());
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_11c))))->Entity::Velocity(&local_60);
|
|
local_148.y = 1.0 - local_130.y;
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_1b8._h),&local_148.y);
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__div(GHIDRA_CAST<Vector *>(&local_208._h),&local_130.y);
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_140,pVVar9);
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Position(&local_1f0);
|
|
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_120))))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_60,&local_160);
|
|
local_148.y = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::DistanceSquared(scratchVec);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_1b8._h),&local_160);
|
|
local_150.y = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::DistanceSquared(scratchVec);
|
|
if (local_150.y < local_148.y) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::__unm(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
local_EAX_25497 = local_120;
|
|
this = self;
|
|
}
|
|
}
|
|
if (((GHIDRA_CAST<Entity *>(this->_parent) != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_parent))))->Entity::IsFamiliar(), bVar1 != 0)) &&
|
|
(iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_parent))))->Entity::Parent(), iVar8 != 0)) {
|
|
local_EAX_25497 = GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_parent))))->Entity)::Parent();
|
|
}
|
|
if (this->_subtype == 1) {
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::__unm(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(scratchVec);
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_EAX_25497))))->Entity::Position(GHIDRA_CAST<Vector *>((local_78 + 8)));
|
|
(GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_128,&local_160);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_128)))->Vector::__sub(&local_60,&this->_pos);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__mul(GHIDRA_CAST<Vector *>((local_78 + 8)),&local_130.y);
|
|
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(scratchVec);
|
|
this->_friction = this->_friction * 0.8;
|
|
break;
|
|
case 0xec:
|
|
FamiliarAI::star_of_bethlehem(this);
|
|
break;
|
|
case 0xee:
|
|
ai_blood_clot(this,0);
|
|
break;
|
|
case 0xef:
|
|
FamiliarAI::cube_baby(this);
|
|
break;
|
|
case 0xf0:
|
|
ai_umbilical_baby(this,0);
|
|
break;
|
|
case 0xf1:
|
|
FamiliarAI::blood_puppy(this);
|
|
break;
|
|
case 0xf2:
|
|
FamiliarAI::vanishing_twin(this);
|
|
break;
|
|
case 0xf3:
|
|
if (this->_state < 1) {
|
|
fVar13 = (this->_targetPosition).x;
|
|
if ((0.0 <= fVar13) &&
|
|
(pfVar10 = &(this->_targetPosition).y, 0.0 < *pfVar10 || *pfVar10 == 0.0))
|
|
goto LAB_0061fc21;
|
|
fVar16 = (this->_targetPosition).y;
|
|
fallVelocity = this->_speedMultiplier * 1.2 + fVar16;
|
|
fVar13 = this->_speedMultiplier * fVar16 + fVar13;
|
|
(this->_targetPosition).x = fVar13;
|
|
(this->_targetPosition).y = fallVelocity;
|
|
if ((fallVelocity < 0.0) || (iVar8 = 5, fallVelocity < -26.0)) {
|
|
iVar8 = 3;
|
|
}
|
|
this->_entityGridCollisionClass = iVar8;
|
|
if (0.0 < fVar13) {
|
|
(this->_targetPosition).x = 0.0;
|
|
(this->_targetPosition).y = 0.0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x400000000000000);
|
|
iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetPlayerType();
|
|
if ((iVar8 == 0x10) || (iVar8 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetPlayerType(), iVar8 == 0x23))
|
|
{
|
|
play_sound_with_fart_seed(499,1.0,2,0,1.0);
|
|
play_sound_with_fart_seed(0x1d3,1.0,2,0,1.0);
|
|
}
|
|
else {
|
|
play_sound_with_fart_seed(0x48,1.0,2,0,1.0);
|
|
uVar4 = Random();
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2,uVar4);
|
|
followTarget->Update();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (this->_state == 1) {
|
|
(GHIDRA_CAST<msvc::vector *>((&this->_hitList)))->msvc::vector::clear(0);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearEntityFlags(0x400000000000000);
|
|
uVar4 = this->_state & 0x80000003;
|
|
isEveryFourthState = uVar4 == 0;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
isEveryFourthState = (uVar4 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (isEveryFourthState) {
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(this) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*virtualFn)();
|
|
}
|
|
this->_entityGridCollisionClass = 0;
|
|
(GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_140);
|
|
local_128.y = assert_lerp_range((float)this->_state,0.0,15.0,1.0,16.0,1);
|
|
this->_state = this->_state + 1;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::__sub(&local_158,&this->_pos);
|
|
bVar1 = 0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::Resized(&local_174,local_128.y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity(scratchVec,bVar1);
|
|
iVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(2.0,0.0);
|
|
if (iVar8 != 0) {
|
|
uVar4 = Random();
|
|
local_128.y = 0.5;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::__mul(&local_158,&local_128.y);
|
|
followTarget = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6f,&this->_pos,scratchVec,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&local_174)))->Vector::Vector(0.0,-8.0);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_posOffset)))->Vector::__add(&local_184,scratchVec);
|
|
(GHIDRA_CAST<Entity *>((followTarget)))->Entity::SetPositionOffset(scratchVec);
|
|
set_field_358(followTarget,-5.0);
|
|
followTarget->Update();
|
|
}
|
|
LAB_0061fc21:
|
|
this->_friction = this->_friction * 0.85;
|
|
}
|
|
local_128.y = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::LengthSquared();
|
|
if ((3.0 < local_128.y) && (bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(3,0), bVar1 != 0)) {
|
|
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(this))))->Entity_NPC::MakeSplat(0.5);
|
|
}
|
|
followTarget = this->_player;
|
|
(this->_posOffset).y = (this->_targetPosition).x;
|
|
scratchVec = (GHIDRA_CAST<Entity *>((followTarget)))->Entity::Position(&local_158);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_174,scratchVec);
|
|
local_140.x = scratchVec->x;
|
|
local_140.y = scratchVec->y;
|
|
FUN_007792f0();
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000000000000);
|
|
if (bVar1 == 0) {
|
|
if (this->_state < 1) {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x43c80000);
|
|
}
|
|
else {
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(0x44c80000);
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Entity *>((this->_player)))->Entity::Position(&local_158);
|
|
local_128.y = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::DistanceSquared(&this->_pos);
|
|
if (local_128.y <= (float)local_118) {
|
|
Entity_Player::AnimateCollectible
|
|
(this->_player,0x2d9,GHIDRA_CAST<uint8_t *>("HideItem"),GHIDRA_CAST<uint8_t *>("PlayerPickupSparkle"));
|
|
play_sound_with_fart_seed(0xf9,1.0,2,0,1.0);
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player)::GetEffects();
|
|
(GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::RemoveCollectibleEffect(0x2d9,-1);
|
|
this->Remove();
|
|
}
|
|
}
|
|
}
|
|
switchD_0061ddf2_caseD_12:
|
|
LAB_00624200:
|
|
bVar1 = (GHIDRA_CAST<Vector *>((&self->_orbitDistance)))->Vector::operator_ne(&g_vectorZero);
|
|
if (bVar1 != 0) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::HasEntityFlags(0x20000000000);
|
|
if (bVar1 != 0) {
|
|
fVar13 = normalize_angle_degrees(self->_orbitAngleOffset - self->_orbitSpeed * 10.0);
|
|
self->_orbitAngleOffset = fVar13;
|
|
cVar2 = FUN_0060d120();
|
|
if ((cVar2 != '\0') && (bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::IsFrame(4,0), bVar1 != 0)) {
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(self) + 0x3c);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
(*virtualFn)();
|
|
}
|
|
}
|
|
local_EAX_25497 = self;
|
|
if (self->_orbitLayer == 8) {
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((self->_player)))->Entity_Player)::GetEffects();
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if (bVar1 == 0) {
|
|
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((local_EAX_25497->_player)))->Entity_Player)::GetEffects();
|
|
bVar1 = (GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::HasCollectibleEffect(0x12a);
|
|
if (bVar1 == 0) goto LAB_0062434e;
|
|
}
|
|
fVar13 = normalize_angle_degrees
|
|
(local_EAX_25497->_orbitAngleOffset - local_EAX_25497->_orbitSpeed * 0.5);
|
|
local_EAX_25497->_orbitAngleOffset = fVar13;
|
|
}
|
|
}
|
|
LAB_0062434e:
|
|
FUN_00860f00();
|
|
iVar8 = FUN_0060d6a0();
|
|
if (iVar8 < 1) {
|
|
local_EAX_25497 = self;
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::IsFrame(iVar8,self->_index);
|
|
local_EAX_25497 = self;
|
|
if (bVar1 != 0) {
|
|
if ((self->_variant != 0x18) && (self->_variant != 0x66)) {
|
|
(GHIDRA_CAST<msvc::vector *>((&self->_hitList)))->msvc::vector::clear(0);
|
|
}
|
|
}
|
|
}
|
|
fVar13 = apply_tear_modifiers(local_EAX_25497);
|
|
if (1.0 < fVar13) {
|
|
iVar8 = self->_variant;
|
|
if (iVar8 == 0xe7) {
|
|
scratchVec2 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity)::SpriteScale();
|
|
pVVar9 = &local_148;
|
|
local_148.y = 1.1;
|
|
scratchVec = GHIDRA_CAST<Vector *>((local_78 + 8));
|
|
}
|
|
else {
|
|
if (((iVar8 == 900) || (iVar8 == 0x3e)) || (iVar8 == 0xd3)) goto LAB_0062442e;
|
|
scratchVec2 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity)::SpriteScale();
|
|
pVVar9 = &local_150;
|
|
local_150.y = 1.25;
|
|
scratchVec = &local_60;
|
|
}
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec2)))->Vector::__mul(scratchVec,&pVVar9->y);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::SetSpriteScale(scratchVec);
|
|
}
|
|
LAB_0062442e:
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
bVar1 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
|
|
if ((bVar1 != 0) && (bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::IsFlying(), bVar1 == 0)) {
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
|
|
scratchVec = &self->_pos;
|
|
gridEntity = (GHIDRA_CAST<Room *>((room)))->Room::GetGridEntityFromPos(scratchVec);
|
|
if (((gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) &&
|
|
(iVar8 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType(), iVar8 == 0x13)) ||
|
|
((self->_variant == 0x4b || (self->_variant == 900)))) {
|
|
fVar13 = (self->_velocity).y;
|
|
if (self->_variant == 900) {
|
|
(self->_velocity).y = fVar13 + 0.8;
|
|
}
|
|
else {
|
|
pVVar9 = &self->_velocity;
|
|
(self->_velocity).y = fVar13 * 0.5;
|
|
if (pVVar9->x <= 0.0) {
|
|
if (pVVar9->x < 0.0) {
|
|
local_148.y = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Length();
|
|
pVVar9->x = -local_148.y;
|
|
}
|
|
}
|
|
else {
|
|
fVar13 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Length();
|
|
pVVar9->x = fVar13;
|
|
}
|
|
game = g_game;
|
|
(self->_velocity).y = 0.0;
|
|
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level)::GetCurrentRoom();
|
|
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_78 + 8)))))->Vector::Vector(0.0,
|
|
(self->_sizeMulti).y * self->_size + 0.5);
|
|
scratchVec = (GHIDRA_CAST<Vector *>((scratchVec)))->Vector::__add(&local_60,pVVar9);
|
|
local_140.x = scratchVec->x;
|
|
local_140.y = scratchVec->y;
|
|
iVar8 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(*scratchVec);
|
|
if (iVar8 != 4) {
|
|
bVar1 = 0;
|
|
scratchVec = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_78 + 8)))))->Vector::Vector(0.0,3.5);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::AddVelocity_divided(scratchVec,bVar1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(self))))->Entity::Update();
|
|
(GHIDRA_CAST<ANM2 *>((&self->_chargeBarSprite)))->ANM2::Update();
|
|
if (self->_dead != 0) {
|
|
self->Remove();
|
|
}
|
|
gridIndexCounts = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0xf3c)));
|
|
if (GHIDRA_CAST<PathFinder *>(self->_target) != GHIDRA_CAST<PathFinder *>(0x0)) {
|
|
local_148.y = (float)(GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(self->_target))))->PathFinder::GetGridIndex();
|
|
piVar11 = map_find_value(gridIndexCounts,GHIDRA_UINT(&local_148.y));
|
|
*piVar11 = *piVar11 + 1;
|
|
}
|
|
FUN_0042c770();
|
|
msvc::iterator_copy(gridIndexCounts,&local_148.y);
|
|
cVar2 = FUN_0042c710();
|
|
while (cVar2 != '\0') {
|
|
iVar8 = FUN_005cba30();
|
|
if (*GHIDRA_CAST<int *>((iVar8 + 4)) < 0) {
|
|
iVar8 = FUN_005cba30();
|
|
*GHIDRA_CAST<int *>((iVar8 + 4)) = *GHIDRA_CAST<int *>((iVar8 + 4)) + 1;
|
|
}
|
|
iVar8 = FUN_005cba30();
|
|
if (*GHIDRA_CAST<int *>((iVar8 + 4)) == 0) {
|
|
pfVar10 = GHIDRA_CAST<float *>(FUN_00651db0());
|
|
local_118 = GHIDRA_CAST<Entity_Player *>(*pfVar10);
|
|
}
|
|
else {
|
|
set_iterator_post_increment(&local_118,&local_17c.y,0);
|
|
}
|
|
msvc::iterator_copy(gridIndexCounts,&local_148.y);
|
|
cVar2 = FUN_0042c710();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
switchD_0061ddf2_caseD_62:
|
|
MoveDelayed(this,0x14);
|
|
goto switchD_0061ddf2_caseD_12;
|
|
}
|
|
|
|
// 00624a80
|
|
void Entity_Familiar::Interpolate()
|
|
{
|
|
float fVar1;
|
|
uint8_t isEffectActive;
|
|
float velocityX;
|
|
float baseFriction;
|
|
float baseFriction;
|
|
int orbitLayer;
|
|
void *player;
|
|
|
|
switch(this->_variant) {
|
|
case 0x3d:
|
|
ai_incubus_shot();
|
|
break;
|
|
case 0x50:
|
|
update_weapon(this,1);
|
|
break;
|
|
case 0xca:
|
|
ai_shadow_intruder_damocles(this,1);
|
|
break;
|
|
case 0xee:
|
|
fVar1 = this->_speedMultiplier;
|
|
baseFriction = this->_friction;
|
|
if (fVar1 != 1.0) {
|
|
baseFriction = baseFriction / ((baseFriction + fVar1) - baseFriction * fVar1);
|
|
}
|
|
baseFriction = this->_baseFriction;
|
|
velocityX = baseFriction * (this->_velocity).x;
|
|
baseFriction = baseFriction * (this->_velocity).y;
|
|
(this->_velocity).x = velocityX;
|
|
(this->_velocity).y = baseFriction;
|
|
fVar1 = this->_speedMultiplier;
|
|
this->_friction = baseFriction;
|
|
(this->_pos).x = fVar1 * velocityX + (this->_pos).x;
|
|
(this->_pos).y = fVar1 * baseFriction + (this->_pos).y;
|
|
ai_blood_clot(this,1);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::CollideWithGrid(1);
|
|
return;
|
|
case 0xf0:
|
|
ai_umbilical_baby(this,1);
|
|
}
|
|
fVar1 = this->_orbitAngleOffset;
|
|
orbitLayer = this->_orbitLayer;
|
|
if (-1 < orbitLayer) {
|
|
baseFriction = fVar1;
|
|
if ((this->_flags & 0x20000000000) != 0) {
|
|
baseFriction = fVar1 - this->_orbitSpeed * 5.0;
|
|
if (360.0 < ABS(baseFriction)) {
|
|
baseFriction = fmodf(baseFriction,360.0);
|
|
}
|
|
if (baseFriction <= 180.0) {
|
|
if (baseFriction < -180.0) {
|
|
baseFriction = baseFriction + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
baseFriction = baseFriction - 360.0;
|
|
}
|
|
this->_orbitAngleOffset = baseFriction;
|
|
}
|
|
if (orbitLayer == 8) {
|
|
player = this->_player;
|
|
isEffectActive =
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(player) + 0x1508)))))->TemporaryEffects::HasCollectibleEffect(0x4d);
|
|
if ((isEffectActive != 0) ||
|
|
(isEffectActive =
|
|
TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(player) + 0x1508)),0x12a), isEffectActive != 0)) {
|
|
baseFriction = baseFriction - this->_orbitSpeed * 0.25;
|
|
if (360.0 < ABS(baseFriction)) {
|
|
baseFriction = fmodf(baseFriction,360.0);
|
|
}
|
|
if (baseFriction <= 180.0) {
|
|
if (baseFriction < -180.0) {
|
|
baseFriction = baseFriction + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
baseFriction = baseFriction - 360.0;
|
|
}
|
|
this->_orbitAngleOffset = baseFriction;
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Interpolate();
|
|
if (this->_variant == 0xf3) {
|
|
(this->_posOffset).y =
|
|
(this->_targetPosition).y * 0.5 * this->_speedMultiplier + (this->_posOffset).y;
|
|
}
|
|
this->_orbitAngleOffset = fVar1;
|
|
return;
|
|
}
|
|
|
|
// 00624dd0
|
|
uint8_t Entity_Familiar::RenderShadowLayer(Vector *offset)
|
|
{
|
|
uint8_t bVar1;
|
|
Entity *umbilicalWhip;
|
|
|
|
bVar1 = IsLilithBirthrightIncubus(this);
|
|
if (bVar1 != 0) {
|
|
umbilicalWhip = get_incubus_umbilical_whip(this);
|
|
if ((umbilicalWhip == GHIDRA_CAST<Entity *>(0x0)) || (umbilicalWhip->_visible == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::RenderShadowLayer(offset);
|
|
return bVar1;
|
|
}
|
|
|
|
// 00624e10
|
|
void Entity_Familiar::Render(Vector *offset)
|
|
{
|
|
code *pcVar1;
|
|
float fVar2;
|
|
uint8_t bVar3;
|
|
Entity *umbilicalWhip;
|
|
uint32_t seed;
|
|
LayerState *layer;
|
|
void *pvVar4;
|
|
Game *game;
|
|
uint8_t *layerId;
|
|
float *layerColor;
|
|
int iVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
double flooredCoord;
|
|
uint8_t local_194 [44];
|
|
ColorMod fadedColor;
|
|
int iconRenderParams;
|
|
uint32_t uStack_138;
|
|
uint32_t uStack_134;
|
|
uint32_t uStack_130;
|
|
uint32_t uStack_12c;
|
|
float savedColorizeR;
|
|
float savedColorizeG;
|
|
float savedColorizeB;
|
|
float savedColorizeA;
|
|
float savedTintR;
|
|
float savedTintG;
|
|
float savedTintB;
|
|
float savedTintA;
|
|
float savedOffsetXY [2];
|
|
float savedOffsetZ;
|
|
float opacity;
|
|
Vector *renderOffset;
|
|
uint8_t savedPlayerFlag171;
|
|
float local_f0;
|
|
float local_ec;
|
|
Vector iconPosX;
|
|
float local_e0;
|
|
char isHologram;
|
|
int *local_d8;
|
|
float local_d4;
|
|
float local_d0;
|
|
Vector iconScaleX;
|
|
int savedPlayerColor2;
|
|
int iStack_c0;
|
|
int iStack_bc;
|
|
int iStack_b8;
|
|
int iStack_b4;
|
|
int iStack_b0;
|
|
int iStack_ac;
|
|
int iStack_a8;
|
|
uint64_t uStack_a4;
|
|
int iStack_9c;
|
|
float savedPlayerColor;
|
|
float fStack_94;
|
|
float fStack_90;
|
|
int iStack_8c;
|
|
float fStack_88;
|
|
float fStack_84;
|
|
float fStack_80;
|
|
float fStack_7c;
|
|
float afStack_78 [2];
|
|
float fStack_70;
|
|
int fadedPlayerColor;
|
|
int iStack_68;
|
|
int iStack_64;
|
|
float fStack_60;
|
|
int iStack_5c;
|
|
int iStack_58;
|
|
int iStack_54;
|
|
int iStack_50;
|
|
uint64_t uStack_4c;
|
|
int iStack_44;
|
|
ColorMod tmpColor;
|
|
uint32_t stackCookie;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
float local_8;
|
|
int *player;
|
|
Vector *renderPos;
|
|
ColorMod *spriteColor;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00af6cd1;
|
|
local_10 = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((&tmpColor)[1]._colorize);
|
|
ExceptionList = &local_10;
|
|
renderOffset = offset;
|
|
bVar3 = IsLilithBirthrightIncubus(this);
|
|
if (bVar3 != 0) {
|
|
umbilicalWhip = get_incubus_umbilical_whip(this);
|
|
if (umbilicalWhip == GHIDRA_CAST<Entity *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (umbilicalWhip->_visible == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
savedTintR = (this->_sprite)._color._tint[0];
|
|
savedTintG = (this->_sprite)._color._tint[1];
|
|
savedTintB = (this->_sprite)._color._tint[2];
|
|
savedTintA = (this->_sprite)._color._tint[3];
|
|
savedOffsetXY = *(float (*) [2])(this->_sprite)._color._offset;
|
|
savedOffsetZ = (this->_sprite)._color._offset[2];
|
|
opacity = 1.0;
|
|
savedColorizeR = (this->_sprite)._color._colorize[0];
|
|
savedColorizeG = (this->_sprite)._color._colorize[1];
|
|
savedColorizeB = (this->_sprite)._color._colorize[2];
|
|
savedColorizeA = (this->_sprite)._color._colorize[3];
|
|
if (this->_player == (void *)0x0) {
|
|
game = g_game;
|
|
}
|
|
else {
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(bVar3 = NetplayManager::IsIdxLocalPlayer
|
|
(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x1618))), bVar3 == 0)) {
|
|
if ((g_game == GHIDRA_CAST<Game *>(0x0)) || (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
|
|
opacity = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1;
|
|
}
|
|
else {
|
|
opacity = 1.0;
|
|
}
|
|
}
|
|
game = g_game;
|
|
spriteColor = &(this->_sprite)._color;
|
|
fadedColor._tint[3] = savedTintA * opacity;
|
|
offset = renderOffset;
|
|
fadedColor._tint[0] = savedTintR;
|
|
fadedColor._tint[1] = savedTintG;
|
|
fadedColor._tint[2] = savedTintB;
|
|
fadedColor._colorize[0] = savedColorizeR;
|
|
fadedColor._colorize[1] = savedColorizeG;
|
|
fadedColor._colorize[2] = savedColorizeB;
|
|
fadedColor._colorize[3] = savedColorizeA;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fadedColor._offset)) + 0x0))) = savedOffsetXY;
|
|
if (spriteColor != &fadedColor) {
|
|
*(float (*) [2])(this->_sprite)._color._offset = savedOffsetXY;
|
|
spriteColor->_tint[0] = savedTintR;
|
|
(this->_sprite)._color._tint[1] = savedTintG;
|
|
(this->_sprite)._color._tint[2] = savedTintB;
|
|
(this->_sprite)._color._tint[3] = fadedColor._tint[3];
|
|
(this->_sprite)._color._offset[2] = savedOffsetZ;
|
|
(this->_sprite)._color._colorize[0] = savedColorizeR;
|
|
(this->_sprite)._color._colorize[1] = savedColorizeG;
|
|
(this->_sprite)._color._colorize[2] = savedColorizeB;
|
|
(this->_sprite)._color._colorize[3] = savedColorizeA;
|
|
}
|
|
}
|
|
local_d8 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(game->_room) + 0x12bc));
|
|
if (this->_player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_00624ff9:
|
|
isHologram = '\0';
|
|
}
|
|
else {
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IsHologram();
|
|
isHologram = '\x01';
|
|
if (bVar3 == 0) goto LAB_00624ff9;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c7fd10) &&
|
|
(_Init_thread_header(), DAT_00c7fd10 == -1)) {
|
|
_DAT_00c5c97c = 0x300000004;
|
|
DAT_00c5c984 = 0x1b;
|
|
_atexit(GHIDRA_CAST<_func_4879 *>(&DAT_00b15590));
|
|
local_8 = -NAN;
|
|
_Init_thread_footer(&DAT_00c7fd10);
|
|
}
|
|
if (isHologram != '\0') {
|
|
if ((DAT_00c5c978 == 0) &&
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n")), DAT_00c5c978 == 0)) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
seed = DAT_00c5c978 >> ((uint8_t)_DAT_00c5c97c & 0x1f) ^ DAT_00c5c978;
|
|
seed = seed << ((uint8_t)((uint64_t)_DAT_00c5c97c >> 0x20) & 0x1f) ^ seed;
|
|
tmpColor._offset[0] = 0.0;
|
|
tmpColor._offset[1] = 0.0;
|
|
DAT_00c5c978 = seed >> ((uint8_t)DAT_00c5c984 & 0x1f) ^ seed;
|
|
tmpColor._offset[2] = 0.0;
|
|
tmpColor._tint[0] = 1.0;
|
|
tmpColor._tint[1] = 1.0;
|
|
tmpColor._tint[2] = 1.0;
|
|
tmpColor._colorize[0] = 0.0;
|
|
tmpColor._colorize[1] = 0.0;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 0.0;
|
|
tmpColor._tint[3] =
|
|
(float)((double)GHIDRA_INT(DAT_00c5c978) + __uint_to_double_fixup[-(GHIDRA_INT(DAT_00c5c978) >> 0x1f)]) *
|
|
2.3283062e-10 * 0.15 + 0.05;
|
|
render_color_stack_push(&tmpColor);
|
|
}
|
|
if (this->_variant == 0x4b) {
|
|
pvVar4 = this->_player;
|
|
local_f0 = (g_screenHeight - 182.0) * 0.5;
|
|
local_d4 = (g_screenWidth - 338.0) * 0.5;
|
|
local_ec = g_displayPixelRatio * g_screenPointScale;
|
|
local_d0 = ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x33c)) - 60.0) * 0.65 + local_d4) * local_ec + 0.5;
|
|
flooredCoord = floor((double)local_d0);
|
|
local_d0 = (float)flooredCoord / local_ec;
|
|
local_e0 = ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x340)) - 140.0) * 0.65 + local_f0) * local_ec + 0.5;
|
|
flooredCoord = floor((double)local_e0);
|
|
local_e0 = (float)flooredCoord / local_ec;
|
|
local_d4 = (((this->_pos).x - 60.0) * 0.65 + local_d4) * local_ec + 0.5;
|
|
flooredCoord = floor((double)local_d4);
|
|
iconPosX.y = (float)flooredCoord / local_ec;
|
|
local_d4 = (((this->_pos).y - 140.0) * 0.65 + local_f0) * local_ec + 0.5;
|
|
flooredCoord = floor((double)local_d4);
|
|
local_d0 = local_d0 - iconPosX.y;
|
|
local_e0 = local_e0 - (float)flooredCoord / local_ec;
|
|
if (local_d8 == GHIDRA_CAST<int *>(&DAT_00000005)) {
|
|
local_e0 = local_e0 * -1.0;
|
|
}
|
|
layerId = GHIDRA_CAST<uint8_t *>(0x1);
|
|
do {
|
|
fVar7 = (float)((double)GHIDRA_INT(layerId) + __uint_to_double_fixup[-(GHIDRA_INT(layerId) >> 0x1f)]);
|
|
fVar6 = 1.0 - fVar7 * 0.125;
|
|
local_d4 = (this->_sprite)._scale.x;
|
|
iconPosX.y = (fVar7 * local_d0 * 0.125 + 0.0) / local_d4;
|
|
local_d4 = ((-5.0 - fVar6 * fVar6 * 7.0) + fVar7 * local_e0 * 0.125) / local_d4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(layerId);
|
|
layerId = layerId + 1;
|
|
(layer->_pos).x = iconPosX.y;
|
|
(layer->_pos).y = local_d4;
|
|
} while (layerId < &DAT_00000009);
|
|
LAB_0062578c:
|
|
offset = renderOffset;
|
|
}
|
|
else if (this->_variant == 0x4f) {
|
|
local_f0 = (g_screenHeight - 182.0) * 0.5;
|
|
iconScaleX.y = (g_screenWidth - 338.0) * 0.5;
|
|
local_e0 = g_displayPixelRatio * g_screenPointScale;
|
|
iconPosX.y = ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - 60.0) * 0.65 + iconScaleX.y) * local_e0
|
|
+ 0.5;
|
|
flooredCoord = floor((double)iconPosX.y);
|
|
local_d0 = (float)flooredCoord / local_e0;
|
|
iconPosX.y = ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - 140.0) * 0.65 + local_f0) * local_e0 +
|
|
0.5;
|
|
flooredCoord = floor((double)iconPosX.y);
|
|
iconPosX.y = (float)flooredCoord;
|
|
local_ec = iconPosX.y / local_e0;
|
|
iconScaleX.y = (((this->_pos).x - 60.0) * 0.65 + iconScaleX.y) * local_e0 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconPosX.y = (float)flooredCoord / local_e0;
|
|
iconScaleX.y = (((this->_pos).y - 140.0) * 0.65 + local_f0) * local_e0 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
local_d0 = local_d0 - iconPosX.y;
|
|
local_ec = local_ec - (float)flooredCoord / local_e0;
|
|
if (local_d8 == GHIDRA_CAST<int *>(&DAT_00000005)) {
|
|
local_ec = local_ec * -1.0;
|
|
}
|
|
layerId = GHIDRA_CAST<uint8_t *>(0x1);
|
|
local_d8 = GHIDRA_CAST<int *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x14f4)) * -1.0));
|
|
iconScaleX.y = -16.0 - (float)local_d8;
|
|
do {
|
|
fVar7 = (float)((double)GHIDRA_INT(layerId) + __uint_to_double_fixup[-(GHIDRA_INT(layerId) >> 0x1f)]);
|
|
fVar6 = 1.0 - fVar7 / 9.0;
|
|
local_d4 = (this->_sprite)._scale.x;
|
|
iconPosX.y = ((fVar7 * local_d0) / 9.0 + 0.0) / local_d4;
|
|
local_d4 = (iconScaleX.y * fVar6 * fVar6 + (float)local_d8 + (fVar7 * local_ec) / 9.0) /
|
|
local_d4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(layerId);
|
|
layerId = layerId + 1;
|
|
(layer->_pos).x = iconPosX.y;
|
|
(layer->_pos).y = local_d4;
|
|
} while (layerId < GHIDRA_CAST<uint8_t *>(0xa));
|
|
goto LAB_0062578c;
|
|
}
|
|
switch(this->_variant) {
|
|
case 0x30:
|
|
local_d0 = (float)__RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::
|
|
RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::IsaacsBodyData::RTTI_Type_Descriptor);
|
|
if (local_d0 != 0.0) {
|
|
local_d8 = GHIDRA_CAST<int *>((g_displayPixelRatio * g_screenPointScale));
|
|
iconScaleX.y = ((((this->_pos).x + (this->_posOffset).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_d8 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconPosX.y = (float)flooredCoord / (float)local_d8;
|
|
iconScaleX.y = ((((this->_posOffset).y + (this->_pos).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * (float)local_d8 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconScaleX.y = (float)flooredCoord;
|
|
fVar7 = iconScaleX.y / (float)local_d8;
|
|
local_f0 = 5.60519e-45;
|
|
local_d8 = GHIDRA_CAST<int *>((GHIDRA_INT(local_d0) + 0x568));
|
|
fVar6 = offset->y;
|
|
layerColor = GHIDRA_CAST<float *>((GHIDRA_INT(local_d0) + 0x1c0));
|
|
(this->_renderPosition).x = iconPosX.y + offset->x;
|
|
(this->_renderPosition).y = fVar7 + fVar6;
|
|
do {
|
|
iVar5 = *local_d8;
|
|
if (-1 < iVar5) {
|
|
spriteColor = &(this->_sprite)._color;
|
|
if (GHIDRA_CAST<ColorMod *>(layerColor) != spriteColor) {
|
|
fVar6 = (this->_sprite)._color._tint[1];
|
|
fVar7 = (this->_sprite)._color._tint[2];
|
|
fVar2 = (this->_sprite)._color._tint[3];
|
|
*layerColor = spriteColor->_tint[0];
|
|
layerColor[1] = fVar6;
|
|
layerColor[2] = fVar7;
|
|
layerColor[3] = fVar2;
|
|
fVar6 = (this->_sprite)._color._colorize[1];
|
|
fVar7 = (this->_sprite)._color._colorize[2];
|
|
fVar2 = (this->_sprite)._color._colorize[3];
|
|
layerColor[4] = (this->_sprite)._color._colorize[0];
|
|
layerColor[5] = fVar6;
|
|
layerColor[6] = fVar7;
|
|
layerColor[7] = fVar2;
|
|
fVar6 = (this->_sprite)._color._offset[1];
|
|
layerColor[8] = (this->_sprite)._color._offset[0];
|
|
layerColor[9] = fVar6;
|
|
layerColor[10] = (this->_sprite)._color._offset[2];
|
|
iVar5 = *local_d8;
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((layerColor + -0x2a)))))->Sprite::RenderLayer(iVar5,&this->_renderPosition,
|
|
&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_d8 = local_d8 + 1;
|
|
layerColor = layerColor + 0x45;
|
|
local_f0 = (float)(GHIDRA_INT(local_f0) + -1);
|
|
} while (local_f0 != 0.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(local_d0) + 4)))))->Sprite::RenderLayer(0,&this->_renderPosition,&g_vectorZero,
|
|
&g_vectorZero);
|
|
break;
|
|
}
|
|
default:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Render(offset);
|
|
break;
|
|
case 0x44:
|
|
if (this->_visible != 0) {
|
|
local_d8 = GHIDRA_CAST<int *>((g_displayPixelRatio * g_screenPointScale));
|
|
iconScaleX.y = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_d8 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconPosX.y = (float)flooredCoord / (float)local_d8;
|
|
iconScaleX.y = ((((this->_posOffset).y + (this->_pos).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * (float)local_d8 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconScaleX.y = (float)flooredCoord;
|
|
fVar6 = offset->x;
|
|
renderPos = &this->_renderPosition;
|
|
(this->_renderPosition).y = iconScaleX.y / (float)local_d8 + offset->y;
|
|
renderPos->x = iconPosX.y + fVar6;
|
|
player = this->_player;
|
|
savedPlayerColor = (float)player[0x3c];
|
|
fStack_94 = (float)player[0x3d];
|
|
fStack_90 = (float)player[0x3e];
|
|
iStack_8c = player[0x3f];
|
|
fStack_88 = (float)player[0x40];
|
|
fStack_84 = (float)player[0x41];
|
|
fStack_80 = (float)player[0x42];
|
|
fStack_7c = (float)player[0x43];
|
|
afStack_78 = *(float (*) [2])(player + 0x44);
|
|
fStack_70 = (float)player[0x46];
|
|
tmpColor._tint[3] = opacity;
|
|
tmpColor._tint[0] = savedPlayerColor;
|
|
tmpColor._tint[1] = fStack_94;
|
|
tmpColor._tint[2] = fStack_90;
|
|
tmpColor._colorize[0] = fStack_88;
|
|
tmpColor._colorize[1] = fStack_84;
|
|
tmpColor._colorize[2] = fStack_80;
|
|
tmpColor._colorize[3] = fStack_7c;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(tmpColor._offset)) + 0x0))) = afStack_78;
|
|
tmpColor._offset[2] = fStack_70;
|
|
(**(code **)(*player + 0x3c))(&tmpColor,0xffffffff,0xff,0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RenderGlow(renderPos);
|
|
FUN_0078e130(renderPos);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RenderHead(renderPos);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_player) + 0x3c))(&savedPlayerColor,0xffffffff,0xff,0,1);
|
|
}
|
|
break;
|
|
case 0x4e:
|
|
case 0xf3:
|
|
local_d8 = GHIDRA_CAST<int *>((g_displayPixelRatio * g_screenPointScale));
|
|
iconScaleX.y = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_d8 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconPosX.y = (float)flooredCoord / (float)local_d8;
|
|
iconScaleX.y = ((((this->_posOffset).y + (this->_pos).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * (float)local_d8 + 0.5;
|
|
flooredCoord = floor((double)iconScaleX.y);
|
|
iconScaleX.y = (float)flooredCoord;
|
|
fVar7 = iconPosX.y + offset->x;
|
|
fVar6 = offset->y;
|
|
renderPos = &this->_renderPosition;
|
|
renderPos->x = fVar7;
|
|
(this->_renderPosition).y = iconScaleX.y / (float)local_d8 + fVar6;
|
|
if (this->_variant == 0xf3) {
|
|
renderPos->x = fVar7 + 0.0;
|
|
(this->_renderPosition).y = (this->_renderPosition).y + 8.45;
|
|
}
|
|
player = this->_player;
|
|
savedPlayerColor2 = player[0x3c];
|
|
iStack_c0 = player[0x3d];
|
|
iStack_bc = player[0x3e];
|
|
iStack_b8 = player[0x3f];
|
|
savedPlayerFlag171 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(player) + 0x171));
|
|
iStack_b4 = player[0x40];
|
|
iStack_b0 = player[0x41];
|
|
iStack_ac = player[0x42];
|
|
iStack_a8 = player[0x43];
|
|
uStack_a4 = *GHIDRA_CAST<uint64_t *>((player + 0x44));
|
|
iStack_9c = player[0x46];
|
|
fStack_60 = opacity;
|
|
fadedPlayerColor = savedPlayerColor2;
|
|
iStack_68 = iStack_c0;
|
|
iStack_64 = iStack_bc;
|
|
iStack_5c = iStack_b4;
|
|
iStack_58 = iStack_b0;
|
|
iStack_54 = iStack_ac;
|
|
iStack_50 = iStack_a8;
|
|
uStack_4c = uStack_a4;
|
|
iStack_44 = iStack_9c;
|
|
(**(code **)(*player + 0x3c))(&fadedPlayerColor,0xffffffff,0xff,0);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_player) + 0x171)) = 1;
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RenderGlow(renderPos);
|
|
FUN_0078e130(renderPos);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RenderHead(renderPos);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_player) + 0x171)) = savedPlayerFlag171;
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_player) + 0x3c))(&savedPlayerColor2,0xffffffff,0xff,0,1);
|
|
break;
|
|
case 0xe7:
|
|
local_d0 = (float)__RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::
|
|
RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor);
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x24));
|
|
if (iVar5 != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x28))) {
|
|
do {
|
|
render_abyss_locust_sprite(this,iVar5,renderOffset);
|
|
iVar5 = iVar5 + 0x114;
|
|
} while (iVar5 != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x28)));
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Render(renderOffset);
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x30));
|
|
if (iVar5 != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x34))) {
|
|
do {
|
|
render_abyss_locust_sprite(this,iVar5,renderOffset);
|
|
iVar5 = iVar5 + 0x114;
|
|
} while (iVar5 != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x34)));
|
|
}
|
|
break;
|
|
case 0xed:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Render(offset);
|
|
if (((this->_visible != 0) &&
|
|
(pvVar4 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0),
|
|
pvVar4 != (void *)0x0)) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar4) + 0x2c)) != '\0')) {
|
|
uStack_12c = 1;
|
|
if (((uint8_t)g_graphicsManager_flags & 4) == 0) {
|
|
uStack_138 = 6;
|
|
}
|
|
else {
|
|
uStack_138 = 1;
|
|
}
|
|
iconRenderParams = 0;
|
|
uStack_134 = 1;
|
|
uStack_130 = 1;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
tmpColor._tint[0] = 1.0;
|
|
tmpColor._tint[1] = 1.0;
|
|
iconScaleX.x = (layer->_size).x * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x18));
|
|
tmpColor._tint[2] = 1.0;
|
|
tmpColor._offset[0] = 0.6;
|
|
tmpColor._offset[1] = 0.4;
|
|
iconScaleX.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) * (layer->_size).y;
|
|
tmpColor._offset[2] = 0.8;
|
|
tmpColor._tint[3] = opacity;
|
|
tmpColor._colorize[0] = 0.0;
|
|
tmpColor._colorize[1] = 0.0;
|
|
tmpColor._colorize[2] = 0.0;
|
|
tmpColor._colorize[3] = 0.0;
|
|
iconPosX.x = (this->_renderPosition).x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x10));
|
|
iconPosX.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x14)) + (this->_renderPosition).y;
|
|
GameOver::render_collectible_icon
|
|
(&g_game->_gameOver,this->_subtype,&iconPosX,&tmpColor,&iconScaleX,&iconRenderParams
|
|
);
|
|
}
|
|
break;
|
|
case 0xf0:
|
|
FUN_00435130();
|
|
}
|
|
FUN_00860fe0(this,renderOffset);
|
|
render_charge_indicator(this,&this->_renderPosition);
|
|
if ((isHologram != '\0') && (g_colorStackSize = g_colorStackSize - 1, g_colorStackSize == 0)) {
|
|
DAT_00c78dbc = 0;
|
|
}
|
|
spriteColor = &(this->_sprite)._color;
|
|
if (spriteColor != GHIDRA_CAST<ColorMod *>(local_194)) {
|
|
spriteColor->_tint[0] = savedTintR;
|
|
(this->_sprite)._color._tint[1] = savedTintG;
|
|
(this->_sprite)._color._tint[2] = savedTintB;
|
|
(this->_sprite)._color._tint[3] = savedTintA;
|
|
(this->_sprite)._color._colorize[0] = savedColorizeR;
|
|
(this->_sprite)._color._colorize[1] = savedColorizeG;
|
|
(this->_sprite)._color._colorize[2] = savedColorizeB;
|
|
(this->_sprite)._color._colorize[3] = savedColorizeA;
|
|
*(float (*) [2])(this->_sprite)._color._offset = savedOffsetXY;
|
|
(this->_sprite)._color._offset[2] = savedOffsetZ;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0062a8f0
|
|
uint8_t Entity_Familiar::CanPlayerFire()
|
|
{
|
|
void *pvVar1;
|
|
|
|
pvVar1 = this->_player;
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x1398)) == '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x139a)) == '\0')) &&
|
|
(*GHIDRA_CAST<int *>(&g_game->_stageTransition) == 0)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x410)) != '\0' && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x414)) < 1)))) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0062a930
|
|
void Entity_Familiar::AddCoins(int count)
|
|
{
|
|
int iVar1;
|
|
code *pcVar2;
|
|
uint8_t isHasBffs;
|
|
int coins;
|
|
uint32_t seed;
|
|
uint32_t roll;
|
|
|
|
iVar1 = this->_variant;
|
|
coins = this->_coins + count;
|
|
this->_coins = coins;
|
|
if (iVar1 == 0xe8) {
|
|
if (0 < coins % 100) {
|
|
do {
|
|
coins = coins + 99;
|
|
} while (0 < coins % 100);
|
|
this->_coins = coins;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBlueFlies(1,&this->_pos,GHIDRA_CAST<Entity *>(0x0));
|
|
return;
|
|
}
|
|
if ((((iVar1 != 0xf1) && (iVar1 == 0x58)) && (this->_state == 3)) && (0 < count)) {
|
|
do {
|
|
isHasBffs = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
seed = (this->_dropRNG)._seed;
|
|
if (isHasBffs == 0) {
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
seed = (this->_dropRNG)._seed;
|
|
if (seed == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ seed;
|
|
roll = seed % 5;
|
|
}
|
|
else {
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
seed = (this->_dropRNG)._seed;
|
|
if (seed == 0) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ seed;
|
|
roll = seed & 3;
|
|
}
|
|
(this->_dropRNG)._seed = seed;
|
|
if (roll == 0) {
|
|
this->_counter = this->_counter + 1;
|
|
}
|
|
count = count + -1;
|
|
} while (count != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0062aaa0
|
|
void Entity_Familiar::AddHearts(int param_2)
|
|
{
|
|
this->_hearts = this->_hearts + param_2;
|
|
return;
|
|
}
|
|
|
|
// 0062aab0
|
|
void Entity_Familiar::TriggerRoomClear()
|
|
{
|
|
uint8_t bVar1;
|
|
Entity *shot;
|
|
Entity_Player *playerEntity;
|
|
Entity *shot_00;
|
|
int iVar3;
|
|
uint32_t uVar4;
|
|
uint32_t pickupSubType;
|
|
uint32_t pickupVariant;
|
|
float dropChance;
|
|
RNG spawnRng;
|
|
Vector spiderPos;
|
|
float local_10;
|
|
Vector local_c;
|
|
Manager *manager;
|
|
Entity *playerEntity;
|
|
void **spiderCounter;
|
|
|
|
if (this->_exists == 0) {
|
|
return;
|
|
}
|
|
playerEntity = this->_player;
|
|
if (playerEntity == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
return;
|
|
}
|
|
if (playerEntity->_exists == 0) {
|
|
return;
|
|
}
|
|
this->_roomClearCount = this->_roomClearCount + 1;
|
|
pickupSubType = 0;
|
|
pickupVariant = 0;
|
|
local_c.y = 0.0;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((playerEntity)))->Entity_Player::HasCollectible(0xf7,0);
|
|
switch(this->_variant) {
|
|
case 0x14:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.35;
|
|
pickupVariant = 0x28;
|
|
}
|
|
else {
|
|
local_c.y = 0.42;
|
|
pickupVariant = 0x28;
|
|
}
|
|
break;
|
|
case 0x15:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.5;
|
|
pickupVariant = 0x14;
|
|
}
|
|
else {
|
|
local_c.y = 0.57;
|
|
pickupVariant = 0x14;
|
|
}
|
|
break;
|
|
case 0x16:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.35;
|
|
pickupVariant = 10;
|
|
pickupSubType = 2;
|
|
}
|
|
else {
|
|
local_c.y = 0.42;
|
|
pickupVariant = 10;
|
|
pickupSubType = 2;
|
|
}
|
|
break;
|
|
case 0x17:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.125;
|
|
pickupVariant = 10;
|
|
pickupSubType = 3;
|
|
}
|
|
else {
|
|
local_c.y = 0.166;
|
|
pickupVariant = 10;
|
|
pickupSubType = 3;
|
|
}
|
|
break;
|
|
case 0x34:
|
|
iVar3 = 2;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar1 != 0) {
|
|
iVar3 = 3;
|
|
}
|
|
do {
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&spiderPos,&this->_pos,0.0,0,0,0);
|
|
playerEntity = this->_player;
|
|
spiderCounter = &playerEntity[4]._config;
|
|
*spiderCounter = (void *)(GHIDRA_INT(*spiderCounter) + 1);
|
|
spawn_blue_spider(&spiderPos,playerEntity,&g_vectorZero);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(shot);
|
|
iVar3 = iVar3 + -1;
|
|
} while (iVar3 != 0);
|
|
pickupVariant = 0;
|
|
pickupSubType = 0;
|
|
break;
|
|
case 0x39:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.18;
|
|
}
|
|
else {
|
|
local_c.y = 0.22;
|
|
}
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(4);
|
|
switch(uVar4) {
|
|
case 0:
|
|
pickupVariant = 10;
|
|
pickupSubType = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(6);
|
|
pickupSubType = pickupSubType + 1;
|
|
break;
|
|
case 1:
|
|
pickupVariant = 0x14;
|
|
pickupSubType = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(4);
|
|
pickupSubType = pickupSubType + 1;
|
|
break;
|
|
case 2:
|
|
pickupVariant = 0x1e;
|
|
pickupSubType = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(3);
|
|
pickupSubType = pickupSubType + 1;
|
|
break;
|
|
case 3:
|
|
pickupVariant = 0x28;
|
|
pickupSubType = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(2);
|
|
pickupSubType = pickupSubType + 1;
|
|
}
|
|
break;
|
|
case 0x52:
|
|
local_10 = 0.8;
|
|
local_c.y = 0.0;
|
|
if (bVar1 == 0) {
|
|
local_10 = 1.0;
|
|
}
|
|
dropChance = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomFloat();
|
|
local_10 = dropChance * local_10;
|
|
dropChance = local_10;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13c0)) == 0x24) {
|
|
dropChance = local_10 * 0.75;
|
|
}
|
|
if (0.1 <= dropChance) {
|
|
if (0.35 <= dropChance) break;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(7);
|
|
switch(uVar4) {
|
|
case 0:
|
|
pickupVariant = 10;
|
|
dropChance = 1.0;
|
|
break;
|
|
case 1:
|
|
pickupVariant = 0x14;
|
|
dropChance = 1.0;
|
|
break;
|
|
case 2:
|
|
pickupVariant = 0x1e;
|
|
dropChance = 1.0;
|
|
break;
|
|
case 3:
|
|
pickupVariant = 0x28;
|
|
dropChance = 1.0;
|
|
break;
|
|
case 4:
|
|
pickupVariant = 0x5a;
|
|
dropChance = 1.0;
|
|
break;
|
|
case 5:
|
|
pickupVariant = 300;
|
|
dropChance = 1.0;
|
|
break;
|
|
case 6:
|
|
pickupVariant = 0x46;
|
|
default:
|
|
dropChance = 1.0;
|
|
}
|
|
}
|
|
else {
|
|
pickupVariant = 0x15e;
|
|
dropChance = 1.0;
|
|
}
|
|
goto LAB_0062acdf;
|
|
case 0x58:
|
|
if (this->_state != 1) break;
|
|
local_10 = 1.12104e-43;
|
|
uVar4 = 100;
|
|
if (bVar1 != 0) {
|
|
uVar4 = 0x50;
|
|
}
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(uVar4);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13c0)) == 0x24) {
|
|
uVar4 = GHIDRA_INT((uVar4 << 2)) / 3;
|
|
}
|
|
dropChance = local_c.y;
|
|
if (GHIDRA_INT(uVar4) < 0x21) {
|
|
this->_counter = this->_counter + 1;
|
|
}
|
|
goto LAB_0062acdf;
|
|
case 0x5b:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.125;
|
|
pickupVariant = 300;
|
|
}
|
|
else {
|
|
local_c.y = 0.166;
|
|
pickupVariant = 300;
|
|
}
|
|
break;
|
|
case 0x5e:
|
|
local_10 = 1.12104e-43;
|
|
uVar4 = 100;
|
|
if (bVar1 != 0) {
|
|
uVar4 = 0x50;
|
|
}
|
|
local_c.y = 0.0;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(uVar4);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13c0)) == 0x24) {
|
|
uVar4 = GHIDRA_INT((uVar4 << 2)) / 3;
|
|
}
|
|
if (GHIDRA_INT(uVar4) < 10) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(3);
|
|
if (uVar4 == 0) {
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x5a,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
}
|
|
else {
|
|
playerEntity = this->_player;
|
|
spiderCounter = &playerEntity[4]._config;
|
|
*spiderCounter = (void *)(GHIDRA_INT(*spiderCounter) + 1);
|
|
spawn_blue_spider(&this->_pos,playerEntity,&g_vectorZero);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(shot_00);
|
|
}
|
|
}
|
|
break;
|
|
case 0x70:
|
|
if (bVar1 == 0) {
|
|
pickupVariant = 0x46;
|
|
dropChance = 0.125;
|
|
}
|
|
else {
|
|
pickupVariant = 0x46;
|
|
dropChance = 0.166;
|
|
}
|
|
goto LAB_0062acdf;
|
|
case 0x72:
|
|
if (bVar1 == 0) {
|
|
local_c.y = 0.125;
|
|
pickupVariant = 0x45;
|
|
}
|
|
else {
|
|
local_c.y = 0.166;
|
|
pickupVariant = 0x45;
|
|
}
|
|
}
|
|
dropChance = local_c.y;
|
|
LAB_0062acdf:
|
|
playerEntity = this->_player;
|
|
if (playerEntity->_playerType == 0x24) {
|
|
dropChance = dropChance * 0.75;
|
|
}
|
|
uVar4 = this->_roomClearCount & 0x800003ff;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
uVar4 = (uVar4 - 1 | 0xfffffc00) + 1;
|
|
}
|
|
if ((pickupVariant != 0) && (0.0 < dropChance)) {
|
|
if (dropChance < 1.0) {
|
|
if (GHIDRA_INT(((float)GHIDRA_INT((uVar4 + 1)) * dropChance)) <= GHIDRA_INT(((float)GHIDRA_INT(uVar4) * dropChance)))
|
|
goto LAB_0062ae77;
|
|
playerEntity = this->_player;
|
|
}
|
|
if (((pickupVariant != 10) || (bVar1 = (GHIDRA_CAST<Entity_Player *>((playerEntity)))->Entity_Player::HasTrinket(0x16,0), bVar1 == 0)) ||
|
|
(uVar4 = Random(), uVar4 % 5 == 0)) {
|
|
if (this->_variant == 0x5b) {
|
|
pickupSubType = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
pickupSubType = ItemPool::GetCardEx(pickupSubType,0,-1,0,1);
|
|
}
|
|
Room::FindFreePickupSpawnPosition(g_game->_room,&local_c,&this->_pos,0.0,0,0,0);
|
|
spawnRng._seed = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
|
|
spawnRng._shift1 = 5;
|
|
spawnRng._shift2 = 0x11;
|
|
spawnRng._shift3 = 0xd;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&spawnRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,pickupVariant,&local_c,&g_vectorZero,GHIDRA_CAST<Entity *>(this),pickupSubType,uVar4);
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Spawn,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
manager = g_manager;
|
|
if (this->_variant == 0x16) {
|
|
local_10 = 3.06884e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_10));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_10),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
LAB_0062ae77:
|
|
manager = g_manager;
|
|
iVar3 = this->_variant;
|
|
if (iVar3 == 0x5d) {
|
|
if (this->_subtype != 0) {
|
|
this->_state = 1;
|
|
return;
|
|
}
|
|
}
|
|
else if (iVar3 == 0xdd) {
|
|
if (this->_hearts < 6) {
|
|
local_10 = 6.60012e-43;
|
|
this->_hearts = this->_hearts + 1;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_10));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_10),1.0,2,0,1.0,0.0);
|
|
paschal_candle_sync_effects(this);
|
|
return;
|
|
}
|
|
}
|
|
else if (((iVar3 != 0xee) && (iVar3 == 0xce)) &&
|
|
((this->_dead == 0 && (1 < g_game->_frameCount - this->_spawnFrame)))) {
|
|
if (this->_wispCollectibleType == 0x1ea) {
|
|
iVar3 = GetRandomWisp(&this->_dropRNG);
|
|
FUN_0043d7f0(iVar3);
|
|
this->_health = this->_maxHitPoints;
|
|
}
|
|
else if (this->_wispCollectibleType == 0x203) {
|
|
this->_health = this->_maxHitPoints;
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0062b360
|
|
void Entity_Familiar::level_start()
|
|
{
|
|
void *pvVar1;
|
|
float fVar2;
|
|
uint8_t bVar3;
|
|
uint8_t *pbVar4;
|
|
uint32_t uVar5;
|
|
Vector *followPos;
|
|
uint8_t *pbVar6;
|
|
int extraout_ECX;
|
|
bool bVar7;
|
|
Vector local_18;
|
|
uint32_t local_10;
|
|
uint32_t local_c;
|
|
uint8_t *animData;
|
|
int roomEntity;
|
|
|
|
if (this->_variant != 100) goto LAB_0062b462;
|
|
this->_subtype = 0;
|
|
this->_visible = 1;
|
|
this->_shadowSize = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_config) + 0x24));
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0062b3e6:
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar4 = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
pbVar6 = s_Idle;
|
|
do {
|
|
bVar3 = *pbVar4;
|
|
bVar7 = bVar3 < *pbVar6;
|
|
if (bVar3 != *pbVar6) {
|
|
LAB_0062b3d0:
|
|
uVar5 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_0062b3d5;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = pbVar4[1];
|
|
bVar7 = bVar3 < pbVar6[1];
|
|
if (bVar3 != pbVar6[1]) goto LAB_0062b3d0;
|
|
pbVar4 = pbVar4 + 2;
|
|
pbVar6 = pbVar6 + 2;
|
|
} while (bVar3 != 0);
|
|
uVar5 = 0;
|
|
LAB_0062b3d5:
|
|
if ((uVar5 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_0062b3e6;
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if ((0x6d0 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)))
|
|
&& (fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x6d0)), fVar2 != 0.0)) {
|
|
local_10 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar2) + 0x78));
|
|
local_18.y = 0.0;
|
|
local_c = 0;
|
|
local_18.x = fVar2;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)))))->TemporaryEffects::RemoveEffect(&local_18,1);
|
|
}
|
|
LAB_0062b462:
|
|
roomEntity = this->_variant;
|
|
if (roomEntity == 0x2a) {
|
|
this->_subtype = GHIDRA_UINT(this->_subtype) >> 1;
|
|
}
|
|
else if ((roomEntity == 0x77) || (roomEntity == 0x18)) {
|
|
this->_subtype = 0;
|
|
}
|
|
else if (roomEntity == 0xcb) {
|
|
if (g_game->_isStartingFromState == 0) {
|
|
this->_hearts = 0;
|
|
roomEntity = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetHealthType();
|
|
if (GHIDRA_INT((2 - GHIDRA_UINT((roomEntity != 3)))) < *GHIDRA_CAST<int *>((extraout_ECX + 0x1344))) {
|
|
this->_state = 4;
|
|
fVar2 = *GHIDRA_CAST<float *>((extraout_ECX + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((extraout_ECX + 0x33c));
|
|
(this->_pos).y = fVar2;
|
|
}
|
|
}
|
|
FUN_00640050();
|
|
}
|
|
else if (roomEntity == 0xdd) {
|
|
paschal_candle_sync_effects(this);
|
|
}
|
|
else if (roomEntity == 0xd3) {
|
|
if (g_game->_isStartingFromState == 0) {
|
|
if (this->_state == 4) {
|
|
this->_visible = 1;
|
|
roomEntity = 1;
|
|
}
|
|
else {
|
|
roomEntity = 2;
|
|
}
|
|
this->_state = roomEntity;
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) + 0.0;
|
|
(this->_pos).y = fVar2 + 48.0;
|
|
return;
|
|
}
|
|
}
|
|
else if (roomEntity == 0xce) {
|
|
if (this->_subtype == 0x2be) {
|
|
this->Remove();
|
|
}
|
|
else if ((this->_subtype == 0x7f) && (5 < g_game->_frameCount - this->_spawnFrame)) {
|
|
this->Remove();
|
|
}
|
|
}
|
|
else if (roomEntity == 0xec) {
|
|
roomEntity = g_game->_currentRoomIdx;
|
|
if (roomEntity < 0) {
|
|
roomEntity = g_game->_startingRoomIdx;
|
|
}
|
|
this->_coins = -1;
|
|
(this->_formationTargetOffset).x = (float)(roomEntity % 0xd);
|
|
(this->_formationOffset).x = (float)(roomEntity % 0xd);
|
|
(this->_formationTargetOffset).y = (float)(roomEntity / 0xd);
|
|
(this->_formationOffset).y = (float)(roomEntity / 0xd);
|
|
}
|
|
else if (roomEntity == 0xf0) {
|
|
this->Remove();
|
|
}
|
|
followPos = GetFollowTargetPosition(this,&local_18,0);
|
|
(this->_pos).x = followPos->x;
|
|
(this->_pos).y = followPos->y;
|
|
roomEntity = this->_variant;
|
|
if (roomEntity == 0xf1) {
|
|
uVar5 = 0;
|
|
pvVar1 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x1254)) == 0) {
|
|
return;
|
|
}
|
|
do {
|
|
roomEntity = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x124c)) + uVar5 * 4));
|
|
if ((*GHIDRA_CAST<int *>((roomEntity + 0x28)) == 0x322) &&
|
|
(*GHIDRA_CAST<Entity_Familiar **>((roomEntity + 0x3bc)) == this)) {
|
|
*GHIDRA_CAST<float *>((roomEntity + 0x33c)) = *GHIDRA_CAST<float *>((roomEntity + 0x33c)) + 0.0;
|
|
*GHIDRA_CAST<float *>((roomEntity + 0x340)) = *GHIDRA_CAST<float *>((roomEntity + 0x340)) + 80.0;
|
|
roomEntity = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x124c)) + uVar5 * 4));
|
|
if (roomEntity == this->_linkedEntity) {
|
|
fVar2 = *GHIDRA_CAST<float *>((roomEntity + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((roomEntity + 0x33c));
|
|
(this->_pos).y = fVar2;
|
|
}
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x1254)));
|
|
roomEntity = this->_variant;
|
|
}
|
|
if (roomEntity == 0xf2) {
|
|
this->_state = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0062bb70
|
|
void Entity_Familiar::room_enter()
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
char isTargetable;
|
|
void *pvVar3;
|
|
Vector *outPosition;
|
|
Vector *tmpVec;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
bool bVar6;
|
|
float fVar7;
|
|
Vector local_60;
|
|
Vector local_58;
|
|
Vector local_50;
|
|
Vector wispOrbitPos;
|
|
Vector itemWispOrbitPos;
|
|
Vector enterDirection;
|
|
Vector randomDirection [3];
|
|
uint64_t local_14;
|
|
int child;
|
|
Game *game;
|
|
uint32_t playerPosY;
|
|
int segment;
|
|
uint32_t *segmentPos;
|
|
|
|
game = g_game;
|
|
uVar5 = this->_variant;
|
|
if (900 < uVar5) goto switchD_0062bba7_caseD_4;
|
|
if (uVar5 == 900) {
|
|
switchD_0062bba7_caseD_49:
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
fVar7 = g_vectorZero.y;
|
|
LAB_0062c604:
|
|
(this->_targetPosition).y = fVar7;
|
|
goto switchD_0062bba7_caseD_4;
|
|
}
|
|
switch(uVar5) {
|
|
case 3:
|
|
case 0x19:
|
|
case 0x5d:
|
|
case 0x68:
|
|
case 0x82:
|
|
case 0xdf:
|
|
case 0xe8:
|
|
this->_fireCooldown = 0xf;
|
|
break;
|
|
case 0x11:
|
|
case 0x2e:
|
|
case 0x2f:
|
|
case 0x47:
|
|
case 0x48:
|
|
case 0x60:
|
|
case 0xcf:
|
|
goto switchD_0062bba7_caseD_11;
|
|
case 0x32:
|
|
case 0x3a:
|
|
this->_subtype = 0;
|
|
this->_fireCooldown = 0;
|
|
goto switchD_0062bba7_caseD_11;
|
|
case 0x33:
|
|
case 0x5f:
|
|
case 0xe7:
|
|
this->_fireCooldown = 0;
|
|
break;
|
|
case 0x3b:
|
|
this->_fireCooldown = 0x3c;
|
|
break;
|
|
case 0x42:
|
|
case 0x43:
|
|
this->_subtype = 1;
|
|
(this->_pathfinder)._movementTarget.x = g_vectorZero.x;
|
|
(this->_pathfinder)._movementTarget.y = g_vectorZero.y;
|
|
(this->_pathfinder)._moveDirection.x = g_vectorZero.x;
|
|
(this->_pathfinder)._moveDirection.y = g_vectorZero.y;
|
|
pvVar3 = game->_room;
|
|
local_58.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x1c));
|
|
local_50.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x14));
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x20));
|
|
local_60.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x18));
|
|
(this->_targetPosition).x = local_50.x;
|
|
(this->_targetPosition).y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x18));
|
|
uVar5 = Random();
|
|
local_60.x = (float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283064e-10 * (fVar7 - local_60.x);
|
|
uVar5 = Random();
|
|
(this->_targetPosition).x =
|
|
(float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) * 2.3283064e-10
|
|
* (local_58.x - local_50.x) + (this->_targetPosition).x;
|
|
(this->_targetPosition).y = local_60.x + (this->_targetPosition).y;
|
|
uVar5 = Random();
|
|
this->_health = this->_maxHitPoints;
|
|
this->_counter = uVar5 % 0x3c + 0x46;
|
|
break;
|
|
case 0x49:
|
|
case 0x7a:
|
|
goto switchD_0062bba7_caseD_49;
|
|
case 0x53:
|
|
goto switchD_0062bba7_caseD_53;
|
|
case 0x55:
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
fVar7 = g_vectorZero.y;
|
|
this->_moveDirection = 3;
|
|
goto LAB_0062c604;
|
|
case 0x56:
|
|
if (g_game->_isStartingFromState != 0) break;
|
|
switchD_0062bba7_caseD_53:
|
|
this->_coins = 0;
|
|
break;
|
|
case 0x5e:
|
|
case 0x71:
|
|
this->_subtype = 1;
|
|
(this->_pathfinder)._movementTarget.x = g_vectorZero.x;
|
|
(this->_pathfinder)._movementTarget.y = g_vectorZero.y;
|
|
(this->_pathfinder)._moveDirection.x = g_vectorZero.x;
|
|
(this->_pathfinder)._moveDirection.y = g_vectorZero.y;
|
|
tmpVec = (GHIDRA_CAST<Room *>((game->_room)))->Room::GetRandomPosition(&local_60,0.0);
|
|
(this->_targetPosition).x = tmpVec->x;
|
|
(this->_targetPosition).y = tmpVec->y;
|
|
uVar5 = Random();
|
|
this->_counter = uVar5 % 0x3c + 0x46;
|
|
break;
|
|
case 0x62:
|
|
case 99:
|
|
case 0x65:
|
|
case 0x6a:
|
|
case 0x83:
|
|
this->_moveDelayNum = -1;
|
|
goto switchD_0062bba7_caseD_11;
|
|
case 0x6f:
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
case 0xd4:
|
|
this->_state = 0;
|
|
break;
|
|
case 0x7c:
|
|
this->_state = 0;
|
|
if (this->_visible == 0) {
|
|
this->_roomClearCount = 0;
|
|
}
|
|
this->_visible = 1;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
break;
|
|
case 0x81:
|
|
this->_state = 0;
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
this->_visible = 1;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("FloatDown"),0);
|
|
break;
|
|
case 0xce:
|
|
if (this->_subtype == 0x20f) {
|
|
this->_keys = 0;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
if (this->_variant == 0xed) {
|
|
child = this->_wispCollectibleType;
|
|
}
|
|
else if (this->_variant == 0xce) {
|
|
child = this->_subtype;
|
|
}
|
|
else {
|
|
child = 0x248;
|
|
}
|
|
pvVar3 = ItemConfig::get_wisp_config(child);
|
|
if (this->_orbitLayer < 0) {
|
|
AddToOrbit(this,*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pvVar3) + 0x18c)) + 7);
|
|
}
|
|
}
|
|
else if (this->_subtype == 0x244) {
|
|
local_14 = 0x1500000001;
|
|
child = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4));
|
|
if ((child == 0) || (uVar5 = *GHIDRA_CAST<uint32_t *>((child + 0x5c)), uVar5 == 0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> 1 ^ uVar5;
|
|
uVar5 = uVar5 << 0x15 ^ uVar5;
|
|
uVar5 = (uVar5 >> 0x14 ^ uVar5) & 7;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + uVar5 * 4 + 0x724)) == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanSpawnDoorOutline(g_game->_currentRoomIdx,uVar5),
|
|
bVar2 != 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::MakeRedRoomDoor(g_game->_currentRoomIdx,uVar5);
|
|
}
|
|
}
|
|
local_50.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_50.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
tmpVec = &local_50;
|
|
outPosition = &wispOrbitPos;
|
|
goto LAB_0062c09b;
|
|
case 0xd3:
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
(this->_pos).y = fVar7;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar2 != 0) {
|
|
this->_coins = 1;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::PlayOverlay(GHIDRA_CAST<uint8_t *>("Mantle"),0);
|
|
}
|
|
break;
|
|
case 0xe0:
|
|
this->Remove();
|
|
break;
|
|
case 0xe1:
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
(this->_pos).y = fVar7;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Fly,0);
|
|
this->_state = 3;
|
|
break;
|
|
case 0xec:
|
|
if (this->_visible == 0) {
|
|
update_star_of_bethlehem_speed(this,0);
|
|
}
|
|
break;
|
|
case 0xed:
|
|
local_58.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_58.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
tmpVec = &local_58;
|
|
outPosition = &itemWispOrbitPos;
|
|
LAB_0062c09b:
|
|
tmpVec = GetOrbitPosition(this,outPosition,tmpVec);
|
|
(this->_pos).x = tmpVec->x;
|
|
(this->_pos).y = tmpVec->y;
|
|
break;
|
|
case 0xee:
|
|
this->_damageCountdown = 0x14;
|
|
break;
|
|
case 0xef:
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
(this->_pos).y = fVar7;
|
|
if (game->_enterDoor < 0) {
|
|
tmpVec = MusicManager::RandomVector(randomDirection);
|
|
}
|
|
else {
|
|
uVar5 = game->_enterDoor + 2U & 0x80000003;
|
|
if (GHIDRA_INT(uVar5) < 0) {
|
|
uVar5 = (uVar5 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
tmpVec = Isaac::GetAxisAlignedUnitVectorFromDir(&enterDirection,uVar5);
|
|
}
|
|
fVar7 = tmpVec->x;
|
|
(this->_pos).y = tmpVec->y * 15.0 + (this->_pos).y;
|
|
(this->_pos).x = fVar7 * 15.0 + (this->_pos).x;
|
|
switchD_0062bba7_caseD_11:
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
break;
|
|
case 0xf0:
|
|
child = __RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::UmbilicalBabyData::RTTI_Type_Descriptor,0);
|
|
if (child != 0) {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((child + 0x14));
|
|
uVar4 = 0;
|
|
if (uVar5 != 0) {
|
|
do {
|
|
local_50.x = (float)((double)GHIDRA_INT((uVar5 - 1)) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT((uVar5 - 1)) >> 0x1f)]);
|
|
if (local_50.x == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Start and End parameters cannot be the same!"));
|
|
}
|
|
playerPosY = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
fVar7 = ((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) - 0.0
|
|
) / (local_50.x - 0.0);
|
|
if (fVar7 <= 0.0) {
|
|
fVar7 = 0.0;
|
|
}
|
|
if (1.0 <= fVar7) {
|
|
fVar7 = 1.0;
|
|
}
|
|
segmentPos = *(uint32_t **)
|
|
(*GHIDRA_CAST<int *>((child + 8)) +
|
|
(*GHIDRA_CAST<int *>((child + 0x10)) + uVar4 & *GHIDRA_CAST<int *>((child + 0xc)) - 1U) * 4);
|
|
*segmentPos = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
segmentPos[1] = playerPosY;
|
|
segmentPos[2] = -15.0 - fVar7 * 5.0;
|
|
uVar5 = *GHIDRA_CAST<int *>((child + 0x10)) + uVar4;
|
|
uVar4 = uVar4 + 1;
|
|
segment = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((child + 8)) + (uVar5 & *GHIDRA_CAST<int *>((child + 0xc)) - 1U) * 4));
|
|
*GHIDRA_CAST<uint32_t *>((segment + 0xc)) = (uint32_t)DAT_00c79c58;
|
|
*GHIDRA_CAST<uint32_t *>((segment + 0x10)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(DAT_00c79c58)) + 0x4)));
|
|
*GHIDRA_CAST<uint32_t *>((segment + 0x14)) = DAT_00c79c60;
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((child + 0x14));
|
|
} while (uVar4 < uVar5);
|
|
}
|
|
}
|
|
break;
|
|
case 0xf1:
|
|
uVar5 = 0;
|
|
pvVar3 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x1254)) != 0) {
|
|
do {
|
|
child = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x124c)) + uVar5 * 4));
|
|
if ((*GHIDRA_CAST<int *>((child + 0x28)) == 0x322) && (*GHIDRA_CAST<Entity_Familiar **>((child + 0x3bc)) == this)) {
|
|
if (child == this->_linkedEntity) {
|
|
*GHIDRA_CAST<float *>((child + 0x33c)) = (this->_pos).x;
|
|
fVar7 = (this->_pos).y;
|
|
}
|
|
else {
|
|
uVar4 = Random();
|
|
local_50.x = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_50.x = local_50.x + local_50.x;
|
|
fVar7 = cos(local_50.x);
|
|
local_58.x = (this->_pos).y;
|
|
*GHIDRA_CAST<float *>((child + 0x33c)) = fVar7 + (this->_pos).x;
|
|
fVar7 = sin(local_50.x);
|
|
fVar7 = fVar7 + local_58.x;
|
|
}
|
|
*GHIDRA_CAST<float *>((child + 0x340)) = fVar7;
|
|
child = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x124c)) + uVar5 * 4));
|
|
*GHIDRA_CAST<float *>((child + 0x360)) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>((child + 0x364)) = g_vectorZero.y;
|
|
child = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x124c)) + uVar5 * 4));
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((child + 0x28)) == 1)) ||
|
|
(*GHIDRA_CAST<int *>((child + 0x28)) - 10U < 0x3de)) {
|
|
*GHIDRA_CAST<uint32_t *>((child + 0xb64)) = 0x10;
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x124c)) + uVar5 * 4)) + 0xc))();
|
|
}
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar3) + 0x1254)));
|
|
}
|
|
break;
|
|
case 0xf2:
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
this->_coins = 0;
|
|
this->_keys = 0;
|
|
pvVar3 = game->_room;
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 8)) == 5) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 4)) + 0x44)) & 1) == 0)) &&
|
|
(uVar5 = 0, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x1264)) != 0)) {
|
|
do {
|
|
isTargetable = (**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x125c)) + uVar5 * 4)) + 0x4c))
|
|
();
|
|
if (((isTargetable != '\0') &&
|
|
(child = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x125c)) + uVar5 * 4)),
|
|
(*GHIDRA_CAST<uint32_t *>((child + 0x168)) & 0x20000000) == 0 && (*GHIDRA_CAST<uint32_t *>((child + 0x16c)) & 0x20) == 0))
|
|
&& (*GHIDRA_CAST<int *>((child + 0x3bc)) == 0)) {
|
|
child = *GHIDRA_CAST<int *>((child + 0x28));
|
|
if (child < 0x197) {
|
|
if (child != 0x196) {
|
|
switch(child) {
|
|
case 0x2d:
|
|
case 0x4e:
|
|
case 0x54:
|
|
case 0x66:
|
|
case 0x111:
|
|
case 0x112:
|
|
case 0x113:
|
|
break;
|
|
default:
|
|
switchD_0062c43c_caseD_2e:
|
|
this->_coins = child;
|
|
this->_keys = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x125c)) + uVar5 * 4)) + 0x2c));
|
|
goto switchD_0062bba7_caseD_4;
|
|
}
|
|
}
|
|
}
|
|
else if (child < 0x391) {
|
|
if (((child != 0x390) && (child != 0x197)) && (child != 0x19c)) {
|
|
bVar6 = child == 0x362;
|
|
LAB_0062c46e:
|
|
if (!bVar6) goto switchD_0062c43c_caseD_2e;
|
|
}
|
|
}
|
|
else if (child != 0x3b6) {
|
|
bVar6 = child == 0x3b7;
|
|
goto LAB_0062c46e;
|
|
}
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar3) + 0x1264)));
|
|
}
|
|
}
|
|
switchD_0062bba7_caseD_4:
|
|
if (((this->_isNotCountedAsFollower != 0) && (g_game->_isStartingFromState == 0)) &&
|
|
(this->_isHourglassRewound == 0)) {
|
|
this->Remove();
|
|
}
|
|
this->_isHourglassRewound = 0;
|
|
return;
|
|
}
|
|
|
|
// 0062c8d0
|
|
void Entity_Familiar::farting_baby_fart()
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
uint8_t *curAnimChar;
|
|
Entity *pEVar4;
|
|
uint32_t uVar5;
|
|
uint8_t *cmpAnimChar;
|
|
void *room;
|
|
uint32_t uVar6;
|
|
bool bVar7;
|
|
uint32_t local_4c;
|
|
Entity *local_48;
|
|
Vector local_44;
|
|
int *enemy;
|
|
ColorMod local_38;
|
|
uint32_t local_c;
|
|
uint8_t *animData;
|
|
int entityType;
|
|
Manager *manager;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_4c);
|
|
if (this->_variant != 0x70) {
|
|
if (this->_variant == 0x7d) {
|
|
uVar6 = this->_state;
|
|
uVar5 = (this->_dropRNG)._seed;
|
|
do {
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar5 = (this->_dropRNG)._seed;
|
|
if (uVar5 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar5 = uVar5 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5;
|
|
(this->_dropRNG)._seed = uVar5;
|
|
this->_state = uVar5 % 5;
|
|
} while (uVar5 % 5 == uVar6);
|
|
FUN_0063b240();
|
|
uVar6 = Random();
|
|
local_44.x = (this->_velocity).x + (this->_pos).x;
|
|
local_44.y = (this->_pos).y + (this->_velocity).y;
|
|
pEVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&local_44,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar6,0);
|
|
pEVar4->Update();
|
|
manager = g_manager;
|
|
local_4c = 0x84;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_4c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_4c,1.0,2,0,1.0,0.0);
|
|
}
|
|
return;
|
|
}
|
|
uVar6 = 0;
|
|
room = g_game->_room;
|
|
local_44.x = (float)room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1264)) != 0) {
|
|
do {
|
|
pEVar4 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar6 * 4));
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (pEVar4->_type != 1)) {
|
|
entityType = pEVar4->_type;
|
|
if ((entityType - 10U < 0x3de) &&
|
|
(((entityType != 0x21 && (entityType != 0x11)) && (entityType != 0x124)))) {
|
|
if (entityType == 0x375) {
|
|
bVar7 = pEVar4->_variant == 10;
|
|
}
|
|
else {
|
|
if ((entityType == 0x3c0) || (entityType == 0x3c5)) goto LAB_0062cb69;
|
|
bVar7 = entityType == 0xf5;
|
|
}
|
|
if (!bVar7) goto LAB_0062c990;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0062c990:
|
|
if ((pEVar4->_dead == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDescendantOf(pEVar4), bVar2 == 0)) {
|
|
local_38._colorize[0] = (this->_pos).x;
|
|
local_38._colorize[1] = (this->_pos).y;
|
|
enemy = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar6 * 4));
|
|
local_38._colorize[2] = (this->_velocity).x;
|
|
local_48 = *GHIDRA_CAST<Entity **>((*enemy + 0x20));
|
|
local_38._colorize[3] = (this->_velocity).y;
|
|
local_38._tint[0] = (float)this->_type;
|
|
local_38._tint[1] = (float)this->_variant;
|
|
local_38._tint[2] = (float)this->_spawnerType;
|
|
local_38._tint[3] = (float)this->_spawnerVariant;
|
|
local_4c = GHIDRA_UINT(((this->_flags & 0x100) != 0));
|
|
if ((this->_flags & 0x20000000) == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = 2;
|
|
}
|
|
if ((this->_flags & 0x40000000000000) == 0) {
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
uVar3 = 4;
|
|
}
|
|
local_38._offset[0] = (float)(uVar3 | uVar5 | local_4c);
|
|
local_38._offset[1] = (float)this;
|
|
(*(code *)local_48)(0x41200000,0,0,&local_38,0x1e);
|
|
local_38._colorize[0] = (this->_pos).x;
|
|
local_38._colorize[1] = (this->_pos).y;
|
|
local_48 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar6 * 4));
|
|
local_38._tint[0] = (float)this->_type;
|
|
local_38._tint[1] = (float)this->_variant;
|
|
local_38._tint[2] = (float)this->_spawnerType;
|
|
local_38._tint[3] = (float)this->_spawnerVariant;
|
|
local_38._colorize[2] = (this->_velocity).x;
|
|
local_38._colorize[3] = (this->_velocity).y;
|
|
if ((this->_flags & 0x20000000) == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = 2;
|
|
}
|
|
if ((this->_flags & 0x40000000000000) == 0) {
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
uVar3 = 4;
|
|
}
|
|
local_38._offset[0] = (float)(uVar3 | uVar5 | GHIDRA_UINT(((this->_flags & 0x100) != 0)));
|
|
local_38._offset[1] = (float)this;
|
|
(GHIDRA_CAST<Entity *>((local_48)))->Entity::AddPoison(GHIDRA_CAST<EntityRef *>(&local_38),0x96,0.0,0);
|
|
room = (void *)local_44.x;
|
|
}
|
|
}
|
|
LAB_0062cb69:
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(room) + 0x1264)));
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
cmpAnimChar = s_Spawn;
|
|
do {
|
|
bVar2 = *curAnimChar;
|
|
bVar7 = bVar2 < *cmpAnimChar;
|
|
if (bVar2 != *cmpAnimChar) {
|
|
LAB_0062cbb0:
|
|
uVar6 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_0062cbb5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = curAnimChar[1];
|
|
bVar7 = bVar2 < cmpAnimChar[1];
|
|
if (bVar2 != cmpAnimChar[1]) goto LAB_0062cbb0;
|
|
curAnimChar = curAnimChar + 2;
|
|
cmpAnimChar = cmpAnimChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar6 = 0;
|
|
LAB_0062cbb5:
|
|
if ((uVar6 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0062cbe8;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Spawn,1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_0062cbe8:
|
|
local_38._tint[0] = 1.0;
|
|
local_38._tint[1] = 1.0;
|
|
local_38._tint[2] = 1.0;
|
|
local_38._tint[3] = 1.0;
|
|
local_38._offset[0] = 0.0;
|
|
local_38._offset[1] = 0.0;
|
|
local_38._offset[2] = 0.0;
|
|
local_38._colorize[0] = 0.0;
|
|
local_38._colorize[1] = 1.0;
|
|
local_38._colorize[2] = 0.0;
|
|
local_38._colorize[3] = 1.0;
|
|
(GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>((GHIDRA_INT(g_game->_room) + 0x1618)))))->Game::start_poop_cloud_screen_effect(&local_38);
|
|
local_38._tint[0] = 1.0;
|
|
local_38._tint[1] = 1.0;
|
|
local_38._tint[2] = 1.0;
|
|
local_38._tint[3] = 0.5;
|
|
local_38._offset[0] = 0.0;
|
|
local_38._colorize[0] = 0.6;
|
|
local_38._colorize[1] = 1.0;
|
|
local_38._colorize[2] = 0.3;
|
|
local_38._colorize[3] = 1.0;
|
|
local_38._offset[1] = 0.0;
|
|
local_38._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::MakeGroundPoof(&this->_pos,&local_38,1.0);
|
|
return;
|
|
}
|
|
|
|
// 0062d290
|
|
void Entity_Familiar::mongo_baby_pick_next_mimic()
|
|
{
|
|
uint8_t isOwned;
|
|
int iVar1;
|
|
int tries;
|
|
int mimicIndex;
|
|
|
|
if (this->_variant == 0x4a) {
|
|
mimicIndex = this->_subtype;
|
|
tries = 0;
|
|
this->_subtype = 0;
|
|
while( true ) {
|
|
iVar1 = GHIDRA_INT(((uint64_t)((int64_t)(mimicIndex + 1) * -0x2aaaaaab) >> 0x20));
|
|
mimicIndex = mimicIndex + 1 + ((iVar1 >> 1) - (iVar1 >> 0x1f)) * 0xc;
|
|
isOwned = Entity_Player::HasCollectible
|
|
(this->_player,*GHIDRA_CAST<int *>((&DAT_00b648b0 + mimicIndex * 4)),0);
|
|
if (isOwned != 0) break;
|
|
tries = tries + 1;
|
|
if (0xb < tries) {
|
|
return;
|
|
}
|
|
}
|
|
this->_subtype = mimicIndex;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0062d7e0
|
|
void Entity_Familiar::RemoveFromFollowers()
|
|
{
|
|
int iVar1;
|
|
Entity_Familiar *childRef;
|
|
int *piVar3;
|
|
int *local_14;
|
|
int *local_10;
|
|
int *local_c;
|
|
Entity_Familiar *leadBaby;
|
|
uint32_t *childRef;
|
|
uint32_t *parentRef;
|
|
|
|
if (this->_variant == 0xeb) {
|
|
childRef = GHIDRA_CAST<Entity_Familiar *>(this->_parent);
|
|
parentRef = &this->_parent;
|
|
if (childRef != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
if (this->_subtype == 0) {
|
|
childRef = GHIDRA_CAST<Entity_Familiar *>(this->_child);
|
|
leadBaby = this;
|
|
if ((childRef == GHIDRA_CAST<Entity_Familiar *>(0x0)) || (childRef->_type != 3)) {
|
|
childRef = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
}
|
|
}
|
|
else {
|
|
leadBaby = GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
if (childRef->_type == 3) {
|
|
leadBaby = childRef;
|
|
}
|
|
childRef = this;
|
|
}
|
|
if ((leadBaby == GHIDRA_CAST<Entity_Familiar *>(0x0)) || (childRef == GHIDRA_CAST<Entity_Familiar *>(0x0))) {
|
|
KAGE_LogMessage(4,GHIDRA_CAST<uint8_t *>("Attempting to remove unpaired twisted baby!\n"));
|
|
iVar1 = *parentRef;
|
|
if ((iVar1 != 0) && (*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 3)) {
|
|
local_10 = GHIDRA_CAST<int *>(this->_child);
|
|
piVar3 = GHIDRA_CAST<int *>((iVar1 + 0x3c0));
|
|
if (*piVar3 != 0) {
|
|
local_14 = piVar3;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*piVar3 = GHIDRA_INT(local_10);
|
|
if (local_10 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(piVar3);
|
|
}
|
|
}
|
|
iVar1 = this->_child;
|
|
if (iVar1 != 0) {
|
|
piVar3 = GHIDRA_CAST<int *>((iVar1 + 0x3bc));
|
|
local_10 = GHIDRA_CAST<int *>(*parentRef);
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x3bc)) != 0) {
|
|
local_14 = piVar3;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*piVar3 = GHIDRA_INT(local_10);
|
|
if (local_10 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(piVar3);
|
|
}
|
|
}
|
|
if (*parentRef != 0) {
|
|
local_14 = parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*parentRef = 0;
|
|
}
|
|
else {
|
|
parentRef = &leadBaby->_parent;
|
|
iVar1 = *parentRef;
|
|
if ((iVar1 != 0) && (*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 3)) {
|
|
local_10 = GHIDRA_CAST<int *>(childRef->_child);
|
|
piVar3 = GHIDRA_CAST<int *>((iVar1 + 0x3c0));
|
|
if (*piVar3 != 0) {
|
|
local_c = piVar3;
|
|
msvc::multiset<unsigned_int>::erase(&local_c);
|
|
}
|
|
*piVar3 = GHIDRA_INT(local_10);
|
|
if (local_10 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(piVar3);
|
|
}
|
|
}
|
|
iVar1 = childRef->_child;
|
|
if (iVar1 != 0) {
|
|
local_c = GHIDRA_CAST<int *>((iVar1 + 0x3bc));
|
|
local_14 = GHIDRA_CAST<int *>(*parentRef);
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x3bc)) != 0) {
|
|
local_10 = local_c;
|
|
msvc::multiset<unsigned_int>::erase(&local_10);
|
|
}
|
|
*local_c = GHIDRA_INT(local_14);
|
|
if (local_14 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(local_c);
|
|
}
|
|
}
|
|
if (*parentRef != 0) {
|
|
local_14 = parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*parentRef = 0;
|
|
parentRef = &leadBaby->_child;
|
|
if (*parentRef != 0) {
|
|
local_14 = parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
childRef = &childRef->_parent;
|
|
*parentRef = 0;
|
|
if (*childRef != 0) {
|
|
local_14 = childRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*childRef = 0;
|
|
this = childRef;
|
|
}
|
|
parentRef = &this->_child;
|
|
if (*parentRef != 0) {
|
|
local_14 = parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*parentRef = 0;
|
|
return;
|
|
}
|
|
}
|
|
if (this->_isFollower != 0) {
|
|
iVar1 = this->_parent;
|
|
parentRef = &this->_parent;
|
|
if (iVar1 != 0) {
|
|
piVar3 = GHIDRA_CAST<int *>((iVar1 + 0x3c0));
|
|
local_10 = GHIDRA_CAST<int *>(this->_child);
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x3c0)) != 0) {
|
|
local_14 = piVar3;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*piVar3 = GHIDRA_INT(local_10);
|
|
if (local_10 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(piVar3);
|
|
}
|
|
}
|
|
iVar1 = this->_child;
|
|
childRef = &this->_child;
|
|
if (iVar1 != 0) {
|
|
local_10 = GHIDRA_CAST<int *>((iVar1 + 0x3bc));
|
|
local_c = GHIDRA_CAST<int *>(*parentRef);
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x3bc)) != 0) {
|
|
local_14 = local_10;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*local_10 = GHIDRA_INT(local_c);
|
|
if (local_c != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(local_10);
|
|
}
|
|
}
|
|
if (*parentRef != 0) {
|
|
local_14 = parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*parentRef = 0;
|
|
if (*childRef != 0) {
|
|
local_14 = childRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*childRef = 0;
|
|
}
|
|
this->_isFollower = 0;
|
|
return;
|
|
}
|
|
|
|
// 0062db20
|
|
void Entity_Familiar::AddToFollowers()
|
|
{
|
|
uint32_t *puVar1;
|
|
void *pvVar2;
|
|
Entity_Familiar *pEVar3;
|
|
uint8_t bVar4;
|
|
EntityConfig_Entity *entityConfig;
|
|
uint8_t *curAnimChar;
|
|
int otherPriority;
|
|
uint32_t uVar5;
|
|
std_string *expectedName;
|
|
int iVar6;
|
|
int *childField;
|
|
std_string *anim;
|
|
bool isLess;
|
|
uint32_t *puVar7;
|
|
uint8_t familiars [12];
|
|
uint32_t uStack_1c;
|
|
int *local_18;
|
|
int *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint8_t *animData;
|
|
Entity_Familiar *chainEntity;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6d75;
|
|
local_10 = ExceptionList;
|
|
if (this->_isSubtype55555 != 0) {
|
|
return;
|
|
}
|
|
if (this->_variant != 0xeb) {
|
|
ExceptionList = &local_10;
|
|
if ((this->_isFollower != 0) && (pvVar2 = (void *)this->_parent, pvVar2 != (void *)0x0)) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x28)) == 3) {
|
|
iVar6 = __RTDynamicCast(pvVar2,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0,
|
|
__security_cookie ^ GHIDRA_UINT((familiars + 0x24)));
|
|
if (((iVar6 != 0) && (*GHIDRA_CAST<char *>((iVar6 + 0xd74)) != '\0')) &&
|
|
(this->_player == *(void **)(iVar6 + 0x410))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] Tried to add familiar %d to followers again!\n"));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x28)) == 1) && (pvVar2 == this->_player)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] Tried to add familiar %d to followers again!\n"));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
this->_isFollower = 1;
|
|
iVar6 = GetFollowerPriority(this);
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(familiars),3,-1,-1,0,0);
|
|
local_8 = 2;
|
|
uVar5 = 0;
|
|
if (uStack_1c != 0) {
|
|
LAB_0062de40:
|
|
chainEntity = *GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + uVar5 * 4));
|
|
if (((chainEntity == GHIDRA_CAST<Entity_Familiar *>(0x0)) || (chainEntity->_type != 3)) ||
|
|
((chainEntity == this ||
|
|
((chainEntity->_isFollower == 0 || (chainEntity->_player != this->_player))))))
|
|
goto LAB_0062de6b;
|
|
for (pEVar3 = GHIDRA_CAST<Entity_Familiar *>(chainEntity->_parent);
|
|
(pEVar3 != GHIDRA_CAST<Entity_Familiar *>(0x0) && (pEVar3->_type == 3));
|
|
pEVar3 = GHIDRA_CAST<Entity_Familiar *>(pEVar3->_parent)) {
|
|
chainEntity = pEVar3;
|
|
}
|
|
otherPriority = GetFollowerPriority(chainEntity);
|
|
do {
|
|
if (otherPriority < iVar6) {
|
|
puVar1 = &this->_child;
|
|
if (this->_child != 0) {
|
|
local_14 = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*puVar1 = chainEntity;
|
|
if (chainEntity != GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
}
|
|
puVar1 = &this->_parent;
|
|
local_18 = GHIDRA_CAST<int *>(chainEntity->_parent);
|
|
puVar7 = &chainEntity->_parent;
|
|
if (this->_parent != 0) {
|
|
local_14 = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*puVar1 = local_18;
|
|
if (local_18 != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
iVar6 = *puVar1;
|
|
if ((iVar6 != 0) && (*GHIDRA_CAST<int *>((iVar6 + 0x28)) == 3)) {
|
|
childField = GHIDRA_CAST<int *>((iVar6 + 0x3c0));
|
|
if (*GHIDRA_CAST<int *>((iVar6 + 0x3c0)) != 0) {
|
|
local_18 = childField;
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
*childField = GHIDRA_INT(this);
|
|
msvc::multiset<unsigned_int>::insert(childField);
|
|
}
|
|
}
|
|
if (*puVar7 != 0) {
|
|
local_18 = puVar7;
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
*puVar7 = this;
|
|
LAB_0062df8a:
|
|
msvc::multiset<unsigned_int>::insert(puVar7);
|
|
break;
|
|
}
|
|
pEVar3 = GHIDRA_CAST<Entity_Familiar *>(chainEntity->_child);
|
|
if (pEVar3 == GHIDRA_CAST<Entity_Familiar *>(0x0)) {
|
|
LAB_0062dfde:
|
|
chainEntity->_child = this;
|
|
msvc::multiset<unsigned_int>::insert(&chainEntity->_child);
|
|
puVar7 = &this->_parent;
|
|
if (this->_parent != 0) {
|
|
local_14 = puVar7;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*puVar7 = chainEntity;
|
|
goto LAB_0062df8a;
|
|
}
|
|
if (pEVar3->_type != 3) {
|
|
local_14 = &chainEntity->_child;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
goto LAB_0062dfde;
|
|
}
|
|
otherPriority = GetFollowerPriority(pEVar3);
|
|
chainEntity = pEVar3;
|
|
} while( true );
|
|
}
|
|
LAB_0062df8f:
|
|
if (familiars[0] != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_8 = 3;
|
|
goto LAB_0062dfa3;
|
|
}
|
|
puVar1 = &this->_parent;
|
|
if (this->_parent != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
*puVar1 = this->_player;
|
|
if (this->_player != (void *)0x0) {
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(familiars),3,0xeb,-1,0,0);
|
|
local_8 = 0;
|
|
uVar5 = 0;
|
|
if (uStack_1c != 0) {
|
|
LAB_0062dbc5:
|
|
chainEntity = *GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + uVar5 * 4));
|
|
if ((((chainEntity == GHIDRA_CAST<Entity_Familiar *>(0x0)) || (chainEntity->_type != 3)) ||
|
|
(chainEntity == this)) ||
|
|
((chainEntity->_exists == 0 || (chainEntity->_player != this->_player)))) goto LAB_0062dbf4;
|
|
for (pEVar3 = GHIDRA_CAST<Entity_Familiar *>(chainEntity->_child); pEVar3 != GHIDRA_CAST<Entity_Familiar *>(0x0);
|
|
pEVar3 = GHIDRA_CAST<Entity_Familiar *>(pEVar3->_child)) {
|
|
chainEntity = pEVar3;
|
|
}
|
|
if (chainEntity->_child != 0) {
|
|
local_14 = &chainEntity->_child;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
chainEntity->_child = this;
|
|
msvc::multiset<unsigned_int>::insert(&chainEntity->_child);
|
|
if (*puVar1 != 0) {
|
|
local_14 = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
}
|
|
*puVar1 = chainEntity;
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
iVar6 = 1 - chainEntity->_subtype;
|
|
goto LAB_0062dbfb;
|
|
}
|
|
LAB_0062dbf9:
|
|
iVar6 = 0;
|
|
LAB_0062dbfb:
|
|
manager = g_manager;
|
|
if (iVar6 != this->_subtype) {
|
|
this->_subtype = iVar6;
|
|
entityConfig = (GHIDRA_CAST<EntityConfig *>((&manager->_entityConfig)))->EntityConfig::GetEntity(this->_type,this->_variant,iVar6)
|
|
;
|
|
this->_config = entityConfig;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&entityConfig->anm2Path,1);
|
|
anim = &(this->_sprite)._animDefaultName;
|
|
if (0xf < (this->_sprite)._animDefaultName._capacity) {
|
|
anim = *GHIDRA_CAST<std_string **>(anim->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = anim;
|
|
do {
|
|
bVar4 = *curAnimChar;
|
|
isLess = bVar4 < (uint8_t)expectedName->_buf[0];
|
|
if (bVar4 != expectedName->_buf[0]) {
|
|
LAB_0062dd02:
|
|
uVar5 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0062dd07;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimChar[1];
|
|
isLess = bVar4 < (uint8_t)expectedName->_buf[1];
|
|
if (bVar4 != expectedName->_buf[1]) goto LAB_0062dd02;
|
|
curAnimChar = curAnimChar + 2;
|
|
expectedName = GHIDRA_CAST<std_string *>((expectedName->_buf + 2));
|
|
} while (bVar4 != 0);
|
|
uVar5 = 0;
|
|
LAB_0062dd07:
|
|
if ((uVar5 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0062dd2f;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(anim),1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_0062dd2f:
|
|
if (familiars[0] != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_8 = 1;
|
|
LAB_0062dfa3:
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)familiars)) + 0x4))),0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
LAB_0062de6b:
|
|
uVar5 = uVar5 + 1;
|
|
if (uStack_1c <= uVar5) goto LAB_0062df8f;
|
|
goto LAB_0062de40;
|
|
LAB_0062dbf4:
|
|
uVar5 = uVar5 + 1;
|
|
if (uStack_1c <= uVar5) goto LAB_0062dbf9;
|
|
goto LAB_0062dbc5;
|
|
}
|
|
|
|
// 0062e020
|
|
void Entity_Familiar::set_player(Entity_Player *player)
|
|
{
|
|
short sVar1;
|
|
char isDelayed;
|
|
uint8_t isFollower;
|
|
bool isOrbiting;
|
|
|
|
isFollower = this->_isFollower;
|
|
if (((isFollower == 0) && (-1 < this->_orbitLayer)) && (this->_exists != 0)) {
|
|
sVar1 = (uint16_t)this->_isDelayed << 8;
|
|
isOrbiting = true;
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
LAB_0062e072:
|
|
if (this->_variant != 0xeb) goto LAB_0062e088;
|
|
}
|
|
else {
|
|
sVar1 = CONCAT11(this->_isDelayed,isFollower);
|
|
isOrbiting = false;
|
|
if (isFollower == 0) goto LAB_0062e072;
|
|
isOrbiting = false;
|
|
}
|
|
RemoveFromFollowers(this);
|
|
LAB_0062e088:
|
|
isDelayed = (char)((uint16_t)sVar1 >> 8);
|
|
if (isDelayed != '\0') {
|
|
RemoveFromDelayed(this);
|
|
}
|
|
this->_player = player;
|
|
if (isOrbiting) {
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,1);
|
|
}
|
|
if (((char)sVar1 != '\0') || (this->_variant == 0xeb)) {
|
|
AddToFollowers(this);
|
|
}
|
|
if (isDelayed != '\0') {
|
|
AddToDelayed(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0062e120
|
|
void Entity_Familiar::ai_samsons_chains()
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
uint64_t qVar3;
|
|
float *pfVar4;
|
|
int iVar5;
|
|
float *pfVar6;
|
|
int iVar7;
|
|
uint64_t *allocCounter;
|
|
uint32_t uVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
EntityList_EL chainList;
|
|
float local_40;
|
|
float local_3c;
|
|
float local_38;
|
|
float local_34;
|
|
float local_30;
|
|
float local_2c;
|
|
float toPlayerY;
|
|
float toPlayerX;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t uStack_14;
|
|
Game *game;
|
|
Entity_Familiar *otherChain;
|
|
Room *room;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
uStack_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af3a60;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
toPlayerX = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - (this->_pos).x;
|
|
toPlayerY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - (this->_pos).y;
|
|
local_3c = toPlayerX * toPlayerX + toPlayerY * toPlayerY;
|
|
local_40 = sqrtf(local_3c);
|
|
game = g_game;
|
|
if (0.01 < local_40) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x10) {
|
|
fVar9 = toPlayerX;
|
|
if (0.0 < local_40) {
|
|
fVar9 = (1.0 / local_40) * toPlayerX;
|
|
}
|
|
local_30 = (local_40 - 70.0) * 0.1;
|
|
local_2c = 0.0;
|
|
local_34 = (local_40 - 100.0) * 1.6;
|
|
local_38 = 0.0;
|
|
pfVar6 = &local_30;
|
|
if (local_30 <= 0.0) {
|
|
pfVar6 = &local_2c;
|
|
}
|
|
pfVar4 = &local_34;
|
|
if (local_34 <= 0.0) {
|
|
pfVar4 = &local_38;
|
|
}
|
|
(this->_velocity).x = fVar9 * (*pfVar6 + *pfVar4) + (this->_velocity).x;
|
|
}
|
|
else {
|
|
fVar9 = toPlayerY;
|
|
fVar10 = toPlayerX;
|
|
if (0.0 < local_40) {
|
|
fVar9 = (1.0 / local_40) * toPlayerY;
|
|
fVar10 = (1.0 / local_40) * toPlayerX;
|
|
}
|
|
local_38 = (local_40 - 70.0) * 0.1;
|
|
local_34 = 0.0;
|
|
local_30 = (local_40 - 100.0) * 1.6;
|
|
local_2c = 0.0;
|
|
pfVar6 = &local_38;
|
|
if (local_38 <= 0.0) {
|
|
pfVar6 = &local_34;
|
|
}
|
|
fVar1 = *pfVar6;
|
|
pfVar6 = &local_30;
|
|
if (local_30 <= 0.0) {
|
|
pfVar6 = &local_2c;
|
|
}
|
|
fVar2 = *pfVar6;
|
|
(this->_velocity).x = fVar10 * (fVar1 + fVar2) + (this->_velocity).x;
|
|
(this->_velocity).y = fVar9 * (fVar1 + fVar2) + (this->_velocity).y;
|
|
}
|
|
}
|
|
iVar5 = this->_variant;
|
|
(this->_velocity).x = (this->_velocity).x * 0.8836;
|
|
(this->_velocity).y = (this->_velocity).y * 0.8836;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),&chainList,3,iVar5,-1,0,0);
|
|
uVar8 = 0;
|
|
if (chainList._size != 0) {
|
|
do {
|
|
otherChain = *GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chainList)) + 0x4))) + uVar8 * 4));
|
|
if (otherChain != this) {
|
|
local_2c = (this->_pos).x - (otherChain->_pos).x;
|
|
local_30 = (this->_pos).y - (otherChain->_pos).y;
|
|
local_38 = 0.0;
|
|
fVar9 = sqrtf(local_2c * local_2c + local_30 * local_30);
|
|
local_34 = 20.0 - fVar9;
|
|
pfVar6 = &local_38;
|
|
if (0.0 <= 20.0 - fVar9) {
|
|
pfVar6 = &local_34;
|
|
}
|
|
if (fVar9 <= 0.0) {
|
|
fVar10 = local_30;
|
|
fVar9 = local_2c;
|
|
}
|
|
else {
|
|
fVar9 = (*pfVar6 * 0.1) / fVar9;
|
|
fVar10 = local_30 * fVar9;
|
|
fVar9 = local_2c * fVar9;
|
|
}
|
|
(this->_velocity).x = fVar9 + (this->_velocity).x;
|
|
(this->_velocity).y = fVar10 + (this->_velocity).y;
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT(chainList._size));
|
|
}
|
|
if (14400.0 < local_3c) {
|
|
if (local_40 <= 0.0) {
|
|
fVar9 = toPlayerX;
|
|
local_3c = toPlayerY;
|
|
}
|
|
else {
|
|
fVar9 = toPlayerX * (120.0 / local_40);
|
|
local_3c = toPlayerY * (120.0 / local_40);
|
|
}
|
|
local_40 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - fVar9;
|
|
local_3c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - local_3c;
|
|
room = g_game->_room;
|
|
iVar7 = GHIDRA_INT(((local_40 - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((local_3c - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar7 < 0) || (room->_gridWidth <= iVar7)) || (iVar5 < 0)) ||
|
|
(room->_gridHeight <= iVar5)) {
|
|
iVar7 = -1;
|
|
}
|
|
else {
|
|
iVar7 = iVar5 * room->_gridWidth + iVar7;
|
|
}
|
|
uVar8 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(iVar7);
|
|
if (uVar8 == 0) {
|
|
(this->_pos).x = local_40;
|
|
(this->_pos).y = local_3c;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
fVar9 = g_vectorZero.y;
|
|
}
|
|
else {
|
|
fVar9 = (this->_velocity).x;
|
|
local_38 = (this->_velocity).y;
|
|
local_40 = 5.0;
|
|
local_3c = sqrtf(fVar9 * fVar9 + local_38 * local_38);
|
|
pfVar6 = &local_40;
|
|
if (local_3c <= 5.0) {
|
|
pfVar6 = &local_3c;
|
|
}
|
|
fVar9 = *pfVar6;
|
|
if (local_3c <= 0.0) goto LAB_0062e5c3;
|
|
(this->_velocity).x = (fVar9 / local_3c) * (this->_velocity).x;
|
|
fVar9 = local_38 * (fVar9 / local_3c);
|
|
}
|
|
(this->_velocity).y = fVar9;
|
|
}
|
|
LAB_0062e5c3:
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(chainList)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chainList)) + 0x4))) != 0) {
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chainList)) + 0x4))) + -4));
|
|
qVar3 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar8;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar3) < uVar8));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chainList)) + 0x4))) + -4)));
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0062e620
|
|
void Entity_Familiar::update_weapon(uint8_t isInterpolated)
|
|
{
|
|
void *pvVar1;
|
|
uint8_t isLullaby;
|
|
Weapon *newWeapon;
|
|
uint32_t rngResult;
|
|
int weaponTarget;
|
|
float shootDirection;
|
|
undefined3 in_stack_00000005;
|
|
float local_28;
|
|
Vector local_24;
|
|
uint8_t isShooting [4];
|
|
Vector aimDirection;
|
|
Vector markedAim;
|
|
int *oldWeapon;
|
|
int playerWeapon;
|
|
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x173)) != '\0') {
|
|
return;
|
|
}
|
|
playerWeapon = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13e0));
|
|
if (isInterpolated == 0) {
|
|
oldWeapon = this->_weapon;
|
|
if (playerWeapon == 0) {
|
|
if (oldWeapon != GHIDRA_CAST<int *>(0x0)) {
|
|
Isaac::DestoryWeapon(&this->_weapon);
|
|
}
|
|
}
|
|
else {
|
|
if (oldWeapon != GHIDRA_CAST<int *>(0x0)) {
|
|
if (oldWeapon[0xc] == *GHIDRA_CAST<int *>((playerWeapon + 0x30))) goto LAB_0062e6b0;
|
|
(**(code **)(*oldWeapon + 0x14))();
|
|
if (this->_weapon != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_weapon))(1);
|
|
}
|
|
this->_weapon = (void *)0x0;
|
|
}
|
|
newWeapon = Isaac::CreateWeapon(*GHIDRA_CAST<int *>((playerWeapon + 0x30)),GHIDRA_CAST<Entity *>(this));
|
|
this->_weapon = newWeapon;
|
|
}
|
|
}
|
|
LAB_0062e6b0:
|
|
pvVar1 = this->_player;
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x1398)) == '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x139a)) == '\0')) &&
|
|
(*GHIDRA_CAST<int *>(&g_game->_stageTransition) == 0)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x410)) != '\0' && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x414)) < 1)))) {
|
|
aimDirection.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x1630));
|
|
local_28 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x162c));
|
|
aimDirection.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x1634));
|
|
isShooting[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x162c)) != -1;
|
|
markedAim.y = 0.0;
|
|
markedAim.x = 0.0;
|
|
if ((playerWeapon != 0) && (this->_weapon != (void *)0x0)) {
|
|
TryAimAtMarkedTarget(this,&aimDirection,GHIDRA_CAST<int *>(&local_28),&markedAim);
|
|
}
|
|
shootDirection = local_28;
|
|
if (this->_variant == 0x4c) {
|
|
rngResult = Random();
|
|
local_28 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_28 = local_28 + local_28;
|
|
local_24.x = cos(local_28);
|
|
aimDirection.y = sin(local_28);
|
|
aimDirection.x = local_24.x;
|
|
if (ABS(local_24.x) <= ABS(aimDirection.y)) {
|
|
shootDirection = (float)(GHIDRA_UINT((0.0 <= aimDirection.y)) * 2 + 1);
|
|
local_24.x = shootDirection;
|
|
}
|
|
else {
|
|
shootDirection = 2.8026e-45;
|
|
if (local_24.x < 0.0) {
|
|
shootDirection = 0.0;
|
|
}
|
|
}
|
|
}
|
|
if (this->_counter < 1) {
|
|
if ((shootDirection == -NAN) &&
|
|
((this->_headFrameDelay < 1 ||
|
|
(shootDirection = (float)this->_shootDirection, shootDirection == -NAN)))) {
|
|
shootDirection = 4.2039e-45;
|
|
}
|
|
if ((this->_weapon != GHIDRA_CAST<int *>(0x0)) &&
|
|
(weaponTarget = (**(code **)(*GHIDRA_CAST<int *>(this->_weapon) + 0x24))(), weaponTarget != 0)) {
|
|
local_24.x = *GHIDRA_CAST<float *>((weaponTarget + 0x33c)) - (this->_pos).x;
|
|
local_24.y = *GHIDRA_CAST<float *>((weaponTarget + 0x340)) - (this->_pos).y;
|
|
shootDirection = (float)vector_to_direction(&local_24);
|
|
}
|
|
this->_shootDirection = GHIDRA_INT(shootDirection);
|
|
}
|
|
if ((playerWeapon != 0) && (pvVar1 = this->_weapon, pvVar1 != (void *)0x0)) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x28)) = markedAim.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x2c)) = markedAim.y;
|
|
isLullaby = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x8d,0);
|
|
if (isLullaby == 0) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_weapon) + 0x10)) = *GHIDRA_CAST<uint32_t *>((playerWeapon + 0x10));
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_weapon) + 0x10)) = *GHIDRA_CAST<float *>((playerWeapon + 0x10)) * 0.5;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_weapon) + 0x34)) = *GHIDRA_CAST<uint32_t *>((playerWeapon + 0x34)) | 0x40000000;
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_weapon) + 8))(_isInterpolated);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_weapon) + 0xc))(isShooting,local_24.y,_isInterpolated);
|
|
}
|
|
if (isInterpolated == 0) {
|
|
if (this->_fireCooldown == 0) {
|
|
if (this->_headFrameDelay < 9) {
|
|
PlayFloatAnim(this,this->_shootDirection);
|
|
}
|
|
else {
|
|
PlayShootAnim(this,this->_shootDirection);
|
|
}
|
|
}
|
|
if (0 < this->_counter) {
|
|
this->_counter = this->_counter + -1;
|
|
}
|
|
if (0 < this->_headFrameDelay) {
|
|
this->_headFrameDelay = this->_headFrameDelay + -1;
|
|
}
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
isLullaby = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x8d,0);
|
|
if ((isLullaby != 0) && (0 < this->_fireCooldown)) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0062ee30
|
|
void Entity_Familiar::ai_lil_gurdy()
|
|
{
|
|
Vector *coneDir;
|
|
void *pvVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
Vector *targetDir;
|
|
uint8_t *puVar4;
|
|
int chargeFrames;
|
|
float fVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
char *anim;
|
|
EntityRef *source;
|
|
float local_44;
|
|
Vector local_40;
|
|
Vector local_38;
|
|
EntityRef damageSource;
|
|
Manager *manager;
|
|
int target;
|
|
|
|
if (this->_state == 0) {
|
|
pvVar1 = this->_player;
|
|
this->_entityGridCollisionClass = 3;
|
|
target = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x162c));
|
|
fVar5 = sqrtf(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x1630)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x1630)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x1634)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x1634)));
|
|
if ((fVar5 < 0.5) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x1638)) == '\0')) {
|
|
target = -1;
|
|
}
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&local_38,this->_lastDirection);
|
|
bVar2 = TryAimAtMarkedTarget(this,&local_38,&this->_lastDirection,GHIDRA_CAST<Vector *>(0x0));
|
|
if ((bVar2 != 0) && (0x59 < this->_fireCooldown)) {
|
|
target = -1;
|
|
}
|
|
pvVar1 = this->_player;
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x1398)) == '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x139a)) == '\0')) &&
|
|
(*GHIDRA_CAST<int *>(&g_game->_stageTransition) == 0)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x410)) != '\0' && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x414)) < 1)))) {
|
|
chargeFrames = this->_fireCooldown;
|
|
if (target == -1) {
|
|
if (chargeFrames < 1) {
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) goto LAB_0062f0b9;
|
|
anim = GHIDRA_CAST<char *>(s_Idle);
|
|
}
|
|
else {
|
|
this->_state = 1;
|
|
target = 0x5a;
|
|
if (chargeFrames < 0x5a) {
|
|
target = chargeFrames;
|
|
}
|
|
this->_entityGridCollisionClass = 6;
|
|
this->_fireCooldown = target;
|
|
fVar5 = ((float)target / 90.0) * 20.0 + 5.0;
|
|
fVar6 = local_38.x * fVar5 + (this->_velocity).x;
|
|
(this->_velocity).y = local_38.y * fVar5 + (this->_velocity).y;
|
|
(this->_velocity).x = fVar6;
|
|
fVar10 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x360)) * 0.6;
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x364)) * 0.6;
|
|
fVar10 = fVar10 + fVar10;
|
|
fVar7 = fVar7 + fVar7;
|
|
fVar9 = local_38.y * fVar7 + local_38.x * fVar10;
|
|
fVar5 = local_38.y * fVar9;
|
|
fVar9 = local_38.x * fVar9;
|
|
if (local_38.y * fVar5 + local_38.x * fVar9 < 0.0) {
|
|
fVar7 = fVar7 - fVar5;
|
|
fVar10 = fVar10 - fVar9;
|
|
}
|
|
anim = "Dashing";
|
|
(this->_velocity).y = fVar7 + (this->_velocity).y;
|
|
(this->_velocity).x = fVar6 + fVar10;
|
|
local_38.x = fVar5;
|
|
}
|
|
}
|
|
else {
|
|
if (chargeFrames == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("ChargeStart"),0);
|
|
chargeFrames = this->_fireCooldown;
|
|
}
|
|
this->_lastDirection = target;
|
|
this->_fireCooldown = chargeFrames + 1;
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) goto LAB_0062f0b9;
|
|
anim = "Charging";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim),0);
|
|
}
|
|
LAB_0062f0b9:
|
|
if (this->_state == 0) {
|
|
local_44 = this->_friction * 0.8;
|
|
this->_friction = local_44;
|
|
fVar5 = (this->_pos).x;
|
|
fVar9 = (this->_pos).y;
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
fVar10 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
fVar8 = fVar5 - fVar7;
|
|
fVar6 = fVar9 - fVar10;
|
|
if (2500.0 < fVar6 * fVar6 + fVar8 * fVar8) {
|
|
local_38.x = (fVar7 - fVar5) * 0.05;
|
|
local_40.x = (fVar10 - fVar9) * 0.05;
|
|
fVar7 = sqrtf(local_40.x * local_40.x + local_38.x * local_38.x);
|
|
fVar5 = local_40.x;
|
|
fVar9 = local_38.x;
|
|
if ((1.0 < fVar7) && (0.0 < fVar7)) {
|
|
fVar5 = (1.0 / fVar7) * local_40.x;
|
|
fVar9 = (1.0 / fVar7) * local_38.x;
|
|
}
|
|
if (local_44 != 0.0) {
|
|
fVar7 = this->_speedMultiplier;
|
|
(this->_velocity).y = (fVar7 * fVar5) / local_44 + (this->_velocity).y;
|
|
(this->_velocity).x = (fVar7 * fVar9) / local_44 + (this->_velocity).x;
|
|
}
|
|
}
|
|
}
|
|
uVar3 = Random();
|
|
if (uVar3 % 3 != 0) goto LAB_0062f7c8;
|
|
fVar5 = 10.0;
|
|
}
|
|
else {
|
|
if (this->_state != 1) goto LAB_0062f7c8;
|
|
if (this->_collidesWithGrid != 0) {
|
|
local_38.x = (this->_gridCollisionVelocity).x + (this->_pos).x;
|
|
local_40.x = (float)g_game->_room;
|
|
local_44 = (this->_gridCollisionVelocity).y;
|
|
local_38.y = local_44 + (this->_pos).y;
|
|
local_38.x = (float)(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_40.x))))->Room::GetGridIndex(&local_38);
|
|
if (GHIDRA_INT(local_38.x) < 0) {
|
|
fVar5 = local_44;
|
|
}
|
|
else {
|
|
damageSource._entity = this->_player;
|
|
if (damageSource._entity == (void *)0x0) {
|
|
damageSource._type = 0;
|
|
damageSource._variant = 0;
|
|
damageSource._spawnerType = 0;
|
|
damageSource._spawnerVariant = 0;
|
|
damageSource._position.x = g_vectorZero.x;
|
|
damageSource._position.y = g_vectorZero.y;
|
|
damageSource._velocity.x = g_vectorZero.x;
|
|
damageSource._velocity.y = g_vectorZero.y;
|
|
LAB_0062f341:
|
|
damageSource._flags = 0;
|
|
if (damageSource._entity != (void *)0x0) goto LAB_0062f347;
|
|
damageSource._flags = 0;
|
|
LAB_0062f363:
|
|
local_44 = 0.0;
|
|
if (damageSource._entity != (void *)0x0) goto LAB_0062f36f;
|
|
LAB_0062f388:
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
damageSource._type = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x28));
|
|
damageSource._variant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x2c));
|
|
damageSource._spawnerType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x34));
|
|
damageSource._spawnerVariant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x38));
|
|
damageSource._position.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x33c));
|
|
damageSource._position.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x340));
|
|
damageSource._velocity.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x360));
|
|
damageSource._velocity.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x364));
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x168)) & 0x100) == 0) goto LAB_0062f341;
|
|
damageSource._flags = 1;
|
|
LAB_0062f347:
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x168)) & 0x20000000) == 0) goto LAB_0062f363;
|
|
local_44 = 2.8026e-45;
|
|
LAB_0062f36f:
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(damageSource._entity) + 0x16c)) & 0x400000) == 0) goto LAB_0062f388;
|
|
uVar3 = 4;
|
|
}
|
|
fVar5 = (this->_gridCollisionVelocity).y;
|
|
fVar9 = (this->_gridCollisionVelocity).x;
|
|
damageSource._flags = uVar3 | GHIDRA_UINT(local_44) | damageSource._flags;
|
|
source = &damageSource;
|
|
fVar5 = sqrtf(fVar9 * fVar9 + fVar5 * fVar5);
|
|
fVar5 = fVar5 / 10.0;
|
|
if (fVar5 <= 1.0) {
|
|
fVar5 = 1.0;
|
|
}
|
|
if (4.0 <= fVar5) {
|
|
fVar5 = 4.0;
|
|
}
|
|
(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_40.x))))->Room::DamageGridWithSource(GHIDRA_INT(local_38.x),GHIDRA_INT(fVar5),source);
|
|
fVar5 = (this->_gridCollisionVelocity).y;
|
|
}
|
|
fVar9 = (this->_gridCollisionVelocity).x;
|
|
if (64.0 < fVar5 * fVar5 + fVar9 * fVar9) {
|
|
(this->_hitList)._end = (this->_hitList)._begin;
|
|
fVar5 = (this->_gridCollisionVelocity).y;
|
|
}
|
|
fVar9 = (this->_gridCollisionVelocity).x;
|
|
local_44 = sqrtf(fVar9 * fVar9 + fVar5 * fVar5);
|
|
local_40.x = (this->_velocity).x;
|
|
coneDir = &this->_velocity;
|
|
local_38.x = (this->_velocity).y;
|
|
fVar5 = sqrtf(local_40.x * local_40.x + local_38.x * local_38.x);
|
|
if (fVar5 <= 0.0) {
|
|
fVar9 = local_40.x;
|
|
fVar5 = local_38.x;
|
|
}
|
|
else {
|
|
fVar9 = local_40.x * (1.0 / fVar5);
|
|
fVar5 = local_38.x * (1.0 / fVar5);
|
|
}
|
|
coneDir->x = fVar9;
|
|
(this->_velocity).y = fVar5;
|
|
if ((0.0 < local_44) && (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x100), bVar2 == 0)) {
|
|
PickEnemyTarget(this,800.0,0,0xb,coneDir,15.0);
|
|
target = this->_target;
|
|
if (target != 0) {
|
|
local_38.x = *GHIDRA_CAST<float *>((target + 0x33c)) - (this->_pos).x;
|
|
local_38.y = *GHIDRA_CAST<float *>((target + 0x340)) - (this->_pos).y;
|
|
targetDir = (GHIDRA_CAST<Vector *>((&local_38)))->Vector::Normalized(&local_40);
|
|
coneDir->x = targetDir->x;
|
|
(this->_velocity).y = targetDir->y;
|
|
}
|
|
}
|
|
fVar9 = local_44 * (this->_velocity).y;
|
|
fVar5 = local_44 * coneDir->x;
|
|
(this->_velocity).y = fVar9;
|
|
coneDir->x = fVar5;
|
|
manager = g_manager;
|
|
fVar5 = -(fVar9 * (this->_gridCollisionNormal).y + fVar5 * (this->_gridCollisionNormal).x);
|
|
if (fVar5 <= 20.0) {
|
|
if (4.0 < fVar5) {
|
|
fVar5 = (fVar5 - 4.0) * 0.125;
|
|
if (fVar5 <= 0.0) {
|
|
fVar5 = 0.0;
|
|
}
|
|
if (1.0 <= fVar5) {
|
|
fVar5 = 1.0;
|
|
}
|
|
SoundEffects::PlayWithFartOverride(0x48,fVar5 * 0.5 + 0.5,2,0,1.0);
|
|
}
|
|
}
|
|
else {
|
|
local_38.x = 3.92364e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38.x),0.8,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
local_40.x = (this->_velocity).x;
|
|
fVar5 = (this->_velocity).y;
|
|
local_38.x = sqrtf(local_40.x * local_40.x + fVar5 * fVar5);
|
|
if (this->_fireCooldown < 1) {
|
|
local_44 = 0.98;
|
|
local_40.x = local_38.x * 0.02 + 0.8;
|
|
puVar4 = GHIDRA_CAST<uint8_t *>(&local_40);
|
|
if (0.98 <= local_40.x) {
|
|
puVar4 = GHIDRA_CAST<uint8_t *>(&local_44);
|
|
}
|
|
this->_friction = *GHIDRA_CAST<float *>(puVar4) * this->_friction;
|
|
}
|
|
else {
|
|
target = this->_fireCooldown + -3;
|
|
this->_fireCooldown = target;
|
|
if (0.0 < local_38.x) {
|
|
fVar5 = (float)target / 60.0;
|
|
if (fVar5 <= 0.0) {
|
|
fVar5 = 0.0;
|
|
}
|
|
if (1.0 <= fVar5) {
|
|
fVar5 = 1.0;
|
|
}
|
|
fVar5 = fVar5 * (3.0 / local_38.x) + local_38.x;
|
|
if (40.0 <= fVar5) {
|
|
fVar5 = 40.0;
|
|
}
|
|
(this->_velocity).x = (fVar5 / local_38.x) * local_40.x;
|
|
(this->_velocity).y = (fVar5 / local_38.x) * (this->_velocity).y;
|
|
local_38.x = fVar5;
|
|
}
|
|
}
|
|
if (local_38.x < 1.0) {
|
|
this->_state = 0;
|
|
this->_fireCooldown = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("DashStop"),0);
|
|
}
|
|
fVar5 = 10.0 / local_38.x;
|
|
if (fVar5 <= 2.0) {
|
|
fVar5 = 2.0;
|
|
}
|
|
if (10.0 <= fVar5) {
|
|
fVar5 = 10.0;
|
|
}
|
|
}
|
|
target = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(fVar5,0.0);
|
|
if (target != 0) {
|
|
uVar3 = Random();
|
|
Entity_NPC::MakeSplat
|
|
(GHIDRA_CAST<Entity_NPC *>(this),
|
|
(float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.2);
|
|
}
|
|
LAB_0062f7c8:
|
|
(this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0;
|
|
return;
|
|
}
|
|
|
|
// 00630440
|
|
void Entity_Familiar::AddKeys(int param_2)
|
|
{
|
|
this->_keys = this->_keys + param_2;
|
|
return;
|
|
}
|
|
|
|
// 00630450
|
|
void Entity_Familiar::store_backup(void *backup)
|
|
{
|
|
int iVar1;
|
|
uint32_t linkedHealth;
|
|
|
|
*GHIDRA_CAST<int *>(backup) = this->_initSeed;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0x2c)) = (this->_dropRNG)._seed;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 4)) = this->_variant;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 8)) = this->_subtype;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0xc)) = this->_coins;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0x10)) = this->_hearts;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0x14)) = this->_keys;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0x18)) = this->_state;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0x1c)) = this->_roomClearCount;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(backup) + 0x20)) = (this->_formationTargetOffset).x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(backup) + 0x24)) = (this->_formationTargetOffset).y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(backup) + 0x28)) = this->_health;
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(backup) + 0x30)) = this->_isNotCountedAsFollower;
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(backup) + 0x31)) = this->_isSubtype55555;
|
|
iVar1 = this->_variant;
|
|
if ((iVar1 == 0xce) || (iVar1 == 0xed)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(backup) + 0x1c)) = this->_orbitLayer;
|
|
iVar1 = this->_variant;
|
|
}
|
|
if (iVar1 == 0xf1) {
|
|
if (this->_linkedEntity == 0) {
|
|
linkedHealth = 0;
|
|
}
|
|
else {
|
|
linkedHealth = *GHIDRA_CAST<uint32_t *>((this->_linkedEntity + 0x380));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(backup) + 0x28)) = linkedHealth;
|
|
iVar1 = this->_variant;
|
|
}
|
|
if (iVar1 == 0xec) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(backup) + 0x28)) = this->_orbitSpeed;
|
|
iVar1 = this->_variant;
|
|
}
|
|
if (iVar1 == 0xe7) {
|
|
iVar1 = __RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(backup) + 0x1c)) = GHIDRA_UINT(*GHIDRA_CAST<uint8_t *>((iVar1 + 0x50)));
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00631050
|
|
void Entity_Familiar::MoveDelayed(int numFrames)
|
|
{
|
|
float fVar1;
|
|
uint8_t isDuctTape;
|
|
uint32_t *historyEntry;
|
|
float *historySlot;
|
|
void *leader;
|
|
int remaining;
|
|
int historyIndex;
|
|
uint32_t leaderY;
|
|
float posY;
|
|
|
|
if (this->_isSubtype55555 != 0) {
|
|
(this->_pos).x = (this->_formationOffset).x;
|
|
(this->_pos).y = (this->_formationOffset).y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
return;
|
|
}
|
|
isDuctTape = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x6d,0);
|
|
if (isDuctTape != 0) {
|
|
move_to_parent_offset(this);
|
|
return;
|
|
}
|
|
if (((this->_formationOffset).x == g_vectorZero.x) &&
|
|
((this->_formationOffset).y == g_vectorZero.y)) {
|
|
historyIndex = this->_moveDelayNum;
|
|
}
|
|
else {
|
|
reset_follow_target(this);
|
|
historyIndex = -1;
|
|
}
|
|
leader = this->_player;
|
|
if ((void *)this->_parent != (void *)0x0) {
|
|
leader = (void *)this->_parent;
|
|
}
|
|
if (historyIndex == -1) {
|
|
historyIndex = 0;
|
|
this->_moveDelayNum = 0;
|
|
if (3 < numFrames) {
|
|
remaining = (numFrames - 4U >> 2) + 1;
|
|
historyIndex = remaining * 4;
|
|
historyEntry = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x424))));
|
|
do {
|
|
leaderY = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x340));
|
|
historyEntry[-3] = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x33c));
|
|
historyEntry[-2] = leaderY;
|
|
leaderY = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x340));
|
|
historyEntry[-1] = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x33c));
|
|
*historyEntry = leaderY;
|
|
leaderY = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x340));
|
|
historyEntry[1] = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x33c));
|
|
historyEntry[2] = leaderY;
|
|
leaderY = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x340));
|
|
historyEntry[3] = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x33c));
|
|
historyEntry[4] = leaderY;
|
|
remaining = remaining + -1;
|
|
historyEntry = historyEntry + 8;
|
|
} while (remaining != 0);
|
|
}
|
|
if (historyIndex < numFrames) {
|
|
remaining = numFrames - historyIndex;
|
|
historySlot = &(GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 4].y;
|
|
do {
|
|
leaderY = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(leader) + 0x340));
|
|
*historySlot = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(leader) + 0x33c));
|
|
historySlot[1] = (float)leaderY;
|
|
remaining = remaining + -1;
|
|
historySlot = historySlot + 2;
|
|
} while (remaining != 0);
|
|
}
|
|
}
|
|
else {
|
|
historyIndex = (historyIndex + 1) % numFrames;
|
|
this->_moveDelayNum = historyIndex;
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(leader) + 0x340));
|
|
(GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 4].y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(leader) + 0x33c));
|
|
(GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 5].x = fVar1;
|
|
}
|
|
historyIndex = (this->_moveDelayNum + 1) % numFrames;
|
|
if (this->_variant == 0x83) {
|
|
fVar1 = (GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 5].x;
|
|
posY = (this->_pos).y;
|
|
(this->_velocity).x =
|
|
((GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 4].y - (this->_pos).x) * 0.5;
|
|
(this->_velocity).y = (fVar1 - posY) * 0.5;
|
|
}
|
|
else {
|
|
fVar1 = (GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 5].x;
|
|
(this->_velocity).x =
|
|
((GHIDRA_CAST<Vector *>((&this->_splatColor + 0xc)))[historyIndex + 4].y - (this->_pos).x) * 0.1 +
|
|
(this->_velocity).x;
|
|
(this->_velocity).y = (fVar1 - (this->_pos).y) * 0.1 + (this->_velocity).y;
|
|
}
|
|
this->_friction = this->_friction * 0.7;
|
|
return;
|
|
}
|
|
|
|
// 006312f0
|
|
void Entity_Familiar::MoveDiagonally(float speed)
|
|
{
|
|
Vector *position;
|
|
uint8_t bVar1;
|
|
uint32_t rngResult;
|
|
Entity *spawned;
|
|
int *effect;
|
|
float fVar2;
|
|
float fVar3;
|
|
float fVar4;
|
|
Vector local_10;
|
|
Game *game;
|
|
bool isFixedAngle;
|
|
int tls;
|
|
|
|
if ((this->_variant == 0x4c) || (this->_variant == 0x3a)) {
|
|
isFixedAngle = true;
|
|
}
|
|
else {
|
|
isFixedAngle = false;
|
|
}
|
|
if (this->_isSubtype55555 != 0) {
|
|
(this->_pos).x = (this->_formationOffset).x;
|
|
(this->_pos).y = (this->_formationOffset).y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
return;
|
|
}
|
|
fVar2 = (this->_velocity).x;
|
|
if ((fVar2 == g_vectorZero.x) && ((this->_velocity).y == g_vectorZero.y)) {
|
|
rngResult = Random();
|
|
local_10.x = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_10.x = local_10.x + local_10.x;
|
|
fVar2 = cos(local_10.x);
|
|
fVar3 = sin(local_10.x);
|
|
(this->_velocity).x = fVar2 * 10.0;
|
|
(this->_velocity).y = fVar3 * 10.0;
|
|
return;
|
|
}
|
|
tls = *GHIDRA_CAST<int *>(ThreadLocalStoragePointer);
|
|
(this->_velocity).x = fVar2 * 0.7;
|
|
(this->_velocity).y = (this->_velocity).y * 0.7;
|
|
if ((*GHIDRA_CAST<int *>((tls + 0xc)) < DAT_00c7fd14) &&
|
|
(_Init_thread_header(&DAT_00c7fd14), DAT_00c7fd14 == -1)) {
|
|
DAT_00c7fd18 = sqrtf(2.0);
|
|
_Init_thread_footer(&DAT_00c7fd14);
|
|
}
|
|
local_10.x = 0.7853982;
|
|
if (!isFixedAngle) {
|
|
local_10.x = ((float)this->_fireCooldown * 3.1415927) / 180.0 + 0.7853982;
|
|
}
|
|
fVar4 = cos(local_10.x);
|
|
fVar3 = DAT_00c7fd18;
|
|
fVar2 = (this->_velocity).x;
|
|
if (fVar2 <= 0.0) {
|
|
fVar2 = fVar2 - DAT_00c7fd18 * fVar4 * speed;
|
|
}
|
|
else {
|
|
fVar2 = DAT_00c7fd18 * fVar4 * speed + fVar2;
|
|
}
|
|
(this->_velocity).x = fVar2;
|
|
fVar4 = sin(local_10.x);
|
|
game = g_game;
|
|
fVar2 = (this->_velocity).y;
|
|
if (fVar2 <= 0.0) {
|
|
fVar2 = fVar2 - fVar4 * fVar3 * speed;
|
|
}
|
|
else {
|
|
fVar2 = fVar4 * fVar3 * speed + fVar2;
|
|
}
|
|
position = &this->_pos;
|
|
(this->_velocity).y = fVar2;
|
|
Room::GetClampedPositionImpl(game->_room,&local_10,position,0.0,0.0,0.0,0.0);
|
|
if (position->x <= local_10.x) {
|
|
if (position->x < local_10.x) {
|
|
(this->_velocity).x = speed * 3.0 + (this->_velocity).x;
|
|
}
|
|
}
|
|
else {
|
|
(this->_velocity).x = (this->_velocity).x - speed * 3.0;
|
|
}
|
|
fVar2 = (this->_pos).y;
|
|
if (fVar2 <= local_10.y) {
|
|
if (fVar2 < local_10.y) {
|
|
(this->_velocity).y = speed * 3.0 + (this->_velocity).y;
|
|
}
|
|
}
|
|
else {
|
|
(this->_velocity).y = (this->_velocity).y - speed * 3.0;
|
|
}
|
|
rngResult = Random();
|
|
if (((rngResult & 3) == 0) && ((this->_variant == 0x11 || (this->_variant == 0xcf)))) {
|
|
rngResult = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,7,position,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,rngResult,0);
|
|
effect = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0));
|
|
rngResult = Random();
|
|
fVar2 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.3 + 0.1;
|
|
effect[0x39] = GHIDRA_INT(fVar2);
|
|
effect[0x3a] = GHIDRA_INT(fVar2);
|
|
(**(code **)(*effect + 0xc))();
|
|
}
|
|
game = g_game;
|
|
if ((((this->_variant == 0xcf) && ((this->_flags & 0x4000) == 0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar1 == 0)) &&
|
|
(((~(uint8_t)game->_frameCount & 1) != 0 && (rngResult = Random(), 1 < rngResult % 5)))) {
|
|
rngResult = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x2e,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,rngResult,0)
|
|
;
|
|
effect = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0));
|
|
rngResult = Random();
|
|
fVar3 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.2;
|
|
fVar2 = fVar3 * g_vectorOne.x;
|
|
effect[0x3a] = GHIDRA_INT((fVar3 * g_vectorOne.y));
|
|
effect[0x39] = GHIDRA_INT(fVar2);
|
|
(**(code **)(*effect + 0xc))();
|
|
}
|
|
if (!isFixedAngle) {
|
|
if (((0.0 < (this->_velocity).x) && ((this->_targetPosition).x <= 0.0)) ||
|
|
((0.0 < (this->_velocity).y && ((this->_targetPosition).y <= 0.0)))) {
|
|
rngResult = Random();
|
|
this->_fireCooldown = rngResult % 0x1f - 0xf;
|
|
}
|
|
(this->_targetPosition).x = (this->_velocity).x;
|
|
(this->_targetPosition).y = (this->_velocity).y;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00631850
|
|
void Entity_Familiar::move_to_parent_offset()
|
|
{
|
|
Vector *followOffset;
|
|
float fVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
Vector followOffsetResult;
|
|
void *player;
|
|
|
|
if ((*GHIDRA_CAST<char *>(g_game->_room) != '\0') &&
|
|
(g_game->_frameCount == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f0)))) {
|
|
player = this->_player;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x33c));
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x340));
|
|
followOffset = UpdateFollowPosition(this,&followOffsetResult);
|
|
fVar3 = followOffset->y;
|
|
(this->_pos).x = fVar1 + followOffset->x;
|
|
(this->_pos).y = fVar2 + fVar3;
|
|
return;
|
|
}
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
followOffset = UpdateFollowPosition(this,&followOffsetResult);
|
|
fVar1 = (fVar1 + followOffset->x) - (this->_pos).x;
|
|
fVar2 = (fVar2 + followOffset->y) - (this->_pos).y;
|
|
(this->_velocity).x = fVar1;
|
|
fVar3 = fVar1 * fVar1 + fVar2 * fVar2;
|
|
(this->_velocity).y = fVar2;
|
|
if (10000.0 < fVar3) {
|
|
fVar3 = sqrtf(fVar3);
|
|
if (0.0 < fVar3) {
|
|
(this->_velocity).y = (100.0 / fVar3) * fVar2;
|
|
(this->_velocity).x = (100.0 / fVar3) * fVar1;
|
|
}
|
|
}
|
|
(this->_velocity).x = (this->_velocity).x * 0.8;
|
|
(this->_velocity).y = (this->_velocity).y * 0.8;
|
|
return;
|
|
}
|
|
|
|
// 00631b20
|
|
void Entity_Familiar::delirium_morph()
|
|
{
|
|
char *pcVar1;
|
|
size_t _Size;
|
|
uint32_t uVar2;
|
|
uint64_t qVar3;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
LayerState *layer;
|
|
std_string *extraout_EAX;
|
|
std_string *path;
|
|
uint8_t *resolvedPath;
|
|
Entity *poofEffect;
|
|
int iVar6;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t unk;
|
|
void *pvVar7;
|
|
uint64_t *heapCounter;
|
|
code *pcVar8;
|
|
char *_Size_00;
|
|
uint32_t uVar9;
|
|
float fVar10;
|
|
uint32_t *local_70;
|
|
int oldSirenHelper;
|
|
uint32_t *local_68;
|
|
Entity_Familiar *local_64;
|
|
std_string *local_60;
|
|
uint32_t local_5c;
|
|
char *local_58;
|
|
ANM2 *local_54;
|
|
uint8_t *local_50;
|
|
code *local_4c;
|
|
uint8_t local_46;
|
|
uint8_t local_45;
|
|
void *redirectedPath [3];
|
|
uint64_t local_38;
|
|
uint32_t local_30;
|
|
std_string sheetPath;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_c;
|
|
uint32_t ehState;
|
|
float oldPosY;
|
|
float oldVelocityX;
|
|
float oldVelocityY;
|
|
uint32_t *refSlot;
|
|
|
|
ehState = 0xffffffff;
|
|
puStack_c = &LAB_00af6e7d;
|
|
savedExceptionList = ExceptionList;
|
|
ExceptionList = &savedExceptionList;
|
|
local_58 = GHIDRA_CAST<char *>(this->_variant);
|
|
uVar5 = this->_initSeed;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x0))) = '\x05';
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x1))) = '\0';
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x2))) = '\0';
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x3))) = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) = 3;
|
|
local_54 = GHIDRA_CAST<ANM2 *>(0x15);
|
|
local_50 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
do {
|
|
local_64 = this;
|
|
if (local_58 != GHIDRA_CAST<char *>(this->_variant)) break;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar8 = (code *)swi(3);
|
|
(*pcVar8)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> 5 ^ uVar5;
|
|
uVar5 = uVar5 << 3 ^ uVar5;
|
|
uVar5 = uVar5 >> 0x15 ^ uVar5;
|
|
local_50 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_50) + 1));
|
|
local_58 = *GHIDRA_CAST<char **>((&DAT_00b64820 + (uVar5 % 0x16) * 4));
|
|
} while (local_50 < 10);
|
|
local_4c = this->_player;
|
|
fVar10 = (this->_pos).x;
|
|
local_5c = this->_child;
|
|
local_50 = GHIDRA_CAST<uint8_t *>(this->_parent);
|
|
iVar6 = this->_spawnerType;
|
|
oldPosY = (this->_pos).y;
|
|
local_60 = GHIDRA_CAST<std_string *>(this->_spawnerVariant);
|
|
oldVelocityX = (this->_velocity).x;
|
|
local_68 = this->_sirenOriginalPlayer;
|
|
oldVelocityY = (this->_velocity).y;
|
|
oldSirenHelper = this->_sirenHelper;
|
|
if (this->_weapon != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_weapon) + 0x14))(__security_cookie ^ GHIDRA_UINT(&(&sheetPath)[1]._size));
|
|
if (this->_weapon != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_weapon))(1);
|
|
}
|
|
this->_weapon = (void *)0x0;
|
|
}
|
|
if (GHIDRA_CAST<int *>(this->_linkedEntity) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_linkedEntity) + 0x28))();
|
|
}
|
|
local_46 = this->_isFollower;
|
|
local_45 = this->_isDelayed;
|
|
RecalculateOrbitOffset(this,this->_orbitLayer,0);
|
|
RemoveFromFollowers(this);
|
|
RemoveFromDelayed(this);
|
|
this->ClearReferences();
|
|
if (this->_spawnerEntity != 0) {
|
|
local_70 = &this->_spawnerEntity;
|
|
msvc::multiset<unsigned_int>::erase(&local_70);
|
|
}
|
|
this->_spawnerEntity = local_4c;
|
|
if (local_4c != (code *)0x0) {
|
|
msvc::multiset<unsigned_int>::insert(&this->_spawnerEntity);
|
|
}
|
|
local_4c = *(code **)(*GHIDRA_CAST<int *>(this) + 4);
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar8 = (code *)swi(3);
|
|
(*pcVar8)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> ((uint8_t)local_38 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << (SUB81(local_38,4) & 0x1f) ^ uVar5;
|
|
(*local_4c)(this->_type,local_58,0,uVar5 >> ((uint8_t)local_54 & 0x1f) ^ uVar5);
|
|
if (((this->_isFollower != 0) && (local_46 != 0)) || ((this->_isDelayed != 0 && (local_45 != 0))))
|
|
{
|
|
RemoveFromFollowers(this);
|
|
RemoveFromDelayed(this);
|
|
refSlot = &this->_parent;
|
|
this->_isFollower = local_46;
|
|
this->_isDelayed = local_45;
|
|
if (*refSlot != 0) {
|
|
local_4c = (code *)refSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_4c);
|
|
}
|
|
*refSlot = local_50;
|
|
if (local_50 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(refSlot);
|
|
pcVar8 = (code *)(GHIDRA_INT(local_50) + 0x3c0);
|
|
if (*GHIDRA_CAST<int *>(pcVar8) != 0) {
|
|
local_4c = pcVar8;
|
|
msvc::multiset<unsigned_int>::erase(&local_4c);
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>(pcVar8) = this;
|
|
msvc::multiset<unsigned_int>::insert(pcVar8);
|
|
}
|
|
refSlot = &this->_child;
|
|
if (this->_child != 0) {
|
|
local_4c = (code *)refSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_4c);
|
|
}
|
|
*refSlot = local_5c;
|
|
if (local_5c != 0) {
|
|
msvc::multiset<unsigned_int>::insert(refSlot);
|
|
pcVar8 = (code *)(local_5c + 0x3bc);
|
|
if (*GHIDRA_CAST<int *>(pcVar8) != 0) {
|
|
local_4c = pcVar8;
|
|
msvc::multiset<unsigned_int>::erase(&local_4c);
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>(pcVar8) = this;
|
|
msvc::multiset<unsigned_int>::insert(pcVar8);
|
|
}
|
|
}
|
|
(this->_pos).x = fVar10;
|
|
(this->_pos).y = oldPosY;
|
|
(this->_velocity).x = oldVelocityX;
|
|
this->_spawnerType = iVar6;
|
|
this->_spawnerVariant = GHIDRA_INT(local_60);
|
|
(this->_velocity).y = oldVelocityY;
|
|
this->_appearTimer = 0;
|
|
local_45 = '\0';
|
|
local_50 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
local_54 = &this->_sprite;
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((local_54)))->ANM2::GetLayer(local_50);
|
|
if (layer->_layerData == (void *)0x0) {
|
|
sheetPath._capacity = 0xf;
|
|
sheetPath._size = 0;
|
|
sheetPath._buf[0] = '\0';
|
|
sheetPath._buf[1] = '\0';
|
|
sheetPath._buf[2] = '\0';
|
|
sheetPath._buf[3] = '\0';
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<msvc::string *>((sheetPath._buf)))->msvc::string::string((void *)(GHIDRA_INT(layer->_layerData) + 0x20));
|
|
}
|
|
uVar5 = sheetPath._size;
|
|
ehState = 0;
|
|
local_5c = sheetPath._capacity;
|
|
if (sheetPath._size < 4) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_00499950();
|
|
}
|
|
if (sheetPath._capacity - sheetPath._size < 0x12) {
|
|
if (0x7fffffff - sheetPath._size < 0x12) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::string::_Xlen();
|
|
}
|
|
uVar9 = sheetPath._size + 0x12 | 0xf;
|
|
if (uVar9 < 0x80000000) {
|
|
if (0x7fffffff - (sheetPath._capacity >> 1) < sheetPath._capacity) {
|
|
uVar9 = 0x7fffffff;
|
|
}
|
|
else {
|
|
uVar2 = sheetPath._capacity + (sheetPath._capacity >> 1);
|
|
if (uVar9 < uVar2) {
|
|
uVar9 = uVar2;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar9 = 0x7fffffff;
|
|
}
|
|
local_58 = msvc::_Allocate(uVar9 + 1);
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0)));
|
|
uVar2 = local_5c;
|
|
sheetPath._size = uVar5 + 0x12;
|
|
local_60 = GHIDRA_CAST<std_string *>((uVar5 - 3));
|
|
sheetPath._capacity = uVar9;
|
|
if (local_5c < 0x10) {
|
|
*GHIDRA_CAST<uint32_t *>(local_58) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0)));
|
|
local_58[4] = 'f';
|
|
local_58[5] = 'a';
|
|
local_58[6] = 'm';
|
|
local_58[7] = 'i';
|
|
local_58[8] = 'l';
|
|
local_58[9] = 'i';
|
|
local_58[10] = 'a';
|
|
local_58[0xb] = 'r';
|
|
local_58[0xc] = '/';
|
|
local_58[0xd] = 'd';
|
|
local_58[0xe] = 'e';
|
|
local_58[0xf] = 'l';
|
|
local_58[0x10] = 'i';
|
|
local_58[0x11] = 'r';
|
|
local_58[0x12] = 'i';
|
|
local_58[0x13] = 'u';
|
|
local_58[0x14] = 'm';
|
|
local_58[0x15] = '/';
|
|
memcpy(local_58 + 0x16,sheetPath._buf + 4,(size_t)local_60);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint32_t *>(local_58) = *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint32_t *>(sheetPath._buf))) + 0x0)));
|
|
local_58[4] = 'f';
|
|
local_58[5] = 'a';
|
|
local_58[6] = 'm';
|
|
local_58[7] = 'i';
|
|
local_58[8] = 'l';
|
|
local_58[9] = 'i';
|
|
local_58[10] = 'a';
|
|
local_58[0xb] = 'r';
|
|
local_58[0xc] = '/';
|
|
local_58[0xd] = 'd';
|
|
local_58[0xe] = 'e';
|
|
local_58[0xf] = 'l';
|
|
local_58[0x10] = 'i';
|
|
local_58[0x11] = 'r';
|
|
local_58[0x12] = 'i';
|
|
local_58[0x13] = 'u';
|
|
local_58[0x14] = 'm';
|
|
local_58[0x15] = '/';
|
|
memcpy(local_58 + 0x16,(void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) + 4),(size_t)local_60);
|
|
uVar5 = uVar2 + 1;
|
|
pvVar7 = (void *)uVar4;
|
|
if (0xfff < uVar5) {
|
|
pvVar7 = *(void **)(uVar4 + -4);
|
|
uVar5 = uVar2 + 0x24;
|
|
if (0x1f < (uVar4 - GHIDRA_INT(pvVar7)) - 4U) goto LAB_006321d1;
|
|
}
|
|
operator_delete(pvVar7,uVar5);
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) = local_58;
|
|
}
|
|
else {
|
|
local_60 = &sheetPath;
|
|
if (0xf < sheetPath._capacity) {
|
|
local_60 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(sheetPath._buf))) + 0x0)));
|
|
}
|
|
pcVar1 = local_60->_buf + 4;
|
|
if (("/" < pcVar1) || (local_60->_buf + sheetPath._size < "familiar/delirium/")) {
|
|
_Size_00 = GHIDRA_CAST<char *>(0x12);
|
|
}
|
|
else if ("familiar/delirium/" < pcVar1) {
|
|
_Size_00 = local_60[-0x79802]._buf + 8;
|
|
}
|
|
else {
|
|
_Size_00 = GHIDRA_CAST<char *>(0x0);
|
|
}
|
|
_Size = sheetPath._size - 3;
|
|
sheetPath._size = sheetPath._size + 0x12;
|
|
memmove((void *)(GHIDRA_INT(&local_60->_capacity) + 2),pcVar1,_Size);
|
|
pcVar1 = local_60->_buf;
|
|
memcpy(pcVar1 + 4,"familiar/delirium/",(size_t)_Size_00);
|
|
memcpy(_Size_00 + GHIDRA_INT((pcVar1 + 4)),_Size_00 + 0xb6403e,0x12 - GHIDRA_INT(_Size_00));
|
|
}
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&g_manager->_modManager),GHIDRA_CAST<std_string *>(redirectedPath),&sheetPath);
|
|
if (&sheetPath != extraout_EAX) {
|
|
if (0xf < sheetPath._capacity) {
|
|
uVar5 = sheetPath._capacity + 1;
|
|
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)sheetPath._buf)) + 0x0)));
|
|
if (0xfff < uVar5) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) + -4);
|
|
uVar5 = sheetPath._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) - GHIDRA_INT(pvVar7)) - 4U) goto LAB_006321d1;
|
|
}
|
|
operator_delete(pvVar7,uVar5);
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) = *GHIDRA_CAST<uint32_t *>(extraout_EAX->_buf);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((extraout_EAX->_buf + 4));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x8))) = *GHIDRA_CAST<uint32_t *>((extraout_EAX->_buf + 8));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0xc))) = *GHIDRA_CAST<uint32_t *>((extraout_EAX->_buf + 0xc));
|
|
sheetPath._size = extraout_EAX->_size;
|
|
sheetPath._capacity = extraout_EAX->_capacity;
|
|
extraout_EAX->_size = 0;
|
|
extraout_EAX->_capacity = 0xf;
|
|
extraout_EAX->_buf[0] = '\0';
|
|
}
|
|
if (0xf < local_30) {
|
|
uVar5 = local_30 + 1;
|
|
pvVar7 = redirectedPath[0];
|
|
if (0xfff < uVar5) {
|
|
pvVar7 = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4);
|
|
uVar5 = local_30 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006321d1;
|
|
}
|
|
operator_delete(pvVar7,uVar5);
|
|
}
|
|
path = &sheetPath;
|
|
if (0xf < sheetPath._capacity) {
|
|
path = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(sheetPath._buf))) + 0x0)));
|
|
}
|
|
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<uint8_t *>(path));
|
|
local_46 = resolvedPath != GHIDRA_CAST<uint8_t *>(0x0);
|
|
if (resolvedPath != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((resolvedPath + -4));
|
|
qVar3 = *heapCounter;
|
|
*GHIDRA_CAST<uint32_t *>(heapCounter) = GHIDRA_UINT(*heapCounter) - uVar5;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar3) < uVar5));
|
|
free(resolvedPath + -4);
|
|
ehState = ehState & 0xffffff00;
|
|
}
|
|
resolvedPath = local_50;
|
|
unk = 0;
|
|
if (local_46 != 0) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_54))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(local_50),&sheetPath);
|
|
local_45 = '\x01';
|
|
unk = extraout_CL;
|
|
}
|
|
ehState = 0xffffffff;
|
|
if (0xf < sheetPath._capacity) {
|
|
uVar5 = sheetPath._capacity + 1;
|
|
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)sheetPath._buf)) + 0x0)));
|
|
if (0xfff < uVar5) {
|
|
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) + -4);
|
|
uVar5 = sheetPath._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) - GHIDRA_INT(pvVar7)) - 4U) {
|
|
LAB_006321d1:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar7,uVar5);
|
|
unk = extraout_CL_00;
|
|
}
|
|
this = local_64;
|
|
local_50 = resolvedPath + 1;
|
|
} while (local_50 < GHIDRA_CAST<uint8_t *>((local_64->_sprite)._layerCount));
|
|
if (local_45 != '\0') {
|
|
(GHIDRA_CAST<ANM2 *>((&local_64->_sprite)))->ANM2::LoadGraphics(unk);
|
|
}
|
|
}
|
|
uVar5 = Random();
|
|
poofEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar5);
|
|
fVar10 = g_vectorOne.y * 0.5;
|
|
iVar6 = *GHIDRA_CAST<int *>(poofEffect);
|
|
(poofEffect->_sprite)._scale.x = g_vectorOne.x * 0.5;
|
|
(poofEffect->_sprite)._scale.y = fVar10;
|
|
(**(code **)(iVar6 + 0xc))();
|
|
iVar6 = this->_sirenHelper;
|
|
refSlot = &this->_sirenHelper;
|
|
if (iVar6 != oldSirenHelper) {
|
|
if (iVar6 != 0) {
|
|
local_64 = GHIDRA_CAST<Entity_Familiar *>(refSlot);
|
|
msvc::multiset<unsigned_int>::erase(&local_64);
|
|
}
|
|
*refSlot = oldSirenHelper;
|
|
iVar6 = 0;
|
|
if (oldSirenHelper != 0) {
|
|
msvc::multiset<unsigned_int>::insert(refSlot);
|
|
iVar6 = *refSlot;
|
|
}
|
|
}
|
|
this->_sirenOriginalPlayer = local_68;
|
|
if (iVar6 != 0) {
|
|
refSlot = GHIDRA_CAST<uint32_t *>((iVar6 + 0x3c4));
|
|
if (*GHIDRA_CAST<int *>((iVar6 + 0x3c4)) != 0) {
|
|
local_68 = refSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_68);
|
|
}
|
|
*refSlot = this;
|
|
msvc::multiset<unsigned_int>::insert(refSlot);
|
|
}
|
|
this->_isLilDelirium = 1;
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 006322f0
|
|
void Entity_Familiar::init_lil_harbinger_sprite()
|
|
{
|
|
uint8_t *pbVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
uint32_t uVar4;
|
|
uint8_t *pbVar5;
|
|
uint32_t extraout_ECX;
|
|
void *ptr;
|
|
uint32_t extraout_ECX_00;
|
|
char *wantedAnimName;
|
|
uint32_t layerId;
|
|
bool isLess;
|
|
std_string sheetPath;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6ebd;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(&sheetPath) + 0x28U;
|
|
ExceptionList = &local_10;
|
|
uVar3 = this->_subtype;
|
|
if (4 < uVar3) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("[err] Wrong Harbinger subtype %u!\n"));
|
|
uVar3 = this->_subtype;
|
|
}
|
|
uVar3 = -GHIDRA_UINT((uVar3 != 0)) & uVar3;
|
|
uVar4 = 4;
|
|
if (uVar3 < 4) {
|
|
uVar4 = uVar3;
|
|
}
|
|
layerId = 0;
|
|
this->_subtype = uVar4;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
sheetPath._size = 0;
|
|
sheetPath._capacity = 0xf;
|
|
uVar4 = -GHIDRA_UINT((this->_subtype != 0)) & this->_subtype;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) = (void *)0x0;
|
|
uVar3 = 4;
|
|
if (uVar4 < 4) {
|
|
uVar3 = uVar4;
|
|
}
|
|
pbVar1 = (&PTR_s_gfx_familiar_familiar_122_miniwa_00b64890)[uVar3];
|
|
pbVar5 = pbVar1;
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
pbVar5 = pbVar5 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((sheetPath._buf)))->msvc::string::assign(pbVar1,GHIDRA_INT(pbVar5) - GHIDRA_INT((pbVar1 + 1)));
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(layerId,&sheetPath);
|
|
local_8 = 0xffffffff;
|
|
uVar3 = extraout_ECX;
|
|
if (0xf < sheetPath._capacity) {
|
|
uVar3 = sheetPath._capacity + 1;
|
|
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)sheetPath._buf)) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
ptr = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) + -4);
|
|
uVar3 = sheetPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(sheetPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar3);
|
|
uVar3 = extraout_ECX_00;
|
|
}
|
|
layerId = layerId + 1;
|
|
} while (layerId < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)uVar3);
|
|
pbVar1 = (this->_sprite)._animState._animData;
|
|
if (pbVar1 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar5 = pbVar1;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar1 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<uint8_t **>(pbVar1);
|
|
}
|
|
wantedAnimName = "FloatDown";
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
isLess = bVar2 < (uint8_t)*wantedAnimName;
|
|
if (bVar2 != *wantedAnimName) {
|
|
LAB_00632450:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00632455;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar5[1];
|
|
isLess = bVar2 < (uint8_t)wantedAnimName[1];
|
|
if (bVar2 != wantedAnimName[1]) goto LAB_00632450;
|
|
pbVar5 = pbVar5 + 2;
|
|
wantedAnimName = wantedAnimName + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_00632455:
|
|
if ((uVar3 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_00632488;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("FloatDown"),1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_00632488:
|
|
uVar4 = -GHIDRA_UINT((this->_subtype != 0)) & this->_subtype;
|
|
uVar3 = 4;
|
|
if (uVar4 < 4) {
|
|
uVar3 = uVar4;
|
|
}
|
|
this->_collisionDamage = *GHIDRA_CAST<float *>((&DAT_00b64878 + uVar3 * 4));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006324d0
|
|
void Entity_Familiar::render_charge_indicator(Vector *renderPos)
|
|
{
|
|
uint8_t bVar1;
|
|
int rootSpawner;
|
|
int iVar2;
|
|
long double weaponCharge;
|
|
float chargePercent;
|
|
char *anim;
|
|
Vector local_10;
|
|
void *chargeAnimData;
|
|
|
|
if ((g_manager->_optionsConfig)._enableChargeBars == 0) {
|
|
return;
|
|
}
|
|
rootSpawner = this->_variant;
|
|
iVar2 = 0;
|
|
if (rootSpawner == 0x50) {
|
|
if (this->_weapon != GHIDRA_CAST<int *>(0x0)) {
|
|
weaponCharge = (long double)(**(code **)(*GHIDRA_CAST<int *>(this->_weapon) + 0x1c))();
|
|
local_10.x = (float)weaponCharge;
|
|
if (0.0 < local_10.x) {
|
|
chargePercent = local_10.x * 100.0;
|
|
goto LAB_006326d0;
|
|
}
|
|
}
|
|
LAB_0063263a:
|
|
if ((this->_chargeBarSprite)._animState._animData != (void *)0x0) {
|
|
anim = "Disappear";
|
|
LAB_00632650:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_chargeBarSprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim),0);
|
|
goto LAB_00632655;
|
|
}
|
|
}
|
|
else {
|
|
if (((rootSpawner != 0x3d) && (rootSpawner != 0x6c)) && (rootSpawner != 0xe6)) {
|
|
if (rootSpawner == 0x57) {
|
|
if (this->_state == 0) {
|
|
chargePercent = (float)this->_fireCooldown / 90.0;
|
|
goto LAB_006326b8;
|
|
}
|
|
}
|
|
else {
|
|
if (rootSpawner == 0x7d) {
|
|
rootSpawner = this->_fireCooldown;
|
|
if (rootSpawner < 0) {
|
|
chargePercent = 0.0;
|
|
}
|
|
else {
|
|
iVar2 = apply_forgotten_lullaby(this,0x1e);
|
|
chargePercent = (1.0 - (float)rootSpawner / (float)iVar2) * 100.0;
|
|
if (chargePercent <= 0.0) {
|
|
chargePercent = 0.0;
|
|
}
|
|
}
|
|
goto LAB_006326c8;
|
|
}
|
|
if (rootSpawner == 0x3e) {
|
|
chargePercent = (float)this->_fireCooldown / 30.0;
|
|
goto LAB_006326b8;
|
|
}
|
|
}
|
|
goto LAB_0063263a;
|
|
}
|
|
rootSpawner = this->_fireCooldown;
|
|
iVar2 = apply_forgotten_lullaby(this,0x1e);
|
|
local_10.x = 1.0 - (float)(rootSpawner + 1) / (float)iVar2;
|
|
rootSpawner = apply_forgotten_lullaby(this,0x1e);
|
|
if (this->_fireCooldown == rootSpawner) {
|
|
iVar2 = 0;
|
|
goto LAB_0063263a;
|
|
}
|
|
chargePercent = local_10.x;
|
|
LAB_006326b8:
|
|
chargePercent = chargePercent * 100.0;
|
|
if (chargePercent <= 0.0) {
|
|
chargePercent = 0.0;
|
|
}
|
|
LAB_006326c8:
|
|
if (100.0 <= chargePercent) {
|
|
chargePercent = 100.0;
|
|
}
|
|
LAB_006326d0:
|
|
iVar2 = GHIDRA_INT(chargePercent);
|
|
if (iVar2 == 0) goto LAB_0063263a;
|
|
if (iVar2 == 100) {
|
|
chargeAnimData = (this->_chargeBarSprite)._animState._animData;
|
|
if (chargeAnimData != (void *)0x0) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(chargeAnimData) + 0x34)) == '\0') {
|
|
if ((this->_chargeBarSprite)._animState._isPlaying == 0) goto LAB_0063270c;
|
|
goto LAB_00632723;
|
|
}
|
|
goto LAB_00632655;
|
|
}
|
|
LAB_0063270c:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_chargeBarSprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("StartCharged"),0);
|
|
if ((this->_chargeBarSprite)._animState._animData != (void *)0x0) {
|
|
LAB_00632723:
|
|
if ((this->_chargeBarSprite)._animState._isPlaying != 0) goto LAB_00632655;
|
|
}
|
|
anim = "Charged";
|
|
goto LAB_00632650;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_chargeBarSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Charging"),1);
|
|
if (((bVar1 != 0) && ((this->_chargeBarSprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_chargeBarSprite)._animState)))->AnimationState::SetFrameFloat((float)iVar2),
|
|
(this->_chargeBarSprite)._animState._animData != (void *)0x0)) {
|
|
(this->_chargeBarSprite)._animState._isPlaying = 0;
|
|
}
|
|
LAB_00632655:
|
|
if (((this->_chargeBarSprite)._animState._animData != (void *)0x0) &&
|
|
((this->_chargeBarSprite)._animState._isPlaying != 0)) goto LAB_00632689;
|
|
}
|
|
if (iVar2 < 1) {
|
|
return;
|
|
}
|
|
if (g_game->_frameCount - this->_spawnFrame < 7) {
|
|
return;
|
|
}
|
|
LAB_00632689:
|
|
rootSpawner = this->_spawnerEntity;
|
|
if (rootSpawner != 0) {
|
|
for (; *GHIDRA_CAST<int *>((rootSpawner + 0x3c8)) != 0; rootSpawner = *GHIDRA_CAST<int *>((rootSpawner + 0x3c8))) {
|
|
}
|
|
}
|
|
rootSpawner = __RTDynamicCast(rootSpawner,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0);
|
|
if (((rootSpawner == 0) || (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1)))) ||
|
|
(bVar1 = NetplayManager::IsIdxLocalPlayer
|
|
(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),
|
|
*GHIDRA_CAST<uint32_t *>((rootSpawner + 0x1618))), bVar1 != 0)) {
|
|
local_10.x = renderPos->x + 12.0;
|
|
local_10.y = renderPos->y - 35.0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_chargeBarSprite)))->ANM2::Render(&local_10,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00632820
|
|
void Entity_Familiar::ai_lil_monstro()
|
|
{
|
|
code *pcVar1;
|
|
Entity_Player *tear;
|
|
uint64_t qVar2;
|
|
uint8_t bVar3;
|
|
int iVar4;
|
|
uint8_t *curAnimName;
|
|
Entity *spawned;
|
|
Entity_Tear *tear;
|
|
TearParams *pTVar5;
|
|
char *attackAnimName;
|
|
uint8_t *flyAnimName;
|
|
uint64_t *allocCounter;
|
|
uint32_t uVar6;
|
|
bool isLess;
|
|
float dirLength;
|
|
float fVar7;
|
|
float dirX;
|
|
uint32_t uVar8;
|
|
TypeDescriptor *pTVar9;
|
|
TypeDescriptor *pTVar10;
|
|
uint32_t uVar11;
|
|
EntityList_EL nearbyEnemies;
|
|
Entity_Familiar *self;
|
|
Vector local_90;
|
|
Vector local_88;
|
|
float local_80;
|
|
TearParams tearHitParams;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
float local_8;
|
|
uint8_t *animData;
|
|
void *curAnimData;
|
|
uint32_t *targetRef;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00af6f00;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(((&tearHitParams)[1]._tearColor._colorize + 3));
|
|
ExceptionList = &local_10;
|
|
self = this;
|
|
iVar4 = apply_forgotten_lullaby(this,0x1e);
|
|
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(iVar4,0);
|
|
if (bVar3 != 0) {
|
|
local_90.y = 0.0;
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&nearbyEnemies,&this->_pos,150.0,8);
|
|
uVar6 = 0;
|
|
local_8 = 0.0;
|
|
if (nearbyEnemies._size != 0) {
|
|
do {
|
|
spawned = *GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x4))) + uVar6 * 4));
|
|
bVar3 = (GHIDRA_CAST<Entity *>((spawned)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (((bVar3 != 0) && (bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDescendantOf(spawned), bVar3 == 0))
|
|
&& ((spawned->_flags & 0x20000010) == 0)) {
|
|
local_88.y = (spawned->_pos).y;
|
|
local_88.x = (spawned->_pos).x;
|
|
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&this->_pos,&local_88,3,0,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar3 != 0) {
|
|
local_90.y = (float)spawned;
|
|
}
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < GHIDRA_UINT(nearbyEnemies._size));
|
|
if (GHIDRA_CAST<Entity *>(local_90.y) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_88.y = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_90.y) + 0x33c)))->x - (this->_pos).x;
|
|
local_80 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_90.y) + 0x33c)))->y - (this->_pos).y;
|
|
this->_headFrameDelay = 0xc;
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_006329dd:
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Attack"),1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
attackAnimName = "Attack";
|
|
do {
|
|
bVar3 = *curAnimName;
|
|
isLess = bVar3 < (uint8_t)*attackAnimName;
|
|
if (bVar3 != *attackAnimName) {
|
|
LAB_006329c7:
|
|
uVar6 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_006329cc;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimName[1];
|
|
isLess = bVar3 < (uint8_t)attackAnimName[1];
|
|
if (bVar3 != attackAnimName[1]) goto LAB_006329c7;
|
|
curAnimName = curAnimName + 2;
|
|
attackAnimName = attackAnimName + 2;
|
|
} while (bVar3 != 0);
|
|
uVar6 = 0;
|
|
LAB_006329cc:
|
|
if ((uVar6 != 0) ||
|
|
((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_006329dd;
|
|
}
|
|
(this->_sprite)._flipX = local_88.y < 0.0;
|
|
dirLength = sqrtf(local_80 * local_80 + local_88.y * local_88.y);
|
|
fVar7 = local_80;
|
|
dirX = local_88.y;
|
|
if (0.0 < dirLength) {
|
|
fVar7 = local_80 * (1.0 / dirLength);
|
|
dirX = local_88.y * (1.0 / dirLength);
|
|
}
|
|
targetRef = &this->_target;
|
|
(this->_targetPosition).x = dirX * 8.0;
|
|
(this->_targetPosition).y = fVar7 * 8.0;
|
|
if (*targetRef != 0) {
|
|
local_88.y = (float)targetRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_88.y);
|
|
}
|
|
*targetRef = local_90.y;
|
|
msvc::multiset<unsigned_int>::insert(targetRef);
|
|
}
|
|
}
|
|
local_8 = -NAN;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x4))) != 0) {
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x4))) + -4));
|
|
qVar2 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar6;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < uVar6));
|
|
free((void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEnemies)) + 0x4))) + -4));
|
|
}
|
|
local_8 = -NAN;
|
|
}
|
|
}
|
|
if (this->_headFrameDelay < 1) {
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
flyAnimName = s_Fly;
|
|
do {
|
|
bVar3 = *curAnimName;
|
|
isLess = bVar3 < *flyAnimName;
|
|
if (bVar3 != *flyAnimName) {
|
|
LAB_00632b48:
|
|
uVar6 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00632b4d;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimName[1];
|
|
isLess = bVar3 < flyAnimName[1];
|
|
if (bVar3 != flyAnimName[1]) goto LAB_00632b48;
|
|
curAnimName = curAnimName + 2;
|
|
flyAnimName = flyAnimName + 2;
|
|
} while (bVar3 != 0);
|
|
uVar6 = 0;
|
|
LAB_00632b4d:
|
|
if ((uVar6 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_00632b80;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Fly,1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
this->_headFrameDelay = this->_headFrameDelay + -1;
|
|
}
|
|
LAB_00632b80:
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
(bVar3 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("Shoot")),
|
|
bVar3 != 0)) {
|
|
local_90.x = (this->_targetPosition).x;
|
|
iVar4 = this->_target;
|
|
local_90.y = (this->_targetPosition).y;
|
|
if (iVar4 != 0) {
|
|
local_88.y = *GHIDRA_CAST<float *>((iVar4 + 0x33c)) - (this->_pos).x;
|
|
local_80 = *GHIDRA_CAST<float *>((iVar4 + 0x340)) - (this->_pos).y;
|
|
dirLength = sqrtf(local_88.y * local_88.y + local_80 * local_80);
|
|
targetRef = GHIDRA_CAST<uint32_t *>(local_88.y);
|
|
fVar7 = local_80;
|
|
if (0.0 < dirLength) {
|
|
targetRef = GHIDRA_CAST<uint32_t *>((local_88.y * (1.0 / dirLength)));
|
|
fVar7 = local_80 * (1.0 / dirLength);
|
|
}
|
|
local_90.x = (float)targetRef * 10.0;
|
|
local_90.y = fVar7 * 10.0;
|
|
}
|
|
uVar6 = Random();
|
|
uVar11 = 0;
|
|
pTVar10 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor;
|
|
pTVar9 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar8 = 0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,0,&this->_pos,&local_90,GHIDRA_CAST<Entity *>(this),0,uVar6);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast(spawned,uVar8,pTVar9,pTVar10,uVar11));
|
|
tear->_fallingSpeed = 1.2;
|
|
local_88.y = apply_tear_modifiers(this);
|
|
fVar7 = apply_tear_modifiers(this);
|
|
local_80 = fVar7 * 0.2 + 0.7;
|
|
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(tear) + 0x40);
|
|
tear = self->_player;
|
|
uVar6 = Random();
|
|
pTVar5 = Entity_Player::GetTearHitParams
|
|
(tear,&tearHitParams,1,1.0,(uVar6 & 1) * 2 + -1,GHIDRA_CAST<Entity *>(0x0));
|
|
(*pcVar1)(local_88.y * pTVar5->_tearDamage);
|
|
fVar7 = local_80;
|
|
if (local_80 <= 0.01) {
|
|
fVar7 = 0.01;
|
|
}
|
|
tear->_baseScale = fVar7;
|
|
tear->_fScale = fVar7;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
this = self;
|
|
TryFireTear(self,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
}
|
|
curAnimData = (this->_sprite)._animState._animData;
|
|
if ((curAnimData != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(curAnimData) + 0x34)) != '\0')) {
|
|
(this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00632d90
|
|
void Entity_Familiar::ai_variant_111()
|
|
{
|
|
int iVar1;
|
|
Entity_Familiar *pEVar2;
|
|
uint8_t isBreakableRock;
|
|
RoomDescriptor *doorTargetRoom;
|
|
uint32_t rngResult;
|
|
int iVar3;
|
|
Vector *randomPos;
|
|
float *pfVar4;
|
|
int extraout_ECX;
|
|
int extraout_EDX;
|
|
void *freePtr;
|
|
float *pfVar5;
|
|
Game *game;
|
|
float *candidatesEnd;
|
|
uint32_t rngResult;
|
|
float fVar7;
|
|
float fVar8;
|
|
float *local_2c;
|
|
Vector scratchVec;
|
|
Entity_Familiar *local_1c;
|
|
void *local_18;
|
|
float *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
GridEntity *rockGrid;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af5d8d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((((this->_targetPosition).x != g_vectorZero.x) ||
|
|
((this->_targetPosition).y != g_vectorZero.y)) || (1 < this->_state)) goto LAB_00633192;
|
|
candidatesEnd = GHIDRA_CAST<float *>(0x0);
|
|
local_2c = GHIDRA_CAST<float *>(0x0);
|
|
local_8 = 0;
|
|
local_18 = (void *)0x0;
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_INT(g_game->_room) + 0x724));
|
|
game = g_game;
|
|
local_1c = this;
|
|
local_14 = pfVar4;
|
|
do {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pfVar4) + GHIDRA_INT(local_18) * 4));
|
|
if (iVar3 != 0) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0xc)) != 2) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x160)) == 7) {
|
|
LAB_00632e6b:
|
|
doorTargetRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(*GHIDRA_CAST<int *>((iVar3 + 0x394)),-1);
|
|
game = g_game;
|
|
pfVar4 = local_14;
|
|
if (doorTargetRoom->VisitedCount != 0) goto LAB_00632f15;
|
|
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_14) + GHIDRA_INT(local_18) * 4)) + 0x24));
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
scratchVec.x = (float)(iVar3 % iVar1) * 40.0 + 40.0;
|
|
scratchVec.y = (float)(iVar3 / iVar1) * 40.0 + 120.0;
|
|
if (candidatesEnd == GHIDRA_CAST<float *>(0x0)) {
|
|
msvc::vector<Vector>::_Emplace_reallocate(0,&scratchVec);
|
|
game = g_game;
|
|
candidatesEnd = local_2c;
|
|
}
|
|
else {
|
|
*candidatesEnd = scratchVec.x;
|
|
candidatesEnd[1] = scratchVec.y;
|
|
local_2c = candidatesEnd + 2;
|
|
candidatesEnd = local_2c;
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((iVar3 + 0x160)) == 8) goto LAB_00632e6b;
|
|
pfVar4 = local_14;
|
|
}
|
|
}
|
|
LAB_00632f15:
|
|
this = local_1c;
|
|
pfVar5 = GHIDRA_CAST<float *>(0x0);
|
|
fVar7 = 40.0;
|
|
fVar8 = 120.0;
|
|
local_18 = (void *)(GHIDRA_INT(local_18) + 1);
|
|
} while (local_18 < 8);
|
|
local_14 = pfVar5;
|
|
if (((((game->_levelStateFlags & 0x2000U) == 0) &&
|
|
(iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x768)), -1 < iVar3)) &&
|
|
((iVar3 < 0x1c0 &&
|
|
((rockGrid = *GHIDRA_CAST<GridEntity **>((GHIDRA_CAST<char *>(game->_room) + iVar3 * 4 + 0x24)),
|
|
rockGrid != GHIDRA_CAST<GridEntity *>(0x0) &&
|
|
(isBreakableRock = (GHIDRA_CAST<GridEntity *>((rockGrid)))->GridEntity::IsBreakableRock(), isBreakableRock != 0)))))) &&
|
|
(*GHIDRA_CAST<int *>((extraout_ECX + 0xc)) != 2)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
scratchVec.x = (float)(extraout_EDX % iVar3) * fVar7 + fVar7;
|
|
scratchVec.y = (float)(extraout_EDX / iVar3) * fVar7 + fVar8;
|
|
if (candidatesEnd == local_14) {
|
|
msvc::vector<Vector>::_Emplace_reallocate(candidatesEnd,&scratchVec);
|
|
local_14 = GHIDRA_CAST<float *>(0x0);
|
|
game = g_game;
|
|
candidatesEnd = local_2c;
|
|
}
|
|
else {
|
|
*candidatesEnd = scratchVec.x;
|
|
candidatesEnd[1] = scratchVec.y;
|
|
local_2c = candidatesEnd + 2;
|
|
candidatesEnd = local_2c;
|
|
}
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x764));
|
|
if (-1 < iVar3) {
|
|
if (iVar3 < 0x1c0) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + iVar3 * 4 + 0x24));
|
|
if (iVar1 != 0) {
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 4)) != 4) {
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 4)) != 0x16) goto LAB_0063308e;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0xc)) != 2) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
scratchVec.x = (float)(iVar3 % iVar1) * 40.0 + 40.0;
|
|
scratchVec.y = (float)(iVar3 / iVar1) * 40.0 + 120.0;
|
|
this = local_1c;
|
|
if (candidatesEnd == local_14) {
|
|
msvc::vector<Vector>::_Emplace_reallocate(candidatesEnd,&scratchVec);
|
|
local_14 = GHIDRA_CAST<float *>(0x0);
|
|
game = g_game;
|
|
candidatesEnd = local_2c;
|
|
}
|
|
else {
|
|
*candidatesEnd = scratchVec.x;
|
|
candidatesEnd[1] = scratchVec.y;
|
|
candidatesEnd = candidatesEnd + 2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_0063308e:
|
|
manager = g_manager;
|
|
rngResult = GHIDRA_INT(candidatesEnd) >> 3;
|
|
local_18 = (void *)0x0;
|
|
if (rngResult == 0) {
|
|
this->_state = 2;
|
|
randomPos = (GHIDRA_CAST<Room *>((game->_room)))->Room::GetRandomPosition(&scratchVec,0.0);
|
|
(this->_targetPosition).x = randomPos->x;
|
|
(this->_targetPosition).y = randomPos->y;
|
|
}
|
|
else {
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(0x392);
|
|
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);
|
|
rngResult = Random();
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_INT(local_18) + (rngResult % rngResult) * 8));
|
|
(this->_targetPosition).x = *pfVar4;
|
|
(this->_targetPosition).y = pfVar4[1];
|
|
this->_state = GHIDRA_UINT((rngResult == 1));
|
|
}
|
|
this->_fireCooldown = 0x96;
|
|
local_8 = 0xffffffff;
|
|
if (local_18 != (void *)0x0) {
|
|
rngResult = GHIDRA_INT(local_14) - GHIDRA_INT(local_18) & 0xfffffff8;
|
|
freePtr = local_18;
|
|
if (0xfff < rngResult) {
|
|
freePtr = *(void **)(GHIDRA_CAST<char *>(local_18) + -4);
|
|
rngResult = rngResult + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_18) + (-4 - GHIDRA_INT(freePtr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freePtr,rngResult);
|
|
}
|
|
LAB_00633192:
|
|
if (this->_state == 2) {
|
|
local_18 = (void *)(this->_velocity).x;
|
|
fVar7 = (this->_velocity).y;
|
|
local_14 = GHIDRA_CAST<float *>(((this->_targetPosition).x - (this->_pos).x));
|
|
if (1.0 <= (float)local_18 * (float)local_18 + fVar7 * fVar7) {
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(((this->_targetPosition).y - (this->_pos).y));
|
|
rngResult = Random();
|
|
local_18 = (void *)((float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]
|
|
) * 2.3283064e-10 * 0.2 + 0.1);
|
|
scratchVec.y = atan2f((float)local_1c,(float)local_14);
|
|
scratchVec.y = scratchVec.y * 57.295776;
|
|
fVar7 = atan2f((this->_velocity).y,(this->_velocity).x);
|
|
fVar7 = LerpAngleDeg(fVar7 * 57.295776,scratchVec.y,(float)local_18);
|
|
local_18 = (void *)(fVar7 * 0.017453292);
|
|
scratchVec.y = 0.5;
|
|
local_1c = (Entity_Familiar *)
|
|
sqrtf((float)local_1c * (float)local_1c + (float)local_14 * (float)local_14);
|
|
pfVar4 = &scratchVec.y;
|
|
if ((float)local_1c <= 0.5) {
|
|
pfVar4 = GHIDRA_CAST<float *>(&local_1c);
|
|
}
|
|
fVar7 = cos((float)local_18);
|
|
(this->_velocity).x = fVar7 * (float)*pfVar4 + (this->_velocity).x;
|
|
fVar7 = sin((float)local_18);
|
|
(this->_velocity).y = fVar7 * (float)*pfVar4 + (this->_velocity).y;
|
|
}
|
|
else {
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(((this->_targetPosition).y - (this->_pos).y));
|
|
fVar7 = sqrtf((float)local_14 * (float)local_14 + (float)local_1c * (float)local_1c);
|
|
if (fVar7 <= 0.0) {
|
|
pEVar2 = local_1c;
|
|
pfVar4 = local_14;
|
|
}
|
|
else {
|
|
pEVar2 = GHIDRA_CAST<Entity_Familiar *>(((0.5 / fVar7) * (float)local_1c));
|
|
pfVar4 = GHIDRA_CAST<float *>(((float)local_14 * (0.5 / fVar7)));
|
|
}
|
|
(this->_velocity).y = (float)pEVar2 + (this->_velocity).y;
|
|
(this->_velocity).x = (float)local_18 + (float)pfVar4;
|
|
}
|
|
this->_friction = this->_friction * 0.8;
|
|
if ((0 < this->_fireCooldown) &&
|
|
(iVar3 = this->_fireCooldown + -1, this->_fireCooldown = iVar3, iVar3 == 0)) {
|
|
randomPos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetRandomPosition(&scratchVec,0.0);
|
|
(this->_targetPosition).x = randomPos->x;
|
|
(this->_targetPosition).y = randomPos->y;
|
|
rngResult = Random();
|
|
this->_fireCooldown = (rngResult % 3 + 1) * 0x1e;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(((this->_targetPosition).x - (this->_pos).x));
|
|
local_18 = (void *)((this->_targetPosition).y - (this->_pos).y);
|
|
fVar7 = (float)local_18 * (float)local_18 + (float)local_1c * (float)local_1c;
|
|
if ((1.0 < fVar7) && (fVar7 = sqrtf(fVar7), 0.0 < fVar7)) {
|
|
local_18 = (void *)((float)local_18 * (1.0 / fVar7));
|
|
local_1c = GHIDRA_CAST<Entity_Familiar *>(((1.0 / fVar7) * (float)local_1c));
|
|
}
|
|
(this->_velocity).x = (float)local_1c + (this->_velocity).x;
|
|
fVar7 = this->_friction;
|
|
(this->_velocity).y = (float)local_18 + (this->_velocity).y;
|
|
this->_friction = fVar7 * 0.8;
|
|
if ((0 < this->_fireCooldown) &&
|
|
(iVar3 = this->_fireCooldown + -1, this->_fireCooldown = iVar3, iVar3 == 0)) {
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00633500
|
|
void Entity_Familiar::update_angry_fly()
|
|
{
|
|
uint64_t qVar1;
|
|
uint8_t bVar2;
|
|
char cVar3;
|
|
Entity *this_00;
|
|
uint32_t rngResult;
|
|
uint32_t *puVar4;
|
|
int iVar5;
|
|
uint64_t *allocCounter;
|
|
int *targetSlot;
|
|
uint32_t uVar6;
|
|
void *ptr;
|
|
bool isExcluded;
|
|
float fVar7;
|
|
uint8_t entityList [4];
|
|
void *pvStack_30;
|
|
uint32_t *puStack_2c;
|
|
uint32_t *puStack_28;
|
|
int *local_24;
|
|
Entity_Familiar *local_20;
|
|
void *newTarget;
|
|
void *room;
|
|
uint32_t *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
void *candidatesData;
|
|
int entityType;
|
|
Entity_Familiar *otherFly;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6f45;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
this_00 = GHIDRA_CAST<Entity *>(this->_target);
|
|
targetSlot = &this->_target;
|
|
local_24 = targetSlot;
|
|
local_20 = this;
|
|
if (this_00 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
if (this_00 == this->_player) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x1e,this->_index);
|
|
if (bVar2 != 0) goto LAB_0063357f;
|
|
this_00 = GHIDRA_CAST<Entity *>(*targetSlot);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity *>((this_00)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar2 != 0) || (bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0x96,this->_index), bVar2 == 0))
|
|
goto LAB_00633702;
|
|
}
|
|
LAB_0063357f:
|
|
newTarget = this->_player;
|
|
pvStack_30 = (void *)0x0;
|
|
puStack_2c = GHIDRA_CAST<uint32_t *>(0x0);
|
|
puStack_28 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
room = g_game->_room;
|
|
local_8 = 0;
|
|
msvc::vector<unsigned_int>::_Reallocate(0x20);
|
|
uVar6 = 0;
|
|
puVar4 = puStack_2c;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1264)) != 0) {
|
|
do {
|
|
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar6 * 4));
|
|
local_14 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar6 * 4));
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (*GHIDRA_CAST<int *>((iVar5 + 0x28)) != 1)) {
|
|
entityType = *GHIDRA_CAST<int *>((iVar5 + 0x28));
|
|
if ((entityType - 10U < 0x3de) &&
|
|
(((entityType != 0x21 && (entityType != 0x11)) && (entityType != 0x124)))) {
|
|
if (entityType == 0x375) {
|
|
isExcluded = *GHIDRA_CAST<int *>((iVar5 + 0x2c)) == 10;
|
|
}
|
|
else {
|
|
if ((entityType == 0x3c0) || (entityType == 0x3c5)) goto LAB_00633662;
|
|
isExcluded = entityType == 0xf5;
|
|
}
|
|
if (!isExcluded) goto LAB_0063363b;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0063363b:
|
|
if (*GHIDRA_CAST<char *>((iVar5 + 0x173)) == '\0') {
|
|
if (puVar4 == puStack_28) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(puVar4,local_14);
|
|
puVar4 = puStack_2c;
|
|
}
|
|
else {
|
|
*puVar4 = *local_14;
|
|
puStack_2c = puVar4 + 1;
|
|
puVar4 = puStack_2c;
|
|
}
|
|
}
|
|
}
|
|
LAB_00633662:
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(room) + 0x1264)));
|
|
}
|
|
candidatesData = pvStack_30;
|
|
uVar6 = GHIDRA_INT(puVar4) - GHIDRA_INT(pvStack_30) >> 2;
|
|
if (uVar6 != 0) {
|
|
rngResult = Random();
|
|
newTarget = *(void **)(GHIDRA_CAST<char *>(candidatesData) + (rngResult % uVar6) * 4);
|
|
}
|
|
targetSlot = local_24;
|
|
if (*local_24 != 0) {
|
|
msvc::multiset<unsigned_int>::erase(&local_24);
|
|
}
|
|
*targetSlot = GHIDRA_INT(newTarget);
|
|
if (newTarget != (void *)0x0) {
|
|
msvc::multiset<unsigned_int>::insert(targetSlot);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (candidatesData != (void *)0x0) {
|
|
uVar6 = (GHIDRA_INT(puStack_28) - GHIDRA_INT(candidatesData) >> 2) * 4;
|
|
ptr = candidatesData;
|
|
if (0xfff < uVar6) {
|
|
ptr = *(void **)(GHIDRA_CAST<char *>(candidatesData) + -4);
|
|
uVar6 = uVar6 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(candidatesData) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar6);
|
|
}
|
|
this = local_20;
|
|
LAB_00633702:
|
|
if (*targetSlot == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("[err] Angry Fly - Got a null target!\n"));
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(entityList),this->_type,
|
|
this->_variant,-1,1,0);
|
|
local_8 = 1;
|
|
puVar4 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_14 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
iVar5 = 1;
|
|
if (puStack_28 != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
do {
|
|
otherFly = *GHIDRA_CAST<Entity_Familiar **>((GHIDRA_CAST<char *>(pvStack_30) + GHIDRA_INT(puVar4) * 4));
|
|
if (otherFly == this) {
|
|
local_14 = puVar4;
|
|
}
|
|
else if (otherFly->_target == *targetSlot) {
|
|
iVar5 = iVar5 + 1;
|
|
}
|
|
puVar4 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(puVar4) + 1));
|
|
} while (puVar4 < puStack_28);
|
|
}
|
|
fVar7 = ((float)GHIDRA_INT(local_14) * 360.0) / (float)iVar5;
|
|
if (360.0 < ABS(fVar7)) {
|
|
fVar7 = fmodf(fVar7,360.0);
|
|
}
|
|
if (fVar7 <= 180.0) {
|
|
if (fVar7 < -180.0) {
|
|
fVar7 = fVar7 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar7 = fVar7 - 360.0;
|
|
}
|
|
local_20 = GHIDRA_CAST<Entity_Familiar *>(0x42820000);
|
|
local_14 = GHIDRA_CAST<uint32_t *>(fVar7);
|
|
cVar3 = (**(code **)(*GHIDRA_CAST<int *>(*targetSlot) + 0x4c))();
|
|
if ((cVar3 != '\0') && (iVar5 = g_game->_frameCount % 0x96, iVar5 < 0x1e)) {
|
|
fVar7 = ABS((float)iVar5 / 30.0 - 0.5);
|
|
local_20 = GHIDRA_CAST<Entity_Familiar *>(((fVar7 + fVar7) * 65.0));
|
|
}
|
|
iVar5 = *targetSlot;
|
|
local_24 = GHIDRA_CAST<int *>((((float)g_game->_frameCount * 3.6 + (float)local_14) * 0.017453292));
|
|
local_14 = GHIDRA_CAST<uint32_t *>(sin((float)local_24));
|
|
fVar7 = cos((float)local_24);
|
|
local_14 = (uint32_t *)
|
|
((((float)local_14 * (float)local_20 + *GHIDRA_CAST<float *>((iVar5 + 0x340))) - (this->_pos).y) *
|
|
0.22);
|
|
local_24 = GHIDRA_CAST<int *>((((fVar7 * (float)local_20 + *GHIDRA_CAST<float *>((iVar5 + 0x33c))) - (this->_pos).x) * 0.22
|
|
));
|
|
(this->_velocity).y = (float)local_14;
|
|
(this->_velocity).x = (float)local_24;
|
|
fVar7 = (float)local_14 * (float)local_14 + (float)local_24 * (float)local_24;
|
|
if ((100.0 < fVar7) && (fVar7 = sqrtf(fVar7), 0.0 < fVar7)) {
|
|
(this->_velocity).x = (float)local_24 * (10.0 / fVar7);
|
|
(this->_velocity).y = (float)local_14 * (10.0 / fVar7);
|
|
}
|
|
if (entityList[0] == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (pvStack_30 != (void *)0x0) {
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvStack_30) + -4));
|
|
qVar1 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar6;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar6));
|
|
free(GHIDRA_CAST<uint32_t *>((GHIDRA_INT(pvStack_30) + -4)));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00634000
|
|
uint8_t Entity_Familiar::TryFireTear(Entity_Tear *tear)
|
|
{
|
|
BitSet128 flags;
|
|
int lullabyMultiplier;
|
|
int iVar1;
|
|
bool bVar2;
|
|
bool bVar3;
|
|
float fVar4;
|
|
bool isFiring;
|
|
float tearHeight;
|
|
float fallingSpeed;
|
|
float tearRange;
|
|
BitSet128 tearFlags;
|
|
ColorMod tearColor;
|
|
Game *game;
|
|
Entity_Player *player;
|
|
|
|
player = this->_player;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2ef8)))) != 0x7f)) {
|
|
iVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x7f);
|
|
bVar3 = false;
|
|
bVar2 = iVar1 == 0;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2ef0))) != '\0') {
|
|
isFiring = true;
|
|
goto LAB_00634064;
|
|
}
|
|
lullabyMultiplier = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x7f);
|
|
bVar3 = SBORROW4(lullabyMultiplier,1);
|
|
iVar1 = lullabyMultiplier + -1;
|
|
bVar2 = lullabyMultiplier == 1;
|
|
}
|
|
bVar3 = bVar3 == iVar1 < 0;
|
|
isFiring = !bVar2 && bVar3;
|
|
if (bVar2 || !bVar3) {
|
|
return isFiring;
|
|
}
|
|
LAB_00634064:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = (uint32_t)(tear->_tearFlags)._l;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = (uint32_t)(tear->_tearFlags)._h;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4));
|
|
tearColor._offset[2] = (tear->_sprite)._color._offset[2];
|
|
tearColor._tint[0] = (tear->_sprite)._color._tint[0];
|
|
tearColor._tint[1] = (tear->_sprite)._color._tint[1];
|
|
tearColor._tint[2] = (tear->_sprite)._color._tint[2];
|
|
tearColor._tint[3] = (tear->_sprite)._color._tint[3];
|
|
tearColor._colorize[0] = (tear->_sprite)._color._colorize[0];
|
|
tearColor._colorize[1] = (tear->_sprite)._color._colorize[1];
|
|
tearColor._colorize[2] = (tear->_sprite)._color._colorize[2];
|
|
tearColor._colorize[3] = (tear->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(tearColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((tear->_sprite)._color._offset);
|
|
tearHeight = tear->_height;
|
|
fallingSpeed = tear->_fallingSpeed;
|
|
tearRange = tear->_tearRange;
|
|
apply_baby_bender_tear_params(this,&tearFlags,&tearColor,&tearHeight,&fallingSpeed,&tearRange,0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = (uint32_t)tearFlags._l;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = (uint32_t)tearFlags._h;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)));
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
|
tear->SetColor(&tearColor,0xffffffff,0xff,0,1);
|
|
tear->_height = tearHeight;
|
|
fVar4 = (GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::get_height_offset_y(tearHeight);
|
|
game = g_game;
|
|
(tear->_posOffset).y = fVar4;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) && ((tear->_posOffset).y = -18.0, -5.1 < tearHeight))
|
|
{
|
|
tear->_height = -5.1;
|
|
}
|
|
tear->_fallingSpeed = fallingSpeed;
|
|
tear->_tearRange = tearRange;
|
|
return isFiring;
|
|
}
|
|
|
|
// 006341a0
|
|
uint8_t Entity_Familiar::apply_baby_bender(Entity_Tear *tear)
|
|
{
|
|
uint8_t isHasBabyBender;
|
|
BitSet128 tearFlags;
|
|
uint8_t unusedHeight [4];
|
|
uint8_t unusedFallingSpeed [4];
|
|
uint8_t unusedRange [4];
|
|
ColorMod tearColor;
|
|
int tearVtable;
|
|
|
|
isHasBabyBender = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(0x7f,0);
|
|
if (isHasBabyBender != 0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = (uint32_t)(tear->_tearFlags)._l;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = (uint32_t)(tear->_tearFlags)._h;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4));
|
|
tearColor._offset[2] = (tear->_sprite)._color._offset[2];
|
|
tearColor._tint[0] = (tear->_sprite)._color._tint[0];
|
|
tearColor._tint[1] = (tear->_sprite)._color._tint[1];
|
|
tearColor._tint[2] = (tear->_sprite)._color._tint[2];
|
|
tearColor._tint[3] = (tear->_sprite)._color._tint[3];
|
|
tearColor._colorize[0] = (tear->_sprite)._color._colorize[0];
|
|
tearColor._colorize[1] = (tear->_sprite)._color._colorize[1];
|
|
tearColor._colorize[2] = (tear->_sprite)._color._colorize[2];
|
|
tearColor._colorize[3] = (tear->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(tearColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((tear->_sprite)._color._offset);
|
|
apply_baby_bender_tear_params
|
|
(this,&tearFlags,&tearColor,unusedHeight,unusedFallingSpeed,unusedRange,1);
|
|
tearVtable = *GHIDRA_CAST<int *>(tear);
|
|
*GHIDRA_CAST<uint32_t *>(&(tear->_tearFlags)._l) = (uint32_t)tearFlags._l;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint32_t *>(&(tear->_tearFlags)._h) = (uint32_t)tearFlags._h;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)));
|
|
(**(code **)(tearVtable + 0x3c))(&tearColor,0xffffffff,0xff,0,1);
|
|
}
|
|
return isHasBabyBender;
|
|
}
|
|
|
|
// 00634260
|
|
Vector * Entity_Familiar::UpdateFollowPosition(Vector *outOffset)
|
|
{
|
|
float fVar1;
|
|
void *pvVar2;
|
|
uint64_t qVar3;
|
|
char cVar4;
|
|
uint32_t uVar5;
|
|
uint32_t *puVar6;
|
|
int iVar7;
|
|
Entity_Familiar *otherFamiliar;
|
|
uint64_t *allocCounter;
|
|
uint32_t listIndex;
|
|
float fVar8;
|
|
uint8_t *sideSign;
|
|
float fVar9;
|
|
uint32_t *puVar10;
|
|
float fVar11;
|
|
EntityList_EL familiars;
|
|
int priority [2];
|
|
uint32_t *prioritySetHead;
|
|
int prioritySetSize;
|
|
uint32_t *local_28;
|
|
float local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
int local_14;
|
|
uint8_t formationMode;
|
|
int listEntity;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((priority + 0xd));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af6f85;
|
|
local_1c = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_UINT((priority + 10));
|
|
ExceptionList = &local_1c;
|
|
cVar4 = FUN_00634920(uVar5);
|
|
if (cVar4 == '\0') {
|
|
pvVar2 = this->_player;
|
|
if (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 0x1ef0)) != GHIDRA_UINT(this->_formationMode)) {
|
|
(this->_formationTargetOffset).x = g_vectorZero.x;
|
|
(this->_formationTargetOffset).y = g_vectorZero.y;
|
|
}
|
|
if (((this->_formationTargetOffset).x == g_vectorZero.x) &&
|
|
((this->_formationTargetOffset).y == g_vectorZero.y)) {
|
|
this->_formationMode = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar2) + 0x1ef0));
|
|
prioritySetHead = GHIDRA_CAST<uint32_t *>(0x0);
|
|
prioritySetSize = 0;
|
|
puVar6 = operator_new(0x18);
|
|
*puVar6 = puVar6;
|
|
puVar6[1] = puVar6;
|
|
puVar6[2] = puVar6;
|
|
*GHIDRA_CAST<uint16_t *>((puVar6 + 3)) = 0x101;
|
|
local_14 = 0;
|
|
local_24 = 0.0;
|
|
prioritySetHead = puVar6;
|
|
if (this->_formationMode != 0) {
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,-1,-1,0,0)
|
|
;
|
|
listIndex = 0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
if (familiars._size != 0) {
|
|
iVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4)));
|
|
do {
|
|
listEntity = *GHIDRA_CAST<int *>((iVar7 + listIndex * 4));
|
|
if ((*GHIDRA_CAST<char *>((listEntity + 0x173)) == '\0') && (*GHIDRA_CAST<char *>((listEntity + 0x172)) != '\0'))
|
|
{
|
|
cVar4 = FUN_00634920(uVar5);
|
|
if ((cVar4 == '\0') && (otherFamiliar->_player == this->_player)) {
|
|
priority[0] = GetFollowerPriority(otherFamiliar);
|
|
FUN_00652690(&local_28,priority);
|
|
}
|
|
iVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4)));
|
|
}
|
|
listIndex = listIndex + 1;
|
|
} while (listIndex < GHIDRA_UINT(familiars._size));
|
|
}
|
|
puVar6 = prioritySetHead;
|
|
local_28 = GHIDRA_CAST<uint32_t *>(*prioritySetHead);
|
|
while ((local_28 != puVar6 && (GHIDRA_CAST<Entity_Familiar *>(local_28[5]) != this))) {
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_28);
|
|
local_24 = (float)(GHIDRA_INT(local_24) + 1);
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) != 0) {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + -4));
|
|
qVar3 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar5;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar3) < uVar5));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + -4)));
|
|
puVar6 = prioritySetHead;
|
|
}
|
|
}
|
|
}
|
|
formationMode = this->_formationMode;
|
|
if (formationMode == 1) {
|
|
if ((GHIDRA_UINT(local_24) & 1) == 0) {
|
|
sideSign = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
}
|
|
else {
|
|
sideSign = &DAT_bf800000;
|
|
}
|
|
(this->_formationTargetOffset).y = 0.0;
|
|
(this->_formationTargetOffset).x = (float)(GHIDRA_INT(local_24) / 2 + 1) * 32.0 * (float)sideSign;
|
|
}
|
|
else if (formationMode == 2) {
|
|
(this->_formationTargetOffset).x = 0.0;
|
|
(this->_formationTargetOffset).y = (float)&DAT_42000000;
|
|
fVar8 = local_24;
|
|
if (prioritySetSize != 2) {
|
|
fVar8 = (float)(GHIDRA_INT(local_24) - 1);
|
|
}
|
|
if (-1 < GHIDRA_INT(fVar8)) {
|
|
if ((GHIDRA_UINT(fVar8) & 1) == 0) {
|
|
sideSign = &DAT_bf800000;
|
|
}
|
|
else {
|
|
sideSign = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
}
|
|
fVar8 = (float)(GHIDRA_INT(fVar8) / 2 + 1) * 24.0 * (float)sideSign + 0.0;
|
|
(this->_formationTargetOffset).x = fVar8;
|
|
(this->_formationTargetOffset).y = (this->_formationTargetOffset).y - ABS(fVar8);
|
|
}
|
|
}
|
|
else if (formationMode == 3) {
|
|
local_28 = (uint32_t *)
|
|
((360.0 / (float)((double)prioritySetSize +
|
|
__uint_to_double_fixup[-(prioritySetSize >> 0x1f)])) *
|
|
(float)GHIDRA_INT(local_24) * 0.017453292);
|
|
local_24 = cos((float)local_28);
|
|
fVar8 = sin((float)local_28);
|
|
(this->_formationTargetOffset).x = local_24 * 0.0 - fVar8 * 54.0;
|
|
(this->_formationTargetOffset).y = fVar8 * 0.0 + local_24 * 54.0;
|
|
}
|
|
else {
|
|
fVar11 = (this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
fVar8 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_formationTargetOffset).x = fVar11;
|
|
(this->_formationTargetOffset).y = fVar8;
|
|
(this->_formationOffset).x = fVar11;
|
|
(this->_formationOffset).y = fVar8;
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&prioritySetHead,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&prioritySetHead,
|
|
(_Tree_node<unsigned_int,void*> *)puVar6[1]);
|
|
operator_delete(prioritySetHead,0x18);
|
|
}
|
|
fVar8 = (this->_formationOffset).x;
|
|
fVar11 = (this->_formationTargetOffset).x;
|
|
if ((fVar8 != fVar11) || ((this->_formationOffset).y != (this->_formationTargetOffset).y)) {
|
|
fVar9 = (this->_formationOffset).y;
|
|
fVar1 = (this->_formationTargetOffset).y;
|
|
(this->_formationOffset).x = (fVar11 - fVar8) * 0.1 + fVar8;
|
|
(this->_formationOffset).y = (fVar1 - fVar9) * 0.1 + fVar9;
|
|
}
|
|
fVar9 = 0.0;
|
|
local_24 = 0.0;
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x1630));
|
|
fVar11 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x1634));
|
|
if (this->_formationMode != 0) {
|
|
if (0.1 < fVar8 * fVar8 + fVar11 * fVar11) {
|
|
fVar8 = atan2f(fVar11,fVar8);
|
|
fVar9 = fVar8 * 57.295776 - 90.0;
|
|
}
|
|
local_24 = fVar9;
|
|
}
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(this->_formationAngle);
|
|
puVar10 = puVar6;
|
|
if ((float)puVar6 < 0.0) {
|
|
puVar10 = GHIDRA_CAST<uint32_t *>((GHIDRA_UINT(puVar6) ^ 0x80000000));
|
|
}
|
|
if (360.0 < (float)puVar10) {
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(fmodf((float)puVar6,360.0));
|
|
}
|
|
if ((float)puVar6 <= 180.0) {
|
|
if ((float)puVar6 < -180.0) {
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(((float)puVar6 + 360.0));
|
|
}
|
|
}
|
|
else {
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(((float)puVar6 - 360.0));
|
|
}
|
|
fVar8 = local_24;
|
|
if (local_24 < 0.0) {
|
|
fVar8 = -local_24;
|
|
}
|
|
fVar11 = local_24;
|
|
local_28 = puVar6;
|
|
if (360.0 < fVar8) {
|
|
fVar11 = fmodf(local_24,360.0);
|
|
}
|
|
if (fVar11 <= 180.0) {
|
|
if (fVar11 < -180.0) {
|
|
fVar11 = fVar11 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar11 = fVar11 - 360.0;
|
|
}
|
|
fVar8 = fVar11 - (float)local_28;
|
|
if (fVar8 < 0.0) {
|
|
fVar8 = -fVar8;
|
|
}
|
|
puVar6 = local_28;
|
|
if (180.0 < fVar8) {
|
|
if (fVar11 <= (float)local_28) {
|
|
fVar11 = fVar11 + 360.0;
|
|
}
|
|
else {
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(((float)local_28 + 360.0));
|
|
}
|
|
}
|
|
fVar11 = (fVar11 - (float)puVar6) * 0.1 + (float)puVar6;
|
|
fVar8 = fVar11;
|
|
if (fVar11 < 0.0) {
|
|
fVar8 = -fVar11;
|
|
}
|
|
if (360.0 < fVar8) {
|
|
fVar11 = fmodf(fVar11,360.0);
|
|
}
|
|
if (fVar11 <= 180.0) {
|
|
if (fVar11 < -180.0) {
|
|
fVar11 = fVar11 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar11 = fVar11 - 360.0;
|
|
}
|
|
this->_formationAngle = fVar11;
|
|
local_24 = fVar11 * 0.017453292;
|
|
local_28 = GHIDRA_CAST<uint32_t *>(cos(local_24));
|
|
fVar9 = sin(local_24);
|
|
fVar8 = (this->_formationOffset).x;
|
|
fVar11 = (this->_formationOffset).y;
|
|
outOffset->x = (float)local_28 * fVar8 - fVar9 * fVar11;
|
|
outOffset->y = (float)local_28 * fVar11 + fVar9 * fVar8;
|
|
}
|
|
else {
|
|
outOffset->x = g_vectorZero.x;
|
|
outOffset->y = g_vectorZero.y;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return outOffset;
|
|
}
|
|
|
|
// 006348d0
|
|
void Entity_Familiar::reset_follow_target()
|
|
{
|
|
(this->_formationTargetOffset).x = g_vectorZero.x;
|
|
(this->_formationTargetOffset).y = g_vectorZero.y;
|
|
(this->_formationOffset).x = (this->_formationTargetOffset).x;
|
|
(this->_formationOffset).y = (this->_formationTargetOffset).y;
|
|
this->_formationAngle = 0.0;
|
|
this->_formationMode = 0xff;
|
|
return;
|
|
}
|
|
|
|
// 00634a40
|
|
void Entity_Familiar::ResolveOrbitConflict()
|
|
{
|
|
char cVar1;
|
|
uint32_t uVar2;
|
|
int extraout_ECX;
|
|
uint32_t familiarIndex;
|
|
uint32_t extraout_EDX;
|
|
uint8_t familiars [12];
|
|
uint32_t uStack_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af3860;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((familiars + 0x1c));
|
|
ExceptionList = &local_10;
|
|
if (this->_formationMode != 0) {
|
|
cVar1 = FUN_00634920(uVar2);
|
|
if (cVar1 == '\0') {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(familiars),3,-1,-1,0,0)
|
|
;
|
|
familiarIndex = 0;
|
|
if (uStack_14 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<Entity_Familiar **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + familiarIndex * 4)) != this) {
|
|
cVar1 = FUN_00634920(uVar2);
|
|
familiarIndex = extraout_EDX;
|
|
if ((cVar1 == '\0') && (*(void **)(extraout_ECX + 0x410) == this->_player)) {
|
|
*GHIDRA_CAST<uint8_t *>((extraout_ECX + 0xda4)) = 0xff;
|
|
}
|
|
}
|
|
familiarIndex = familiarIndex + 1;
|
|
} while (familiarIndex < uStack_14);
|
|
}
|
|
if (familiars[0] == '\0') {
|
|
local_8 = 0;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)familiars)) + 0x4))),0);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00634b10
|
|
void Entity_Familiar::ai_lil_spewer()
|
|
{
|
|
code *pcVar1;
|
|
BitSet128 flags;
|
|
uint8_t bVar2;
|
|
int iVar3;
|
|
Entity *spawned;
|
|
Entity_Tear *tear;
|
|
uint8_t rngShift2;
|
|
uint8_t rngShift3;
|
|
void *pvVar4;
|
|
void *extraout_ECX;
|
|
uint32_t babyIdx;
|
|
uint32_t uVar5;
|
|
uint32_t uVar6;
|
|
float fVar7;
|
|
uint32_t *puVar8;
|
|
float fVar9;
|
|
uint32_t uVar10;
|
|
TypeDescriptor *pTVar11;
|
|
TypeDescriptor *pTVar12;
|
|
uint32_t uVar13;
|
|
BitSet128 tearFlagsLo;
|
|
float tearModifier;
|
|
float baseDamage;
|
|
float baseFallingSpeed;
|
|
Vector fireDir;
|
|
Vector local_68;
|
|
uint32_t *local_60;
|
|
Vector local_5c;
|
|
RNG rng;
|
|
std_string *local_44;
|
|
uint32_t local_40;
|
|
std_vector *local_3c;
|
|
uint8_t isAimingAtMarked;
|
|
float tearColor;
|
|
float local_30;
|
|
float local_2c;
|
|
uint32_t local_28;
|
|
uint32_t local_24;
|
|
uint32_t uStack_20;
|
|
uint32_t uStack_1c;
|
|
uint32_t uStack_18;
|
|
uint32_t local_14;
|
|
uint32_t local_10;
|
|
uint32_t local_c;
|
|
uint32_t local_8;
|
|
void *babiesBegin;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
if (this->_subtype == 0) {
|
|
uVar6 = this->_initSeed ^ g_game->_dungeonPlacementSeed;
|
|
local_3c = &(g_manager->_entityConfig)._babies;
|
|
rng._shift1 = 1;
|
|
rng._shift2 = 0x15;
|
|
local_44 = GHIDRA_CAST<std_string *>(&DAT_00000014);
|
|
local_40 = 0;
|
|
do {
|
|
uVar5 = (GHIDRA_INT((g_manager->_entityConfig)._babies._end) - GHIDRA_INT(local_3c->_begin)) / 0x38;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> 1 ^ uVar6;
|
|
uVar6 = uVar6 << 0x15 ^ uVar6;
|
|
uVar6 = uVar6 >> 0x14 ^ uVar6;
|
|
babyIdx = 0;
|
|
if (uVar5 != 0) {
|
|
babyIdx = uVar6 % uVar5;
|
|
}
|
|
babiesBegin = local_3c->_begin;
|
|
local_5c.y = (float)(GHIDRA_INT(babiesBegin) + babyIdx * 0x38);
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_5c.y) + 0x34));
|
|
pvVar4 = (void *)local_5c.y;
|
|
if ((GHIDRA_INT(uVar5) < 0) ||
|
|
((uVar5 < 0x282 &&
|
|
(((uVar5 == 0 || ((g_manager->_persistentGameData)._achievements[uVar5] != 0)) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0))))))))))
|
|
goto LAB_00634ca6;
|
|
local_40 = local_40 + 1;
|
|
} while (local_40 < 10);
|
|
local_40 = (GHIDRA_INT((g_manager->_entityConfig)._babies._end) - GHIDRA_INT(babiesBegin)) / 0x38 - 0x47;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> 1 ^ uVar6;
|
|
uVar6 = uVar6 << 0x15 ^ uVar6;
|
|
uVar5 = 0;
|
|
if (local_40 != 0) {
|
|
uVar5 = (uVar6 >> 0x14 ^ uVar6) % local_40;
|
|
}
|
|
pvVar4 = (void *)(GHIDRA_INT(babiesBegin) + (uVar5 + 0x47) * 0x38);
|
|
LAB_00634ca6:
|
|
uVar6 = 0;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
local_44 = GHIDRA_CAST<std_string *>((GHIDRA_INT(pvVar4) + 0x1c));
|
|
do {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar6,local_44);
|
|
uVar6 = uVar6 + 1;
|
|
pvVar4 = extraout_ECX;
|
|
} while (uVar6 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)pvVar4);
|
|
this->_subtype = 1;
|
|
}
|
|
rng._seed = this->_initSeed ^ g_game->_dungeonPlacementSeed;
|
|
rng._shift1 = 1;
|
|
rng._shift2 = 0x1b;
|
|
rng._shift3 = 0x1b;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x173)) != '\0') {
|
|
return;
|
|
}
|
|
iVar3 = this->_fireCooldown;
|
|
if (0 < iVar3) {
|
|
iVar3 = iVar3 + -1;
|
|
this->_fireCooldown = iVar3;
|
|
}
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x162c));
|
|
local_40 = uVar6;
|
|
if (uVar6 == 0xffffffff) {
|
|
if ((((-1 < this->_headFrameDelay) &&
|
|
(iVar3 = this->_headFrameDelay + -1, this->_headFrameDelay = iVar3, iVar3 < 0)) &&
|
|
(bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1cddc,1), bVar2 != 0)) &&
|
|
(((this->_sprite)._animState._animData != (void *)0x0 &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0),
|
|
(this->_sprite)._animState._animData != (void *)0x0)))) {
|
|
(this->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar3 < 1) {
|
|
fVar7 = apply_tear_modifiers(this);
|
|
local_44 = GHIDRA_CAST<std_string *>(0x0);
|
|
local_60 = GHIDRA_CAST<uint32_t *>(((fVar7 * 0.25 + 0.75) * 0.8));
|
|
tearFlagsLo._l = 0;
|
|
tearFlagsLo._h = 0;
|
|
familiar_wisp_pick_tear_color(&rng,GHIDRA_CAST<int *>(&local_44),&tearFlagsLo);
|
|
tearModifier = apply_tear_modifiers(this);
|
|
if (rng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
bVar2 = (uint8_t)rng._shift1;
|
|
uVar5 = GHIDRA_UINT(rng._seed) >> (bVar2 & 0x1f) ^ rng._seed;
|
|
rngShift2 = (uint8_t)rng._shift2;
|
|
uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5;
|
|
rngShift3 = (uint8_t)rng._shift3;
|
|
uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5;
|
|
baseDamage = (float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283062e-10 * 4.0 + 2.0;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5;
|
|
baseFallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283062e-10 * 0.4 - 0.2;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5;
|
|
local_3c = (std_vector *)
|
|
((float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283062e-10);
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> (rngShift3 & 0x1f) ^ uVar5;
|
|
local_5c.y = (float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> (bVar2 & 0x1f) ^ uVar5;
|
|
local_14 = 0;
|
|
local_10 = 0;
|
|
uVar5 = uVar5 << (rngShift2 & 0x1f) ^ uVar5;
|
|
local_c = 0;
|
|
local_68.y = (float)(uVar5 >> (rngShift3 & 0x1f) ^ uVar5);
|
|
local_28 = 0x3f800000;
|
|
local_24 = 0;
|
|
uStack_20 = 0;
|
|
uStack_1c = 0;
|
|
uStack_18 = 0;
|
|
tearColor = (float)((double)GHIDRA_INT(local_68.y) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_68.y) >> 0x1f)]) * 2.3283062e-10;
|
|
local_30 = local_5c.y;
|
|
local_2c = (float)local_3c;
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&fireDir,uVar6);
|
|
isAimingAtMarked = TryAimAtMarkedTarget(this,&fireDir,GHIDRA_CAST<int *>(&local_40),GHIDRA_CAST<Vector *>(0x0));
|
|
local_5c.y = fireDir.x * 10.0;
|
|
local_3c = GHIDRA_CAST<std_vector *>((fireDir.y * 10.0));
|
|
if (local_68.y == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = GHIDRA_UINT(local_68.y) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_68.y);
|
|
uVar6 = uVar6 << (rngShift2 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar6;
|
|
local_68.y = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283062e-10 * 0.6 + 0.7;
|
|
local_68.x = local_5c.y * local_68.y;
|
|
local_68.y = (float)local_3c * local_68.y;
|
|
if (isAimingAtMarked == 0) {
|
|
fVar7 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x360)) * 0.6;
|
|
fVar9 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x364)) * 0.6;
|
|
local_68.x = fVar7 + fVar7 + local_68.x;
|
|
local_68.y = fVar9 + fVar9 + local_68.y;
|
|
}
|
|
uVar5 = Random();
|
|
uVar13 = 0;
|
|
pTVar12 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor;
|
|
local_5c.x = fireDir.x * 10.0 + (this->_pos).x;
|
|
pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar10 = 0;
|
|
local_5c.y = fireDir.y * 10.0 + (this->_pos).y;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,GHIDRA_UINT(local_44),&local_5c,&local_68,GHIDRA_CAST<Entity *>(this),0,uVar5);
|
|
tear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast(spawned,uVar10,pTVar11,pTVar12,uVar13));
|
|
uVar5 = Random();
|
|
tear->_fallingAccel = 0.0;
|
|
tear->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + baseFallingSpeed;
|
|
tear->SetCollisionDamage(baseDamage * tearModifier);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = (uint32_t)tearFlagsLo._h;
|
|
flags._l = tearFlagsLo._l;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlagsLo._h)) + 0x4)));
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
|
puVar8 = local_60;
|
|
if ((float)local_60 <= 0.01) {
|
|
puVar8 = GHIDRA_CAST<uint32_t *>(0x3c23d70a);
|
|
}
|
|
tear->_baseScale = (float)puVar8;
|
|
tear->_fScale = (float)puVar8;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
if (tear->_parent != 0) {
|
|
local_60 = &tear->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&local_60);
|
|
}
|
|
tear->_parent = this;
|
|
msvc::multiset<unsigned_int>::insert(&tear->_parent);
|
|
tear->SetColor(&tearColor,0xffffffff,0xff,0,1);
|
|
uVar5 = Random();
|
|
tear->_tearIdx = uVar5 & 1;
|
|
TryFireTear(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)rng._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar6;
|
|
iVar3 = apply_forgotten_lullaby(this,(uVar6 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar6) % 0xc + 10)
|
|
;
|
|
this->_fireCooldown = iVar3;
|
|
this->_headFrameDelay = 0x12;
|
|
}
|
|
else if (this->_headFrameDelay < 9) {
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation((&PTR_DAT_00b6297c)[uVar6],1);
|
|
if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0),
|
|
(this->_sprite)._animState._animData != (void *)0x0)) {
|
|
(this->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
this->_headFrameDelay = 8;
|
|
goto LAB_0063535f;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation((&PTR_DAT_00b6297c)[local_40],1);
|
|
if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(2.0),
|
|
(this->_sprite)._animState._animData != (void *)0x0)) {
|
|
(this->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
this->_headFrameDelay = this->_headFrameDelay + -1;
|
|
}
|
|
LAB_0063535f:
|
|
FollowParent(this);
|
|
return;
|
|
}
|
|
|
|
// 006378c0
|
|
void Entity_Familiar::ai_lil_harbingers()
|
|
{
|
|
code *pcVar1;
|
|
float *pfVar2;
|
|
uint8_t bVar3;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
Entity *pEVar6;
|
|
Vector *pVVar7;
|
|
Vector *randomPos;
|
|
uint8_t *pbVar8;
|
|
uint8_t *pbVar9;
|
|
int iVar10;
|
|
uint32_t subtypeIndex;
|
|
char *expectedName;
|
|
uint32_t *linkedEntitySlot;
|
|
bool bVar11;
|
|
float fVar12;
|
|
float fVar13;
|
|
uint32_t entityIndex;
|
|
int entityType;
|
|
Vector local_64;
|
|
Room *local_5c;
|
|
float local_58;
|
|
uint32_t entityCount;
|
|
Entity *local_50;
|
|
int fireDelayBySubtype [5];
|
|
float maxSpeedBySubtype [5];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float fStack_14;
|
|
Game *game;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((maxSpeedBySubtype + 0xd));
|
|
fStack_14 = -NAN;
|
|
puStack_18 = &LAB_00af6ff0;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((maxSpeedBySubtype + 10));
|
|
ExceptionList = &local_1c;
|
|
iVar10 = this->_state;
|
|
local_24 = uVar4;
|
|
pfVar2 = maxSpeedBySubtype + 0xd;
|
|
if (300 < iVar10) {
|
|
uVar5 = (this->_dropRNG)._seed;
|
|
pfVar2 = maxSpeedBySubtype + 0xd;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar5 = (this->_dropRNG)._seed;
|
|
pfVar2 = GHIDRA_CAST<float *>(puStack_20);
|
|
if (uVar5 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(pfVar2);
|
|
uVar5 = uVar5 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar5;
|
|
(this->_dropRNG)._seed = uVar5;
|
|
this->_subtype = uVar5 % 5;
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
init_lil_harbinger_sprite(this,uVar4);
|
|
uVar4 = Random();
|
|
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
pEVar6->Update();
|
|
this->_state = 0;
|
|
iVar10 = 0;
|
|
pfVar2 = GHIDRA_CAST<float *>(puStack_20);
|
|
}
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(pfVar2);
|
|
local_58 = (this->_targetPosition).x;
|
|
if ((local_58 == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) {
|
|
pVVar7 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetRandomPosition(&local_64,this->_size);
|
|
(this->_targetPosition).x = pVVar7->x;
|
|
(this->_targetPosition).y = pVVar7->y;
|
|
iVar10 = this->_state;
|
|
local_58 = (this->_targetPosition).x;
|
|
}
|
|
this->_state = iVar10 + 1;
|
|
pVVar7 = &this->_pos;
|
|
local_50 = GHIDRA_CAST<Entity *>(((this->_targetPosition).y - (this->_pos).y));
|
|
local_58 = local_58 - pVVar7->x;
|
|
fVar12 = sqrtf((float)local_50 * (float)local_50 + local_58 * local_58);
|
|
if (fVar12 <= 0.0) {
|
|
fVar13 = local_58;
|
|
pEVar6 = local_50;
|
|
}
|
|
else {
|
|
fVar13 = (2.0 / fVar12) * local_58;
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((2.0 / fVar12) * (float)local_50));
|
|
}
|
|
(this->_velocity).x = fVar13 + (this->_velocity).x;
|
|
(this->_velocity).y = (float)pEVar6 + (this->_velocity).y;
|
|
iVar10 = this->_subtype;
|
|
if ((iVar10 == 0) || (iVar10 == 3)) {
|
|
fVar13 = pVVar7->x - (this->_targetPosition).x;
|
|
fVar12 = (this->_pos).y - (this->_targetPosition).y;
|
|
if (fVar12 * fVar12 + fVar13 * fVar13 < 25.0) {
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
}
|
|
game = g_game;
|
|
if ((((this->_flags & 0x4000) == 0) && (bVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar3 == 0)) &&
|
|
((game->_frameCount + this->_index) % 3 == 0)) {
|
|
local_5c = game->_room;
|
|
local_58 = 0.0;
|
|
uVar4 = (local_5c->_entityList)._updateEL._size;
|
|
entityIndex = 0;
|
|
local_50 = GHIDRA_CAST<Entity *>(0x0);
|
|
entityCount = uVar4;
|
|
if (uVar4 != 0) {
|
|
local_64.y = *GHIDRA_CAST<float *>(&game->_deathmatchManager);
|
|
do {
|
|
pEVar6 = *(Entity **)
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((local_5c->_entityList)._updateEL)) + 0x4)))) + entityIndex * 4);
|
|
if ((GHIDRA_INT(local_64.y) < 2) || (pEVar6->_type != 1)) {
|
|
entityType = pEVar6->_type;
|
|
uVar4 = entityCount;
|
|
if (entityType - 10U < 0x3de) goto LAB_00637d3b;
|
|
}
|
|
else {
|
|
entityType = 1;
|
|
LAB_00637d3b:
|
|
if (((pEVar6->_entityCollisionClass != 1) && (pEVar6->_entityCollisionClass != 0)) &&
|
|
((pEVar6->_isInvicible == 0 && (pEVar6->_dead == 0)))) {
|
|
bVar3 = (GHIDRA_CAST<Entity *>((pEVar6)))->Entity::HasEntityFlags(0x10);
|
|
if (((bVar3 == 0) || (entityType == 0x322)) || (entityType == 0x362)) {
|
|
fVar12 = (pEVar6->_pos).x - (this->_pos).x;
|
|
fVar13 = (pEVar6->_pos).y - (this->_pos).y;
|
|
fVar12 = fVar13 * fVar13 + fVar12 * fVar12;
|
|
if (local_50 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_58 = fVar12;
|
|
local_50 = pEVar6;
|
|
}
|
|
else if (fVar12 < local_58) {
|
|
local_58 = fVar12;
|
|
local_50 = pEVar6;
|
|
}
|
|
}
|
|
uVar4 = entityCount;
|
|
}
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < uVar4);
|
|
}
|
|
if (local_50 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
fVar13 = (this->_pos).x - (this->_targetPosition).x;
|
|
fVar12 = (this->_pos).y - (this->_targetPosition).y;
|
|
if (fVar12 * fVar12 + fVar13 * fVar13 < 25.0) {
|
|
pVVar7 = (GHIDRA_CAST<Room *>((local_5c)))->Room::GetRandomPosition(&local_64,this->_size);
|
|
(this->_targetPosition).x = pVVar7->x;
|
|
(this->_targetPosition).y = pVVar7->y;
|
|
}
|
|
}
|
|
else {
|
|
fVar12 = (local_50->_pos).y;
|
|
(this->_targetPosition).x = (local_50->_pos).x;
|
|
(this->_targetPosition).y = fVar12;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
fVar12 = pVVar7->x - (this->_targetPosition).x;
|
|
fVar13 = (this->_pos).y - (this->_targetPosition).y;
|
|
if (fVar13 * fVar13 + fVar12 * fVar12 < 25.0) {
|
|
randomPos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetRandomPosition(&local_64,this->_size);
|
|
(this->_targetPosition).x = randomPos->x;
|
|
(this->_targetPosition).y = randomPos->y;
|
|
iVar10 = this->_subtype;
|
|
}
|
|
if (iVar10 == 1) {
|
|
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0xc,this->_index);
|
|
if ((bVar3 != 0) && ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) {
|
|
uVar4 = Random();
|
|
pEVar6 = this->_player;
|
|
uVar5 = 0x35;
|
|
goto LAB_00637be3;
|
|
}
|
|
}
|
|
else if (((iVar10 == 2) &&
|
|
(bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0xc,this->_index), bVar3 != 0)) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) {
|
|
uVar4 = Random();
|
|
pEVar6 = this->_player;
|
|
uVar5 = 0x2d;
|
|
LAB_00637be3:
|
|
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,uVar5,pVVar7,&g_vectorZero,pEVar6,0,uVar4,0);
|
|
iVar10 = __RTDynamicCast(pEVar6,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0);
|
|
*GHIDRA_CAST<uint32_t *>((iVar10 + 0x45c)) = 0x78;
|
|
*GHIDRA_CAST<uint32_t *>((iVar10 + 0x460)) = 0x78;
|
|
*GHIDRA_CAST<uint32_t *>((iVar10 + 0x470)) = 1;
|
|
}
|
|
}
|
|
uVar4 = this->_subtype;
|
|
maxSpeedBySubtype[4] = 2.0;
|
|
fireDelayBySubtype[4] = 0x3c;
|
|
maxSpeedBySubtype[0] = 2.5;
|
|
maxSpeedBySubtype[1] = 2.0;
|
|
maxSpeedBySubtype[2] = 2.0;
|
|
maxSpeedBySubtype[3] = 1.5;
|
|
fireDelayBySubtype[0] = 0x96;
|
|
fireDelayBySubtype[1] = 0x5a;
|
|
fireDelayBySubtype[2] = 0x5a;
|
|
fireDelayBySubtype[3] = 0x5a;
|
|
if (4 < uVar4) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("[err] Wrong Harbinger subtype %u!\n"));
|
|
uVar4 = this->_subtype;
|
|
}
|
|
fVar12 = (this->_velocity).x;
|
|
local_64.y = (this->_velocity).y;
|
|
fVar12 = sqrtf(fVar12 * fVar12 + local_64.y * local_64.y);
|
|
subtypeIndex = -GHIDRA_UINT((uVar4 != 0)) & uVar4;
|
|
uVar5 = 4;
|
|
if (subtypeIndex < 4) {
|
|
uVar5 = subtypeIndex;
|
|
}
|
|
if (maxSpeedBySubtype[uVar5] <= fVar12 && fVar12 != maxSpeedBySubtype[uVar5]) {
|
|
uVar5 = 4;
|
|
if (subtypeIndex < 4) {
|
|
uVar5 = subtypeIndex;
|
|
}
|
|
if (0.0 < fVar12) {
|
|
fVar13 = maxSpeedBySubtype[uVar5];
|
|
(this->_velocity).y = (fVar13 / fVar12) * local_64.y;
|
|
(this->_velocity).x = (fVar13 / fVar12) * (this->_velocity).x;
|
|
uVar4 = this->_subtype;
|
|
}
|
|
}
|
|
iVar10 = this->_fireCooldown + 1;
|
|
this->_fireCooldown = iVar10;
|
|
uVar4 = -GHIDRA_UINT((uVar4 != 0)) & uVar4;
|
|
uVar5 = 4;
|
|
if (uVar4 < 4) {
|
|
uVar5 = uVar4;
|
|
}
|
|
if ((fireDelayBySubtype[uVar5] <= iVar10) && (this->_linkedEntity == 0)) {
|
|
this->_fireCooldown = 0;
|
|
uVar4 = Random();
|
|
local_5c = GHIDRA_CAST<Room *>((GHIDRA_CAST<Game *>((g_game)))->Game)::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,this->_player,
|
|
this->_subtype + 1,uVar4,0);
|
|
if (this->_subtype == 4) {
|
|
uVar4 = Random();
|
|
local_5c = GHIDRA_CAST<Room *>((GHIDRA_CAST<Game *>((g_game)))->Game)::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,this->_player,
|
|
this->_subtype + 1,uVar4,0);
|
|
}
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("PreSpawn"),1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
linkedEntitySlot = &this->_linkedEntity;
|
|
if (*linkedEntitySlot != 0) {
|
|
local_64.y = (float)linkedEntitySlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_64.y);
|
|
}
|
|
*linkedEntitySlot = local_5c;
|
|
pEVar6 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (local_5c != GHIDRA_CAST<Room *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(linkedEntitySlot);
|
|
pEVar6 = GHIDRA_CAST<Entity *>(this->_linkedEntity);
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(pEVar6);
|
|
}
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
pbVar8 = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
expectedName = "PreSpawn";
|
|
do {
|
|
bVar3 = *pbVar8;
|
|
bVar11 = bVar3 < (uint8_t)*expectedName;
|
|
if (bVar3 != *expectedName) {
|
|
LAB_006380a0:
|
|
uVar4 = -GHIDRA_UINT(bVar11) | 1;
|
|
goto LAB_006380a5;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = pbVar8[1];
|
|
bVar11 = bVar3 < (uint8_t)expectedName[1];
|
|
if (bVar3 != expectedName[1]) goto LAB_006380a0;
|
|
pbVar8 = pbVar8 + 2;
|
|
expectedName = expectedName + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_006380a5:
|
|
if (uVar4 == 0) {
|
|
pbVar8 = (this->_sprite)._animState._animData;
|
|
if (pbVar8 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar9 = pbVar8;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar9 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
expectedName = "FloatDown";
|
|
do {
|
|
bVar3 = *pbVar9;
|
|
bVar11 = bVar3 < (uint8_t)*expectedName;
|
|
if (bVar3 != *expectedName) {
|
|
LAB_006380e0:
|
|
uVar4 = -GHIDRA_UINT(bVar11) | 1;
|
|
goto LAB_006380e5;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = pbVar9[1];
|
|
bVar11 = bVar3 < (uint8_t)expectedName[1];
|
|
if (bVar3 != expectedName[1]) goto LAB_006380e0;
|
|
pbVar9 = pbVar9 + 2;
|
|
expectedName = expectedName + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_006380e5:
|
|
if ((uVar4 == 0) && ((pbVar8[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0063811c;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("FloatDown"),1);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
}
|
|
LAB_0063811c:
|
|
fVar12 = (this->_velocity).x;
|
|
if (0.0 < ABS(fVar12)) {
|
|
(this->_sprite)._flipX = fVar12 < 0.0;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00638c10
|
|
Entity_Laser * Entity_Familiar::FireBrimstone(Vector *AimDirection, uint8_t Unk)
|
|
{
|
|
Entity_Tear *laser;
|
|
int direction;
|
|
float fVar1;
|
|
Vector local_4c;
|
|
Vector *aimDirection;
|
|
uint32_t deliriumColor;
|
|
uint32_t uStack_3c;
|
|
uint32_t uStack_38;
|
|
uint32_t uStack_34;
|
|
uint32_t local_30;
|
|
uint32_t uStack_2c;
|
|
uint32_t uStack_28;
|
|
uint32_t uStack_24;
|
|
uint32_t local_20;
|
|
uint32_t local_1c;
|
|
uint32_t local_18;
|
|
uint32_t local_14;
|
|
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
aimDirection = AimDirection;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x173)) == '\0') {
|
|
fVar1 = AimDirection->x;
|
|
local_4c.x = fVar1 * 10.0;
|
|
local_4c.y = -19.0 - ABS(fVar1) * 4.0;
|
|
fVar1 = atan2f(AimDirection->y,fVar1);
|
|
laser = (Entity_Tear *)
|
|
Entity_Laser::ShootAngle(1,&this->_pos,fVar1 * 57.295776,8,&local_4c,GHIDRA_CAST<Entity *>(this),0);
|
|
fVar1 = apply_tear_modifiers(this);
|
|
laser->SetCollisionDamage(fVar1 * 3.0);
|
|
(laser->_tearHaloANM2)._animState._animData = (void *)0x3f000000;
|
|
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(laser))))->Entity_Laser::ResetSpriteScale();
|
|
if (-0.5 < aimDirection->y || aimDirection->y == -0.5) {
|
|
fVar1 = 3000.0;
|
|
}
|
|
else {
|
|
fVar1 = -10.0;
|
|
}
|
|
laser->_renderDepthOffset = fVar1;
|
|
if (Unk == 0) {
|
|
if (this->_isLilDelirium != 0) {
|
|
local_20 = 0x3f800000;
|
|
local_30 = 0;
|
|
uStack_2c = 0;
|
|
uStack_28 = 0;
|
|
uStack_24 = 0;
|
|
deliriumColor = 0x3e4ccccd;
|
|
uStack_3c = 0x3f800000;
|
|
uStack_38 = 0;
|
|
uStack_34 = 0x3f800000;
|
|
local_1c = 0x3f800000;
|
|
local_18 = 0;
|
|
laser->SetColor(&deliriumColor,0xffffffff,0xff,0,1);
|
|
}
|
|
apply_baby_bender(this,laser);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(laser));
|
|
laser->Update();
|
|
if (this->_linkedEntity != 0) {
|
|
local_4c.y = (float)&this->_linkedEntity;
|
|
msvc::multiset<unsigned_int>::erase(&local_4c.y);
|
|
}
|
|
this->_linkedEntity = laser;
|
|
msvc::multiset<unsigned_int>::insert(&this->_linkedEntity);
|
|
this->_headFrameDelay = 0x1e;
|
|
if (ABS(aimDirection->x) <= ABS(aimDirection->y)) {
|
|
direction = GHIDRA_UINT((0.0 <= aimDirection->y)) * 2 + 1;
|
|
}
|
|
else {
|
|
direction = 2;
|
|
if (aimDirection->x < 0.0) {
|
|
direction = 0;
|
|
}
|
|
}
|
|
PlayShootAnim(this,direction);
|
|
}
|
|
}
|
|
else {
|
|
laser = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
return GHIDRA_CAST<Entity_Laser *>(laser);
|
|
}
|
|
|
|
// 00639000
|
|
Entity * Entity_Familiar::ThrowDip(int subType, Vector *position, Entity *spawner)
|
|
{
|
|
int *piVar1;
|
|
uint32_t uVar2;
|
|
Entity *pEVar3;
|
|
int playerColor;
|
|
float *colorSlot;
|
|
uint32_t uVar4;
|
|
uint64_t *heapBytes;
|
|
int *oldestDip;
|
|
float score;
|
|
float bestScore;
|
|
uint8_t local_7c [8];
|
|
float local_74;
|
|
uint32_t dipCount;
|
|
Entity *savedSpawner;
|
|
int *local_64;
|
|
float local_60 [15];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float local_14;
|
|
ColorMod *dipColor;
|
|
float dipListData;
|
|
uint32_t flagsHigh;
|
|
bool isUnderCap;
|
|
Entity *owner;
|
|
uint64_t prevBytes;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_60 + 0x17));
|
|
puStack_18 = &LAB_00af702d;
|
|
local_1c = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((local_60 + 0x14));
|
|
ExceptionList = &local_1c;
|
|
savedSpawner = spawner;
|
|
local_24 = uVar2;
|
|
while( true ) {
|
|
local_14 = -NAN;
|
|
oldestDip = GHIDRA_CAST<int *>(0x0);
|
|
bestScore = 1e+10;
|
|
local_64 = GHIDRA_CAST<int *>(0x0);
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>((local_7c + 4)),3,0xc9,-1
|
|
,0,0);
|
|
dipListData = local_74;
|
|
local_14 = 0.0;
|
|
uVar4 = 0;
|
|
if (dipCount == 0) break;
|
|
do {
|
|
piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_74) + uVar4 * 4));
|
|
if ((((piVar1 != GHIDRA_CAST<int *>(0x0)) && (piVar1[10] == 3)) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar1) + 0x173)) == '\0')
|
|
) && (GHIDRA_CAST<Entity *>(piVar1[0x104]) == savedSpawner)) {
|
|
local_60[0xc] = 10000.0;
|
|
local_60[0xd] = 10000.0;
|
|
local_60[0xe] = 10000.0;
|
|
local_60[0] = 0.0;
|
|
local_60[1] = 10000.0;
|
|
local_60[2] = -200.0;
|
|
local_60[3] = 20000.0;
|
|
local_60[4] = 20000.0;
|
|
local_60[5] = 10000.0;
|
|
local_60[6] = 20000.0;
|
|
local_60[7] = 0.0;
|
|
local_60[8] = 0.0;
|
|
local_60[9] = 0.0;
|
|
local_60[10] = 0.0;
|
|
local_60[0xb] = 0.0;
|
|
if (GHIDRA_UINT(piVar1[0xc]) < 0xf) {
|
|
score = local_60[piVar1[0xc]];
|
|
}
|
|
else {
|
|
score = 0.0;
|
|
}
|
|
score = score - (float)(g_game->_frameCount - piVar1[0xca]);
|
|
if (score < bestScore) {
|
|
oldestDip = piVar1;
|
|
bestScore = score;
|
|
}
|
|
local_64 = GHIDRA_CAST<int *>((GHIDRA_INT(local_64) + 1));
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < dipCount);
|
|
isUnderCap = local_64 < GHIDRA_CAST<int *>(0x21);
|
|
local_64 = oldestDip;
|
|
if (isUnderCap) break;
|
|
if (oldestDip == GHIDRA_CAST<int *>(0x0)) {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity_Familiar::ThrowDip: couldn\'t find a candidate for removal, remaining: %d\n"
|
|
);
|
|
goto joined_r0x0063923f;
|
|
}
|
|
local_60[5] = 0.0;
|
|
local_60[10] = g_vectorZero.y;
|
|
local_60[0xc] = g_vectorZero.y;
|
|
local_60[6] = 0.0;
|
|
local_60[7] = 0.0;
|
|
local_60[8] = 0.0;
|
|
local_60[9] = g_vectorZero.x;
|
|
local_60[0xb] = g_vectorZero.x;
|
|
local_60[0xd] = 0.0;
|
|
local_60[0xe] = 0.0;
|
|
(**(code **)(*oldestDip + 0x24))(local_60 + 5,uVar2);
|
|
local_14 = -NAN;
|
|
if (local_7c[4] == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (dipListData != 0.0) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(dipListData) + -4));
|
|
prevBytes = *heapBytes;
|
|
*GHIDRA_CAST<uint32_t *>(heapBytes) = GHIDRA_UINT(*heapBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevBytes) < uVar4));
|
|
free((void *)(GHIDRA_INT(dipListData) + -4));
|
|
}
|
|
}
|
|
}
|
|
joined_r0x0063923f:
|
|
if (local_7c[4] == '\0') {
|
|
local_14 = -NAN;
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (dipListData != 0.0) {
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(dipListData) + -4));
|
|
prevBytes = *heapBytes;
|
|
*GHIDRA_CAST<uint32_t *>(heapBytes) = GHIDRA_UINT(*heapBytes) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevBytes) < uVar2));
|
|
free((void *)(GHIDRA_INT(dipListData) + -4));
|
|
}
|
|
}
|
|
local_14 = -NAN;
|
|
uVar2 = Random();
|
|
owner = savedSpawner;
|
|
pEVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(3,0xc9,position,&g_vectorZero,savedSpawner,
|
|
-GHIDRA_UINT((4 < subType - 7U)) & subType,uVar2);
|
|
flagsHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pEVar3->_flags) + 4));
|
|
*GHIDRA_CAST<uint32_t *>(&pEVar3->_flags) = GHIDRA_UINT(pEVar3->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pEVar3->_flags) + 4)) = flagsHigh;
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (owner != GHIDRA_CAST<Entity *>(0x0))) && (owner->_type == 1)
|
|
) {
|
|
playerColor = 0;
|
|
colorSlot = GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x60))));
|
|
do {
|
|
if (*colorSlot == owner[5]._color._colorize[0]) goto LAB_006392f7;
|
|
playerColor = playerColor + 1;
|
|
colorSlot = colorSlot + 1;
|
|
} while (playerColor < 4);
|
|
playerColor = 5;
|
|
LAB_006392f7:
|
|
PlayerManager::GetPlayerColorValue(GHIDRA_CAST<KColor *>(local_7c),playerColor);
|
|
dipColor = &(pEVar3->_sprite)._color;
|
|
if (dipColor != GHIDRA_CAST<ColorMod *>((local_60 + 4))) {
|
|
(pEVar3->_sprite)._color._colorize[0] = 0.0;
|
|
(pEVar3->_sprite)._color._colorize[1] = 0.0;
|
|
(pEVar3->_sprite)._color._colorize[2] = 0.0;
|
|
(pEVar3->_sprite)._color._colorize[3] = 0.0;
|
|
dipColor->_tint[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_7c)) + 0x0)));
|
|
(pEVar3->_sprite)._color._tint[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_7c)) + 0x4)));
|
|
(pEVar3->_sprite)._color._tint[2] = local_74;
|
|
(pEVar3->_sprite)._color._tint[3] = 1.0;
|
|
*GHIDRA_CAST<uint64_t *>((pEVar3->_sprite)._color._offset) =
|
|
CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_7c)) + 0x4))) * 0.25,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_7c)) + 0x0))) * 0.25);
|
|
(pEVar3->_sprite)._color._offset[2] = local_74 * 0.25;
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return pEVar3;
|
|
}
|
|
|
|
// 00639750
|
|
Entity_Tear * Entity_Familiar::FireProjectile(Vector *AimDirection, uint8_t Unk)
|
|
{
|
|
Entity_Player *this_00;
|
|
BitSet128 flags;
|
|
BitSet128 flags_00;
|
|
BitSet128 flags_01;
|
|
Vector velocity_00;
|
|
uint8_t bVar1;
|
|
uint32_t rngResult;
|
|
int iVar2;
|
|
ColorMod *other;
|
|
Vector *pVVar3;
|
|
uint32_t uVar4;
|
|
Entity_Tear *tear;
|
|
float fVar5;
|
|
int extraout_ECX;
|
|
float fVar6;
|
|
uint32_t uVar7;
|
|
float fVar8;
|
|
uint8_t extraout_var [12];
|
|
float afVar9 [4];
|
|
float afVar10 [4];
|
|
uint32_t *puVar11;
|
|
float fVar12;
|
|
float tearDamage;
|
|
float tearScale;
|
|
float local_140;
|
|
float fStack_13c;
|
|
float local_138;
|
|
float fStack_134;
|
|
float local_12c;
|
|
float local_128;
|
|
Vector *local_124;
|
|
float velocityY;
|
|
float velocityX;
|
|
float fallingSpeed;
|
|
Vector velocity;
|
|
uint32_t *local_10c;
|
|
Vector local_108;
|
|
float local_100;
|
|
float local_fc;
|
|
Vector local_f8;
|
|
Vector local_f0;
|
|
float local_e8;
|
|
float local_e4;
|
|
float local_dc;
|
|
ColorMod tmpColor;
|
|
Color tearColor;
|
|
TearParams hitParams;
|
|
uint32_t local_14;
|
|
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(&tearDamage);
|
|
fallingSpeed = 0.0;
|
|
velocityX = AimDirection->x * 10.0;
|
|
velocityY = AimDirection->y * 10.0;
|
|
velocity.x = velocityX;
|
|
velocity.y = velocityY;
|
|
if (Unk == 0) {
|
|
iVar2 = this->_variant;
|
|
if (iVar2 == 200) {
|
|
tearScale = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x360)) * 0.6;
|
|
local_12c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x364)) * 0.6;
|
|
tearScale = tearScale + tearScale;
|
|
local_12c = local_12c + local_12c;
|
|
local_124 = GHIDRA_CAST<Vector *>(AimDirection->x);
|
|
local_128 = AimDirection->y;
|
|
fVar8 = sqrtf((float)local_124 * (float)local_124 + local_128 * local_128);
|
|
if (0.0 < fVar8) {
|
|
local_124 = GHIDRA_CAST<Vector *>((AimDirection->x * (1.0 / fVar8)));
|
|
local_128 = AimDirection->y * (1.0 / fVar8);
|
|
}
|
|
local_10c = GHIDRA_CAST<uint32_t *>(AimDirection->x);
|
|
local_100 = AimDirection->y;
|
|
fVar8 = sqrtf((float)local_10c * (float)local_10c + local_100 * local_100);
|
|
if (fVar8 <= 0.0) {
|
|
puVar11 = local_10c;
|
|
fVar8 = local_100;
|
|
}
|
|
else {
|
|
puVar11 = GHIDRA_CAST<uint32_t *>((AimDirection->x * (1.0 / fVar8)));
|
|
fVar8 = AimDirection->y * (1.0 / fVar8);
|
|
}
|
|
fVar8 = fVar8 * local_12c + (float)puVar11 * tearScale;
|
|
fVar12 = local_128 * fVar8;
|
|
fVar8 = (float)local_124 * fVar8;
|
|
velocity.x = tearScale;
|
|
velocity.y = local_12c;
|
|
if (fVar12 * AimDirection->y + fVar8 * AimDirection->x < 0.0) {
|
|
velocity.x = tearScale - fVar8;
|
|
velocity.y = local_12c - fVar12;
|
|
}
|
|
velocity.x = velocityX + velocity.x;
|
|
velocity.y = velocityY + velocity.y;
|
|
}
|
|
else {
|
|
if ((iVar2 == 8) || (iVar2 == 0xf4)) {
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x360)) * 0.6;
|
|
fVar12 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x364)) * 0.6;
|
|
velocityX = velocityX - (fVar8 + fVar8);
|
|
velocityY = velocityY - (fVar12 + fVar12);
|
|
}
|
|
else {
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x360)) * 0.6;
|
|
fVar12 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x364)) * 0.6;
|
|
velocityX = velocityX + fVar8 + fVar8;
|
|
velocityY = velocityY + fVar12 + fVar12;
|
|
}
|
|
velocity.x = velocityX;
|
|
velocity.y = velocityY;
|
|
if ((velocityY * velocityY + velocityX * velocityX < 100.0) && (iVar2 != 0x6c)) {
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&velocity)))->Vector::Normalized(&local_108);
|
|
velocity.x = pVVar3->x * 10.0;
|
|
velocity.y = pVVar3->y * 10.0;
|
|
}
|
|
}
|
|
}
|
|
velocityY = velocity.y;
|
|
velocityX = velocity.x;
|
|
if ((this->_variant == 0xce) || (this->_variant == 0xed)) {
|
|
velocity_00.y = velocity.y;
|
|
velocity_00.x = velocity.x;
|
|
tear = fire_wisp_projectile(this,velocity_00);
|
|
return tear;
|
|
}
|
|
uVar7 = 0;
|
|
local_12c = 0.0;
|
|
local_140 = 0.0;
|
|
fStack_13c = 0.0;
|
|
local_138 = 0.0;
|
|
fStack_134 = 0.0;
|
|
local_124 = GHIDRA_CAST<Vector *>(apply_tear_modifiers(this));
|
|
fVar8 = apply_tear_modifiers(this);
|
|
fVar12 = 0.8;
|
|
tearDamage = 3.5;
|
|
local_10c = GHIDRA_CAST<uint32_t *>(0x0);
|
|
afVar9[0] = (fVar8 * 0.25 + 0.75) * 0.8;
|
|
afVar9[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)extraout_var)) + 0x0)));
|
|
afVar9[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)extraout_var)) + 0x4)));
|
|
afVar9[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)extraout_var)) + 0x8)));
|
|
tearScale = afVar9[0];
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::Color();
|
|
uVar4 = this->_variant;
|
|
if (uVar4 == 0x4a) {
|
|
local_100 = (float)this->_subtype;
|
|
LAB_00639ad8:
|
|
local_128 = 0.0;
|
|
if (local_100 == 1.12104e-44) goto LAB_00639ae3;
|
|
}
|
|
else {
|
|
local_100 = -NAN;
|
|
if (uVar4 != 0xb) goto LAB_00639ad8;
|
|
LAB_00639ae3:
|
|
rngResult = Random();
|
|
afVar9 = (float [4])ZEXT416(GHIDRA_UINT(tearScale));
|
|
fVar12 = 0.8;
|
|
uVar4 = this->_variant;
|
|
local_128 = (float)(rngResult % 10 + 1);
|
|
}
|
|
afVar10 = afVar9;
|
|
if (uVar4 == 0xc) {
|
|
local_140 = (float)g_tearFlagPiercing._l;
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagPiercing._l)) + 0x4)));
|
|
local_138 = (float)g_tearFlagPiercing._h;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagPiercing._h)) + 0x4)));
|
|
if (this->_player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetTrinketMultiplier(0x36);
|
|
afVar10 = afVar9;
|
|
if (1 < iVar2) {
|
|
tearDamage = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x1470));
|
|
if (2 < iVar2) {
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(afVar10)) + 0x0))) = (double)tearDamage * 1.5;
|
|
afVar10[2] = 0.0;
|
|
afVar10[3] = 0.0;
|
|
tearDamage = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&((float)afVar10)) + 0x0)));
|
|
}
|
|
}
|
|
}
|
|
goto LAB_0063a552;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(afVar10)) + 0x4))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(afVar9)) + 0x4)));
|
|
if (((uVar4 == 9) || (local_128 == 1.4013e-45)) || (local_100 == 8.40779e-45)) {
|
|
local_140 = (float)g_tearFlagSpectral._l;
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4)));
|
|
tearColor._tint[0] = _DAT_00babc50;
|
|
tearColor._tint[1] = _UNK_00babc54;
|
|
tearColor._tint[2] = _UNK_00babc58;
|
|
tearColor._tint[3] = _UNK_00babc5c;
|
|
local_138 = (float)g_tearFlagSpectral._h;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4)));
|
|
afVar10 = _DAT_00babc50;
|
|
}
|
|
else {
|
|
fVar8 = afVar9[0];
|
|
if (((uVar4 == 10) || (local_128 == 2.8026e-45)) || (local_100 == 9.80909e-45)) {
|
|
tearScale = fVar8 * 0.9;
|
|
uVar7 = 1;
|
|
local_12c = 1.4013e-45;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(afVar10)) + 0x0))) = ZEXT812(0x40800000);
|
|
afVar10[3] = 0.0;
|
|
tearDamage = afVar10[0];
|
|
goto LAB_0063a552;
|
|
}
|
|
if ((local_128 == 4.2039e-45) || (local_100 == 1.12104e-44)) {
|
|
uVar7 = 1;
|
|
afVar10[0] = fVar8 * fVar12;
|
|
afVar10[1] = (float)afVar9[1];
|
|
afVar10[2] = (float)afVar9[2];
|
|
afVar10[3] = (float)afVar9[3];
|
|
local_12c = 1.4013e-45;
|
|
fallingSpeed = 1.2;
|
|
tearDamage = 3.0;
|
|
tearScale = afVar10[0];
|
|
goto LAB_0063a552;
|
|
}
|
|
if (((uVar4 == 6) || (local_128 == 5.60519e-45)) || (local_100 == 5.60519e-45)) {
|
|
afVar10[0] = fVar8 * 1.06;
|
|
uVar7 = 1;
|
|
local_12c = 1.4013e-45;
|
|
tearDamage = 5.0;
|
|
tearScale = afVar10[0];
|
|
goto LAB_0063a552;
|
|
}
|
|
if (((uVar4 == 4) || (local_128 == 7.00649e-45)) || (local_100 == 2.8026e-45)) {
|
|
local_140 = (float)(GHIDRA_UINT(g_tearFlagSlow._l) | GHIDRA_UINT(g_tearFlagGish._l));
|
|
fStack_13c = (float)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._l)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagGish._l)) + 0x4))));
|
|
local_138 = (float)(GHIDRA_UINT(g_tearFlagSlow._h) | GHIDRA_UINT(g_tearFlagGish._h));
|
|
fStack_134 = (float)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._h)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagGish._h)) + 0x4))));
|
|
tearColor._tint[0] = _DAT_00bac560;
|
|
tearColor._tint[1] = _UNK_00bac564;
|
|
tearColor._tint[2] = _UNK_00bac568;
|
|
tearColor._tint[3] = _UNK_00bac56c;
|
|
tearColor._offset[0] = -0.5882353;
|
|
tearColor._offset[1] = -0.5882353;
|
|
tearColor._offset[2] = -0.5882353;
|
|
afVar10 = _DAT_00bac560;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (((uVar4 == 5) || (local_128 == 8.40779e-45)) || (local_100 == 4.2039e-45)) {
|
|
uVar7 = 0x15;
|
|
local_140 = (float)g_tearFlagHoming._l;
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4)));
|
|
fallingSpeed = -3.0;
|
|
local_12c = 2.94273e-44;
|
|
local_138 = (float)g_tearFlagHoming._h;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4)));
|
|
goto LAB_0063a54a;
|
|
}
|
|
if ((uVar4 == 0xd) || (local_128 == 9.80909e-45)) {
|
|
local_140 = (float)(GHIDRA_UINT((float)g_tearFlagSpectral._l) | GHIDRA_UINT((float)g_tearFlagHoming._l));
|
|
fStack_13c = (float)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(g_tearFlagSpectral._l))) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(g_tearFlagHoming._l))) + 0x4))));
|
|
local_138 = (float)(GHIDRA_UINT((float)g_tearFlagSpectral._h) | GHIDRA_UINT((float)g_tearFlagHoming._h));
|
|
fStack_134 = (float)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(g_tearFlagSpectral._h))) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(g_tearFlagHoming._h))) + 0x4))));
|
|
fallingSpeed = -3.0;
|
|
tearColor._tint[0] = _DAT_00babc50;
|
|
tearColor._tint[1] = _UNK_00babc54;
|
|
tearColor._tint[2] = _UNK_00babc58;
|
|
tearColor._tint[3] = _UNK_00babc5c;
|
|
afVar10 = _DAT_00babc50;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (uVar4 == 0x2d) {
|
|
local_12c = 1.4013e-45;
|
|
uVar7 = 1;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (((0x45 < uVar4) && (uVar4 < 0x49)) || (local_128 == 1.12104e-44)) {
|
|
uVar4 = Random();
|
|
if ((uVar4 % 10 == 0) || (local_128 == 1.12104e-44)) {
|
|
local_140 = (float)g_tearFlagCharm._l;
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCharm._l)) + 0x4)));
|
|
local_138 = (float)g_tearFlagCharm._h;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCharm._h)) + 0x4)));
|
|
}
|
|
tearColor._tint[0] = _DAT_00bac6e0;
|
|
tearColor._tint[1] = _UNK_00bac6e4;
|
|
tearColor._tint[2] = _UNK_00bac6e8;
|
|
tearColor._tint[3] = _UNK_00bac6ec;
|
|
tearColor._offset[0] = 0.19607845;
|
|
tearColor._offset[1] = 0.0;
|
|
tearColor._offset[2] = 0.0;
|
|
afVar10 = _DAT_00bac6e0;
|
|
if (this->_variant == 0x48) {
|
|
local_140 = (float)(GHIDRA_UINT(local_140) | GHIDRA_UINT(g_tearFlagHpDrop._l));
|
|
fStack_13c = (float)(GHIDRA_UINT(fStack_13c) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHpDrop._l)) + 0x4))));
|
|
local_138 = (float)(GHIDRA_UINT(local_138) | GHIDRA_UINT(g_tearFlagHpDrop._h));
|
|
fStack_134 = (float)(GHIDRA_UINT(fStack_134) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHpDrop._h)) + 0x4))));
|
|
}
|
|
goto LAB_0063a552;
|
|
}
|
|
if (((uVar4 == 7) || (local_100 == 7.00649e-45)) || (local_128 == 1.4013e-44)) {
|
|
tearColor._tint[0] = _DAT_00babfa0;
|
|
tearColor._tint[1] = _UNK_00babfa4;
|
|
tearColor._tint[2] = _UNK_00babfa8;
|
|
tearColor._tint[3] = _UNK_00babfac;
|
|
tearDamage = 6.0;
|
|
afVar10 = _DAT_00babfa0;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (uVar4 == 0x6b) {
|
|
tearDamage = 6.0;
|
|
tmpColor._colorize = (float [4])ZEXT816(0);
|
|
local_12c = 8.40779e-45;
|
|
tmpColor._tint[0] = _DAT_00bac7b0;
|
|
tmpColor._tint[1] = _UNK_00bac7b4;
|
|
tmpColor._tint[2] = _UNK_00bac7b8;
|
|
tmpColor._tint[3] = _UNK_00bac7bc;
|
|
tmpColor._offset[0] = 0.0;
|
|
tmpColor._offset[1] = 0.2;
|
|
tmpColor._offset[2] = 0.4;
|
|
afVar10 = _DAT_00bac7b0;
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(&tmpColor);
|
|
uVar7 = 6;
|
|
goto LAB_0063a552;
|
|
}
|
|
if ((uVar4 == 0x61) || (local_100 == 1.4013e-44)) {
|
|
tearColor._tint[0] = _DAT_00babfa0;
|
|
tearColor._tint[1] = _UNK_00babfa4;
|
|
tearColor._tint[2] = _UNK_00babfa8;
|
|
tearColor._tint[3] = _UNK_00babfac;
|
|
afVar10 = _DAT_00babfa0;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (((uVar4 == 0x50) || (uVar4 == 0x51)) || (uVar4 == 0x4c)) {
|
|
this_00 = this->_player;
|
|
uVar4 = Random();
|
|
Entity_Player::GetTearHitParams
|
|
(this_00,&hitParams,1,(float)local_124,(uVar4 & 1) * 2 + -1,GHIDRA_CAST<Entity *>(0x0));
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(&hitParams._tearColor);
|
|
local_fc = (float)(~(GHIDRA_UINT(g_tearFlagMulligan._h) | GHIDRA_UINT(g_tearFlagLudovico._h) |
|
|
GHIDRA_UINT(g_tearFlagHpDrop._h)) & GHIDRA_UINT(hitParams._flags._h));
|
|
local_108.x = (float)(~((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagMulligan._l)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4))) |
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHpDrop._l)) + 0x4)))) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(hitParams._flags._l)) + 0x4))));
|
|
local_f8.x = (float)(~((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagMulligan._h)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4))) |
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHpDrop._h)) + 0x4)))) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(hitParams._flags._h)) + 0x4))));
|
|
fVar8 = (float)(~(GHIDRA_UINT(g_tearFlagMulligan._l) | GHIDRA_UINT(g_tearFlagLudovico._l) |
|
|
GHIDRA_UINT(g_tearFlagHpDrop._l)) & GHIDRA_UINT(hitParams._flags._l));
|
|
tearDamage = hitParams._tearDamage;
|
|
local_140 = fVar8;
|
|
fStack_13c = local_108.x;
|
|
local_138 = local_fc;
|
|
fStack_134 = local_f8.x;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x95,0);
|
|
if (bVar1 != 0) {
|
|
fStack_13c = (float)(GHIDRA_UINT(local_108.x) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagExplosive._l)) + 0x4))));
|
|
local_140 = (float)(GHIDRA_UINT(fVar8) | GHIDRA_UINT(g_tearFlagExplosive._l));
|
|
local_138 = (float)(GHIDRA_UINT(local_fc) | GHIDRA_UINT(g_tearFlagExplosive._h));
|
|
fStack_134 = (float)(GHIDRA_UINT(local_f8.x) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagExplosive._h)) + 0x4))));
|
|
}
|
|
tearScale = hitParams._tearScale;
|
|
fallingSpeed = -*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x1478));
|
|
local_10c = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(this->_player) + 0x147c));
|
|
afVar10 = (float [4])ZEXT416(local_10c);
|
|
local_12c = (float)hitParams._tearVariant;
|
|
uVar7 = hitParams._tearVariant;
|
|
goto LAB_0063a552;
|
|
}
|
|
if ((uVar4 == 0x58) && (this->_state == 2)) {
|
|
uVar4 = Random();
|
|
afVar10 = afVar9;
|
|
if (uVar4 % 10 == 0) {
|
|
local_140 = (float)g_tearFlagCoinDrop._l;
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCoinDrop._l)) + 0x4)));
|
|
local_138 = (float)g_tearFlagCoinDrop._h;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagCoinDrop._h)) + 0x4)));
|
|
goto LAB_0063a54a;
|
|
}
|
|
}
|
|
iVar2 = this->_variant;
|
|
if (iVar2 == 0x5c) {
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4)));
|
|
local_140 = (float)g_tearFlagHoming._l;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4)));
|
|
local_138 = (float)g_tearFlagHoming._h;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color();
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(other);
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
tearDamage = 10.0;
|
|
}
|
|
else {
|
|
tearDamage = 6.0;
|
|
}
|
|
tearScale = 1.1;
|
|
velocityX = velocityX * 0.75;
|
|
fallingSpeed = -0.75;
|
|
velocityY = velocityY * 0.75;
|
|
afVar10 = (float [4])ZEXT416(GHIDRA_UINT(velocityY));
|
|
velocity.x = velocityX;
|
|
velocity.y = velocityY;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (iVar2 == 0x4c) {
|
|
tearDamage = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x157c));
|
|
goto LAB_0063a552;
|
|
}
|
|
if (iVar2 == 0x6c) {
|
|
local_12c = 1.4013e-45;
|
|
pVVar3 = MusicManager::RandomVector(&local_108);
|
|
uVar4 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar12 = fVar8 * pVVar3->y;
|
|
fVar8 = fVar8 * pVVar3->x;
|
|
velocityX = fVar8 + fVar8 + velocityX;
|
|
velocityY = velocityY + fVar12 + fVar12;
|
|
velocity.x = velocityX;
|
|
velocity.y = velocityY;
|
|
uVar4 = Random();
|
|
uVar7 = Random();
|
|
local_10c = GHIDRA_CAST<uint32_t *>(0x3f000000);
|
|
tearScale = tearScale *
|
|
((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.05 + ((float)(uVar4 & 1) + 0.0) * 0.4 + 0.9);
|
|
uVar4 = Random();
|
|
fallingSpeed = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 15.0 + 5.0;
|
|
afVar10 = (float [4])ZEXT416(GHIDRA_UINT(fallingSpeed));
|
|
fallingSpeed = 0.0 - fallingSpeed;
|
|
uVar7 = 1;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (iVar2 == 8) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13c0));
|
|
if ((iVar2 == 2) || (iVar2 == 0x17)) goto LAB_0063a061;
|
|
LAB_0063a140:
|
|
if (local_100 != 1.54143e-44) goto LAB_0063a552;
|
|
}
|
|
else {
|
|
if (iVar2 == 0xf4) {
|
|
LAB_0063a061:
|
|
local_12c = 1.4013e-45;
|
|
tearDamage = 7.5;
|
|
uVar7 = 1;
|
|
goto LAB_0063a552;
|
|
}
|
|
if (iVar2 == 200) {
|
|
tmpColor._tint[2] = 1.0;
|
|
tmpColor._tint[0] = 1.0;
|
|
tmpColor._tint[1] = 1.0;
|
|
tmpColor._tint[3] = 1.0;
|
|
tearDamage = 1.5;
|
|
tmpColor._colorize[0] = _DAT_00bac850;
|
|
tmpColor._colorize[1] = _UNK_00bac854;
|
|
tmpColor._colorize[2] = _UNK_00bac858;
|
|
tmpColor._colorize[3] = _UNK_00bac85c;
|
|
tmpColor._offset[0] = 0.4;
|
|
tmpColor._offset[1] = 0.4;
|
|
tmpColor._offset[2] = 0.38;
|
|
afVar10 = _DAT_00bac850;
|
|
(GHIDRA_CAST<Color *>((&tearColor)))->Color::operator_assign(&tmpColor);
|
|
goto LAB_0063a552;
|
|
}
|
|
if (iVar2 == 0xe1) {
|
|
fVar8 = 3.0;
|
|
tearDamage = 3.0;
|
|
Random();
|
|
FUN_0067af30();
|
|
fallingSpeed = 0.0;
|
|
tearScale = fVar8 * 1.25 * tearScale;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(afVar10)) + 0x0))) = ZEXT812(0xbccccccd);
|
|
afVar10[3] = 0.0;
|
|
local_10c = afVar10[0];
|
|
goto LAB_0063a552;
|
|
}
|
|
if (iVar2 != 0xd1) goto LAB_0063a140;
|
|
}
|
|
uVar7 = 0x29;
|
|
tearScale = tearScale * 1.1;
|
|
afVar10 = (float [4])ZEXT416(GHIDRA_UINT(tearScale));
|
|
local_dc = (float)g_tearFlagIce._l;
|
|
local_f8.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagIce._l)) + 0x4)));
|
|
local_140 = (float)g_tearFlagIce._l;
|
|
fStack_13c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagIce._l)) + 0x4)));
|
|
local_12c = 5.74532e-44;
|
|
local_fc = (float)g_tearFlagIce._h;
|
|
local_108.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagIce._h)) + 0x4)));
|
|
local_138 = (float)g_tearFlagIce._h;
|
|
fStack_134 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagIce._h)) + 0x4)));
|
|
uVar4 = Random();
|
|
if (uVar4 % 10 != 0) goto LAB_0063a552;
|
|
local_140 = (float)(GHIDRA_UINT(local_dc) | GHIDRA_UINT(g_tearFlagFreeze._l));
|
|
fStack_13c = (float)(GHIDRA_UINT(local_f8.x) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._l)) + 0x4))));
|
|
local_138 = (float)(GHIDRA_UINT(local_fc) | GHIDRA_UINT(g_tearFlagFreeze._h));
|
|
fStack_134 = (float)(GHIDRA_UINT(local_108.x) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._h)) + 0x4))));
|
|
}
|
|
LAB_0063a54a:
|
|
LAB_0063a552:
|
|
if (this->_isLilDelirium != 0) {
|
|
if (uVar7 == 0) {
|
|
uVar7 = 1;
|
|
}
|
|
tearColor._colorize[0] = _DAT_00bac940;
|
|
tearColor._colorize[1] = _UNK_00bac944;
|
|
tearColor._colorize[2] = _UNK_00bac948;
|
|
tearColor._colorize[3] = _UNK_00bac94c;
|
|
afVar10 = _DAT_00bac940;
|
|
local_12c = (float)uVar7;
|
|
}
|
|
local_108.x = (float)(GHIDRA_UINT(fStack_134) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagBurstsplit._h)) + 0x4))));
|
|
if ((((GHIDRA_UINT(local_140) & GHIDRA_UINT(g_tearFlagBurstsplit._l)) != 0 ||
|
|
(GHIDRA_UINT(fStack_13c) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagBurstsplit._l)) + 0x4)))) != 0) ||
|
|
((GHIDRA_UINT(local_138) & GHIDRA_UINT(g_tearFlagBurstsplit._h)) != 0 ||
|
|
GHIDRA_CAST<uint32_t *>(local_108.x) != GHIDRA_CAST<uint32_t *>(0x0))) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xe9,0), bVar1 == 0)) {
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x1474));
|
|
fallingSpeed = ((fVar8 * 0.75) / *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x1464))) * (23.75 / -fVar8);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(afVar10)) + 0x0))) = ZEXT812(0x3fa66666);
|
|
afVar10[3] = 0.0;
|
|
local_10c = afVar10[0];
|
|
}
|
|
if (this->_player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IsHologram();
|
|
if (bVar1 != 0) {
|
|
afVar10 = (float [4])ZEXT416(GHIDRA_UINT((tearColor._tint[3] * 0.25)));
|
|
tearColor._tint[3] = tearColor._tint[3] * 0.25;
|
|
}
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(bVar1 = NetplayManager::IsIdxLocalPlayer
|
|
(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),
|
|
*GHIDRA_CAST<uint32_t *>((extraout_ECX + 0x1618))), bVar1 == 0)) {
|
|
FUN_00925df0();
|
|
tearColor._tint[3] = afVar10[0] * tearColor._tint[3];
|
|
}
|
|
}
|
|
if (((this->_variant == 10) || (local_128 == 1.26117e-44)) || (local_100 == 9.80909e-45)) {
|
|
local_128 = 2.8026e-45;
|
|
local_f0.x = velocityX - velocityY * 0.2;
|
|
local_f0.y = velocityX * 0.2 + velocityY;
|
|
local_e8 = velocityY * 0.2 + velocityX;
|
|
local_e4 = velocityY - velocityX * 0.2;
|
|
tearDamage = tearDamage * (float)local_124;
|
|
if (tearScale <= 0.01) {
|
|
tearScale = 0.01;
|
|
}
|
|
local_124 = &local_f0;
|
|
do {
|
|
pVVar3 = local_124;
|
|
uVar4 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,GHIDRA_UINT(local_12c),&this->_pos,pVVar3,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
uVar4 = Random();
|
|
tear->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + fallingSpeed;
|
|
tear->_fallingAccel = (float)local_10c;
|
|
tear->SetCollisionDamage(tearDamage);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x4))) = local_140;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x0))) = tearScale;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x0))) = fStack_13c;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x4))) = local_138;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags_01);
|
|
tear->_baseScale = tearDamage;
|
|
tear->_fScale = tearDamage;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
tear->SetColor(tmpColor._offset + 2,0xffffffff,0xff,0,1);
|
|
if (tear->_parent != 0) {
|
|
local_108.x = (float)&tear->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&local_108);
|
|
}
|
|
tear->_parent = this;
|
|
msvc::multiset<unsigned_int>::insert(&tear->_parent);
|
|
uVar4 = Random();
|
|
tear->_tearIdx = uVar4 & 1;
|
|
TryFireTear(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
local_124 = local_124 + 1;
|
|
local_128 = (float)(GHIDRA_INT(local_128) + -1);
|
|
} while (local_128 != 0.0);
|
|
return tear;
|
|
}
|
|
tearDamage = tearDamage * (float)local_124;
|
|
if (tearScale <= 0.01) {
|
|
tearScale = 0.01;
|
|
}
|
|
if (this->_variant != 200) {
|
|
uVar4 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,uVar7,&this->_pos,&velocity,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
uVar4 = Random();
|
|
tear->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10
|
|
* 0.2 + fallingSpeed;
|
|
tear->_fallingAccel = (float)local_10c;
|
|
tear->SetCollisionDamage(tearDamage);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x4))) = local_140;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x0))) = tearScale;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x0))) = fStack_13c;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = local_138;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags_00);
|
|
tear->_baseScale = tearDamage;
|
|
tear->_fScale = tearDamage;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
if (tear->_parent != 0) {
|
|
local_10c = &tear->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&local_10c);
|
|
}
|
|
tear->_parent = this;
|
|
msvc::multiset<unsigned_int>::insert(&tear->_parent);
|
|
tear->SetColor(tmpColor._offset + 2,0xffffffff,0xff,0,1);
|
|
uVar4 = Random();
|
|
tear->_tearIdx = uVar4 & 1;
|
|
TryFireTear(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
return tear;
|
|
}
|
|
local_124 = GHIDRA_CAST<Vector *>(0x0);
|
|
do {
|
|
local_128 = ((float)GHIDRA_INT(local_124) / 3.0) * 10.0 - 5.0;
|
|
local_108.x = (((float)GHIDRA_INT(local_124) / 3.0) * 180.0 - 90.0) * 0.017453292;
|
|
local_fc = cos(local_108.x);
|
|
fVar8 = sin(local_108.x);
|
|
local_128 = local_128 * 0.017453292;
|
|
local_f8.x = (AimDirection->x * local_fc - AimDirection->y * fVar8) * 10.0 + (this->_pos).x;
|
|
local_f8.y = (AimDirection->y * local_fc + AimDirection->x * fVar8) * 10.0 + (this->_pos).y;
|
|
local_108.x = cos(local_128);
|
|
fVar8 = sin(local_128);
|
|
velocity.x = velocityX * local_108.x - velocityY * fVar8;
|
|
velocity.y = velocityY * local_108.x + velocityX * fVar8;
|
|
uVar4 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,GHIDRA_UINT(local_12c),&local_f8,&velocity,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
uVar4 = Random();
|
|
tear->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10
|
|
* 0.2 + fallingSpeed;
|
|
tear->_fallingAccel = (float)local_10c;
|
|
tear->SetCollisionDamage(tearDamage);
|
|
uVar4 = Random();
|
|
if (uVar4 % 10 == 0) {
|
|
fVar8 = tearScale;
|
|
fVar12 = local_140;
|
|
fVar6 = fStack_13c;
|
|
fVar5 = local_138;
|
|
}
|
|
else {
|
|
fVar8 = (float)(GHIDRA_UINT(tearScale) | GHIDRA_UINT(g_tearFlagSlow._l));
|
|
fVar12 = (float)(GHIDRA_UINT(local_140) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._l)) + 0x4))));
|
|
fVar6 = (float)(GHIDRA_UINT(fStack_13c) | GHIDRA_UINT(g_tearFlagSlow._h));
|
|
fVar5 = (float)(GHIDRA_UINT(local_138) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._h)) + 0x4))));
|
|
local_f8.y = fVar8;
|
|
local_f0.x = fVar12;
|
|
local_f0.y = fVar6;
|
|
local_e8 = fVar5;
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = fVar12;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = fVar8;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = fVar6;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = fVar5;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
|
tear->_baseScale = tearDamage;
|
|
tear->_fScale = tearDamage;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
tear->SetColor(tmpColor._offset + 2,0xffffffff,0xff,0,1);
|
|
if (tear->_parent != 0) {
|
|
local_108.x = (float)&tear->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&local_108);
|
|
}
|
|
tear->_parent = this;
|
|
msvc::multiset<unsigned_int>::insert(&tear->_parent);
|
|
uVar4 = Random();
|
|
tear->_tearIdx = uVar4 & 1;
|
|
TryFireTear(this,tear);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
local_124 = GHIDRA_CAST<Vector *>((GHIDRA_INT(local_124) + 1));
|
|
} while (GHIDRA_INT(local_124) < 4);
|
|
return tear;
|
|
}
|
|
|
|
// 0063aef0
|
|
Entity_Laser * Entity_Familiar::sprinkler_shoot_laser(float angle, float distance)
|
|
{
|
|
Entity_Player *this_00;
|
|
Entity_Laser *pEVar1;
|
|
uint32_t rngResult;
|
|
int iVar2;
|
|
float fVar3;
|
|
uint8_t auStack_90 [4];
|
|
float distanceLocal;
|
|
float angleRad;
|
|
float local_84;
|
|
Vector laserOffset;
|
|
TearParams tearParams;
|
|
uint32_t local_c;
|
|
bool isSpectral;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(auStack_90);
|
|
angleRad = angle * 0.017453292;
|
|
distanceLocal = distance;
|
|
local_84 = angle;
|
|
fVar3 = cos(angleRad);
|
|
laserOffset.x = fVar3 * distanceLocal + 0.0;
|
|
fVar3 = sin(angleRad);
|
|
laserOffset.y = fVar3 * distanceLocal - 32.0;
|
|
pEVar1 = Entity_Laser::ShootAngle(2,&this->_pos,local_84,3,&laserOffset,GHIDRA_CAST<Entity *>(this),0);
|
|
pEVar1->_oneHit = 1;
|
|
this_00 = this->_player;
|
|
rngResult = Random();
|
|
Entity_Player::GetTearHitParams(this_00,&tearParams,3,1.0,(rngResult & 1) * 2 + -1,GHIDRA_CAST<Entity *>(0x0));
|
|
iVar2 = *GHIDRA_CAST<int *>(pEVar1);
|
|
*GHIDRA_CAST<uint32_t *>(&(pEVar1->_tearFlags)._l) = (uint32_t)tearParams._flags._l;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(pEVar1->_tearFlags)._l) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearParams._flags._l)) + 0x4)));
|
|
*GHIDRA_CAST<uint32_t *>(&(pEVar1->_tearFlags)._h) = (uint32_t)tearParams._flags._h;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(pEVar1->_tearFlags)._h) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearParams._flags._h)) + 0x4)));
|
|
(**(code **)(iVar2 + 0x3c))(&tearParams._tearColor,0xffffffff,0xff,0,1);
|
|
pEVar1->SetCollisionDamage((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearParams)) + 0x34))));
|
|
if (((GHIDRA_UINT(tearParams._tearColor._colorize[2]) & GHIDRA_UINT(g_tearFlagSpectral._l)) == 0 &&
|
|
(GHIDRA_UINT(tearParams._tearColor._colorize[3]) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4)))) == 0) &&
|
|
((GHIDRA_UINT(tearParams._tearColor._offset[0]) & GHIDRA_UINT(g_tearFlagSpectral._h)) == 0 &&
|
|
(GHIDRA_UINT(tearParams._tearColor._offset[1]) & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4)))) == 0)) {
|
|
isSpectral = false;
|
|
}
|
|
else {
|
|
isSpectral = true;
|
|
}
|
|
pEVar1->_renderDepthOffset = 3000.0;
|
|
iVar2 = 3;
|
|
if (isSpectral) {
|
|
iVar2 = 6;
|
|
}
|
|
pEVar1->_entityGridCollisionClass = iVar2;
|
|
return pEVar1;
|
|
}
|
|
|
|
// 0063b340
|
|
void Entity_Familiar::update_idle_anim_by_size()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *currentName;
|
|
uint32_t compareResult;
|
|
uint8_t *wantedName;
|
|
uint32_t sizeIdx;
|
|
bool isLess;
|
|
float scaledY;
|
|
float targetSize [2];
|
|
uint8_t animName [32];
|
|
uint32_t local_c;
|
|
uint8_t *animData;
|
|
float baseSize;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(targetSize);
|
|
targetSize[0] =
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x15c)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0xe4)) * 100.0;
|
|
if (this->_orbitSpeed == targetSize[0]) {
|
|
return;
|
|
}
|
|
sizeIdx = 0;
|
|
do {
|
|
if (targetSize[0] < (float)(&DAT_00b644a0)[sizeIdx] * 1.5) break;
|
|
sizeIdx = sizeIdx + 1;
|
|
} while (sizeIdx < 4);
|
|
FUN_00652a30(animName,0x20,"Idle%d",sizeIdx);
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
currentName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
currentName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantedName = animName;
|
|
do {
|
|
bVar1 = *currentName;
|
|
isLess = bVar1 < *wantedName;
|
|
if (bVar1 != *wantedName) {
|
|
LAB_0063b402:
|
|
compareResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0063b407;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentName[1];
|
|
isLess = bVar1 < wantedName[1];
|
|
if (bVar1 != wantedName[1]) goto LAB_0063b402;
|
|
currentName = currentName + 2;
|
|
wantedName = wantedName + 2;
|
|
} while (bVar1 != 0);
|
|
compareResult = 0;
|
|
LAB_0063b407:
|
|
if ((compareResult == 0) &&
|
|
((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0063b43a;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(animName,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_0063b43a:
|
|
baseSize = (float)(&DAT_00b644a0)[sizeIdx];
|
|
scaledY = targetSize[0] * g_vectorOne.y;
|
|
(this->_sprite)._scale.x = (targetSize[0] * g_vectorOne.x) / baseSize;
|
|
(this->_sprite)._scale.y = scaledY / baseSize;
|
|
this->_orbitSpeed = targetSize[0];
|
|
this->_size = targetSize[0];
|
|
return;
|
|
}
|
|
|
|
// 0063b8b0
|
|
void Entity_Familiar::RemoveFromPlayer(uint8_t UnusedRemoveFamiliar)
|
|
{
|
|
uint32_t *_Src;
|
|
short *psVar1;
|
|
void **ppvVar2;
|
|
void *pvVar3;
|
|
Entity_Player *this_00;
|
|
uint8_t bVar4;
|
|
ItemConfig_Item *item;
|
|
uint32_t uVar5;
|
|
uint32_t familiarFlagBit;
|
|
int *piVar6;
|
|
uint32_t *puVar7;
|
|
uint16_t newCount;
|
|
int removedCount;
|
|
int iVar8;
|
|
RNG local_38;
|
|
uint32_t collectibleId;
|
|
int removeIndex;
|
|
int removeCount;
|
|
char isEvaluateNeeded;
|
|
int local_18 [5];
|
|
int currentCount;
|
|
uint32_t *levelItemsEnd;
|
|
Manager *manager;
|
|
|
|
local_18[4] = __security_cookie ^ GHIDRA_UINT((local_18 + 5));
|
|
this->Remove();
|
|
manager = g_manager;
|
|
item = this->_item;
|
|
isEvaluateNeeded = '\0';
|
|
switch(this->_variant) {
|
|
case 0x1c:
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xef,0);
|
|
iVar8 = (bVar4 != 0) + 0xee;
|
|
goto LAB_0063b918;
|
|
case 0x41:
|
|
pvVar3 = this->_player;
|
|
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(pvVar3) + 0x1508)))))->TemporaryEffects::HasNullEffect(0x6b);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(pvVar3) + 0x1508)))))->TemporaryEffects::RemoveNullEffect(0x6b,1);
|
|
goto LAB_0063bcad;
|
|
}
|
|
break;
|
|
case 0x66:
|
|
local_38._seed = this->_initSeed;
|
|
local_38._shift1 = 2;
|
|
local_38._shift2 = 0x15;
|
|
local_38._shift3 = 9;
|
|
local_18[1] = 0x90;
|
|
local_18[2] = 0x116;
|
|
local_18[3] = 0x184;
|
|
uVar5 = (GHIDRA_CAST<RNG *>((&local_38)))->RNG::RandomInt(3);
|
|
iVar8 = local_18[uVar5 + 1];
|
|
LAB_0063b918:
|
|
item = (GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig::GetCollectible(iVar8);
|
|
isEvaluateNeeded = '\x01';
|
|
break;
|
|
case 0x67:
|
|
iVar8 = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(this->_player) + 0x1382)) + -1;
|
|
newCount = 0;
|
|
if (0 < iVar8) {
|
|
newCount = (short)iVar8;
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(this->_player) + 0x1382)) = newCount;
|
|
goto LAB_0063bcad;
|
|
case 0x71:
|
|
iVar8 = this->_player->_playerForms[0xc];
|
|
if (iVar8 < 1) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IncrementPlayerFormCounter(0xc,-iVar8);
|
|
return;
|
|
case 0xf4:
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)))))->TemporaryEffects::RemoveNullEffect(0x6b,1);
|
|
goto LAB_0063bcad;
|
|
}
|
|
if (item != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
iVar8 = item->type;
|
|
if (((iVar8 == 1) || (iVar8 == 3)) || (iVar8 == 4)) {
|
|
uVar5 = item->id;
|
|
removeCount = 0;
|
|
collectibleId = uVar5;
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x19d,0);
|
|
if ((bVar4 == 0) && (bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x19c,0), bVar4 == 0)
|
|
) {
|
|
LAB_0063bb29:
|
|
if (uVar5 == 10) {
|
|
pvVar3 = (this->_player->_pillEffectUses)._begin;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x28));
|
|
if (iVar8 < 1) {
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(10,0);
|
|
if (bVar4 == 0) {
|
|
iVar8 = 0;
|
|
}
|
|
else {
|
|
iVar8 = 1;
|
|
removeCount = 1;
|
|
piVar6 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x16d4)) + 0x28));
|
|
*piVar6 = *piVar6 + 1;
|
|
}
|
|
goto LAB_0063bc53;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x28)) = iVar8 + -1;
|
|
}
|
|
else {
|
|
LAB_0063bbd4:
|
|
if (uVar5 != 0x20d) {
|
|
if (uVar5 == 0x49) {
|
|
iVar8 = this->_variant + -0x2b;
|
|
currentCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x153c));
|
|
removedCount = currentCount;
|
|
if (iVar8 < currentCount) {
|
|
removedCount = iVar8;
|
|
}
|
|
iVar8 = iVar8 - removedCount;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x153c)) = currentCount - removedCount;
|
|
removeCount = iVar8;
|
|
}
|
|
else {
|
|
familiarFlagBit = 0;
|
|
if (uVar5 != 0xcf) goto LAB_0063bad8;
|
|
iVar8 = this->_variant + -0x44;
|
|
currentCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x1540));
|
|
removedCount = currentCount;
|
|
if (iVar8 < currentCount) {
|
|
removedCount = iVar8;
|
|
}
|
|
iVar8 = iVar8 - removedCount;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x1540)) = currentCount - removedCount;
|
|
removeCount = iVar8;
|
|
}
|
|
goto LAB_0063bc53;
|
|
}
|
|
psVar1 = GHIDRA_CAST<short *>((GHIDRA_INT(this->_player) + 0x1384));
|
|
*psVar1 = *psVar1 + -1;
|
|
}
|
|
}
|
|
else {
|
|
if (GHIDRA_INT(uVar5) < 0x114) {
|
|
if (uVar5 == 0x113) {
|
|
familiarFlagBit = 0x10;
|
|
}
|
|
else {
|
|
switch(uVar5) {
|
|
case 0x62:
|
|
familiarFlagBit = 0x100;
|
|
break;
|
|
default:
|
|
goto LAB_0063bb29;
|
|
case 0x70:
|
|
familiarFlagBit = 0x40;
|
|
break;
|
|
case 0x71:
|
|
familiarFlagBit = 4;
|
|
break;
|
|
case 0xb2:
|
|
familiarFlagBit = 0x80;
|
|
break;
|
|
case 0x10e:
|
|
familiarFlagBit = 1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
switch(uVar5) {
|
|
case 0x116:
|
|
familiarFlagBit = 2;
|
|
break;
|
|
default:
|
|
goto LAB_0063bbd4;
|
|
case 0x168:
|
|
familiarFlagBit = 8;
|
|
break;
|
|
case 0x16b:
|
|
familiarFlagBit = 0x200;
|
|
break;
|
|
case 0x186:
|
|
familiarFlagBit = 0x400;
|
|
break;
|
|
case 0x1a1:
|
|
familiarFlagBit = 0x20;
|
|
}
|
|
}
|
|
LAB_0063bad8:
|
|
iVar8 = 1;
|
|
removeCount = 1;
|
|
if (familiarFlagBit != 0) {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x1938));
|
|
if ((familiarFlagBit & uVar5) != 0) {
|
|
iVar8 = 0;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x1938)) = uVar5 | familiarFlagBit;
|
|
removeCount = 0;
|
|
}
|
|
}
|
|
LAB_0063bc53:
|
|
removeIndex = 0;
|
|
if (0 < iVar8) {
|
|
LAB_0063bc60:
|
|
this_00 = this->_player;
|
|
if ((this_00->_temporaryeffects)._disabled == 0) {
|
|
for (piVar6 = (this_00->_temporaryeffects)._effects._begin;
|
|
piVar6 != (this_00->_temporaryeffects)._effects._end; piVar6 = piVar6 + 4) {
|
|
if (GHIDRA_CAST<ItemConfig_Item *>(*piVar6) == item) {
|
|
if ((item->type == 3) && (item->passiveCache == 0)) goto LAB_0063bdc5;
|
|
puVar7 = (this_00->_levelEffectItems)._begin;
|
|
levelItemsEnd = (this_00->_levelEffectItems)._end;
|
|
if (puVar7 != levelItemsEnd) goto LAB_0063bd00;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
LAB_0063bc8b:
|
|
(GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::RemoveCollectible(collectibleId,0,0,1);
|
|
goto LAB_0063bc9b;
|
|
}
|
|
}
|
|
}
|
|
else if (iVar8 == 2) {
|
|
uVar5 = item->id;
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasTrinket(uVar5,0);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::TryRemoveTrinket(uVar5);
|
|
}
|
|
}
|
|
}
|
|
LAB_0063bca7:
|
|
if (isEvaluateNeeded == '\0') {
|
|
return;
|
|
}
|
|
LAB_0063bcad:
|
|
puVar7 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_player) + 0x1574));
|
|
*puVar7 = *puVar7 | 0x200;
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::EvaluateItems();
|
|
return;
|
|
LAB_0063bd00:
|
|
_Src = puVar7 + 1;
|
|
if (*puVar7 != collectibleId) {
|
|
puVar7 = _Src;
|
|
if (_Src == levelItemsEnd) goto LAB_0063bc8b;
|
|
goto LAB_0063bd00;
|
|
}
|
|
memmove(puVar7,_Src,GHIDRA_INT(levelItemsEnd) - GHIDRA_INT(_Src));
|
|
ppvVar2 = &(this_00->_levelEffectItems)._end;
|
|
*ppvVar2 = (void *)(GHIDRA_INT(*ppvVar2) + -4);
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x173c)) + removeIndex * 4));
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (GHIDRA_INT(uVar5) < 0) goto LAB_0063bdc5;
|
|
LAB_0063bd84:
|
|
pvVar3 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar3) >> 2 <= GHIDRA_INT(uVar5))
|
|
goto LAB_0063bdc5;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar5 * 4));
|
|
}
|
|
else {
|
|
if (-1 < GHIDRA_INT(uVar5)) goto LAB_0063bd84;
|
|
if ((GHIDRA_INT(uVar5) < 0) &&
|
|
(pvVar3 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT(~uVar5) < GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar3) >> 2)
|
|
) {
|
|
iVar8 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar3) + ~uVar5 * 4));
|
|
}
|
|
else {
|
|
iVar8 = 0;
|
|
}
|
|
}
|
|
if (iVar8 != 0) {
|
|
local_18[2] = *GHIDRA_CAST<uint32_t *>((iVar8 + 0x78));
|
|
local_18[1] = 0;
|
|
local_18[3] = 0;
|
|
local_18[0] = iVar8;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)))))->TemporaryEffects::RemoveEffect(local_18,1);
|
|
}
|
|
LAB_0063bdc5:
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) = (uint64_t)GHIDRA_UINT(item->maxCooldown) << 0x20;
|
|
local_38._shift3 = 0;
|
|
local_38._seed = GHIDRA_INT(item);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)))))->TemporaryEffects::RemoveEffect(&local_38,1);
|
|
LAB_0063bc9b:
|
|
removeIndex = removeIndex + 1;
|
|
if (removeCount <= removeIndex) goto LAB_0063bca7;
|
|
goto LAB_0063bc60;
|
|
}
|
|
|
|
// 0063c1c0
|
|
void Entity_Familiar::ai_minisaac()
|
|
{
|
|
float targetY;
|
|
code *pcVar2;
|
|
int64_t lVar3;
|
|
int64_t lVar4;
|
|
Vector *position;
|
|
uint8_t bVar5;
|
|
char cVar6;
|
|
int iVar7;
|
|
char *anim;
|
|
uint32_t uVar8;
|
|
Entity *pEVar9;
|
|
int *piVar10;
|
|
int unusedArg;
|
|
void *pvVar11;
|
|
uint32_t uVar12;
|
|
uint32_t uVar13;
|
|
uint32_t uVar14;
|
|
PlayerManager *playerManager;
|
|
uint32_t uVar15;
|
|
bool bVar16;
|
|
float fVar17;
|
|
uint64_t timeNs;
|
|
uint64_t uVar18;
|
|
uint32_t local_e4;
|
|
uint32_t spawnSubType;
|
|
uint32_t finalSubType;
|
|
float local_d8;
|
|
uint32_t spawnType;
|
|
uint32_t local_d0;
|
|
uint32_t spawnVariant;
|
|
Game *spawnGame;
|
|
float local_c4;
|
|
uint32_t local_c0;
|
|
int landSound;
|
|
int landSound2;
|
|
int deathSound;
|
|
void *triggerNode;
|
|
float local_a8;
|
|
Vector particlePos;
|
|
uint32_t local_98;
|
|
int *erasedSpawnerSlot;
|
|
uint32_t subTypeKey;
|
|
Entity_Familiar *savedFamiliar;
|
|
Vector particleVelocity;
|
|
int triggerKeyType;
|
|
int triggerKeyVariant;
|
|
int anyVariantKeyType;
|
|
uint32_t anyVariantKeyVariant;
|
|
uint64_t rngShifts;
|
|
uint32_t rngShift3;
|
|
uint8_t anyVariantFind [4];
|
|
uint8_t itemFindResult [8];
|
|
int itemNode;
|
|
RNG cardRng;
|
|
char *dirAnims [12];
|
|
Game *game;
|
|
Manager *manager;
|
|
std_set *spawnTriggerTargets;
|
|
uint32_t *spawnerSlot;
|
|
ANM2 *sprite;
|
|
float targetY;
|
|
|
|
dirAnims[4] = "WalkLeft";
|
|
dirAnims[5] = "WalkUp";
|
|
dirAnims[6] = "WalkRight";
|
|
dirAnims[7] = "WalkDown";
|
|
dirAnims[0] = "FlyLeft";
|
|
dirAnims[1] = "FlyUp";
|
|
dirAnims[2] = "FlyRight";
|
|
dirAnims[3] = "FlyDown";
|
|
dirAnims[8] = "HeadLeft";
|
|
dirAnims[9] = "HeadUp";
|
|
dirAnims[10] = "HeadRight";
|
|
dirAnims[0xb] = "HeadDown";
|
|
if (this->_player != (void *)0x0) {
|
|
iVar7 = this->_entityGridCollisionClass;
|
|
if ((((iVar7 == 0) || (iVar7 == 3)) || (iVar7 == 1)) || (bVar16 = false, iVar7 == 2)) {
|
|
bVar16 = true;
|
|
}
|
|
iVar7 = this->_state;
|
|
savedFamiliar = this;
|
|
if (iVar7 == 0) {
|
|
fVar17 = (this->_targetPosition).x;
|
|
targetY = (this->_targetPosition).y;
|
|
fVar17 = sqrtf(fVar17 * fVar17 + targetY * targetY);
|
|
if (fVar17 <= 0.01) {
|
|
iVar7 = 3;
|
|
}
|
|
else {
|
|
targetY = (this->_targetPosition).x;
|
|
targetY = (this->_targetPosition).y;
|
|
if (ABS(targetY) <= ABS(targetY)) {
|
|
iVar7 = GHIDRA_UINT((0.0 <= targetY)) * 2 + 1;
|
|
}
|
|
else {
|
|
iVar7 = 2;
|
|
if (targetY < 0.0) {
|
|
iVar7 = 0;
|
|
}
|
|
}
|
|
}
|
|
sprite = &this->_sprite;
|
|
if (bVar16) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(dirAnims[iVar7]),0);
|
|
if (fVar17 <= 0.5) {
|
|
fVar17 = 0.5;
|
|
}
|
|
if (1.0 <= fVar17) {
|
|
fVar17 = 1.0;
|
|
}
|
|
(this->_sprite)._playbackSpeed = fVar17;
|
|
fVar17 = -4.0;
|
|
}
|
|
else {
|
|
if (fVar17 <= 0.01) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>("WalkDown"),0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(dirAnims[iVar7 + 4]),0);
|
|
if (fVar17 <= 0.5) {
|
|
fVar17 = 0.5;
|
|
}
|
|
if (1.0 <= fVar17) {
|
|
fVar17 = 1.0;
|
|
}
|
|
(this->_sprite)._playbackSpeed = fVar17;
|
|
}
|
|
fVar17 = 0.0;
|
|
}
|
|
(this->_posOffset).y = fVar17;
|
|
local_d0 = GHIDRA_UINT((6 < this->_fireCooldown));
|
|
if (this->_shootDirection != -1) {
|
|
iVar7 = this->_shootDirection;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST<uint8_t *>(dirAnims[iVar7 + 8]),1);
|
|
if ((bVar5 != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_d0));
|
|
}
|
|
FamiliarHelper::fly_head_pathfind_move(this);
|
|
minisaac_find_target();
|
|
minisaac_fire(this);
|
|
game = g_game;
|
|
if ((((this->_flags & 0x4000) == 0) && (bVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar5 == 0)) &&
|
|
((game->_frameCount % 0xf == 0 && (1.0 < this->_health)))) {
|
|
this->_health = this->_health - 0.2;
|
|
}
|
|
}
|
|
else if (iVar7 == 1) {
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
bVar5 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(s_Land);
|
|
manager = g_manager;
|
|
if (bVar5 != 0) {
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
landSound = 0x45;
|
|
seed_fart_sound_override(&landSound);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(landSound,0.8,2,0,1.0,0.0);
|
|
}
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
(bVar5 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(s_Land),
|
|
bVar5 != 0)) {
|
|
this->_friction = this->_friction * 0.5;
|
|
}
|
|
}
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
anim = "TransformFlying";
|
|
if (!bVar16) {
|
|
anim = "Transform";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(anim),0);
|
|
this->_state = 2;
|
|
}
|
|
}
|
|
else if (iVar7 == 2) {
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
bVar5 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(s_Land);
|
|
manager = g_manager;
|
|
if (bVar5 != 0) {
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
landSound2 = 0x45;
|
|
seed_fart_sound_override(&landSound2);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(landSound2,0.8,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
this->_friction = this->_friction * 0.5;
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
this->_state = 0;
|
|
this->_entityCollisionClass = 4;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
if (this->_dead != 0) {
|
|
deathSound = 0x37;
|
|
seed_fart_sound_override(&deathSound);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(deathSound,0.8,2,0,1.8,0.0);
|
|
uVar8 = Random();
|
|
position = &this->_pos;
|
|
pEVar9 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,position,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar8,0);
|
|
(GHIDRA_CAST<ANM2 *>((&pEVar9->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Poof_Small"),0);
|
|
uVar8 = Random();
|
|
for (local_d0 = (uVar8 & 1) + 1; local_d0 != 0; local_d0 = local_d0 + -1) {
|
|
uVar8 = Random();
|
|
local_d8 = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_d8 = local_d8 + local_d8;
|
|
fVar17 = cos(local_d8);
|
|
particlePos.x = fVar17 * this->_size * 0.5 + position->x;
|
|
fVar17 = sin(local_d8);
|
|
particlePos.y = fVar17 * this->_size * 0.5 + (this->_pos).y;
|
|
uVar8 = Random();
|
|
fVar17 = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
fVar17 = fVar17 + fVar17;
|
|
uVar8 = Random();
|
|
targetY = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 1.0;
|
|
local_c4 = cos(fVar17);
|
|
local_c4 = local_c4 * targetY;
|
|
particleVelocity.x = local_c4;
|
|
local_a8 = sin(fVar17);
|
|
local_a8 = local_a8 * targetY;
|
|
particleVelocity.y = local_a8;
|
|
local_d8 = (float)Random();
|
|
spawnGame = g_game;
|
|
spawnSubType = 0;
|
|
spawnVariant = 5;
|
|
spawnType = 1000;
|
|
lua_callback_run_pre_entity_spawn
|
|
(GHIDRA_CAST<int *>(&spawnType),GHIDRA_CAST<int *>(&spawnVariant),&particlePos,&particleVelocity,
|
|
GHIDRA_CAST<Entity *>(0x0),GHIDRA_CAST<int *>(&spawnSubType),GHIDRA_CAST<uint32_t *>(&local_d8));
|
|
uVar8 = spawnVariant;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
LAB_0063cadf:
|
|
finalSubType = spawnSubType;
|
|
}
|
|
else {
|
|
piVar10 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_deathmatchManager))) + 0xc))));
|
|
local_e4 = Random();
|
|
uVar12 = spawnSubType;
|
|
rngShifts = 0x900000005;
|
|
rngShift3 = 7;
|
|
if (spawnType != 5) goto LAB_0063cadf;
|
|
if (uVar8 < 0x12d) {
|
|
if (uVar8 == 300) {
|
|
while ((finalSubType = spawnSubType, spawnSubType == 0 ||
|
|
(cVar6 = (**(code **)(*piVar10 + 0x24))(spawnSubType), cVar6 != '\0'))) {
|
|
if (local_e4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
local_e4 = local_e4 >> ((uint8_t)rngShifts & 0x1f) ^ local_e4;
|
|
local_e4 = local_e4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ local_e4;
|
|
local_e4 = local_e4 >> 7 ^ local_e4;
|
|
iVar7 = ItemPool::GetCardEx(local_e4,0x19,10,10,1);
|
|
cardRng._shift1 = 5;
|
|
cardRng._shift2 = 9;
|
|
cardRng._shift3 = 7;
|
|
cardRng._seed = local_e4;
|
|
spawnSubType = lua_callback_run_get_card(&cardRng,iVar7,1,1,0);
|
|
}
|
|
}
|
|
else {
|
|
if (uVar8 == 0x46) {
|
|
local_c0 = spawnSubType >> 0xb;
|
|
do {
|
|
finalSubType = spawnSubType;
|
|
if (spawnSubType != 0) {
|
|
pcVar2 = *(code **)(*piVar10 + 0x28);
|
|
iVar7 = ItemPool::GetPillEffect
|
|
(&g_game->_itemPool,spawnSubType,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
cVar6 = (*pcVar2)(iVar7);
|
|
if (cVar6 == '\0') goto LAB_0063cae7;
|
|
}
|
|
if (local_e4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
local_e4 = local_e4 >> ((uint8_t)rngShifts & 0x1f) ^ local_e4;
|
|
local_e4 = local_e4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ local_e4;
|
|
local_e4 = local_e4 >> 7 ^ local_e4;
|
|
spawnSubType = ItemPool::GetPill(local_e4);
|
|
spawnSubType = spawnSubType | (local_c0 & 1) << 0xb;
|
|
} while( true );
|
|
}
|
|
if (uVar8 != 100) goto LAB_0063cadf;
|
|
finalSubType = spawnSubType;
|
|
if (spawnSubType == 0x19) {
|
|
LAB_0063c921:
|
|
bVar16 = false;
|
|
}
|
|
else {
|
|
subTypeKey = spawnSubType;
|
|
msvc::set<int>::find_node(itemFindResult,&subTypeKey);
|
|
if (((*GHIDRA_CAST<char *>((itemNode + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((itemNode + 0x10)) <= GHIDRA_INT(uVar12))) && (itemNode != piVar10[8]))
|
|
goto LAB_0063c921;
|
|
bVar16 = true;
|
|
}
|
|
if ((uVar12 == 0) || (bVar16)) {
|
|
spawnSubType = (**(code **)(*piVar10 + 0x84))(0);
|
|
finalSubType = spawnSubType;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (uVar8 != 0x15e) goto LAB_0063cadf;
|
|
while ((finalSubType = spawnSubType, spawnSubType == 0 ||
|
|
(cVar6 = (**(code **)(*piVar10 + 0x2c))(spawnSubType), cVar6 != '\0'))) {
|
|
spawnSubType = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetTrinket(0);
|
|
}
|
|
}
|
|
}
|
|
LAB_0063cae7:
|
|
pEVar9 = (GHIDRA_CAST<EntityFactory *>((spawnGame->_entityFactory)))->EntityFactory::Create(spawnType,0);
|
|
lVar3 = CONCAT44(local_c0,local_98);
|
|
if (pEVar9 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
pEVar9 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
else {
|
|
timeNs = GetTimeNs();
|
|
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
local_98 = (uint32_t)((uint64_t)lVar3 >> 0x20);
|
|
uVar18 = (timeNs >> 0x20) * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar12 = GHIDRA_UINT((uVar18 >> 0x20));
|
|
lVar3 = lVar3 + (uVar18 & 0xffffffff);
|
|
local_c0 = GHIDRA_UINT(lVar3);
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
lVar3 = (timeNs >> 0x20) * 0x431bde82 +
|
|
(uint64_t)CONCAT14(CARRY4(uVar12,uVar8),uVar12 + uVar8);
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
uVar12 = GHIDRA_UINT(lVar3) >> 0x12 | uVar8 * 0x4000;
|
|
spawnerSlot = &pEVar9->_spawnerEntity;
|
|
pEVar9->_spawnerType = 0;
|
|
pEVar9->_spawnerVariant = 0;
|
|
if (*spawnerSlot != 0) {
|
|
erasedSpawnerSlot = spawnerSlot;
|
|
msvc::multiset<unsigned_int>::erase(&erasedSpawnerSlot);
|
|
}
|
|
iVar7 = *GHIDRA_CAST<int *>(pEVar9);
|
|
*spawnerSlot = 0;
|
|
(pEVar9->_pos).x = particlePos.x;
|
|
(pEVar9->_pos).y = particlePos.y;
|
|
(pEVar9->_velocity).x = local_c4;
|
|
(pEVar9->_velocity).y = local_a8;
|
|
(**(code **)(iVar7 + 4))(spawnType,spawnVariant,finalSubType,local_d8);
|
|
pvVar11 = spawnGame->_room;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x1214));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x1214)) = iVar7 + 1;
|
|
pEVar9->_index = iVar7;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar11) + 0x1218)))))->EntityList::AddEntity(pEVar9);
|
|
bVar5 = Game::ShouldEraseEnemy(pEVar9);
|
|
if (bVar5 != 0) {
|
|
Entity::RemoveWithPoof(pEVar9,unusedArg);
|
|
}
|
|
if ((pEVar9->_exists != 0) &&
|
|
((spawnGame->_proceduralItemManager)._proceduralItems._begin !=
|
|
(spawnGame->_proceduralItemManager)._proceduralItems._end)) {
|
|
triggerKeyVariant = pEVar9->_variant;
|
|
iVar7 = pEVar9->_type;
|
|
spawnTriggerTargets = &(spawnGame->_proceduralItemManager)._spawnTriggerTargets;
|
|
triggerKeyType = iVar7;
|
|
msvc::map<unsigned_long_long>::find(&triggerNode,&triggerKeyType);
|
|
if (triggerNode == spawnTriggerTargets->_head) {
|
|
anyVariantKeyVariant = 0xffffffff;
|
|
anyVariantKeyType = iVar7;
|
|
piVar10 = GHIDRA_CAST<int *>(std)::map<unsigned_long_long>::find(anyVariantFind,&anyVariantKeyType)
|
|
;
|
|
triggerNode = (void *)*piVar10;
|
|
if (triggerNode == spawnTriggerTargets->_head) goto LAB_0063cd56;
|
|
}
|
|
uVar15 = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar11 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar11) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n");
|
|
pvVar11 = (playerManager->_playerList)._end;
|
|
}
|
|
piVar10 = (playerManager->_playerList)._begin;
|
|
if (uVar15 < GHIDRA_UINT((GHIDRA_INT(pvVar11) - GHIDRA_INT(piVar10) >> 2))) {
|
|
piVar10 = piVar10 + uVar15;
|
|
}
|
|
trigger_set_dispatch
|
|
((void *)(*piVar10 + 0x1fc8),6,pEVar9,&particlePos,&particleVelocity);
|
|
uVar15 = uVar15 + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (uVar15 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
LAB_0063cd56:
|
|
uVar18 = GetTimeNs();
|
|
local_d8 = (float)(uVar18 >> 0x20);
|
|
lVar4 = (uVar18 & 0xffffffff) * 0x431bde82;
|
|
local_c4 = (float)((uint64_t)lVar4 >> 0x20);
|
|
lVar3 = (uint64_t)GHIDRA_UINT(local_d8) * 0x431bde82;
|
|
uVar18 = (uint64_t)GHIDRA_UINT(local_d8) * 0xd7b634db +
|
|
((uVar18 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar13 = GHIDRA_UINT((uVar18 >> 0x20));
|
|
lVar4 = lVar4 + (uVar18 & 0xffffffff);
|
|
local_a8 = (float)lVar4;
|
|
uVar15 = GHIDRA_UINT(((uint64_t)lVar4 >> 0x20));
|
|
lVar4 = lVar3 + (uint64_t)CONCAT14(CARRY4(uVar13,uVar15),uVar13 + uVar15);
|
|
uVar14 = GHIDRA_UINT(((uint64_t)lVar4 >> 0x20));
|
|
uVar15 = GHIDRA_UINT(lVar4) >> 0x12 | uVar14 * 0x4000;
|
|
uVar13 = uVar15 - uVar12;
|
|
bVar16 = CARRY4(GHIDRA_UINT(g_entitySpawnTimeMs),uVar13);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x0))) = GHIDRA_UINT(g_entitySpawnTimeMs) + uVar13;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) =
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) +
|
|
(((uVar14 >> 0x12) - (uVar8 >> 0x12)) - GHIDRA_UINT((uVar15 < uVar12))) + GHIDRA_UINT(bVar16);
|
|
}
|
|
local_c0 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
local_98 = (uint32_t)lVar3;
|
|
pEVar9->Update();
|
|
position = &savedFamiliar->_pos;
|
|
this = savedFamiliar;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0063ce20
|
|
void Entity_Familiar::minisaac_fire()
|
|
{
|
|
int iVar1;
|
|
uint32_t spawnSeed;
|
|
Entity *knifeEntity;
|
|
Entity_Knife *this_00;
|
|
Vector *pVVar2;
|
|
Entity_Tear *tear;
|
|
Manager *manager;
|
|
float fVar3;
|
|
float Volume;
|
|
float Pitch;
|
|
Vector local_34;
|
|
Vector local_2c;
|
|
float local_24;
|
|
Vector local_20;
|
|
Vector shootDir;
|
|
Vector normalizedDir;
|
|
uint32_t *parentRef;
|
|
|
|
if ((-1 < this->_shootDirection) && (this->_fireCooldown < 1)) {
|
|
Isaac::GetAxisAlignedUnitVectorFromDir(&shootDir,this->_shootDirection);
|
|
if (this->_subtype == 99) {
|
|
iVar1 = _get_index_plus_one_if_kind_4_5();
|
|
local_20.x = (float)iVar1 * 0.15 + 1.2;
|
|
fVar3 = apply_tear_modifiers(this);
|
|
local_24 = (fVar3 * 0.4 + 0.6) * local_20.x;
|
|
fVar3 = apply_tear_modifiers(this);
|
|
local_2c.x = (fVar3 * 0.25 + 0.75) * 0.7;
|
|
spawnSeed = Random();
|
|
local_34.x = (this->_pos).x;
|
|
local_34.y = (this->_pos).y;
|
|
knifeEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(8,1,&local_34,&g_vectorZero,GHIDRA_CAST<Entity *>(this),4,spawnSeed,0);
|
|
this_00 = (Entity_Knife *)
|
|
__RTDynamicCast(knifeEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor,0);
|
|
parentRef = &this_00->_parent;
|
|
if (this_00->_parent != 0) {
|
|
local_20.x = (float)parentRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*parentRef = this;
|
|
msvc::multiset<unsigned_int>::insert(parentRef);
|
|
(this_00->_targetPosition).x = 8.0;
|
|
(this_00->_targetPosition).y = 0.0;
|
|
pVVar2 = Vector::ToCardinal(&local_20,&shootDir);
|
|
fVar3 = atan2f(pVVar2->y,pVVar2->x);
|
|
(this_00->_posOffset).x = 0.0;
|
|
(this_00->_posOffset).y = -8.0;
|
|
this_00->_rotation = fVar3 * 57.295776;
|
|
this_00->SetCollisionDamage(local_24 + local_24);
|
|
fVar3 = local_34.y * g_vectorOne.x;
|
|
(this_00->_sprite)._scale.y = local_34.y * g_vectorOne.y;
|
|
(this_00->_sprite)._scale.x = fVar3;
|
|
(GHIDRA_CAST<Entity_Knife *>((this_00)))->Entity_Knife::SetAttackAnimation();
|
|
this_00->Update();
|
|
manager = g_manager;
|
|
this->_fireCooldown = 0x14;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>((GHIDRA_INT(register0x00000010) + -0x38)));
|
|
Pitch = 1.5;
|
|
Volume = 0.6;
|
|
fVar3 = 3.53127e-43;
|
|
}
|
|
else {
|
|
local_20.x = (this->_velocity).x * 0.5;
|
|
local_34.x = (this->_velocity).y * 0.5;
|
|
local_2c.x = shootDir.y;
|
|
local_24 = shootDir.x;
|
|
fVar3 = sqrtf(shootDir.y * shootDir.y + shootDir.x * shootDir.x);
|
|
if (fVar3 <= 0.0) {
|
|
fVar3 = local_2c.x;
|
|
}
|
|
else {
|
|
local_24 = shootDir.x * (1.0 / fVar3);
|
|
fVar3 = local_2c.x * (1.0 / fVar3);
|
|
}
|
|
local_24 = local_34.x * fVar3 + local_20.x * local_24;
|
|
fVar3 = local_20.x;
|
|
if (local_24 < 0.0) {
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&shootDir)))->Vector::Normalized(&normalizedDir);
|
|
fVar3 = local_20.x - local_24 * pVVar2->x;
|
|
local_34.x = local_34.x - local_24 * pVVar2->y;
|
|
}
|
|
local_2c.x = shootDir.x * 9.0 + fVar3;
|
|
local_2c.y = shootDir.y * 9.0 + local_34.x;
|
|
iVar1 = _get_index_plus_one_if_kind_4_5();
|
|
local_20.x = (float)iVar1 * 0.15 + 1.2;
|
|
fVar3 = apply_tear_modifiers(this);
|
|
local_20.x = (fVar3 * 0.4 + 0.6) * local_20.x;
|
|
fVar3 = apply_tear_modifiers(this);
|
|
local_24 = (fVar3 * 0.25 + 0.75) * 0.5;
|
|
spawnSeed = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,0,&this->_pos,&local_2c,GHIDRA_CAST<Entity *>(this),0,spawnSeed,0);
|
|
tear->SetCollisionDamage(local_20.x);
|
|
if (this->_entityGridCollisionClass == 5) {
|
|
fVar3 = -14.0;
|
|
}
|
|
else {
|
|
fVar3 = -18.0;
|
|
}
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(tear))))->Entity_Projectile::SetHeight(fVar3);
|
|
fVar3 = local_2c.y * tear->_baseScale;
|
|
if (fVar3 <= 0.01) {
|
|
fVar3 = 0.01;
|
|
}
|
|
tear->_baseScale = fVar3;
|
|
tear->_fScale = fVar3;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
TryFireTear(this,tear);
|
|
tear->Update();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
manager = g_manager;
|
|
this->_fireCooldown = 10;
|
|
local_24 = 2.14399e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_24));
|
|
Pitch = 1.0;
|
|
Volume = 1.0;
|
|
fVar3 = local_24;
|
|
}
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(fVar3),Volume,2,0,Pitch,0.0);
|
|
}
|
|
if (0 < this->_fireCooldown) {
|
|
this->_fireCooldown = this->_fireCooldown + -1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0063dd60
|
|
void Entity_Familiar::minisaac_find_target()
|
|
{
|
|
Entity_Player *ownerParent;
|
|
Entity_Familiar *familiar;
|
|
uint8_t bVar1;
|
|
uint32_t frameMod;
|
|
Entity *target;
|
|
Vector *sideOffset;
|
|
Entity_Familiar *in_ECX;
|
|
int candidateType;
|
|
bool isUpdateFrame;
|
|
float fVar2;
|
|
float dx;
|
|
Vector sideOffsetBuf;
|
|
Vector candidatePos;
|
|
int *local_28;
|
|
Entity_Familiar *local_24;
|
|
int *local_20;
|
|
float bestScore;
|
|
float score;
|
|
Entity *bestTarget;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
Game *game;
|
|
Entity_NPC *ownerParent;
|
|
uint32_t *targetSlot;
|
|
|
|
game = g_game;
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af7060;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((in_ECX->_flags & 0x4000) == 0) {
|
|
local_24 = in_ECX;
|
|
bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
if (bVar1 == 0) {
|
|
frameMod = game->_frameCount + in_ECX->_index & 0x80000003;
|
|
isUpdateFrame = frameMod == 0;
|
|
if (GHIDRA_INT(frameMod) < 0) {
|
|
isUpdateFrame = (frameMod - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (isUpdateFrame) {
|
|
targetSlot = &in_ECX->_target;
|
|
target = GHIDRA_CAST<Entity *>(*targetSlot);
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(in_ECX->_player) + 0x340)) - (in_ECX->_pos).y;
|
|
dx = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(in_ECX->_player) + 0x33c)) - (in_ECX->_pos).x;
|
|
fVar2 = sqrtf(fVar2 * fVar2 + dx * dx);
|
|
if (800.0 < fVar2) {
|
|
if (target != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_20 = targetSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*targetSlot = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((target != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((target)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar1 != 0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((in_ECX->_flags & 0x100) == 0) {
|
|
local_20 = GHIDRA_CAST<int *>(0x0);
|
|
bestTarget = GHIDRA_CAST<Entity *>(0x0);
|
|
bestScore = 0.0;
|
|
local_28 = g_game->_room;
|
|
if (local_28[0x499] != 0) {
|
|
do {
|
|
target = *GHIDRA_CAST<Entity **>((local_28[0x497] + GHIDRA_INT(local_20) * 4));
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (target->_type != 1)) {
|
|
candidateType = target->_type;
|
|
if (candidateType - 10U < 0x3de) goto LAB_0063dfb5;
|
|
}
|
|
else {
|
|
candidateType = 1;
|
|
LAB_0063dfb5:
|
|
if ((((target->_entityCollisionClass != 1) && (target->_entityCollisionClass != 0))
|
|
&& (target->_isInvicible == 0)) && (target->_dead == 0)) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((target)))->Entity::HasEntityFlags(0x10);
|
|
familiar = local_24;
|
|
if ((((bVar1 == 0) || (candidateType == 0x322)) || (candidateType == 0x362)) &&
|
|
((bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_24))))->Entity::IsDescendantOf(target), bVar1 == 0 &&
|
|
((target->_flags & 0x20000010) == 0)))) {
|
|
candidatePos.y = (target->_pos).y;
|
|
candidatePos.x = (target->_pos).x;
|
|
bVar1 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&familiar->_pos,&candidatePos,3,0,0,0,
|
|
GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar1 != 0) {
|
|
score = 0.0;
|
|
if (target == GHIDRA_CAST<Entity *>(*targetSlot)) {
|
|
score = 100.0;
|
|
}
|
|
fVar2 = (target->_pos).y - (familiar->_pos).y;
|
|
dx = (target->_pos).x - (familiar->_pos).x;
|
|
fVar2 = sqrtf(fVar2 * fVar2 + dx * dx);
|
|
fVar2 = 100.0 - fVar2;
|
|
if (fVar2 <= 0.0) {
|
|
fVar2 = 0.0;
|
|
}
|
|
score = fVar2 + score;
|
|
if ((bestScore < score) &&
|
|
((sideOffset = FamiliarHelper::fly_head_pick_side_offset
|
|
(familiar,&sideOffsetBuf,target),
|
|
sideOffset->x != g_vectorZero.x || (sideOffset->y != g_vectorZero.y)))) {
|
|
bestScore = score;
|
|
bestTarget = target;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_20 = GHIDRA_CAST<int *>((GHIDRA_INT(local_20) + 1));
|
|
} while (local_20 < GHIDRA_CAST<int *>(local_28[0x499]));
|
|
}
|
|
target = bestTarget;
|
|
if (*targetSlot != 0) {
|
|
local_28 = targetSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_28);
|
|
}
|
|
*targetSlot = target;
|
|
if (target == GHIDRA_CAST<Entity *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
ownerParent = GHIDRA_CAST<Entity_Player *>(*targetSlot);
|
|
if (((ownerParent != GHIDRA_CAST<Entity_Player *>(0x0)) && (ownerParent->_type == 1)) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity_Player *>((ownerParent)))->Entity_Player::HasInvincibility(0,GHIDRA_CAST<EntityRef *>(0x0)), bVar1 != 0)) {
|
|
if (*targetSlot != 0) {
|
|
local_20 = targetSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*targetSlot = 0;
|
|
}
|
|
if ((in_ECX->_flags & 0x4000) != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*targetSlot != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
ownerParent = *GHIDRA_CAST<Entity_NPC **>((GHIDRA_CAST<char *>(in_ECX->_player) + 0x3bc));
|
|
if (ownerParent == GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(ownerParent))))->Entity::IsEnemy();
|
|
if (bVar1 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
target = (GHIDRA_CAST<Entity_NPC *>((ownerParent)))->Entity_NPC::GetPlayerTarget();
|
|
fVar2 = (in_ECX->_pos).y - (target->_pos).y;
|
|
dx = (in_ECX->_pos).x - (target->_pos).x;
|
|
fVar2 = sqrtf(fVar2 * fVar2 + dx * dx);
|
|
if (300.0 < fVar2) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*targetSlot != 0) {
|
|
local_20 = targetSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*targetSlot = target;
|
|
}
|
|
msvc::multiset<unsigned_int>::insert(targetSlot);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0063f9f0
|
|
void Entity_Familiar::ai_blood_oath()
|
|
{
|
|
Entity_Familiar *animState = this;
|
|
uint8_t bVar1;
|
|
char isDamaged;
|
|
uint32_t uVar2;
|
|
uint32_t subType;
|
|
Entity *bloodParticle;
|
|
uint8_t *animName;
|
|
uint32_t uVar3;
|
|
int extraout_ECX;
|
|
uint8_t *stabAnimName;
|
|
int extraout_EDX;
|
|
int iVar4;
|
|
bool bVar5;
|
|
float fVar6;
|
|
code *pcStack_74;
|
|
Vector VStack_70;
|
|
float fStack_68;
|
|
Vector VStack_64;
|
|
Vector pickupVelocity;
|
|
EntityRef damageSource;
|
|
Vector local_2c;
|
|
uint8_t *local_24;
|
|
char *local_20;
|
|
Vector local_1c;
|
|
uint32_t uStack_14;
|
|
uint32_t uStack_10;
|
|
uint32_t local_c;
|
|
AnimationState *animState;
|
|
Manager *manager;
|
|
float playerY;
|
|
float posY;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&pcStack_74);
|
|
local_2c.x = (float)s_Idle;
|
|
local_1c.x = 0.0;
|
|
local_1c.y = 0.0;
|
|
uStack_14 = 10;
|
|
uStack_10 = 4;
|
|
iVar4 = 0;
|
|
local_2c.y = (float)s_Idle2;
|
|
local_24 = &DAT_00b1d43c;
|
|
local_20 = "Idle4";
|
|
fVar6 = (float)animState->_hearts / 23.0;
|
|
if (fVar6 <= 0.5) {
|
|
if (fVar6 <= 0.25) {
|
|
if (0.0 < fVar6) {
|
|
iVar4 = 1;
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = 2;
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = 3;
|
|
}
|
|
switch(animState->_state) {
|
|
case 0:
|
|
animState->_state = 3;
|
|
case 3:
|
|
(GHIDRA_CAST<ANM2 *>((&animState->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>((&local_2c.x)[iVar4]),0);
|
|
fVar6 = (&local_1c.x)[iVar4];
|
|
if ((fVar6 != 0.0) && (uVar3 = Random(), uVar3 % GHIDRA_UINT(fVar6) == 0)) {
|
|
uVar3 = Random();
|
|
Entity_NPC::MakeSplat
|
|
(GHIDRA_CAST<Entity_NPC *>(animState),
|
|
(float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.2);
|
|
}
|
|
break;
|
|
default:
|
|
goto LAB_0064001c;
|
|
case 4:
|
|
(GHIDRA_CAST<ANM2 *>((&animState->_sprite)))->ANM2::Play(&DAT_00b643e8,0);
|
|
animState = &(animState->_sprite)._animState;
|
|
fVar6 = animState->_friction;
|
|
playerY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x340));
|
|
posY = (animState->_pos).y;
|
|
(animState->_velocity).x = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x33c)) - (animState->_pos).x) / fVar6;
|
|
(animState->_velocity).y = (playerY - posY) / fVar6;
|
|
if ((animState->_sprite)._animState._animData == (void *)0x0) {
|
|
return;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0);
|
|
manager = g_manager;
|
|
if (bVar1 == 0) {
|
|
if ((animState->_sprite)._animState._animData == (void *)0x0) {
|
|
return;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::IsEventTriggered(&DAT_00b602f0);
|
|
if (bVar1 == 0) {
|
|
return;
|
|
}
|
|
animState->_state = 5;
|
|
return;
|
|
}
|
|
pcStack_74 = (code *)0x4d;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&pcStack_74));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(pcStack_74),1.0,2,0,1.0,0.0);
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((animState->_player)))->Entity_Player::HasInvincibility(0,GHIDRA_CAST<EntityRef *>(0x0));
|
|
if (bVar1 != 0) {
|
|
return;
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Entity_Player *>((animState->_player)))->Entity_Player::GetHealthType();
|
|
VStack_70.x = 0.0;
|
|
if (extraout_EDX < 1) {
|
|
VStack_70.x = (float)(2 - GHIDRA_UINT((iVar4 != 3)));
|
|
}
|
|
fStack_68 = (float)(*GHIDRA_CAST<int *>((extraout_ECX + 0x1344)) - GHIDRA_INT(VStack_70.x));
|
|
iVar4 = 0;
|
|
animState->_hearts = 0;
|
|
if (0 < GHIDRA_INT(fStack_68)) {
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animState->_player) + 0x1344)) <= GHIDRA_INT(VStack_70.x)) break;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animState->_player) + 0x13bc)) = 0;
|
|
damageSource._position.x = (animState->_pos).x;
|
|
damageSource._position.y = (animState->_pos).y;
|
|
damageSource._velocity.x = (animState->_velocity).x;
|
|
pcStack_74 = *(code **)(*GHIDRA_CAST<int *>(animState->_player) + 0x20);
|
|
damageSource._type = animState->_type;
|
|
damageSource._variant = animState->_variant;
|
|
damageSource._spawnerType = animState->_spawnerType;
|
|
damageSource._spawnerVariant = animState->_spawnerVariant;
|
|
damageSource._velocity.y = (animState->_velocity).y;
|
|
if ((animState->_flags & 0x20000000) == 0) {
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
uVar3 = 2;
|
|
}
|
|
if ((animState->_flags & 0x40000000000000) == 0) {
|
|
uVar2 = 0;
|
|
}
|
|
else {
|
|
uVar2 = 4;
|
|
}
|
|
damageSource._flags = uVar2 | uVar3 | GHIDRA_UINT(((animState->_flags & 0x100) != 0));
|
|
damageSource._entity = animState;
|
|
isDamaged = (*pcStack_74)(0x3f800000,0x2042821,0,&damageSource,0x1e);
|
|
if (isDamaged == '\0') break;
|
|
animState->_hearts = animState->_hearts + 1;
|
|
iVar4 = iVar4 + 1;
|
|
} while (iVar4 < GHIDRA_INT(fStack_68));
|
|
}
|
|
if (0 < animState->_hearts) {
|
|
VStack_64.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x33c));
|
|
VStack_64.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x340));
|
|
Isaac::GetRandomPickupVelocity(&pickupVelocity,&VStack_64,0,GHIDRA_CAST<RNG *>(0x0));
|
|
fStack_68 = pickupVelocity.x + pickupVelocity.x;
|
|
VStack_64.y = pickupVelocity.y + pickupVelocity.y;
|
|
VStack_64.x = fStack_68;
|
|
pickupVelocity.x = VStack_64.y;
|
|
uVar3 = Random();
|
|
VStack_70.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x33c));
|
|
VStack_70.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x340));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,&VStack_70,&VStack_64,GHIDRA_CAST<Entity *>(0x0),3,uVar3,0);
|
|
uVar3 = Random();
|
|
uVar2 = Random();
|
|
iVar4 = 0;
|
|
VStack_64.x = (float)(uVar3 % 3 + 8 + uVar2 % 6);
|
|
if (VStack_64.x != 0.0) {
|
|
do {
|
|
uVar2 = Random();
|
|
VStack_70.x = ((float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)])
|
|
* 2.3283064e-10 * 20.0 - 10.0) * 0.017453292;
|
|
pcStack_74 = (code *)cos(VStack_70.x);
|
|
VStack_70.x = sin(VStack_70.x);
|
|
uVar2 = Random();
|
|
local_1c.y = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
local_1c.x = (fStack_68 * (float)pcStack_74 - pickupVelocity.x * VStack_70.x) * local_1c.y
|
|
;
|
|
local_1c.y = (fStack_68 * VStack_70.x + pickupVelocity.x * (float)pcStack_74) * local_1c.y
|
|
;
|
|
local_2c.x = local_1c.x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x33c));
|
|
local_2c.y = local_1c.y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(animState->_player) + 0x340));
|
|
uVar2 = Random();
|
|
subType = 99;
|
|
if (iVar4 < GHIDRA_INT((uVar3 % 3 + 2))) {
|
|
subType = 0;
|
|
}
|
|
bloodParticle =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,5,&local_2c,&local_1c,GHIDRA_CAST<Entity *>(0x0),subType,uVar2,0);
|
|
bloodParticle->Update();
|
|
iVar4 = iVar4 + 1;
|
|
} while (iVar4 < GHIDRA_INT(VStack_64.x));
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((animState->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar1 != 0) {
|
|
animState->_hearts = animState->_hearts + 4;
|
|
}
|
|
}
|
|
FUN_00640050();
|
|
return;
|
|
case 5:
|
|
if (((animState->_sprite)._animState._animData != (void *)0x0) &&
|
|
((animState->_sprite)._animState._isPlaying == 0)) {
|
|
animName = (animState->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animName + 0x14))) {
|
|
animName = *GHIDRA_CAST<uint8_t **>(animName);
|
|
}
|
|
stabAnimName = &DAT_00b643e8;
|
|
do {
|
|
bVar1 = *animName;
|
|
bVar5 = bVar1 < *stabAnimName;
|
|
if (bVar1 != *stabAnimName) {
|
|
LAB_00640002:
|
|
uVar3 = -GHIDRA_UINT(bVar5) | 1;
|
|
goto LAB_00640007;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = animName[1];
|
|
bVar5 = bVar1 < stabAnimName[1];
|
|
if (bVar1 != stabAnimName[1]) goto LAB_00640002;
|
|
animName = animName + 2;
|
|
stabAnimName = stabAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_00640007:
|
|
if (uVar3 == 0) {
|
|
animState->_state = 3;
|
|
}
|
|
}
|
|
}
|
|
FollowParent(animState);
|
|
LAB_0064001c:
|
|
return;
|
|
}
|
|
|
|
// 006402f0
|
|
void Entity_Familiar::paschal_candle_sync_effects()
|
|
{
|
|
Entity_Player *this_00;
|
|
int i;
|
|
int candleEffect [5];
|
|
void *collectiblesBegin;
|
|
|
|
collectiblesBegin = (g_manager->_itemConfig)._collectibles._begin;
|
|
this_00 = this->_player;
|
|
if ((0x8dc < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectiblesBegin) &
|
|
0xfffffffcU))) &&
|
|
(candleEffect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectiblesBegin) + 0x8dc)), candleEffect[0] != 0)) {
|
|
candleEffect[2] = *GHIDRA_CAST<uint32_t *>((candleEffect[0] + 0x78));
|
|
candleEffect[1] = 0;
|
|
candleEffect[3] = 0;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this_00->_temporaryeffects)))->TemporaryEffects::RemoveEffect(candleEffect,-1);
|
|
this_00 = this->_player;
|
|
}
|
|
collectiblesBegin = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(collectiblesBegin) & 0xfffffffcU))
|
|
< 0x8dd) {
|
|
candleEffect[0] = 0;
|
|
}
|
|
else {
|
|
candleEffect[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(collectiblesBegin) + 0x8dc));
|
|
}
|
|
i = 1;
|
|
candleEffect[3] = 0;
|
|
candleEffect[1] = 1;
|
|
candleEffect[2] = 0;
|
|
if (1 < this->_hearts) {
|
|
do {
|
|
TemporaryEffects::AddEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)),candleEffect,1,1);
|
|
i = i + 1;
|
|
} while (i < this->_hearts);
|
|
this_00 = this->_player;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::EvaluateItems();
|
|
return;
|
|
}
|
|
|
|
// 00640ca0
|
|
void Entity_Familiar::ai_boiled_baby()
|
|
{
|
|
int direction;
|
|
uint8_t bVar1;
|
|
int *piVar2;
|
|
int iVar3;
|
|
Vector *pVVar4;
|
|
uint32_t uVar5;
|
|
uint8_t *animNameChar;
|
|
uint8_t *wantedAnimChar;
|
|
char *shootAnimChar;
|
|
bool bVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
float fVar9;
|
|
float jumpProgress;
|
|
float *frictionPtr;
|
|
Vector local_2c;
|
|
Vector local_24;
|
|
Vector local_1c;
|
|
Room *room;
|
|
Vector local_10;
|
|
float friction;
|
|
void *player;
|
|
|
|
room = g_game->_room;
|
|
player = this->_player;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(player) + 0x1519)) == '\0') {
|
|
for (piVar2 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(player) + 0x150c)); piVar2 != *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(player) + 0x1510));
|
|
piVar2 = piVar2 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar2) == 0) && ((GHIDRA_CAST<int *>(*piVar2))[1] == 0x37)) {
|
|
iVar3 = this->_state;
|
|
piVar2 = &this->_state;
|
|
if (iVar3 == 0) {
|
|
this->_visible = 1;
|
|
*piVar2 = 1;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
this->_coins = 0;
|
|
this->_keys = 1;
|
|
uVar5 = Random();
|
|
this->_hearts = (uVar5 & 3) + 2;
|
|
iVar3 = *piVar2;
|
|
}
|
|
frictionPtr = &this->_friction;
|
|
*frictionPtr = this->_friction * 0.7;
|
|
local_24.x = (float)frictionPtr;
|
|
if (iVar3 == 0) goto LAB_00640d22;
|
|
if (iVar3 == 1) {
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) goto LAB_00641131;
|
|
animNameChar = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animNameChar + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(animNameChar);
|
|
}
|
|
shootAnimChar = "Shoot";
|
|
goto LAB_00641000;
|
|
}
|
|
if (((iVar3 != 2) ||
|
|
((GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b1de1c,0),
|
|
(this->_sprite)._animState._animData == (void *)0x0)) ||
|
|
((this->_sprite)._animState._isPlaying != 0)) goto LAB_00640d9b;
|
|
animNameChar = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animNameChar + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(animNameChar);
|
|
}
|
|
wantedAnimChar = &DAT_00b1de1c;
|
|
goto LAB_00640f80;
|
|
}
|
|
}
|
|
}
|
|
this->_state = 0;
|
|
this->_friction = this->_friction * 0.7;
|
|
LAB_00640d22:
|
|
frictionPtr = &this->_friction;
|
|
this->_visible = 0;
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
(this->_pos).y = fVar8;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_player) + 0x173)) == '\0') {
|
|
iVar3 = this->_fireCooldown;
|
|
if (0 < iVar3) {
|
|
iVar3 = iVar3 + -1;
|
|
this->_fireCooldown = iVar3;
|
|
}
|
|
direction = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x162c));
|
|
if ((direction != -1) && (iVar3 < 1)) {
|
|
bVar1 = 0;
|
|
pVVar4 = Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,direction);
|
|
FireProjectile(this,pVVar4,bVar1);
|
|
this->_fireCooldown = 0x2d;
|
|
}
|
|
}
|
|
goto LAB_00640d9b;
|
|
while( true ) {
|
|
bVar1 = animNameChar[1];
|
|
bVar6 = bVar1 < (uint8_t)shootAnimChar[1];
|
|
if (bVar1 != shootAnimChar[1]) goto LAB_00641020;
|
|
animNameChar = animNameChar + 2;
|
|
shootAnimChar = shootAnimChar + 2;
|
|
if (bVar1 == 0) break;
|
|
LAB_00641000:
|
|
bVar1 = *animNameChar;
|
|
bVar6 = bVar1 < (uint8_t)*shootAnimChar;
|
|
if (bVar1 != *shootAnimChar) {
|
|
LAB_00641020:
|
|
uVar5 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_00641025;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
}
|
|
uVar5 = 0;
|
|
LAB_00641025:
|
|
if (((uVar5 == 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("Shoot"));
|
|
frictionPtr = GHIDRA_CAST<float *>(local_24.x);
|
|
if (bVar1 != 0) {
|
|
iVar3 = this->_target;
|
|
if (iVar3 != 0) {
|
|
fVar8 = *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
local_10.x = *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = (this->_pos).x - fVar8;
|
|
fVar7 = (this->_pos).y - local_10.x;
|
|
fVar7 = sqrtf(fVar7 * fVar7 + fVar9 * fVar9);
|
|
local_1c.x = (*GHIDRA_CAST<float *>((this->_target + 0x360)) * fVar7 * 0.075 + fVar8) - (this->_pos).x;
|
|
local_1c.y = (*GHIDRA_CAST<float *>((this->_target + 0x364)) * fVar7 * 0.075 + local_10.x) -
|
|
(this->_pos).y;
|
|
(GHIDRA_CAST<Vector *>((&local_1c)))->Vector::Normalized(&local_10);
|
|
FireProjectile(this,&local_10,1);
|
|
frictionPtr = GHIDRA_CAST<float *>(local_24.x);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LAB_00641131:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
}
|
|
if ((this->_keys < 1) && (this->_target == 0)) {
|
|
PickEnemyTarget(this,1000.0,1,9,&g_vectorZero,15.0);
|
|
}
|
|
if ((((GHIDRA_CAST<Entity *>(this->_target) == GHIDRA_CAST<Entity *>(0x0)) ||
|
|
((bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_target))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar1 == 0 &&
|
|
(*GHIDRA_CAST<int *>((this->_target + 0x28)) != 1)))) || (this->_hearts < 1)) ||
|
|
(fVar8 = (this->_pos).y - *GHIDRA_CAST<float *>((this->_target + 0x340)),
|
|
fVar7 = (this->_pos).x - *GHIDRA_CAST<float *>((this->_target + 0x33c)),
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7), 180.0 <= fVar8)) {
|
|
LAB_0064122e:
|
|
bVar6 = false;
|
|
}
|
|
else {
|
|
local_10.x = *GHIDRA_CAST<float *>((this->_target + 0x33c));
|
|
local_10.y = *GHIDRA_CAST<float *>((this->_target + 0x340));
|
|
bVar1 = (GHIDRA_CAST<Room *>((room)))->Room::CheckLine(&this->_pos,&local_10,3,999,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar1 == 0) goto LAB_0064122e;
|
|
bVar6 = true;
|
|
}
|
|
iVar3 = this->_keys;
|
|
if ((iVar3 < 1) && (bVar6)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Shoot"),0);
|
|
this->_hearts = this->_hearts + -1;
|
|
this->_keys = 0xf;
|
|
this->_coins = 0x14;
|
|
}
|
|
else if (this->_coins < 1) {
|
|
PickEnemyTarget(this,1000.0,1,9,&g_vectorZero,15.0);
|
|
iVar3 = this->_target;
|
|
if (iVar3 == 0) {
|
|
fVar8 = 80.0;
|
|
local_24.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_2c.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
}
|
|
else {
|
|
fVar8 = (this->_pos).y - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar7 = (this->_pos).x - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar7 * fVar7);
|
|
local_10.x = *GHIDRA_CAST<float *>((iVar3 + 0x360)) * fVar8 * 0.08 + *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
local_1c.x = *GHIDRA_CAST<float *>((iVar3 + 0x364)) * fVar8 * 0.08 + *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
local_24.x = local_10.x - (this->_pos).x;
|
|
local_24.y = local_1c.x - (this->_pos).y;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&local_24)))->Vector::Normalized(&local_2c);
|
|
fVar8 = 10.0;
|
|
local_24.x = pVVar4->x * 60.0 + local_10.x;
|
|
local_2c.x = pVVar4->y * 60.0 + local_1c.x;
|
|
}
|
|
fVar9 = (this->_pos).x - local_24.x;
|
|
fVar7 = (this->_pos).y - local_2c.x;
|
|
local_1c.x = fVar8;
|
|
local_10.x = local_24.x;
|
|
local_10.y = local_2c.x;
|
|
fVar8 = sqrtf(fVar7 * fVar7 + fVar9 * fVar9);
|
|
if (180.0 < fVar8) {
|
|
local_24.x = local_24.x - (this->_pos).x;
|
|
local_24.y = local_2c.x - (this->_pos).y;
|
|
pVVar4 = (GHIDRA_CAST<Vector *>((&local_24)))->Vector::Normalized(&local_2c);
|
|
local_10.x = pVVar4->x * 180.0 + (this->_pos).x;
|
|
local_10.y = pVVar4->y * 180.0 + (this->_pos).y;
|
|
}
|
|
pVVar4 = Room::FindFreePickupSpawnPosition(room,&local_1c,&local_10,local_1c.x,1,0,0);
|
|
(this->_targetPosition).x = pVVar4->x;
|
|
(this->_targetPosition).y = pVVar4->y;
|
|
this->_orbitSpeed = 0.0;
|
|
*piVar2 = 2;
|
|
}
|
|
else {
|
|
if (0 < iVar3) {
|
|
this->_keys = iVar3 + -1;
|
|
}
|
|
this->_coins = this->_coins + -1;
|
|
}
|
|
goto LAB_00640d9b;
|
|
while( true ) {
|
|
bVar1 = animNameChar[1];
|
|
bVar6 = bVar1 < wantedAnimChar[1];
|
|
if (bVar1 != wantedAnimChar[1]) goto LAB_00640fa0;
|
|
animNameChar = animNameChar + 2;
|
|
wantedAnimChar = wantedAnimChar + 2;
|
|
if (bVar1 == 0) break;
|
|
LAB_00640f80:
|
|
bVar1 = *animNameChar;
|
|
bVar6 = bVar1 < *wantedAnimChar;
|
|
if (bVar1 != *wantedAnimChar) {
|
|
LAB_00640fa0:
|
|
uVar5 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_00640fa5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
}
|
|
uVar5 = 0;
|
|
LAB_00640fa5:
|
|
if (uVar5 == 0) {
|
|
*piVar2 = 1;
|
|
this->_coins = 5;
|
|
uVar5 = Random();
|
|
this->_hearts = (uVar5 & 3) + 2;
|
|
}
|
|
LAB_00640d9b:
|
|
iVar3 = this->_state;
|
|
if (((iVar3 != 0) &&
|
|
(((this->_targetPosition).x != g_vectorZero.x || ((this->_targetPosition).y != g_vectorZero.y)
|
|
))) && ((iVar3 == 1 ||
|
|
(((iVar3 == 2 && ((this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
(bVar1 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(s_Jump),
|
|
bVar1 != 0)))))) {
|
|
jumpProgress = this->_orbitSpeed + 0.02;
|
|
this->_orbitSpeed = jumpProgress;
|
|
fVar8 = (this->_pos).x;
|
|
fVar7 = (this->_pos).y;
|
|
fVar9 = (this->_targetPosition).y;
|
|
friction = *frictionPtr;
|
|
(this->_velocity).x =
|
|
((((this->_targetPosition).x - fVar8) * jumpProgress + fVar8) - fVar8) / *frictionPtr;
|
|
(this->_velocity).y = (((fVar9 - fVar7) * jumpProgress + fVar7) - fVar7) / friction;
|
|
if (1.0 <= this->_orbitSpeed) {
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006414c0
|
|
void Entity_Familiar::zhl_misfit_006414c0()
|
|
{
|
|
uint32_t *puVar1;
|
|
ANM2 *pAVar2;
|
|
uint8_t rainbowBlue;
|
|
float *damageEvent;
|
|
Entity_Player *player;
|
|
uint32_t uVar4;
|
|
uint8_t *pbVar5;
|
|
int iVar6;
|
|
uint32_t moveRoll;
|
|
Vector *randomDir;
|
|
Entity_Effect *splat;
|
|
Entity *spawnedEffect;
|
|
uint8_t *pbVar7;
|
|
uint8_t *expectedNameCh;
|
|
bool bVar8;
|
|
float fVar9;
|
|
int *piVar10;
|
|
int *local_4c;
|
|
Vector local_48;
|
|
float local_40;
|
|
int *local_3c;
|
|
Vector local_38;
|
|
uint32_t uStack_30;
|
|
uint32_t uStack_2c;
|
|
uint32_t uStack_28;
|
|
uint32_t uStack_24;
|
|
float fStack_20;
|
|
float fStack_1c;
|
|
float fStack_18;
|
|
float fStack_14;
|
|
uint32_t uStack_10;
|
|
uint32_t uStack_c;
|
|
float *damageEventsEnd;
|
|
float dipX;
|
|
float dipY;
|
|
Game *game;
|
|
Manager *manager;
|
|
int oldHallowedCountdown;
|
|
float playerIdx;
|
|
uint8_t rainbowBlue;
|
|
|
|
local_40 = 1.0;
|
|
this->_entityGridCollisionClass = 5;
|
|
this->_entityCollisionClass = 4;
|
|
if (0.0 < this->_pendingDamage) {
|
|
this->_pendingDamage = 0.0;
|
|
damageEventsEnd = *GHIDRA_CAST<float **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
for (damageEvent = *GHIDRA_CAST<float **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))); damageEvent != damageEventsEnd;
|
|
damageEvent = damageEvent + 0xe) {
|
|
playerIdx = *damageEvent;
|
|
if ((GHIDRA_UINT(damageEvent[2]) & 4) != 0) {
|
|
if (3.5 < playerIdx) {
|
|
playerIdx = 3.5;
|
|
}
|
|
*damageEvent = playerIdx;
|
|
}
|
|
this->_pendingDamage = playerIdx + this->_pendingDamage;
|
|
}
|
|
}
|
|
game = g_game;
|
|
switch(this->_subtype) {
|
|
case 1:
|
|
uVar4 = Random();
|
|
if (uVar4 % 3 == 0) {
|
|
PickEnemyTarget(this,240.0,4,0,&g_vectorZero,15.0);
|
|
}
|
|
break;
|
|
case 3:
|
|
local_40 = 0.8;
|
|
break;
|
|
case 4:
|
|
if ((((this->_flags & 0x4000) == 0) && (rainbowBlue = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), rainbowBlue == 0)) &&
|
|
((~(uint8_t)game->_frameCount & 1) != 0)) {
|
|
uVar4 = Random();
|
|
uVar4 = uVar4 % 6;
|
|
rainbowBlue = (&DAT_00b64475)[uVar4 * 3];
|
|
rainbowBlue = (&DAT_00b64476)[uVar4 * 3];
|
|
(this->_splatColor)._offset[0] = (float)(uint8_t)(&DAT_00b64474)[uVar4 * 3] * 0.003921569;
|
|
(this->_splatColor)._offset[1] = (float)rainbowBlue * 0.003921569;
|
|
(this->_splatColor)._offset[2] = (float)rainbowBlue * 0.003921569;
|
|
}
|
|
break;
|
|
case 6:
|
|
if ((((this->_flags & 0x4000) == 0) && (rainbowBlue = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), rainbowBlue == 0)) &&
|
|
(game->_frameCount % 3 == 0)) {
|
|
local_48.x = 0.0;
|
|
playerIdx = 0.0;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
local_48.x = playerIdx;
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(local_48.x));
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) ||
|
|
(rainbowBlue = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(player)), rainbowBlue != 0)) &&
|
|
(playerIdx = (this->_pos).y - (player->_pos).y,
|
|
fVar9 = (this->_pos).x - (player->_pos).x,
|
|
playerIdx = sqrtf(playerIdx * playerIdx + fVar9 * fVar9),
|
|
playerIdx < player->_size + 23.33)) {
|
|
oldHallowedCountdown = player->_hallowedGroundCountdown;
|
|
iVar6 = oldHallowedCountdown + 4;
|
|
if (4 < iVar6) {
|
|
iVar6 = 4;
|
|
}
|
|
player->_hallowedGroundCountdown = iVar6;
|
|
if (0 < oldHallowedCountdown != 0 < iVar6) {
|
|
player->_cacheFlags = player->_cacheFlags | 99;
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::EvaluateItems();
|
|
}
|
|
}
|
|
local_48.x = (float)(GHIDRA_INT(local_48.x) + 1);
|
|
playerIdx = local_48.x;
|
|
} while (GHIDRA_UINT(local_48.x) <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
}
|
|
puVar1 = &this->_child;
|
|
if (this->_child == 0) {
|
|
uVar4 = Random();
|
|
local_48.x = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x70,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar4,0);
|
|
local_3c = &(GHIDRA_CAST<Entity *>(local_48.x))->_parent;
|
|
if ((GHIDRA_CAST<Entity *>(local_48.x))->_parent != 0) {
|
|
local_4c = local_3c;
|
|
msvc::multiset<unsigned_int>::erase(&local_4c);
|
|
}
|
|
*local_3c = GHIDRA_INT(this);
|
|
msvc::multiset<unsigned_int>::insert(local_3c);
|
|
playerIdx = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_48.x) + 0x33c)))->x;
|
|
fVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_48.x) + 0x33c)))->y;
|
|
dipX = (this->_pos).x;
|
|
dipY = (this->_pos).y;
|
|
iVar6 = *GHIDRA_CAST<int *>(local_48.x);
|
|
((GHIDRA_CAST<Entity *>((GHIDRA_INT(local_48.x) + 0x410)))->_sprite)._filename._buf[0xc] = '\x01';
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_48.x) + 0x48)))->_offset).x = 0.0;
|
|
((GHIDRA_CAST<Entity *>((GHIDRA_INT(local_48.x) + 0x410)))->_sprite)._filename._size = GHIDRA_UINT((playerIdx - dipX));
|
|
((GHIDRA_CAST<Entity *>((GHIDRA_INT(local_48.x) + 0x410)))->_sprite)._filename._capacity = GHIDRA_UINT((fVar9 - dipY));
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_48.x) + 0x48)))->_offset).y = -8.0;
|
|
playerIdx = g_vectorOne.y;
|
|
fVar9 = g_vectorOne.x * 0.33;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_48.x) + 0x354)) = 10000;
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_48.x) + 0x48)))->_scale).x = fVar9;
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_48.x) + 0x48)))->_scale).y = playerIdx * 0.33;
|
|
(**(code **)(iVar6 + 0xc))();
|
|
if (*puVar1 != 0) {
|
|
local_3c = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_3c);
|
|
}
|
|
*puVar1 = local_48.x;
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
}
|
|
}
|
|
if ((this->_subtype != 1) && (uVar4 = Random(), uVar4 % 10 == 0)) {
|
|
PickEnemyTarget(this,40.0,4,0,&g_vectorZero,15.0);
|
|
}
|
|
if (this->_target == 0) {
|
|
this->_headFrameDelay = 0;
|
|
}
|
|
iVar6 = this->_state;
|
|
if (iVar6 == 0) {
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (pbVar5 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00641d0e:
|
|
rainbowBlue = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if (rainbowBlue != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar7 = pbVar5;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
pbVar7 = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
expectedNameCh = s_Idle;
|
|
do {
|
|
rainbowBlue = *pbVar7;
|
|
bVar8 = rainbowBlue < *expectedNameCh;
|
|
if (rainbowBlue != *expectedNameCh) {
|
|
LAB_00641cf0:
|
|
uVar4 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_00641cf5;
|
|
}
|
|
if (rainbowBlue == 0) break;
|
|
rainbowBlue = pbVar7[1];
|
|
bVar8 = rainbowBlue < expectedNameCh[1];
|
|
if (rainbowBlue != expectedNameCh[1]) goto LAB_00641cf0;
|
|
pbVar7 = pbVar7 + 2;
|
|
expectedNameCh = expectedNameCh + 2;
|
|
} while (rainbowBlue != 0);
|
|
uVar4 = 0;
|
|
LAB_00641cf5:
|
|
if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_00641d0e;
|
|
}
|
|
uVar4 = 10;
|
|
if (this->_subtype == 0xc) {
|
|
uVar4 = 0x14;
|
|
}
|
|
else if (this->_subtype == 0xd) {
|
|
uVar4 = 3;
|
|
}
|
|
moveRoll = Random();
|
|
if ((moveRoll % uVar4 == 0) && (this->_visible != 0)) {
|
|
puVar1 = &this->_target;
|
|
if ((this->_subtype != 1) &&
|
|
(((*puVar1 != 0 && (this->_headFrameDelay == 0)) && (uVar4 = Random(), (uVar4 & 3) == 0))))
|
|
{
|
|
if (*puVar1 != 0) {
|
|
local_3c = puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_3c);
|
|
}
|
|
*puVar1 = 0;
|
|
}
|
|
local_48.x = (float)*puVar1;
|
|
if ((void *)local_48.x == (void *)0x0) {
|
|
local_48.x = (float)this->_player;
|
|
}
|
|
playerIdx = local_48.x;
|
|
local_38.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_48.x) + 0x340));
|
|
local_38.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_48.x) + 0x33c));
|
|
rainbowBlue = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&this->_pos,&local_38,1,999,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (rainbowBlue == 0) {
|
|
local_38.x = this->_friction;
|
|
local_3c = GHIDRA_CAST<int *>((this->_velocity).x);
|
|
local_4c = GHIDRA_CAST<int *>((this->_velocity).y);
|
|
(GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(&this->_pathfinder))))->PathFinder::Reset();
|
|
local_48.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_48.x) + 0x340));
|
|
local_48.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_48.x) + 0x33c));
|
|
PathFinder::FindGridPath(GHIDRA_CAST<PathFinder *>(&this->_pathfinder),&local_48,1.0,0,1);
|
|
playerIdx = (this->_velocity).x;
|
|
fVar9 = (this->_pos).y + (this->_velocity).y;
|
|
(this->_velocity).x = (float)local_3c;
|
|
(this->_velocity).y = (float)local_4c;
|
|
this->_friction = local_38.x;
|
|
piVar10 = GHIDRA_CAST<int *>((playerIdx + (this->_pos).x));
|
|
}
|
|
else {
|
|
piVar10 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(playerIdx) + 0x33c));
|
|
fVar9 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(playerIdx) + 0x340));
|
|
local_4c = piVar10;
|
|
local_48.x = fVar9;
|
|
if ((void *)playerIdx == this->_player) {
|
|
randomDir = MusicManager::RandomVector(&local_38);
|
|
uVar4 = Random();
|
|
playerIdx = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 80.0;
|
|
fVar9 = local_48.x + playerIdx * randomDir->y;
|
|
piVar10 = GHIDRA_CAST<int *>(((float)local_4c + playerIdx * randomDir->x));
|
|
}
|
|
else if (this->_subtype == 1) {
|
|
local_40 = 2.0;
|
|
}
|
|
}
|
|
playerIdx = (this->_pos).x;
|
|
if ((playerIdx == (float)piVar10) && ((this->_pos).y == fVar9)) {
|
|
uVar4 = Random();
|
|
local_38.x = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_38.x = local_38.x + local_38.x;
|
|
local_48.x = sin(local_38.x);
|
|
local_4c = GHIDRA_CAST<int *>(cos(local_38.x));
|
|
}
|
|
else {
|
|
local_48.x = fVar9 - (this->_pos).y;
|
|
local_4c = GHIDRA_CAST<int *>(((float)piVar10 - playerIdx));
|
|
playerIdx = sqrtf((float)local_4c * (float)local_4c + local_48.x * local_48.x);
|
|
if (0.0 < playerIdx) {
|
|
local_4c = GHIDRA_CAST<int *>(((float)local_4c * (1.0 / playerIdx)));
|
|
local_48.x = local_48.x * (1.0 / playerIdx);
|
|
}
|
|
}
|
|
uVar4 = Random();
|
|
playerIdx = this->_friction;
|
|
fVar9 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0 + 5.0;
|
|
(this->_velocity).y = (fVar9 * local_48.x * local_40) / playerIdx + (this->_velocity).y;
|
|
(this->_velocity).x = (fVar9 * (float)local_4c * local_40) / playerIdx + (this->_velocity).x;
|
|
this->_state = 1;
|
|
}
|
|
playerIdx = this->_friction * 0.8;
|
|
LAB_006420cf:
|
|
this->_friction = playerIdx;
|
|
}
|
|
else {
|
|
if (iVar6 == 1) {
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (pbVar5 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00641c4e:
|
|
rainbowBlue = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1d6fc,1);
|
|
if (rainbowBlue != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar7 = pbVar5;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
pbVar7 = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
expectedNameCh = &DAT_00b1d6fc;
|
|
do {
|
|
rainbowBlue = *pbVar7;
|
|
bVar8 = rainbowBlue < *expectedNameCh;
|
|
if (rainbowBlue != *expectedNameCh) {
|
|
LAB_00641c30:
|
|
uVar4 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_00641c35;
|
|
}
|
|
if (rainbowBlue == 0) break;
|
|
rainbowBlue = pbVar7[1];
|
|
bVar8 = rainbowBlue < expectedNameCh[1];
|
|
if (rainbowBlue != expectedNameCh[1]) goto LAB_00641c30;
|
|
pbVar7 = pbVar7 + 2;
|
|
expectedNameCh = expectedNameCh + 2;
|
|
} while (rainbowBlue != 0);
|
|
uVar4 = 0;
|
|
LAB_00641c35:
|
|
if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_00641c4e;
|
|
}
|
|
playerIdx = (this->_velocity).y;
|
|
fVar9 = (this->_velocity).x;
|
|
if (fVar9 * fVar9 + playerIdx * playerIdx < 1.0) {
|
|
this->_state = 0;
|
|
}
|
|
playerIdx = this->_friction * 0.95;
|
|
goto LAB_006420cf;
|
|
}
|
|
if (iVar6 == 2) {
|
|
pbVar5 = (this->_sprite)._animState._animData;
|
|
if (pbVar5 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00641976:
|
|
rainbowBlue = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1d6fc,1);
|
|
if (rainbowBlue != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<uint8_t **>(pbVar5);
|
|
}
|
|
pbVar7 = &DAT_00b1d6fc;
|
|
do {
|
|
rainbowBlue = *pbVar5;
|
|
bVar8 = rainbowBlue < *pbVar7;
|
|
if (rainbowBlue != *pbVar7) {
|
|
LAB_00641956:
|
|
uVar4 = -GHIDRA_UINT(bVar8) | 1;
|
|
goto LAB_0064195b;
|
|
}
|
|
if (rainbowBlue == 0) break;
|
|
rainbowBlue = pbVar5[1];
|
|
bVar8 = rainbowBlue < pbVar7[1];
|
|
if (rainbowBlue != pbVar7[1]) goto LAB_00641956;
|
|
pbVar5 = pbVar5 + 2;
|
|
pbVar7 = pbVar7 + 2;
|
|
} while (rainbowBlue != 0);
|
|
uVar4 = 0;
|
|
LAB_0064195b:
|
|
if ((uVar4 != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00641976;
|
|
}
|
|
if (((this->_targetPosition).x == g_vectorZero.x) &&
|
|
((this->_targetPosition).y == g_vectorZero.y)) {
|
|
playerIdx = this->_orbitSpeed + 0.7;
|
|
this->_orbitSpeed = playerIdx;
|
|
fVar9 = playerIdx + (this->_posOffset).y;
|
|
(this->_posOffset).y = fVar9;
|
|
if (-26.0 <= fVar9) {
|
|
this->_entityGridCollisionClass = (fVar9 < -3.0) + 5;
|
|
}
|
|
else {
|
|
this->_entityGridCollisionClass = 3;
|
|
}
|
|
}
|
|
else {
|
|
this->_entityGridCollisionClass = 3;
|
|
this->_entityCollisionClass = 0;
|
|
(this->_velocity).x = (this->_orbitDistance).x;
|
|
(this->_velocity).y = (this->_orbitDistance).y;
|
|
playerIdx = this->_orbitSpeed + 0.7;
|
|
this->_orbitSpeed = playerIdx;
|
|
fVar9 = playerIdx + (this->_posOffset).y;
|
|
(this->_posOffset).y = fVar9;
|
|
}
|
|
if (-playerIdx < fVar9) {
|
|
if (((this->_targetPosition).x == g_vectorZero.x) &&
|
|
((this->_targetPosition).y == g_vectorZero.y)) {
|
|
local_38.x = (this->_pos).x;
|
|
local_38.y = (this->_pos).y;
|
|
iVar6 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridCollisionAtPos(this->_pos);
|
|
if (iVar6 == 1) {
|
|
uVar4 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar4,0);
|
|
this->Remove();
|
|
return;
|
|
}
|
|
if ((this->_target != 0) ||
|
|
(PickEnemyTarget(this,80.0,1,0,&g_vectorZero,15.0), this->_target != 0)) {
|
|
this->_headFrameDelay = 1;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
(this->_posOffset).y = 0.0;
|
|
this->_orbitSpeed = 0.0;
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
this->_state = 0;
|
|
if (this->_subtype == 0xc) {
|
|
local_40 = 6.82432e-43;
|
|
}
|
|
else {
|
|
local_40 = 3.61535e-43;
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_40));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_40),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
uVar4 = Random();
|
|
if ((uVar4 % 0x14 == 0) && (this->_subtype != 0xc)) {
|
|
uVar4 = Random();
|
|
splat = Entity_NPC::MakeSplat
|
|
(GHIDRA_CAST<Entity_NPC *>(this),
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 0.2);
|
|
splat->SetColor(&this->_splatColor,0xffffffff,0xff,0,1);
|
|
}
|
|
game = g_game;
|
|
if (this->_dead == 0) {
|
|
iVar6 = this->_subtype;
|
|
if (iVar6 == 1) {
|
|
if (g_game->_frameCount - this->_spawnFrame < 0x1c2) {
|
|
fVar9 = this->_health + 0.03;
|
|
playerIdx = this->_maxHitPoints;
|
|
if (fVar9 <= playerIdx) {
|
|
playerIdx = fVar9;
|
|
}
|
|
this->_health = playerIdx;
|
|
}
|
|
else {
|
|
uStack_30 = 0;
|
|
uStack_2c = 0;
|
|
uStack_28 = 0;
|
|
uStack_24 = 0;
|
|
fStack_20 = g_vectorZero.x;
|
|
fStack_1c = g_vectorZero.y;
|
|
fStack_18 = g_vectorZero.x;
|
|
fStack_14 = g_vectorZero.y;
|
|
uStack_10 = 0;
|
|
uStack_c = 0;
|
|
this->Kill(&uStack_30);
|
|
}
|
|
}
|
|
else {
|
|
if (iVar6 == 5) {
|
|
if (((this->_flags & 0x4000) != 0) || (rainbowBlue = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), rainbowBlue != 0))
|
|
goto LAB_0064243e;
|
|
uVar4 = game->_frameCount + this->_index & 0x80000003;
|
|
bVar8 = uVar4 == 0;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
bVar8 = (uVar4 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if ((!bVar8) || (uVar4 = Random(), (uVar4 & 1) != 0)) goto LAB_0064243e;
|
|
uVar4 = Random();
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x2d,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4,0);
|
|
uVar4 = Random();
|
|
playerIdx = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.4;
|
|
fVar9 = playerIdx * g_vectorOne.y;
|
|
playerIdx = playerIdx * g_vectorOne.x;
|
|
pAVar2 = &spawnedEffect[1]._sprite;
|
|
(pAVar2->_filename)._buf[4] = 'Z';
|
|
(pAVar2->_filename)._buf[5] = '\0';
|
|
(pAVar2->_filename)._buf[6] = '\0';
|
|
(pAVar2->_filename)._buf[7] = '\0';
|
|
(spawnedEffect->_sprite)._scale.y = fVar9;
|
|
pAVar2 = &spawnedEffect[1]._sprite;
|
|
(pAVar2->_filename)._buf[8] = 'Z';
|
|
(pAVar2->_filename)._buf[9] = '\0';
|
|
(pAVar2->_filename)._buf[10] = '\0';
|
|
(pAVar2->_filename)._buf[0xb] = '\0';
|
|
(spawnedEffect->_sprite)._scale.x = playerIdx;
|
|
}
|
|
else {
|
|
if (((iVar6 != 0xe) || ((this->_flags & 0x4000) != 0)) ||
|
|
(rainbowBlue = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), rainbowBlue != 0)) goto LAB_0064243e;
|
|
uVar4 = game->_frameCount + this->_index & 0x80000007;
|
|
bVar8 = uVar4 == 0;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
bVar8 = (uVar4 - 1 | 0xfffffff8) == 0xffffffff;
|
|
}
|
|
if ((!bVar8) || (uVar4 = Random(), uVar4 % 3 != 0)) goto LAB_0064243e;
|
|
uVar4 = Random();
|
|
spawnedEffect =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x8d,&this->_pos,&g_vectorZero,this->_player,0,uVar4,0);
|
|
uVar4 = Random();
|
|
playerIdx = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.5;
|
|
fVar9 = playerIdx * g_vectorOne.y;
|
|
playerIdx = playerIdx * g_vectorOne.x;
|
|
pAVar2 = &spawnedEffect[1]._sprite;
|
|
(pAVar2->_filename)._buf[4] = '<';
|
|
(pAVar2->_filename)._buf[5] = '\0';
|
|
(pAVar2->_filename)._buf[6] = '\0';
|
|
(pAVar2->_filename)._buf[7] = '\0';
|
|
(spawnedEffect->_sprite)._scale.y = fVar9;
|
|
pAVar2 = &spawnedEffect[1]._sprite;
|
|
(pAVar2->_filename)._buf[8] = '<';
|
|
(pAVar2->_filename)._buf[9] = '\0';
|
|
(pAVar2->_filename)._buf[10] = '\0';
|
|
(pAVar2->_filename)._buf[0xb] = '\0';
|
|
(spawnedEffect->_sprite)._scale.x = playerIdx;
|
|
spawnedEffect->SetCollisionDamage(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x157c)) * 0.5);
|
|
}
|
|
spawnedEffect->Update();
|
|
}
|
|
}
|
|
LAB_0064243e:
|
|
if ((0.0 < this->_pendingDamage) &&
|
|
(rainbowBlue = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0), rainbowBlue != 0)) {
|
|
this->_pendingDamage = 0.0;
|
|
damageEventsEnd = *GHIDRA_CAST<float **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
for (damageEvent = *GHIDRA_CAST<float **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))); damageEvent != damageEventsEnd;
|
|
damageEvent = damageEvent + 0xe) {
|
|
playerIdx = *damageEvent;
|
|
*damageEvent = playerIdx * 0.5;
|
|
this->_pendingDamage = playerIdx * 0.5 + this->_pendingDamage;
|
|
}
|
|
}
|
|
(this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0;
|
|
return;
|
|
}
|
|
|
|
// 006424d0
|
|
void Entity_Familiar::ai_bird_cage()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *curAnimName;
|
|
uint32_t uVar2;
|
|
Vector *pVVar3;
|
|
Entity *tmpEntity;
|
|
char *expectedAnimName;
|
|
Entity **targetRef;
|
|
bool isLess;
|
|
float fVar4;
|
|
float fVar5;
|
|
float targetDy;
|
|
Entity *local_3c;
|
|
Vector local_38;
|
|
Vector local_30;
|
|
float enemyDistance;
|
|
int deathmatchMode;
|
|
Entity *local_20;
|
|
uint32_t *local_1c;
|
|
float local_18;
|
|
float awayDirY;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
uint8_t *animData;
|
|
Manager *manager;
|
|
uint32_t *parentRef;
|
|
int target;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af7060;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
switch(this->_state) {
|
|
case 0:
|
|
PickEnemyTarget(this,10000.0,0,5,&g_vectorZero,15.0);
|
|
target = this->_target;
|
|
if (target != 0) {
|
|
fVar5 = *GHIDRA_CAST<float *>((target + 0x340));
|
|
(this->_targetPosition).x = *GHIDRA_CAST<float *>((target + 0x33c));
|
|
(this->_targetPosition).y = fVar5;
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1e0e4,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
this->_state = 1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedAnimName = "Flying";
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
isLess = bVar1 < (uint8_t)*expectedAnimName;
|
|
if (bVar1 != *expectedAnimName) {
|
|
LAB_006425d0:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_006425d5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
isLess = bVar1 < (uint8_t)expectedAnimName[1];
|
|
if (bVar1 != expectedAnimName[1]) goto LAB_006425d0;
|
|
curAnimName = curAnimName + 2;
|
|
expectedAnimName = expectedAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_006425d5:
|
|
if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_00642608;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Flying"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_00642608:
|
|
this->_state = 3;
|
|
ExceptionList = local_10;
|
|
return;
|
|
case 1:
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00642686:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("JumpDown"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedAnimName = "JumpDown";
|
|
do {
|
|
bVar1 = *curAnimName;
|
|
isLess = bVar1 < (uint8_t)*expectedAnimName;
|
|
if (bVar1 != *expectedAnimName) {
|
|
LAB_00642670:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00642675;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimName[1];
|
|
isLess = bVar1 < (uint8_t)expectedAnimName[1];
|
|
if (bVar1 != expectedAnimName[1]) goto LAB_00642670;
|
|
curAnimName = curAnimName + 2;
|
|
expectedAnimName = expectedAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_00642675:
|
|
if ((uVar2 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_00642686;
|
|
}
|
|
this->_state = 2;
|
|
}
|
|
target = this->_target;
|
|
local_20 = GHIDRA_CAST<Entity *>(&this->_target);
|
|
if (target == 0) goto LAB_00642705;
|
|
if (*GHIDRA_CAST<char *>((target + 0x173)) == '\0') {
|
|
fVar5 = *GHIDRA_CAST<float *>((target + 0x340));
|
|
(this->_targetPosition).x = *GHIDRA_CAST<float *>((target + 0x33c));
|
|
(this->_targetPosition).y = fVar5;
|
|
goto LAB_00642705;
|
|
}
|
|
targetRef = &local_20;
|
|
break;
|
|
case 2:
|
|
pVVar3 = &this->_pos;
|
|
pVVar3->x = (this->_targetPosition).x;
|
|
(this->_pos).y = (this->_targetPosition).y;
|
|
if ((this->_sprite)._animState._animData == (void *)0x0) {
|
|
LAB_00642bca:
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Flying"),0);
|
|
this->_state = 3;
|
|
}
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0);
|
|
manager = g_manager;
|
|
if (bVar1 == 0) goto LAB_00642bca;
|
|
local_18 = 7.28675e-44;
|
|
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);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::BombDamage(pVVar3,45.0,24.0,1,this->_player,(BitSet128)ZEXT816(0),4,0);
|
|
uVar2 = Random();
|
|
local_3c = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x48,pVVar3,&g_vectorZero,this->_player,0,uVar2,0);
|
|
parentRef = &local_3c->_parent;
|
|
if (local_3c->_parent != 0) {
|
|
local_20 = GHIDRA_CAST<Entity *>(parentRef);
|
|
msvc::multiset<unsigned_int>::erase(&local_20);
|
|
}
|
|
*parentRef = this;
|
|
msvc::multiset<unsigned_int>::insert(parentRef);
|
|
awayDirY = 0.0;
|
|
local_18 = 0.0;
|
|
local_20 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(g_game->_room) + 0x1264));
|
|
if (local_20 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
deathmatchMode = *GHIDRA_CAST<int *>(&g_game->_deathmatchManager);
|
|
local_1c = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(g_game->_room) + 0x125c));
|
|
do {
|
|
tmpEntity = GHIDRA_CAST<Entity *>(*local_1c);
|
|
local_38.y = (tmpEntity->_pos).y - (this->_pos).y;
|
|
local_30.y = (tmpEntity->_pos).x - (this->_pos).x;
|
|
enemyDistance = sqrtf(local_30.y * local_30.y + local_38.y * local_38.y);
|
|
if ((deathmatchMode < 2) || (tmpEntity->_type != 1)) {
|
|
target = tmpEntity->_type;
|
|
if (target - 10U < 0x3de) goto LAB_006428f9;
|
|
}
|
|
else {
|
|
target = 1;
|
|
LAB_006428f9:
|
|
if ((((((tmpEntity->_entityCollisionClass != 1) &&
|
|
(tmpEntity->_entityCollisionClass != 0)) && (tmpEntity->_isInvicible == 0)) &&
|
|
(tmpEntity->_dead == 0)) &&
|
|
(((bVar1 = (GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::HasEntityFlags(0x10), bVar1 == 0 || (target == 0x322))
|
|
|| (target == 0x362)))) && ((enemyDistance <= 256.0 && (0.0 < enemyDistance)))) {
|
|
local_18 = local_30.y / enemyDistance + local_18;
|
|
awayDirY = local_38.y / enemyDistance + awayDirY;
|
|
}
|
|
}
|
|
local_1c = local_1c + 1;
|
|
local_20 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_20[-1])) + 0x40f))));
|
|
} while (local_20 != GHIDRA_CAST<Entity *>(0x0));
|
|
local_20 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
fVar4 = awayDirY;
|
|
fVar5 = local_18;
|
|
if (awayDirY * awayDirY + local_18 * local_18 < 0.001) {
|
|
pVVar3 = MusicManager::RandomVector(&local_38);
|
|
fVar5 = pVVar3->x;
|
|
fVar4 = pVVar3->y;
|
|
}
|
|
local_18 = atan2f(fVar4,fVar5);
|
|
local_18 = local_18 * 57.295776;
|
|
target = *GHIDRA_CAST<int *>(local_3c);
|
|
*GHIDRA_CAST<float *>((local_3c[1]._sprite._animDefaultName._buf + 4)) = local_18;
|
|
(**(code **)(target + 0xc))();
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (bVar1 != 0) {
|
|
local_20 = GHIDRA_CAST<Entity *>(0x3);
|
|
do {
|
|
local_18 = local_18 + 90.0;
|
|
uVar2 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x48,&this->_pos,&g_vectorZero,this->_player,0,uVar2
|
|
,0);
|
|
parentRef = &tmpEntity->_parent;
|
|
if (tmpEntity->_parent != 0) {
|
|
local_3c = GHIDRA_CAST<Entity *>(parentRef);
|
|
msvc::multiset<unsigned_int>::erase(&local_3c);
|
|
}
|
|
*parentRef = this;
|
|
msvc::multiset<unsigned_int>::insert(parentRef);
|
|
target = *GHIDRA_CAST<int *>(tmpEntity);
|
|
*GHIDRA_CAST<float *>((tmpEntity[1]._sprite._animDefaultName._buf + 4)) = local_18;
|
|
(**(code **)(target + 0xc))();
|
|
local_20 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_20[-1])) + 0x40f))));
|
|
} while (local_20 != GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
target = 4;
|
|
do {
|
|
uVar2 = Random();
|
|
local_3c = (Entity *)
|
|
((float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10 * 360.0 * 0.017453292);
|
|
local_20 = GHIDRA_CAST<Entity *>(cos((float)local_3c));
|
|
local_1c = GHIDRA_CAST<uint32_t *>(sin((float)local_3c));
|
|
uVar2 = Random();
|
|
fVar5 = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
local_30.y = fVar5 * (float)local_1c * 12.0 + (this->_pos).y;
|
|
local_30.x = fVar5 * (float)local_20 * 12.0 + (this->_pos).x;
|
|
uVar2 = Random();
|
|
local_38.x = (float)local_20 * 5.0;
|
|
local_38.y = (float)local_1c * 5.0;
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,4,&local_30,&local_38,GHIDRA_CAST<Entity *>(0x0),0,uVar2,0);
|
|
tmpEntity->Update();
|
|
target = target + -1;
|
|
} while (target != 0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0xc);
|
|
}
|
|
target = this->_target;
|
|
local_3c = GHIDRA_CAST<Entity *>(&this->_target);
|
|
if (target == 0) goto LAB_00642705;
|
|
if (*GHIDRA_CAST<char *>((target + 0x173)) == '\0') {
|
|
fVar5 = *GHIDRA_CAST<float *>((target + 0x340));
|
|
fVar4 = *GHIDRA_CAST<float *>((target + 0x33c)) - (this->_targetPosition).x;
|
|
targetDy = fVar5 - (this->_targetPosition).y;
|
|
if (targetDy * targetDy + fVar4 * fVar4 < 10000.0) {
|
|
(this->_targetPosition).x = *GHIDRA_CAST<float *>((target + 0x33c));
|
|
(this->_targetPosition).y = fVar5;
|
|
}
|
|
goto LAB_00642705;
|
|
}
|
|
targetRef = &local_3c;
|
|
break;
|
|
case 3:
|
|
ai_flying_bird(this,__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
|
default:
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
msvc::multiset<unsigned_int>::erase(targetRef);
|
|
this->_target = 0;
|
|
LAB_00642705:
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006431d0
|
|
void Entity_Familiar::ai_bot_fly()
|
|
{
|
|
BitSet128 flags;
|
|
uint8_t bVar1;
|
|
uint8_t *pbVar2;
|
|
uint32_t uVar3;
|
|
Entity *projectile;
|
|
Entity_Tear *tear;
|
|
char *pcVar4;
|
|
uint8_t *pbVar5;
|
|
int *targetRef;
|
|
bool isLess;
|
|
float fVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
float fVar9;
|
|
uint32_t *puVar10;
|
|
float fVar11;
|
|
float local_3c;
|
|
uint32_t *local_34;
|
|
Vector local_30;
|
|
uint32_t uStack_28;
|
|
int *local_14 [4];
|
|
int target;
|
|
float *targetPosX;
|
|
|
|
pcVar4 = GHIDRA_CAST<char *>(this);
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
pbVar2 = (this->_sprite)._animState._animData;
|
|
if (pbVar2 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar2 = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pcVar4 = "Attack";
|
|
do {
|
|
bVar1 = *pbVar2;
|
|
isLess = bVar1 < (uint8_t)*pcVar4;
|
|
if (bVar1 != *pcVar4) {
|
|
LAB_00643230:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00643235;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar2[1];
|
|
isLess = bVar1 < (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((uint8_t)(GHIDRA_CAST<Entity_Familiar *>(pcVar4)))) + 0x1)));
|
|
if (bVar1 != (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Familiar *>(pcVar4)))) + 0x1)))) goto LAB_00643230;
|
|
pbVar2 = pbVar2 + 2;
|
|
pcVar4 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Familiar *>(pcVar4)))) + 0x2)));
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_00643235:
|
|
if (uVar3 == 0) {
|
|
target_threatening_projectile(this,128.0,GHIDRA_INT(pcVar4),1);
|
|
targetRef = &this->_target;
|
|
if (this->_target != 0) {
|
|
fVar6 = (this->_pos).x;
|
|
targetPosX = GHIDRA_CAST<float *>((this->_target + 0x33c));
|
|
(this->_sprite)._flipX = *targetPosX <= fVar6 && fVar6 != *targetPosX;
|
|
}
|
|
if ((this->_sprite)._animState._animData == (void *)0x0) {
|
|
return;
|
|
}
|
|
local_14[0] = targetRef;
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("Shoot"));
|
|
if (bVar1 == 0) {
|
|
return;
|
|
}
|
|
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (uVar3 = Random(), uVar3 % 3 != 0)) {
|
|
return;
|
|
}
|
|
target = *targetRef;
|
|
if (target == 0) {
|
|
if ((this->_sprite)._flipX == 0) {
|
|
fVar6 = 15.0;
|
|
}
|
|
else {
|
|
fVar6 = -15.0;
|
|
}
|
|
local_30.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x360)) * 0.6;
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x364)) * 0.6;
|
|
local_30.x = local_30.x + local_30.x;
|
|
local_34 = GHIDRA_CAST<uint32_t *>((fVar8 + fVar8));
|
|
local_3c = 0.0;
|
|
fVar8 = sqrtf(fVar6 * fVar6 + 0.0);
|
|
if (fVar8 <= 0.0) {
|
|
fVar9 = local_3c;
|
|
fVar11 = fVar6;
|
|
}
|
|
else {
|
|
fVar9 = (1.0 / fVar8) * 0.0;
|
|
fVar11 = (1.0 / fVar8) * fVar6;
|
|
}
|
|
fVar7 = 0.0;
|
|
local_3c = fVar6;
|
|
if (0.0 < fVar8) {
|
|
fVar7 = (1.0 / fVar8) * 0.0;
|
|
local_3c = (1.0 / fVar8) * fVar6;
|
|
}
|
|
fVar8 = (float)local_34 * fVar7 + local_30.x * local_3c;
|
|
fVar9 = fVar9 * fVar8;
|
|
fVar11 = fVar11 * fVar8;
|
|
puVar10 = local_34;
|
|
if (fVar11 * fVar6 + fVar9 * 0.0 < 0.0) {
|
|
local_30.x = local_30.x - fVar11;
|
|
puVar10 = GHIDRA_CAST<uint32_t *>(((float)local_34 - fVar9));
|
|
}
|
|
local_30.y = (float)puVar10 + 0.0;
|
|
fVar6 = local_30.x + fVar6;
|
|
}
|
|
else {
|
|
fVar6 = (this->_pos).y - *GHIDRA_CAST<float *>((target + 0x340));
|
|
fVar8 = (this->_pos).x - *GHIDRA_CAST<float *>((target + 0x33c));
|
|
fVar6 = sqrtf(fVar6 * fVar6 + fVar8 * fVar8);
|
|
target = *targetRef;
|
|
fVar9 = (fVar6 * 0.05 * *GHIDRA_CAST<float *>((target + 0x364)) + *GHIDRA_CAST<float *>((target + 0x340))) -
|
|
(this->_pos).y;
|
|
fVar6 = (fVar6 * 0.05 * *GHIDRA_CAST<float *>((target + 0x360)) + *GHIDRA_CAST<float *>((target + 0x33c))) -
|
|
(this->_pos).x;
|
|
fVar8 = sqrtf(fVar9 * fVar9 + fVar6 * fVar6);
|
|
if (fVar8 <= 0.0) {
|
|
local_30.y = fVar9;
|
|
}
|
|
else {
|
|
fVar6 = fVar6 * (15.0 / fVar8);
|
|
local_30.y = fVar9 * (15.0 / fVar8);
|
|
}
|
|
}
|
|
local_30.x = fVar6;
|
|
if ((this->_flags & 0x100) == 0) {
|
|
uVar3 = Random();
|
|
tear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,10,&this->_pos,&local_30,GHIDRA_CAST<Entity *>(this),0,uVar3,0);
|
|
tear->SetCollisionDamage(0x40400000);
|
|
local_30.x = (float)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagShielded._l)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4))) |
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4))));
|
|
uStack_28 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagShielded._h)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4))) |
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4)));
|
|
local_34 = (uint32_t *)
|
|
(GHIDRA_UINT(g_tearFlagShielded._l) | GHIDRA_UINT(g_tearFlagSpectral._l) |
|
|
GHIDRA_UINT(g_tearFlagHoming._l));
|
|
local_30.y = (float)(GHIDRA_UINT(g_tearFlagShielded._h) | GHIDRA_UINT(g_tearFlagSpectral._h) |
|
|
GHIDRA_UINT(g_tearFlagHoming._h));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = local_30.x;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = local_34;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = local_30.y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = uStack_28;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::SetTearFlags(flags);
|
|
tear->_baseScale = 0.8;
|
|
tear->_fScale = 0.8;
|
|
(GHIDRA_CAST<Entity_Tear *>((tear)))->Entity_Tear::ResetSpriteScale();
|
|
tear->_fallingAccel = 0.2;
|
|
target = this->_target;
|
|
if (target != 0) {
|
|
if (tear->_target != 0) {
|
|
local_34 = &tear->_target;
|
|
msvc::multiset<unsigned_int>::erase(&local_34);
|
|
}
|
|
tear->_target = target;
|
|
msvc::multiset<unsigned_int>::insert(&tear->_target);
|
|
}
|
|
tear->Update();
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::convert_shot_for_enemy_owner(GHIDRA_CAST<Entity *>(tear));
|
|
targetRef = local_14[0];
|
|
}
|
|
else {
|
|
uVar3 = Random();
|
|
projectile = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(9,0,&this->_pos,&local_30,GHIDRA_CAST<Entity *>(this),0,uVar3,0);
|
|
target = *GHIDRA_CAST<int *>(projectile);
|
|
projectile[1]._type = 0x2000;
|
|
projectile[1]._variant = 0x1000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(projectile[1])) + 0x8)))) = 0x3f4ccccd;
|
|
(**(code **)(target + 0xc))();
|
|
}
|
|
target = *targetRef;
|
|
if (target == 0) {
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((target + 0x168)) = *GHIDRA_CAST<uint32_t *>((target + 0x168)) | 0x10;
|
|
*GHIDRA_CAST<uint32_t *>((target + 0x16c)) = *GHIDRA_CAST<uint32_t *>((target + 0x16c));
|
|
if (*targetRef != 0) {
|
|
local_14[0] = targetRef;
|
|
msvc::multiset<unsigned_int>::erase(local_14);
|
|
}
|
|
*targetRef = 0;
|
|
return;
|
|
}
|
|
}
|
|
target_threatening_projectile(this,128.0,GHIDRA_INT(pcVar4),0);
|
|
pbVar2 = (this->_sprite)._animState._animData;
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pbVar5 = s_Fly;
|
|
do {
|
|
bVar1 = *pbVar2;
|
|
isLess = bVar1 < *pbVar5;
|
|
if (bVar1 != *pbVar5) {
|
|
LAB_006436f0:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_006436f5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar2[1];
|
|
isLess = bVar1 < pbVar5[1];
|
|
if (bVar1 != pbVar5[1]) goto LAB_006436f0;
|
|
pbVar2 = pbVar2 + 2;
|
|
pbVar5 = pbVar5 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_006436f5:
|
|
if ((uVar3 == 0) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' ||
|
|
((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00643729;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Fly,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_00643729:
|
|
if (this->_target != 0) {
|
|
pbVar2 = (this->_sprite)._animState._animData;
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar5 = pbVar2;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pcVar4 = "Attack";
|
|
do {
|
|
bVar1 = *pbVar5;
|
|
isLess = bVar1 < (uint8_t)*pcVar4;
|
|
if (bVar1 != *pcVar4) {
|
|
LAB_00643768:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0064376d;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar5[1];
|
|
isLess = bVar1 < (uint8_t)pcVar4[1];
|
|
if (bVar1 != pcVar4[1]) goto LAB_00643768;
|
|
pbVar5 = pbVar5 + 2;
|
|
pcVar4 = pcVar4 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_0064376d:
|
|
if (uVar3 == 0) {
|
|
if (pbVar2[0x34] == 0) {
|
|
return;
|
|
}
|
|
if ((this->_sprite)._animState._isPlaying != 0) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Attack"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006437a0
|
|
void Entity_Familiar::ai_stitches()
|
|
{
|
|
ANM2 other;
|
|
Vector velocity;
|
|
Entity *beamParentSlot;
|
|
uint8_t bVar2;
|
|
Entity *effect;
|
|
LayerState *layer;
|
|
uint8_t *curAnimChar;
|
|
uint32_t uVar3;
|
|
Game *game;
|
|
char *wantedAnimChar;
|
|
bool bVar4;
|
|
float fVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
Entity_Familiar *pEVar9;
|
|
ANM2 aAStackY_8ca0 [128];
|
|
uint8_t in_stack_fffffe74 [228];
|
|
float in_stack_ffffff58;
|
|
float in_stack_ffffff5c;
|
|
float in_stack_ffffff60;
|
|
Vector *pVVar10;
|
|
uint32_t uVar11;
|
|
int iVar12;
|
|
int *local_70;
|
|
uint8_t isBffs;
|
|
float fStack_68;
|
|
Entity *pEStack_64;
|
|
float local_60;
|
|
Entity_Familiar *local_5c;
|
|
Vector local_58;
|
|
uint32_t uStack_50;
|
|
uint32_t uStack_4c;
|
|
code *pcStack_48;
|
|
float deltaX;
|
|
float distanceToPlayer;
|
|
float fStack_3c;
|
|
ColorMod CStack_38;
|
|
uint32_t local_c;
|
|
uint8_t *animData;
|
|
void *beamParent;
|
|
uint32_t *beamParentSlot;
|
|
int *entity;
|
|
Manager *manager;
|
|
Entity_Player *player;
|
|
Vector *pos;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_70);
|
|
this->_entityGridCollisionClass = 3;
|
|
local_5c = this;
|
|
switch(this->_state) {
|
|
case 0:
|
|
this->_spawnerType = 1;
|
|
LAB_0064423d:
|
|
this->_state = 3;
|
|
break;
|
|
case 1:
|
|
uVar3 = Random();
|
|
iVar12 = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uVar11)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uVar11)) + 0x1))) = 0;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(uVar11)) + 0x2))) = 0;
|
|
fVar8 = 0.0;
|
|
pVVar10 = &g_vectorZero;
|
|
pos = &this->_pos;
|
|
fVar7 = 2.10195e-44;
|
|
fVar5 = 1.4013e-42;
|
|
fVar6 = 9.203692e-39;
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3,0);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(register0x00000010) + -0x18c)))))->ANM2::ANM2(&local_5c->_sprite);
|
|
other._championColor._colorize[0] = in_stack_ffffff58;
|
|
other._filename._buf[0] = in_stack_fffffe74[0];
|
|
other._filename._buf[1] = in_stack_fffffe74[1];
|
|
other._filename._buf[2] = in_stack_fffffe74[2];
|
|
other._filename._buf[3] = in_stack_fffffe74[3];
|
|
other._filename._buf[4] = in_stack_fffffe74[4];
|
|
other._filename._buf[5] = in_stack_fffffe74[5];
|
|
other._filename._buf[6] = in_stack_fffffe74[6];
|
|
other._filename._buf[7] = in_stack_fffffe74[7];
|
|
other._filename._buf[8] = in_stack_fffffe74[8];
|
|
other._filename._buf[9] = in_stack_fffffe74[9];
|
|
other._filename._buf[10] = in_stack_fffffe74[10];
|
|
other._filename._buf[0xb] = in_stack_fffffe74[0xb];
|
|
other._filename._buf[0xc] = in_stack_fffffe74[0xc];
|
|
other._filename._buf[0xd] = in_stack_fffffe74[0xd];
|
|
other._filename._buf[0xe] = in_stack_fffffe74[0xe];
|
|
other._filename._buf[0xf] = in_stack_fffffe74[0xf];
|
|
other._filename._size = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x10)));
|
|
other._filename._capacity = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x14)));
|
|
other._animDefaultName._buf[0] = in_stack_fffffe74[0x18];
|
|
other._animDefaultName._buf[1] = in_stack_fffffe74[0x19];
|
|
other._animDefaultName._buf[2] = in_stack_fffffe74[0x1a];
|
|
other._animDefaultName._buf[3] = in_stack_fffffe74[0x1b];
|
|
other._animDefaultName._buf[4] = in_stack_fffffe74[0x1c];
|
|
other._animDefaultName._buf[5] = in_stack_fffffe74[0x1d];
|
|
other._animDefaultName._buf[6] = in_stack_fffffe74[0x1e];
|
|
other._animDefaultName._buf[7] = in_stack_fffffe74[0x1f];
|
|
other._animDefaultName._buf[8] = in_stack_fffffe74[0x20];
|
|
other._animDefaultName._buf[9] = in_stack_fffffe74[0x21];
|
|
other._animDefaultName._buf[10] = in_stack_fffffe74[0x22];
|
|
other._animDefaultName._buf[0xb] = in_stack_fffffe74[0x23];
|
|
other._animDefaultName._buf[0xc] = in_stack_fffffe74[0x24];
|
|
other._animDefaultName._buf[0xd] = in_stack_fffffe74[0x25];
|
|
other._animDefaultName._buf[0xe] = in_stack_fffffe74[0x26];
|
|
other._animDefaultName._buf[0xf] = in_stack_fffffe74[0x27];
|
|
other._animDefaultName._size = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x28)));
|
|
other._animDefaultName._capacity = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x2c)));
|
|
other._animState._animation = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x30)));
|
|
other._animState._animData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x34)));
|
|
other._animState._layerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x38)));
|
|
other._animState._nullLayerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x3c)));
|
|
other._animState._animFrame = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0x40)));
|
|
other._animState._isPlaying = in_stack_fffffe74[0x44];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other._animState)) + 0x15))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x45)));
|
|
other._animState._currentlyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x48)));
|
|
other._animState._previouslyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x4c)));
|
|
other._overlayAnimState._animation = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x50)));
|
|
other._overlayAnimState._animData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x54)));
|
|
other._overlayAnimState._layerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x58)));
|
|
other._overlayAnimState._nullLayerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x5c)));
|
|
other._overlayAnimState._animFrame = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0x60)));
|
|
other._overlayAnimState._isPlaying = in_stack_fffffe74[100];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other._overlayAnimState)) + 0x15))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x65)));
|
|
other._overlayAnimState._currentlyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x68)));
|
|
other._overlayAnimState._previouslyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x6c)));
|
|
other._overlayRenderFirst = in_stack_fffffe74[0x70];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other)) + 0x71))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x71)));
|
|
other._animData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x74)));
|
|
other._animCount = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x78)));
|
|
other._layerState = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x7c)));
|
|
other._layerCount = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x80)));
|
|
other._nullLayerNames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x84)));
|
|
other._numNullLayers = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x88)));
|
|
other._eventNames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe74)) + 0x8c)));
|
|
other._numEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe74)) + 0x90)));
|
|
other._offset.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0x94)));
|
|
other._offset.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0x98)));
|
|
other._scale.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0x9c)));
|
|
other._scale.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xa0)));
|
|
other._rotation = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xa4)));
|
|
other._color._tint[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xa8)));
|
|
other._color._tint[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xac)));
|
|
other._color._tint[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xb0)));
|
|
other._color._tint[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xb4)));
|
|
other._color._colorize[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xb8)));
|
|
other._color._colorize[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xbc)));
|
|
other._color._colorize[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xc0)));
|
|
other._color._colorize[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xc4)));
|
|
other._color._offset[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xc8)));
|
|
other._color._offset[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xcc)));
|
|
other._color._offset[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xd0)));
|
|
other._championColor._tint[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xd4)));
|
|
other._championColor._tint[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xd8)));
|
|
other._championColor._tint[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xdc)));
|
|
other._championColor._tint[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe74)) + 0xe0)));
|
|
other._championColor._colorize[1] = in_stack_ffffff5c;
|
|
other._championColor._colorize[2] = in_stack_ffffff60;
|
|
other._championColor._colorize[3] = fVar6;
|
|
other._championColor._offset[0] = fVar5;
|
|
other._championColor._offset[1] = fVar7;
|
|
other._championColor._offset[2] = (float)pos;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(other)) + 0x100))) = pVVar10;
|
|
other._playbackSpeed = fVar8;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other)) + 0x108))) = (char)uVar11;
|
|
other._loaded = SUB41(uVar11,1);
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(other)) + 0x10a))) = SUB42(uVar11,2);
|
|
other._shadowLayerIndex = uVar3;
|
|
other._bitflags = iVar12;
|
|
(GHIDRA_CAST<ANM2 *>((&effect->_sprite)))->ANM2::operator_assign(other);
|
|
(GHIDRA_CAST<ANM2 *>((&effect->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("TeleportUp"),0);
|
|
effect->Update();
|
|
this = local_5c;
|
|
player = local_5c->_player;
|
|
pos = &local_5c->_pos;
|
|
local_70 = GHIDRA_CAST<int *>((player->_pos).x);
|
|
local_60 = (player->_pos).y;
|
|
Entity_Player::Teleport(player,pos,1,0);
|
|
manager = g_manager;
|
|
pos->x = (float)local_70;
|
|
(this->_pos).y = local_60;
|
|
beamParent = (manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((manager->_itemConfig)._collectibles._end) - GHIDRA_INT(beamParent) & 0xfffffffcU)) <
|
|
0x9ed) {
|
|
local_58.x = 0.0;
|
|
}
|
|
else {
|
|
local_58.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(beamParent) + 0x9ec));
|
|
}
|
|
uStack_4c = 0;
|
|
uStack_50 = 0xc;
|
|
local_58.y = 1.4013e-45;
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)))))->TemporaryEffects::AddEffect(&local_58,0,1);
|
|
fStack_68 = 30.0;
|
|
local_70 = GHIDRA_CAST<int *>((this->_player->_meleeDamage * 3.0 + 40.0));
|
|
isBffs = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0xf7,0);
|
|
if (isBffs != 0) {
|
|
fStack_68 = 45.0;
|
|
}
|
|
uVar3 = Random();
|
|
local_58.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_58.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&local_58,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3,0);
|
|
effect->Update();
|
|
uVar3 = Random();
|
|
pVVar10 = pos;
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3,0);
|
|
effect->Update();
|
|
local_58.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_58.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
Game::DamageRadius(&local_58,GHIDRA_CAST<Entity *>(this),4,0,GHIDRA_INT(pVVar10),50.0,g_tearFlagsNone,
|
|
(float)local_70,fStack_68);
|
|
fVar6 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x157c));
|
|
if (isBffs != 0) {
|
|
fVar6 = fVar6 + fVar6 + 3.0;
|
|
}
|
|
Game::DamageRadius(pos,GHIDRA_CAST<Entity *>(this),4,0,GHIDRA_INT(pVVar10),50.0,g_tearFlagsNone,fVar6,fStack_68);
|
|
if (isBffs != 0) {
|
|
fStack_68 = 0.0;
|
|
do {
|
|
player = this->_player;
|
|
pEStack_64 = GHIDRA_CAST<Entity *>((player->_shotspeed * 10.0));
|
|
local_70 = GHIDRA_CAST<int *>(((float)((double)GHIDRA_INT(fStack_68) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(fStack_68) >> 0x1f)]) * 360.0 * 0.125
|
|
* 0.017453292));
|
|
fVar6 = cos((float)local_70);
|
|
local_58.x = fVar6 * (float)pEStack_64;
|
|
local_58.y = sin((float)local_70);
|
|
local_58.y = local_58.y * (float)pEStack_64;
|
|
velocity.y = local_58.y;
|
|
velocity.x = local_58.x;
|
|
Entity_Player::FireTear(player,&this->_pos,velocity,0,GHIDRA_CAST<Entity *>(0x0),1.0);
|
|
fStack_68 = (float)(GHIDRA_INT(fStack_68) + 1);
|
|
} while (GHIDRA_UINT(fStack_68) < 8);
|
|
}
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasCollectible(0x3b,0);
|
|
if (bVar2 != 0) {
|
|
fVar6 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x157c));
|
|
fStack_3c = fVar6 + fVar6 + 3.0;
|
|
uVar3 = Random();
|
|
pEStack_64 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xa6,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar3,0);
|
|
beamParent = this->_player;
|
|
beamParentSlot = &pEStack_64->_parent;
|
|
if (pEStack_64->_parent != 0) {
|
|
local_70 = beamParentSlot;
|
|
msvc::multiset<unsigned_int>::erase();
|
|
}
|
|
*beamParentSlot = beamParent;
|
|
if (beamParent != (void *)0x0) {
|
|
msvc::multiset<unsigned_int>::insert();
|
|
}
|
|
effect = pEStack_64;
|
|
CStack_38._offset[0] = 0.0;
|
|
CStack_38._colorize[0] = 0.0;
|
|
CStack_38._colorize[1] = 0.0;
|
|
CStack_38._colorize[2] = 0.0;
|
|
CStack_38._colorize[3] = 0.0;
|
|
CStack_38._offset[1] = 0.0;
|
|
CStack_38._offset[2] = 0.0;
|
|
CStack_38._tint[0] = 0.0;
|
|
CStack_38._tint[1] = 0.0;
|
|
CStack_38._tint[2] = 0.0;
|
|
CStack_38._tint[3] = 1.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEStack_64->_sprite))))->Sprite::SetColor(&CStack_38);
|
|
uVar3 = g_graphicsManager_flags;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&effect->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
iVar12 = 1;
|
|
if ((uVar3 & 4) == 0) {
|
|
iVar12 = 6;
|
|
}
|
|
layer->_blendMode[1] = iVar12;
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[2] = 7;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 7;
|
|
fVar6 = g_vectorOne.y;
|
|
(effect->_sprite)._scale.x = g_vectorOne.x;
|
|
(effect->_sprite)._scale.y = fVar6;
|
|
iVar12 = *GHIDRA_CAST<int *>(effect);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(effect[1])) + 0x44)))) = 0x3da3d70a;
|
|
builtin_strncpy(effect[1]._sprite._filename._buf,"\nף=",4);
|
|
(**(code **)(iVar12 + 0xc))();
|
|
this = local_5c;
|
|
fVar6 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_5c->_player) + 0x340));
|
|
iVar12 = *GHIDRA_CAST<int *>(effect);
|
|
(effect->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_5c->_player) + 0x33c));
|
|
(effect->_pos).y = fVar6;
|
|
fVar6 = g_vectorOne.x;
|
|
fVar5 = g_vectorOne.y * 2.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(effect[1])) + 0x44)))) = 0x3d23d70a;
|
|
beamParentSlot = effect + 1;
|
|
(beamParentSlot->_sprite)._filename._buf[0] = '\n';
|
|
(beamParentSlot->_sprite)._filename._buf[1] = -0x29;
|
|
(beamParentSlot->_sprite)._filename._buf[2] = '#';
|
|
(beamParentSlot->_sprite)._filename._buf[3] = '=';
|
|
(effect->_sprite)._scale.y = fVar5;
|
|
(effect->_sprite)._scale.x = fVar6 * 2.0;
|
|
(**(code **)(iVar12 + 0xc))();
|
|
fStack_68 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) - (this->_pos).y;
|
|
local_5c = GHIDRA_CAST<Entity_Familiar *>((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) - (this->_pos).x));
|
|
distanceToPlayer = sqrtf(fStack_68 * fStack_68 + (float)local_5c * (float)local_5c);
|
|
if (0.0 < distanceToPlayer) {
|
|
pEVar9 = GHIDRA_CAST<Entity_Familiar *>(((float)local_5c / distanceToPlayer));
|
|
local_70 = GHIDRA_CAST<int *>(0x0);
|
|
local_58.x = (float)g_game->_room;
|
|
fVar6 = fStack_68 / distanceToPlayer;
|
|
game = g_game;
|
|
fStack_68 = fVar6;
|
|
local_5c = pEVar9;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_58.x) + 0x1264)) != 0) {
|
|
do {
|
|
entity = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_58.x) + 0x125c)) + GHIDRA_INT(local_70) * 4));
|
|
if ((entity[0x62] != 0) &&
|
|
((((1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager) && (entity[10] == 1)) ||
|
|
(entity[10] - 10U < 0x3de)) && ((entity[0x5a] & 0x20000000U) == 0)))) {
|
|
pEStack_64 = GHIDRA_CAST<Entity *>(((float)entity[0xd0] - (this->_pos).y));
|
|
deltaX = (float)entity[0xcf] - (this->_pos).x;
|
|
pcStack_48 = (code *)(fVar6 * (float)pEStack_64 + (float)pEVar9 * deltaX);
|
|
local_60 = cos(1.5707964);
|
|
fVar6 = sin(1.5707964);
|
|
if ((((fVar6 * (float)local_5c + local_60 * fStack_68) * (float)pEStack_64 +
|
|
(local_60 * (float)local_5c - fVar6 * fStack_68) * deltaX <
|
|
(float)entity[0xdc] + 25.0) && (0.0 <= (float)pcStack_48)) &&
|
|
((float)pcStack_48 <= distanceToPlayer)) {
|
|
CStack_38._offset[1] = (float)this->_player;
|
|
pcStack_48 = *(code **)(*entity + 0x20);
|
|
if ((void *)CStack_38._offset[1] == (void *)0x0) {
|
|
CStack_38._tint[0] = 0.0;
|
|
CStack_38._tint[1] = 0.0;
|
|
CStack_38._tint[2] = 0.0;
|
|
CStack_38._tint[3] = 0.0;
|
|
CStack_38._colorize[0] = g_vectorZero.x;
|
|
CStack_38._colorize[1] = g_vectorZero.y;
|
|
CStack_38._colorize[2] = g_vectorZero.x;
|
|
CStack_38._colorize[3] = g_vectorZero.y;
|
|
LAB_00643fa1:
|
|
pEStack_64 = GHIDRA_CAST<Entity *>(0x0);
|
|
if ((void *)CStack_38._offset[1] != (void *)0x0) goto LAB_00643fad;
|
|
pEStack_64 = GHIDRA_CAST<Entity *>(0x0);
|
|
LAB_00643fcf:
|
|
local_60 = 0.0;
|
|
if ((void *)CStack_38._offset[1] != (void *)0x0) goto LAB_00643fdb;
|
|
LAB_00643ff4:
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
CStack_38._tint[0] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x28));
|
|
CStack_38._tint[1] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x2c));
|
|
CStack_38._tint[2] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x34));
|
|
CStack_38._tint[3] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x38));
|
|
CStack_38._colorize[0] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x33c));
|
|
CStack_38._colorize[1] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x340));
|
|
CStack_38._colorize[2] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x360));
|
|
CStack_38._colorize[3] = *GHIDRA_CAST<float *>((GHIDRA_INT(CStack_38._offset[1]) + 0x364));
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(CStack_38._offset[1]) + 0x168)) & 0x100) == 0)
|
|
goto LAB_00643fa1;
|
|
pEStack_64 = GHIDRA_CAST<Entity *>(0x1);
|
|
LAB_00643fad:
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(CStack_38._offset[1]) + 0x168)) & 0x20000000) == 0)
|
|
goto LAB_00643fcf;
|
|
local_60 = 2.8026e-45;
|
|
LAB_00643fdb:
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(CStack_38._offset[1]) + 0x16c)) & 0x400000) == 0)
|
|
goto LAB_00643ff4;
|
|
uVar3 = 4;
|
|
}
|
|
CStack_38._offset[0] = (float)(uVar3 | GHIDRA_UINT(local_60) | GHIDRA_UINT(pEStack_64));
|
|
(*pcStack_48)();
|
|
}
|
|
game = g_game;
|
|
pEVar9 = local_5c;
|
|
fVar6 = fStack_68;
|
|
}
|
|
local_70 = GHIDRA_CAST<int *>((GHIDRA_INT(local_70) + 1));
|
|
} while (local_70 < *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_58.x) + 0x1264)));
|
|
}
|
|
}
|
|
uVar3 = Random();
|
|
manager = g_manager;
|
|
local_70 = GHIDRA_CAST<int *>(0x1fa);
|
|
local_58.x = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 1.5;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_70));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_70),1.0,1,0,local_58.x,0.0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(6);
|
|
}
|
|
iVar12 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13bc));
|
|
if (iVar12 < 0x1e) {
|
|
iVar12 = 0x1e;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x13bc)) = iVar12;
|
|
beamParent = this->_player;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(beamParent) + 0x16c)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(beamParent) + 0x16c)) | 0x10;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(beamParent) + 0x168)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(beamParent) + 0x168));
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0064418e:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("TeleportDown"),1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantedAnimChar = "TeleportDown";
|
|
do {
|
|
bVar2 = *curAnimChar;
|
|
bVar4 = bVar2 < (uint8_t)*wantedAnimChar;
|
|
if (bVar2 != *wantedAnimChar) {
|
|
LAB_00644170:
|
|
uVar3 = -GHIDRA_UINT(bVar4) | 1;
|
|
goto LAB_00644175;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = curAnimChar[1];
|
|
bVar4 = bVar2 < (uint8_t)wantedAnimChar[1];
|
|
if (bVar2 != wantedAnimChar[1]) goto LAB_00644170;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantedAnimChar = wantedAnimChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_00644175:
|
|
if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_0064418e;
|
|
}
|
|
this->_state = 2;
|
|
break;
|
|
case 2:
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00644210:
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("TeleportDown"),1);
|
|
if (bVar2 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantedAnimChar = "TeleportDown";
|
|
do {
|
|
bVar2 = *curAnimChar;
|
|
bVar4 = bVar2 < (uint8_t)*wantedAnimChar;
|
|
if (bVar2 != *wantedAnimChar) {
|
|
LAB_006441f2:
|
|
uVar3 = -GHIDRA_UINT(bVar4) | 1;
|
|
goto LAB_006441f7;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = curAnimChar[1];
|
|
bVar4 = bVar2 < (uint8_t)wantedAnimChar[1];
|
|
if (bVar2 != wantedAnimChar[1]) goto LAB_006441f2;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantedAnimChar = wantedAnimChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_006441f7:
|
|
if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_00644210;
|
|
}
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) goto LAB_0064423d;
|
|
break;
|
|
case 3:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::GetShootingJoystick(&local_58);
|
|
fVar6 = (this->_velocity).x;
|
|
if (this->_collidesWithGrid != 0) {
|
|
fVar6 = fVar6 * 0.88;
|
|
(this->_velocity).x = fVar6;
|
|
(this->_velocity).y = (this->_velocity).y * 0.88;
|
|
}
|
|
fVar5 = 0.0;
|
|
if ((local_58.x == 0.0) || (local_58.y != 0.0)) {
|
|
if ((local_58.y == 0.0) || (local_58.x != 0.0)) goto LAB_00644300;
|
|
fVar5 = (this->_velocity).y;
|
|
fVar6 = fVar6 * 0.5;
|
|
}
|
|
else {
|
|
(this->_velocity).y = (this->_velocity).y * 0.5;
|
|
fVar5 = fVar6;
|
|
}
|
|
fVar5 = ABS(fVar5);
|
|
LAB_00644300:
|
|
game = g_game;
|
|
fVar7 = (this->_velocity).y;
|
|
fVar8 = -(fVar7 * local_58.y + fVar6 * local_58.x) * 0.2;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
fVar5 = (fVar8 + fVar5 * 0.3 * 0.1 + 3.0) * 0.8;
|
|
(this->_velocity).y = (fVar5 * local_58.y + fVar7) * 0.775;
|
|
(this->_velocity).x = (fVar5 * local_58.x + fVar6) * 0.775;
|
|
Room::GetClampedPositionImpl(game->_room,&local_58,&this->_pos,0.0,0.0,0.0,0.0);
|
|
local_60 = local_58.x - (this->_pos).x;
|
|
local_70 = GHIDRA_CAST<int *>((local_58.y - (this->_pos).y));
|
|
if ((local_60 != g_vectorZero.x) || ((float)local_70 != g_vectorZero.y)) {
|
|
fVar6 = sqrtf((float)local_70 * (float)local_70 + local_60 * local_60);
|
|
if (0.0 < fVar6) {
|
|
local_70 = GHIDRA_CAST<int *>(((float)local_70 * (1.0 / fVar6)));
|
|
local_60 = local_60 * (1.0 / fVar6);
|
|
}
|
|
fVar6 = (this->_velocity).x;
|
|
fVar5 = this->_speedMultiplier;
|
|
fVar7 = -((float)local_70 * (this->_velocity).y + fVar6 * local_60);
|
|
if (fVar7 <= 1.0) {
|
|
fVar7 = 1.0;
|
|
}
|
|
if (10.0 <= fVar7) {
|
|
fVar7 = 10.0;
|
|
}
|
|
(this->_velocity).x = local_60 * fVar7 * fVar5 + fVar6;
|
|
(this->_velocity).y = (float)local_70 * fVar7 * fVar5 + (this->_velocity).y;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006444d0
|
|
Entity * Entity_Familiar::aim_reflected_projectile()
|
|
{
|
|
Entity *tmpEntity;
|
|
uint32_t rngResult;
|
|
int enemyType;
|
|
Game *game;
|
|
uint32_t enemyIdx;
|
|
float fVar1;
|
|
float distance;
|
|
float velocityYSq;
|
|
float fVar2;
|
|
float toEnemyY;
|
|
float bestScore;
|
|
float directionY;
|
|
float directionX;
|
|
Entity *bestTarget;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
Entity_NPC *ownerNpc;
|
|
void *room;
|
|
|
|
game = g_game;
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af70b0;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((((this->_flags & 0x100) != 0) &&
|
|
(ownerNpc = *GHIDRA_CAST<Entity_NPC **>((GHIDRA_CAST<char *>(this->_player) + 0x3bc)), ownerNpc != GHIDRA_CAST<Entity_NPC *>(0x0))) &&
|
|
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (ownerNpc->_type == 1)) ||
|
|
(ownerNpc->_type - 10U < 0x3de)))) {
|
|
tmpEntity = (GHIDRA_CAST<Entity_NPC *>((ownerNpc)))->Entity_NPC::GetPlayerTarget();
|
|
ExceptionList = local_10;
|
|
return tmpEntity;
|
|
}
|
|
directionY = (this->_velocity).y;
|
|
directionX = (this->_velocity).x;
|
|
bestScore = 0.0;
|
|
velocityYSq = directionY * directionY;
|
|
bestTarget = GHIDRA_CAST<Entity *>(0x0);
|
|
fVar1 = sqrtf(directionX * directionX + velocityYSq);
|
|
if (0.0 < fVar1) {
|
|
directionX = directionX * (1.0 / fVar1);
|
|
directionY = directionY * (1.0 / fVar1);
|
|
}
|
|
room = game->_room;
|
|
fVar1 = (this->_velocity).x;
|
|
enemyIdx = 0;
|
|
tmpEntity = GHIDRA_CAST<Entity *>(0x0);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1264)) != 0) {
|
|
do {
|
|
tmpEntity = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + enemyIdx * 4));
|
|
if (((((1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) && (enemyType = 1, tmpEntity->_type == 1)) ||
|
|
(enemyType = tmpEntity->_type, enemyType - 10U < 0x3de)) &&
|
|
((tmpEntity->_entityCollisionClass != 1 && (tmpEntity->_entityCollisionClass != 0)))) &&
|
|
(((tmpEntity->_isInvicible == 0 && (tmpEntity->_dead == 0)) &&
|
|
((((tmpEntity->_flags & 0x10) == 0 || (enemyType == 0x322)) || (enemyType == 0x362)))))) {
|
|
if (fVar1 * fVar1 + velocityYSq <= 1e-05) {
|
|
rngResult = Random();
|
|
fVar2 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]
|
|
) * 2.3283064e-10;
|
|
game = g_game;
|
|
}
|
|
else {
|
|
fVar2 = (tmpEntity->_pos).x - (this->_pos).x;
|
|
toEnemyY = (tmpEntity->_pos).y - (this->_pos).y;
|
|
distance = sqrtf(fVar2 * fVar2 + toEnemyY * toEnemyY);
|
|
if (0.0 < distance) {
|
|
fVar2 = fVar2 * (1.0 / distance);
|
|
toEnemyY = toEnemyY * (1.0 / distance);
|
|
}
|
|
fVar2 = directionX * fVar2 + directionY * toEnemyY;
|
|
}
|
|
if (bestScore < fVar2) {
|
|
bestScore = fVar2;
|
|
bestTarget = tmpEntity;
|
|
}
|
|
}
|
|
enemyIdx = enemyIdx + 1;
|
|
tmpEntity = bestTarget;
|
|
} while (enemyIdx < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(room) + 0x1264)));
|
|
}
|
|
ExceptionList = local_10;
|
|
return tmpEntity;
|
|
}
|
|
|
|
// 00644e80
|
|
void Entity_Familiar::ai_shadow_intruder_damocles(uint8_t isInterpolating)
|
|
{
|
|
code *pcVar1;
|
|
int64_t lVar2;
|
|
int64_t lVar3;
|
|
int64_t lVar4;
|
|
uint8_t bVar5;
|
|
char cVar6;
|
|
uint8_t *curAnimChar;
|
|
uint32_t uVar7;
|
|
uint32_t uVar8;
|
|
EntityRef *sourceRef;
|
|
uint32_t rngResult;
|
|
Entity *spawned;
|
|
int iVar9;
|
|
int *piVar10;
|
|
uint8_t *wantedAnimChar;
|
|
int unusedArg;
|
|
void *pvVar11;
|
|
code *extraout_EDX;
|
|
uint32_t particleIndex;
|
|
ANM2 *sprite;
|
|
PlayerManager *playerManager;
|
|
bool bVar12;
|
|
float fVar13;
|
|
uint64_t timeNs;
|
|
uint8_t *pbVar14;
|
|
uint8_t auStack_12c [4];
|
|
uint32_t spawnSubType;
|
|
uint32_t finalSubType;
|
|
int *piStack_120;
|
|
Entity_Familiar *pEStack_11c;
|
|
Entity *pEStack_118;
|
|
int local_114;
|
|
int iStack_110;
|
|
uint32_t spawnType;
|
|
Entity_Familiar *savedFamiliar;
|
|
float fStack_104;
|
|
Game *pGStack_100;
|
|
Vector particlePos;
|
|
uint32_t uStack_f0;
|
|
int soundId;
|
|
float particleVelX;
|
|
float fStack_e0;
|
|
void *triggerNode;
|
|
uint32_t savedParticleIndex;
|
|
float burstX;
|
|
float burstY;
|
|
int *spawnerRefArg;
|
|
uint32_t uStack_c8;
|
|
uint32_t directSpawnCount;
|
|
int particleCount;
|
|
uint32_t itemKey;
|
|
Vector particleVelocity;
|
|
Vector playerPos;
|
|
Vector slowVelocity;
|
|
int typeKey;
|
|
int variantKey;
|
|
int wildcardKey [3];
|
|
uint64_t rngShifts;
|
|
uint32_t rngShift3;
|
|
int damageSourceType;
|
|
int damageSourceVariant;
|
|
int damageSourceSpawnerType;
|
|
int damageSourceSpawnerVariant;
|
|
float damageSourcePosX;
|
|
float damageSourcePosY;
|
|
float damageSourceVelX;
|
|
float damageSourceVelY;
|
|
uint32_t damageSourceFlags;
|
|
EntityRef local_58;
|
|
RNG cardRng;
|
|
uint32_t local_c;
|
|
Game *game;
|
|
Manager *manager;
|
|
Entity_Familiar *spawnVariant;
|
|
uint32_t *spawnerSlot;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(auStack_12c);
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
(this->_pos).y = fVar13;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
if (isInterpolating != 0) {
|
|
return;
|
|
}
|
|
iVar9 = this->_state;
|
|
savedFamiliar = this;
|
|
if (iVar9 == 0) {
|
|
this->_state = 1;
|
|
this->_fireCooldown = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
return;
|
|
}
|
|
if (iVar9 == 1) {
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
uVar7 = Random();
|
|
fVar13 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
if (0.1 <= fVar13) {
|
|
if (0.5 <= fVar13) {
|
|
pbVar14 = s_Idle;
|
|
}
|
|
else {
|
|
pbVar14 = s_Idle2;
|
|
}
|
|
}
|
|
else {
|
|
pbVar14 = &DAT_00b1d43c;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(pbVar14,1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
game = g_game;
|
|
if ((this->_flags & 0x4000) != 0) {
|
|
return;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
if (bVar5 != 0) {
|
|
return;
|
|
}
|
|
uVar7 = game->_frameCount & 0x80000003;
|
|
bVar12 = uVar7 == 0;
|
|
if (GHIDRA_INT(uVar7) < 0) {
|
|
bVar12 = (uVar7 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (bVar12) {
|
|
iVar9 = this->_subtype;
|
|
if (iVar9 < 1) {
|
|
return;
|
|
}
|
|
uVar7 = Random();
|
|
manager = g_manager;
|
|
if (GHIDRA_INT((uVar7 % 10000)) < iVar9) {
|
|
local_114 = 0x1fd;
|
|
seed_fart_sound_override(&local_114);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_114,1.0,0,0,1.0,0.0);
|
|
this->_state = 2;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (iVar9 != 2) {
|
|
return;
|
|
}
|
|
pbVar14 = (this->_sprite)._animState._animData;
|
|
sprite = &this->_sprite;
|
|
if (pbVar14 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimChar = pbVar14;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar14 + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(pbVar14);
|
|
}
|
|
wantedAnimChar = &DAT_00b1e7b0;
|
|
do {
|
|
bVar5 = *curAnimChar;
|
|
bVar12 = bVar5 < *wantedAnimChar;
|
|
if (bVar5 != *wantedAnimChar) {
|
|
LAB_00644f50:
|
|
uVar7 = -GHIDRA_UINT(bVar12) | 1;
|
|
goto LAB_00644f55;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = curAnimChar[1];
|
|
bVar12 = bVar5 < wantedAnimChar[1];
|
|
if (bVar5 != wantedAnimChar[1]) goto LAB_00644f50;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantedAnimChar = wantedAnimChar + 2;
|
|
} while (bVar5 != 0);
|
|
uVar7 = 0;
|
|
LAB_00644f55:
|
|
if ((uVar7 == 0) && ((pbVar14[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_00644f81;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetAnimation(&DAT_00b1e7b0,1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_00644f81:
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
bVar5 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0);
|
|
manager = g_manager;
|
|
if (bVar5 != 0) {
|
|
soundId = 0x4d;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_player) + 0x13bc)) = 0;
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::HasInvincibility(0,GHIDRA_CAST<EntityRef *>(0x0));
|
|
if (bVar5 == 0) {
|
|
damageSourcePosX = (savedFamiliar->_pos).x;
|
|
damageSourcePosY = (savedFamiliar->_pos).y;
|
|
damageSourceType = savedFamiliar->_type;
|
|
damageSourceVelX = (savedFamiliar->_velocity).x;
|
|
damageSourceVariant = savedFamiliar->_variant;
|
|
damageSourceSpawnerType = savedFamiliar->_spawnerType;
|
|
damageSourceSpawnerVariant = savedFamiliar->_spawnerVariant;
|
|
damageSourceVelY = (savedFamiliar->_velocity).y;
|
|
if ((savedFamiliar->_flags & 0x20000000) == 0) {
|
|
uVar7 = 0;
|
|
}
|
|
else {
|
|
uVar7 = 2;
|
|
}
|
|
if ((savedFamiliar->_flags & 0x40000000000000) == 0) {
|
|
uVar8 = 0;
|
|
}
|
|
else {
|
|
uVar8 = 4;
|
|
}
|
|
damageSourceFlags = uVar8 | uVar7 | GHIDRA_UINT(((savedFamiliar->_flags & 0x100) != 0));
|
|
local_58._type = GHIDRA_INT(savedFamiliar);
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_player) + 0x20))(0x3f800000,0x2002800,0,&damageSourceType,0x1e);
|
|
this = pEStack_11c;
|
|
sourceRef = (GHIDRA_CAST<EntityRef *>((&local_58)))->EntityRef::EntityRef();
|
|
(*extraout_EDX)(sourceRef);
|
|
uVar7 = Random();
|
|
playerPos.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
playerPos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,&playerPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),3,uVar7,0);
|
|
local_114 = 3;
|
|
do {
|
|
uVar7 = Random();
|
|
fVar13 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
piStack_120 = GHIDRA_CAST<int *>((fVar13 + fVar13));
|
|
uVar7 = Random();
|
|
pEStack_11c = (Entity_Familiar *)
|
|
((float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)])
|
|
* 2.3283064e-10 * 15.0 + 6.0);
|
|
burstX = cos((float)piStack_120);
|
|
burstX = burstX * (float)pEStack_11c;
|
|
burstY = sin((float)piStack_120);
|
|
burstY = burstY * (float)pEStack_11c;
|
|
uVar8 = Random();
|
|
particleIndex = 0;
|
|
savedParticleIndex = 0;
|
|
uVar7 = (uVar8 & 1) + 1;
|
|
directSpawnCount = uVar7;
|
|
rngResult = Random();
|
|
particleCount = (uVar8 & 1) + 5 + rngResult % 6;
|
|
if (particleCount != 0) {
|
|
do {
|
|
uVar8 = Random();
|
|
pGStack_100 = GHIDRA_CAST<Game *>((((float)((double)GHIDRA_INT(uVar8) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 10.0 - 5.0) * 0.017453292));
|
|
fStack_104 = cos((float)pGStack_100);
|
|
pGStack_100 = GHIDRA_CAST<Game *>(sin((float)pGStack_100));
|
|
uVar8 = Random();
|
|
fStack_e0 = (float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]
|
|
) * 2.3283064e-10;
|
|
particleVelX = (burstX * fStack_104 - burstY * (float)pGStack_100) * fStack_e0;
|
|
fStack_e0 = (burstX * (float)pGStack_100 + burstY * fStack_104) * fStack_e0;
|
|
particlePos.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c)) + particleVelX;
|
|
particlePos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340)) + fStack_e0;
|
|
particleVelocity.x = particleVelX;
|
|
particleVelocity.y = fStack_e0;
|
|
fVar13 = (float)Random();
|
|
if (particleIndex < uVar7) {
|
|
slowVelocity.x = particleVelX * 0.2;
|
|
slowVelocity.y = fStack_e0 * 0.2;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,5,&particlePos,&slowVelocity,GHIDRA_CAST<Entity *>(0x0),0,
|
|
GHIDRA_UINT(fVar13),0);
|
|
spawned->Update();
|
|
savedParticleIndex = particleIndex;
|
|
}
|
|
else {
|
|
pGStack_100 = g_game;
|
|
spawnSubType = 99;
|
|
pEStack_11c = GHIDRA_CAST<Entity_Familiar *>(&DAT_00000005);
|
|
spawnType = 1000;
|
|
fStack_104 = fVar13;
|
|
lua_callback_run_pre_entity_spawn
|
|
(GHIDRA_CAST<int *>(&spawnType),GHIDRA_CAST<int *>(&pEStack_11c),&particlePos,&particleVelocity,
|
|
GHIDRA_CAST<Entity *>(0x0),GHIDRA_CAST<int *>(&spawnSubType),GHIDRA_CAST<uint32_t *>(&fStack_104));
|
|
spawnVariant = pEStack_11c;
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
LAB_00645675:
|
|
finalSubType = spawnSubType;
|
|
}
|
|
else {
|
|
piVar10 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_deathmatchManager))) + 0xc))));
|
|
piStack_120 = piVar10;
|
|
uVar8 = Random();
|
|
uVar7 = spawnSubType;
|
|
rngShifts = 0x900000005;
|
|
pEStack_118 = GHIDRA_CAST<Entity *>(&DAT_00000007);
|
|
rngShift3 = 7;
|
|
if (spawnType != 5) goto LAB_00645675;
|
|
if (spawnVariant < GHIDRA_CAST<Entity_Familiar *>(0x12d)) {
|
|
if (spawnVariant == GHIDRA_CAST<Entity_Familiar *>(0x12c)) {
|
|
while ((finalSubType = spawnSubType, spawnSubType == 0 ||
|
|
(cVar6 = (**(code **)(*piVar10 + 0x24))(spawnSubType), cVar6 != '\0')))
|
|
{
|
|
if (uVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar8 = uVar8 >> ((uint8_t)rngShifts & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 >> ((uint8_t)pEStack_118 & 0x1f) ^ uVar8;
|
|
iVar9 = ItemPool::GetCardEx(uVar8,0x19,10,10,1);
|
|
cardRng._shift1 = 5;
|
|
cardRng._shift2 = 9;
|
|
cardRng._shift3 = 7;
|
|
cardRng._seed = uVar8;
|
|
spawnSubType = lua_callback_run_get_card(&cardRng,iVar9,1,1,0);
|
|
}
|
|
}
|
|
else {
|
|
if (spawnVariant == GHIDRA_CAST<Entity_Familiar *>(0x46)) {
|
|
uStack_f0 = spawnSubType >> 0xb;
|
|
do {
|
|
finalSubType = spawnSubType;
|
|
if (spawnSubType != 0) {
|
|
pcVar1 = *(code **)(*piVar10 + 0x28);
|
|
iVar9 = ItemPool::GetPillEffect
|
|
(&g_game->_itemPool,spawnSubType,GHIDRA_CAST<Entity_Player *>(0x0))
|
|
;
|
|
cVar6 = (*pcVar1)(iVar9);
|
|
if (cVar6 == '\0') goto LAB_0064567d;
|
|
piVar10 = piStack_120;
|
|
}
|
|
if (uVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar8 = uVar8 >> ((uint8_t)rngShifts & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar8;
|
|
uVar8 = uVar8 >> ((uint8_t)pEStack_118 & 0x1f) ^ uVar8;
|
|
spawnSubType = ItemPool::GetPill(uVar8);
|
|
spawnSubType = spawnSubType | (uStack_f0 & 1) << 0xb;
|
|
} while( true );
|
|
}
|
|
if (spawnVariant != GHIDRA_CAST<Entity_Familiar *>(0x64)) goto LAB_00645675;
|
|
finalSubType = spawnSubType;
|
|
if (spawnSubType == 0x19) {
|
|
LAB_006454c5:
|
|
bVar12 = false;
|
|
}
|
|
else {
|
|
itemKey = spawnSubType;
|
|
msvc::set<int>::find_node(&local_58._spawnerType,&itemKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_58._position.x) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_58._position.x) + 0x10)) <= GHIDRA_INT(uVar7))) &&
|
|
(local_58._position.x != (float)piVar10[8])) goto LAB_006454c5;
|
|
bVar12 = true;
|
|
}
|
|
if ((uVar7 == 0) || (bVar12)) {
|
|
spawnSubType = (**(code **)(*piVar10 + 0x84))(0);
|
|
finalSubType = spawnSubType;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (spawnVariant != GHIDRA_CAST<Entity_Familiar *>(0x15e)) goto LAB_00645675;
|
|
while ((finalSubType = spawnSubType, spawnSubType == 0 ||
|
|
(cVar6 = (**(code **)(*piVar10 + 0x2c))(spawnSubType), cVar6 != '\0'))) {
|
|
spawnSubType = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetTrinket(0);
|
|
}
|
|
}
|
|
}
|
|
LAB_0064567d:
|
|
pEStack_118 = (GHIDRA_CAST<EntityFactory *>((pGStack_100->_entityFactory)))->EntityFactory::Create(spawnType,0);
|
|
if (pEStack_118 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
timeNs = GetTimeNs();
|
|
spawned = pEStack_118;
|
|
uStack_f0 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar2 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
iStack_110 = GHIDRA_INT(((uint64_t)lVar2 >> 0x20));
|
|
lVar3 = (uint64_t)uStack_f0 * 0xd7b634db +
|
|
((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
uVar7 = iStack_110 + GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar2),GHIDRA_UINT(lVar3)));
|
|
lVar2 = (uint64_t)uStack_f0 * 0x431bde82 +
|
|
(uint64_t)CONCAT14(CARRY4(uVar8,uVar7),uVar8 + uVar7);
|
|
uStack_c8 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
spawnerSlot = &pEStack_118->_spawnerEntity;
|
|
piStack_120 = GHIDRA_CAST<int *>((GHIDRA_UINT(lVar2) >> 0x12 | uStack_c8 * 0x4000));
|
|
uStack_c8 = uStack_c8 >> 0x12;
|
|
pEStack_118->_spawnerType = 0;
|
|
pEStack_118->_spawnerVariant = 0;
|
|
if (*spawnerSlot != 0) {
|
|
spawnerRefArg = spawnerSlot;
|
|
msvc::multiset<unsigned_int>::erase(&spawnerRefArg);
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>(spawned);
|
|
*spawnerSlot = 0;
|
|
(spawned->_pos).x = particlePos.x;
|
|
(spawned->_pos).y = particlePos.y;
|
|
(spawned->_velocity).x = particleVelX;
|
|
(spawned->_velocity).y = fStack_e0;
|
|
(**(code **)(iVar9 + 4))(spawnType,pEStack_11c,finalSubType,fStack_104);
|
|
game = pGStack_100;
|
|
pvVar11 = pGStack_100->_room;
|
|
iVar9 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x1214));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x1214)) = iVar9 + 1;
|
|
spawned->_index = iVar9;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar11) + 0x1218)))))->EntityList::AddEntity(spawned);
|
|
bVar5 = Game::ShouldEraseEnemy(spawned);
|
|
if (bVar5 != 0) {
|
|
Entity::RemoveWithPoof(spawned,unusedArg);
|
|
}
|
|
if ((spawned->_exists != 0) &&
|
|
((game->_proceduralItemManager)._proceduralItems._begin !=
|
|
(game->_proceduralItemManager)._proceduralItems._end)) {
|
|
variantKey = spawned->_variant;
|
|
iVar9 = spawned->_type;
|
|
typeKey = iVar9;
|
|
msvc::map<unsigned_long_long>::find(&triggerNode,&typeKey);
|
|
if (triggerNode == (game->_proceduralItemManager)._spawnTriggerTargets._head) {
|
|
wildcardKey[1] = 0xffffffff;
|
|
wildcardKey[0] = iVar9;
|
|
piVar10 = GHIDRA_CAST<int *>(std)::map<unsigned_long_long>::find
|
|
(&local_58._variant,wildcardKey);
|
|
triggerNode = (void *)*piVar10;
|
|
if (triggerNode == (game->_proceduralItemManager)._spawnTriggerTargets._head)
|
|
goto LAB_006458e9;
|
|
}
|
|
uVar7 = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar11 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar11) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"
|
|
);
|
|
pvVar11 = (playerManager->_playerList)._end;
|
|
}
|
|
piVar10 = (playerManager->_playerList)._begin;
|
|
if (uVar7 < GHIDRA_UINT((GHIDRA_INT(pvVar11) - GHIDRA_INT(piVar10) >> 2))) {
|
|
piVar10 = piVar10 + uVar7;
|
|
}
|
|
trigger_set_dispatch
|
|
((void *)(*piVar10 + 0x1fc8),6,spawned,&particlePos,
|
|
&particleVelocity);
|
|
uVar7 = uVar7 + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (uVar7 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
LAB_006458e9:
|
|
timeNs = GetTimeNs();
|
|
uVar7 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar2 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
uStack_f0 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
lVar3 = (uint64_t)uVar7 * 0x431bde82;
|
|
iStack_110 = GHIDRA_INT(lVar3);
|
|
lVar4 = (uint64_t)uVar7 * 0xd7b634db +
|
|
((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
pGStack_100 = GHIDRA_CAST<Game *>((lVar4 + lVar2));
|
|
lVar3 = lVar3 + (uint64_t)
|
|
CONCAT14(CARRY4(GHIDRA_UINT(((uint64_t)lVar4 >> 0x20)),
|
|
uStack_f0 + CARRY4(GHIDRA_UINT(lVar2),GHIDRA_UINT(lVar4))),
|
|
GHIDRA_INT(((uint64_t)(lVar4 + lVar2) >> 0x20)));
|
|
uVar8 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
piVar10 = GHIDRA_CAST<int *>((GHIDRA_UINT(lVar3) >> 0x12 | uVar8 * 0x4000));
|
|
uVar7 = GHIDRA_INT(piVar10) - GHIDRA_INT(piStack_120);
|
|
bVar12 = CARRY4(GHIDRA_UINT(g_entitySpawnTimeMs),uVar7);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x0))) = GHIDRA_UINT(g_entitySpawnTimeMs) + uVar7;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) =
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) +
|
|
(((uVar8 >> 0x12) - uStack_c8) - GHIDRA_UINT((piVar10 < piStack_120))) +
|
|
GHIDRA_UINT(bVar12);
|
|
}
|
|
spawned = pEStack_118;
|
|
pEStack_118->Update();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x4)))) = 0xc1000000;
|
|
uVar7 = directSpawnCount;
|
|
this = savedFamiliar;
|
|
}
|
|
particleIndex = savedParticleIndex + 1;
|
|
savedParticleIndex = particleIndex;
|
|
} while (GHIDRA_INT(particleIndex) < particleCount);
|
|
}
|
|
local_114 = local_114 + -1;
|
|
} while (local_114 != 0);
|
|
sprite = &this->_sprite;
|
|
local_114 = 0;
|
|
}
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,6,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7,0);
|
|
Isaac::SwapANM2(&spawned->_sprite,sprite);
|
|
iVar9 = *GHIDRA_CAST<int *>(spawned);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x40)))) = 1;
|
|
(**(code **)(iVar9 + 0xc))();
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::RemoveCollectible(0x290,0,0,1);
|
|
this->Remove();
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006470c0
|
|
void * Entity_Familiar::get_item_config_entry()
|
|
{
|
|
void *pvVar1;
|
|
|
|
if (this->_variant == 0xe7) {
|
|
pvVar1 = ItemConfig::get_wisp_entry(this->_subtype,this->_coins);
|
|
return pvVar1;
|
|
}
|
|
pvVar1 = ItemConfig::get_wisp_entry(0x19,0);
|
|
return pvVar1;
|
|
}
|
|
|
|
// 00647170
|
|
uint8_t Entity_Familiar::abyss_locust_eat()
|
|
{
|
|
uint32_t uVar1;
|
|
int locustData;
|
|
uint32_t *appendResult;
|
|
uint8_t bVar2;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t extraout_CL_01;
|
|
uint8_t *cursor;
|
|
void *pvVar3;
|
|
void *spritesheetPath;
|
|
char acStack_60 [4];
|
|
char acStack_5c [4];
|
|
char acStack_58 [8];
|
|
uint32_t uStack_50;
|
|
void *gfxRoot [4];
|
|
uint32_t local_3c;
|
|
uint32_t local_38;
|
|
uint8_t fileName [32];
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af7125;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_UINT((fileName + 0x30));
|
|
ExceptionList = &local_10;
|
|
local_14 = uVar1;
|
|
if (this->_variant != 0xe7) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This should only be called on a locust\n"));
|
|
}
|
|
locustData = __RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::
|
|
RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0,uVar1);
|
|
if (*GHIDRA_CAST<uint8_t *>((locustData + 0x50)) < 0x19) {
|
|
bVar2 = *GHIDRA_CAST<uint8_t *>((locustData + 0x50)) + 1;
|
|
*GHIDRA_CAST<uint8_t *>((locustData + 0x50)) = bVar2;
|
|
if (GHIDRA_UINT(bVar2) % 5 == 1) {
|
|
sprintf(fileName,GHIDRA_CAST<uint8_t *>("hungry_%d.png"));
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(gfxRoot))))->msvc::string::string(&(g_manager->_itemConfig)._wispGfxRoot);
|
|
cursor = fileName;
|
|
local_8 = 0;
|
|
do {
|
|
bVar2 = *cursor;
|
|
cursor = cursor + 1;
|
|
} while (bVar2 != 0);
|
|
appendResult = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(gfxRoot))))->msvc::string::append(fileName,GHIDRA_INT(cursor) - GHIDRA_INT((fileName + 1)))
|
|
;
|
|
spritesheetPath = (void *)*appendResult;
|
|
acStack_60 = (char [4])appendResult[1];
|
|
acStack_5c = (char [4])appendResult[2];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(acStack_58)) + 0x0))) = appendResult[3];
|
|
unique0x0000a400 = *GHIDRA_CAST<uint64_t *>((appendResult + 4));
|
|
appendResult[4] = 0;
|
|
appendResult[5] = 0xf;
|
|
*GHIDRA_CAST<uint8_t *>(appendResult) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(&spritesheetPath));
|
|
local_8 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
bVar2 = extraout_CL;
|
|
if (0xf < uStack_50) {
|
|
uVar1 = uStack_50 + 1;
|
|
pvVar3 = spritesheetPath;
|
|
if (0xfff < uVar1) {
|
|
pvVar3 = *(void **)(GHIDRA_CAST<char *>(spritesheetPath) + -4);
|
|
uVar1 = uStack_50 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(spritesheetPath) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006472d2;
|
|
}
|
|
operator_delete(pvVar3,uVar1);
|
|
bVar2 = extraout_CL_00;
|
|
}
|
|
local_8 = -1;
|
|
if (0xf < local_38) {
|
|
uVar1 = local_38 + 1;
|
|
pvVar3 = gfxRoot[0];
|
|
if (0xfff < uVar1) {
|
|
pvVar3 = *(void **)(GHIDRA_INT(gfxRoot[0]) + -4);
|
|
uVar1 = local_38 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(gfxRoot[0]) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006472d2:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar1);
|
|
bVar2 = extraout_CL_01;
|
|
}
|
|
local_3c = 0;
|
|
local_38 = 0xf;
|
|
gfxRoot[0] = (void *)(GHIDRA_UINT(gfxRoot[0]) & 0xffffff00);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics(bVar2);
|
|
}
|
|
bVar2 = 1;
|
|
}
|
|
else {
|
|
bVar2 = 0;
|
|
}
|
|
ExceptionList = local_10;
|
|
return bVar2;
|
|
}
|
|
|
|
// 0064a2d0
|
|
uint8_t Entity_Familiar::break_grid_ahead()
|
|
{
|
|
float fVar1;
|
|
char cVar2;
|
|
int gridY;
|
|
int gridY;
|
|
void *pvVar4;
|
|
uint32_t rngValue;
|
|
float fVar5;
|
|
Vector *gridPos;
|
|
int iVar6;
|
|
uint32_t uVar7;
|
|
float *tearEffectEntry;
|
|
uint32_t uVar8;
|
|
uint32_t tearFlags1;
|
|
uint32_t tearFlags3;
|
|
uint32_t rolledEffectMask;
|
|
uint32_t tearFlags2;
|
|
uint32_t tearFlags0;
|
|
Vector local_68;
|
|
Vector local_60;
|
|
Vector local_58;
|
|
uint32_t uStack_50;
|
|
uint32_t uStack_4c;
|
|
uint32_t uStack_48;
|
|
uint32_t uStack_44;
|
|
int sourceRef;
|
|
int iStack_34;
|
|
int iStack_30;
|
|
int iStack_2c;
|
|
float fStack_28;
|
|
float fStack_24;
|
|
float fStack_20;
|
|
float fStack_1c;
|
|
uint32_t uStack_18;
|
|
Entity_Familiar *pEStack_14;
|
|
GridEntity *gridEntity;
|
|
Room *room;
|
|
|
|
fVar1 = (this->_velocity).y;
|
|
fVar5 = (this->_velocity).x;
|
|
local_58.x = (float)((10.0 < this->_collisionDamage) + 1);
|
|
local_60.x = (float)&this->_velocity;
|
|
iVar6 = GHIDRA_INT((((fVar5 + fVar5 + (this->_pos).x) - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar6 < 0) || (gridY = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc)), gridY <= iVar6)) ||
|
|
(gridY = GHIDRA_INT((((fVar1 + fVar1 + (this->_pos).y) - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x10)) <= gridY || (iVar6 = gridY * gridY + iVar6, iVar6 < 0))))
|
|
{
|
|
return 0;
|
|
}
|
|
local_68.x = (float)this;
|
|
gridY = __RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0);
|
|
if (gridY != 0) {
|
|
if (*GHIDRA_CAST<int *>((gridY + 0x3c)) == iVar6) {
|
|
return 0;
|
|
}
|
|
*GHIDRA_CAST<int *>((gridY + 0x3c)) = iVar6;
|
|
}
|
|
if (0x1bf < iVar6) {
|
|
return 0;
|
|
}
|
|
gridEntity = *GHIDRA_CAST<GridEntity **>((GHIDRA_CAST<char *>(g_game->_room) + iVar6 * 4 + 0x24));
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (gridEntity->_collisionClass == 1) {
|
|
return 0;
|
|
}
|
|
if (gridEntity->_collisionClass == 0) {
|
|
return 0;
|
|
}
|
|
pvVar4 = get_item_config_entry(this);
|
|
uVar7 = 0;
|
|
rolledEffectMask = 0;
|
|
tearFlags0 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 8));
|
|
tearFlags1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0xc));
|
|
tearFlags2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0x10));
|
|
tearFlags3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0x14));
|
|
tearEffectEntry = *GHIDRA_CAST<float **>((GHIDRA_CAST<char *>(pvVar4) + 0x68));
|
|
uStack_50 = tearFlags0;
|
|
uStack_4c = tearFlags1;
|
|
uStack_48 = tearFlags2;
|
|
uStack_44 = tearFlags3;
|
|
if (tearEffectEntry != *GHIDRA_CAST<float **>((GHIDRA_CAST<char *>(pvVar4) + 0x6c))) {
|
|
uVar8 = 1;
|
|
do {
|
|
if (((uVar7 & uVar8) == 0) && (0.0 < *tearEffectEntry)) {
|
|
rngValue = Random();
|
|
uVar7 = rolledEffectMask;
|
|
if ((float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 < *tearEffectEntry) {
|
|
tearFlags0 = tearFlags0 | GHIDRA_UINT(tearEffectEntry[2]);
|
|
tearFlags1 = tearFlags1 | GHIDRA_UINT(tearEffectEntry[3]);
|
|
tearFlags2 = tearFlags2 | GHIDRA_UINT(tearEffectEntry[4]);
|
|
tearFlags3 = tearFlags3 | GHIDRA_UINT(tearEffectEntry[5]);
|
|
rolledEffectMask = rolledEffectMask | GHIDRA_UINT(tearEffectEntry[7]);
|
|
uVar7 = rolledEffectMask;
|
|
}
|
|
}
|
|
tearEffectEntry = tearEffectEntry + 0x1a;
|
|
uVar8 = uVar8 << 1 | GHIDRA_UINT((GHIDRA_INT(uVar8) < 0));
|
|
} while (tearEffectEntry != *GHIDRA_CAST<float **>((GHIDRA_CAST<char *>(pvVar4) + 0x6c)));
|
|
}
|
|
cVar2 = gridEntity->CanTakeDamageFromTearEffects();
|
|
fVar1 = local_68.x;
|
|
if (cVar2 != '\0') {
|
|
if (((tearFlags0 & GHIDRA_UINT(g_tearFlagAcid._l)) == 0 && (tearFlags1 & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagAcid._l)) + 0x4)))) == 0)
|
|
&& ((tearFlags2 & GHIDRA_UINT(g_tearFlagAcid._h)) == 0 &&
|
|
(tearFlags3 & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagAcid._h)) + 0x4)))) == 0)) {
|
|
if (((tearFlags0 & GHIDRA_UINT(g_tearFlagRock._l)) == 0 &&
|
|
(tearFlags1 & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagRock._l)) + 0x4)))) == 0) &&
|
|
((tearFlags2 & GHIDRA_UINT(g_tearFlagRock._h)) == 0 && (tearFlags3 & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagRock._h)) + 0x4)))) == 0
|
|
)) goto LAB_0064a73c;
|
|
}
|
|
fStack_28 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_68.x) + 0x33c)))->x;
|
|
fStack_24 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_68.x) + 0x33c)))->y;
|
|
fStack_20 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_68.x) + 0x360)))->x;
|
|
sourceRef = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_68.x) + 0x28));
|
|
iStack_34 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_68.x) + 0x2c));
|
|
iStack_30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_68.x) + 0x34));
|
|
iStack_2c = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_68.x) + 0x38));
|
|
fStack_1c = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_68.x) + 0x360)))->y;
|
|
if ((*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(local_68.x) + 0x168)) & 0x20000000) == 0) {
|
|
uVar7 = 0;
|
|
}
|
|
else {
|
|
uVar7 = 2;
|
|
}
|
|
fVar5 = (float)(*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((GHIDRA_INT(local_68.x) + 0x168)) + 4)) & 0x400000);
|
|
if (fVar5 == 0.0) {
|
|
uVar8 = 0;
|
|
}
|
|
else {
|
|
uVar8 = 4;
|
|
}
|
|
pEStack_14 = GHIDRA_CAST<Entity_Familiar *>(local_68.x);
|
|
uStack_18 = uVar8 | uVar7 | GHIDRA_UINT(((*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(local_68.x) + 0x168)) & 0x100) != 0));
|
|
local_68.x = fVar5;
|
|
cVar2 = gridEntity->Destroy(0,&sourceRef);
|
|
if (cVar2 != '\0') {
|
|
Vector::ToCardinal(&local_58,GHIDRA_CAST<Vector *>(local_60.x));
|
|
if ((local_58.x == g_vectorZero.x) && (local_58.y == g_vectorZero.y)) {
|
|
return 1;
|
|
}
|
|
gridPos = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Position(&local_68);
|
|
local_60.x = local_58.x * 40.0 + gridPos->x;
|
|
local_60.y = local_58.y * 40.0 + gridPos->y;
|
|
room = g_game->_room;
|
|
iVar6 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&local_60);
|
|
if (iVar6 < 0) {
|
|
return 1;
|
|
}
|
|
if (iVar6 < 0x1c0) {
|
|
(GHIDRA_CAST<Room *>((room)))->Room::TryMakeBridge(room->_gridEntities[iVar6],gridEntity);
|
|
return 1;
|
|
}
|
|
(GHIDRA_CAST<Room *>((room)))->Room::TryMakeBridge(GHIDRA_CAST<GridEntity *>(0x0),gridEntity);
|
|
return 1;
|
|
}
|
|
}
|
|
LAB_0064a73c:
|
|
fStack_28 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar1) + 0x33c)))->x;
|
|
fStack_24 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar1) + 0x33c)))->y;
|
|
local_68.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(gridEntity) + 0x10));
|
|
sourceRef = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar1) + 0x28));
|
|
iStack_34 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar1) + 0x2c));
|
|
iStack_30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar1) + 0x34));
|
|
iStack_2c = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar1) + 0x38));
|
|
fStack_20 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar1) + 0x360)))->x;
|
|
fStack_1c = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar1) + 0x360)))->y;
|
|
if ((*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(fVar1) + 0x168)) & 0x20000000) == 0) {
|
|
uVar7 = 0;
|
|
}
|
|
else {
|
|
uVar7 = 2;
|
|
}
|
|
local_60.x = (float)(*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((GHIDRA_INT(fVar1) + 0x168)) + 4)) & 0x400000);
|
|
if (local_60.x == 0.0) {
|
|
uVar8 = 0;
|
|
}
|
|
else {
|
|
uVar8 = 4;
|
|
}
|
|
pEStack_14 = GHIDRA_CAST<Entity_Familiar *>(fVar1);
|
|
uStack_18 = uVar8 | uVar7 | GHIDRA_UINT(((*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(fVar1) + 0x168)) & 0x100) != 0));
|
|
(*(code *)local_68.x)(local_58.x,&sourceRef);
|
|
return 1;
|
|
}
|
|
|
|
// 0064a830
|
|
void Entity_Familiar::load_config_graphics()
|
|
{
|
|
uint8_t bVar1;
|
|
uint32_t uVar2;
|
|
void *wispEntry;
|
|
uint8_t *pbVar3;
|
|
uint32_t animCompare;
|
|
int iVar4;
|
|
uint32_t *appendedPath;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t extraout_CL_01;
|
|
int collectibleId;
|
|
std_string *animNameCursor;
|
|
void *freeBlock;
|
|
bool isLess;
|
|
std_string *defaultAnim;
|
|
void *sheetPath;
|
|
char acStack_70 [4];
|
|
char acStack_6c [4];
|
|
char acStack_68 [8];
|
|
uint32_t sheetPathCapacity;
|
|
void *basePath [4];
|
|
uint32_t basePathSize;
|
|
uint32_t basePathCapacity;
|
|
uint8_t sheetFileName [32];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = sheetFileName + 0x40;
|
|
local_14 = -1;
|
|
puStack_18 = &LAB_00af7285;
|
|
local_1c = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((sheetFileName + 0x34));
|
|
ExceptionList = &local_1c;
|
|
if (this->_variant == 0xe7) {
|
|
iVar4 = this->_coins;
|
|
collectibleId = this->_subtype;
|
|
}
|
|
else {
|
|
collectibleId = 0x19;
|
|
iVar4 = 0;
|
|
}
|
|
local_24 = uVar2;
|
|
wispEntry = ItemConfig::get_wisp_entry(collectibleId,iVar4);
|
|
if (this->_config == (void *)0x0) goto LAB_0064aa74;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
|
|
defaultAnim = &(this->_sprite)._animDefaultName;
|
|
if (0xf < (this->_sprite)._animDefaultName._capacity) {
|
|
defaultAnim = *GHIDRA_CAST<std_string **>(defaultAnim->_buf);
|
|
}
|
|
pbVar3 = (this->_sprite)._animState._animData;
|
|
if (pbVar3 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0064a90e:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(defaultAnim),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar3 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar3);
|
|
}
|
|
animNameCursor = defaultAnim;
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
isLess = bVar1 < (uint8_t)animNameCursor->_buf[0];
|
|
if (bVar1 != animNameCursor->_buf[0]) {
|
|
LAB_0064a8f6:
|
|
animCompare = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0064a8fb;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
isLess = bVar1 < (uint8_t)animNameCursor->_buf[1];
|
|
if (bVar1 != animNameCursor->_buf[1]) goto LAB_0064a8f6;
|
|
pbVar3 = pbVar3 + 2;
|
|
animNameCursor = GHIDRA_CAST<std_string *>((animNameCursor->_buf + 2));
|
|
} while (bVar1 != 0);
|
|
animCompare = 0;
|
|
LAB_0064a8fb:
|
|
if ((animCompare != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0064a90e;
|
|
}
|
|
iVar4 = __RTDynamicCast(this->_extraData,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0,uVar2);
|
|
if (((*GHIDRA_CAST<uint32_t *>((iVar4 + 0x18)) | *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(wispEntry) + 0x18))) & 0x40000) != 0) {
|
|
sprintf(sheetFileName,GHIDRA_CAST<uint8_t *>("hungry_%d.png"));
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(basePath))))->msvc::string::string(&(g_manager->_itemConfig)._wispGfxRoot);
|
|
pbVar3 = sheetFileName;
|
|
local_14 = 0;
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
pbVar3 = pbVar3 + 1;
|
|
} while (bVar1 != 0);
|
|
appendedPath = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(basePath))))->msvc::string::append(sheetFileName,
|
|
GHIDRA_INT(pbVar3) - GHIDRA_INT((sheetFileName + 1)));
|
|
sheetPath = (void *)*appendedPath;
|
|
acStack_70 = (char [4])appendedPath[1];
|
|
acStack_6c = (char [4])appendedPath[2];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(acStack_68)) + 0x0))) = appendedPath[3];
|
|
unique0x0000a400 = *GHIDRA_CAST<uint64_t *>((appendedPath + 4));
|
|
appendedPath[4] = 0;
|
|
appendedPath[5] = 0xf;
|
|
*GHIDRA_CAST<uint8_t *>(appendedPath) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(&sheetPath));
|
|
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
bVar1 = extraout_CL;
|
|
if (0xf < sheetPathCapacity) {
|
|
uVar2 = sheetPathCapacity + 1;
|
|
freeBlock = sheetPath;
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)(GHIDRA_CAST<char *>(sheetPath) + -4);
|
|
uVar2 = sheetPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(sheetPath) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0064aa4a;
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
bVar1 = extraout_CL_00;
|
|
}
|
|
local_14 = -1;
|
|
if (0xf < basePathCapacity) {
|
|
uVar2 = basePathCapacity + 1;
|
|
freeBlock = basePath[0];
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)(GHIDRA_INT(basePath[0]) + -4);
|
|
uVar2 = basePathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(basePath[0]) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
LAB_0064aa4a:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
bVar1 = extraout_CL_01;
|
|
}
|
|
basePathSize = 0;
|
|
basePathCapacity = 0xf;
|
|
basePath[0] = (void *)(GHIDRA_UINT(basePath[0]) & 0xffffff00);
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics(bVar1);
|
|
}
|
|
LAB_0064aa74:
|
|
anm2_apply_gfx_overrides
|
|
(GHIDRA_CAST<std_string *>((GHIDRA_INT(wispEntry) + 0x84)),GHIDRA_CAST<std_string *>((GHIDRA_INT(wispEntry) + 0x9c)),
|
|
&this->_sprite);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0064b6c0
|
|
void Entity_Familiar::render_abyss_locust_sprite(ANM2 *param_2, float *param_3)
|
|
{
|
|
void *wispEntry;
|
|
int collectibleId;
|
|
int index;
|
|
float fVar1;
|
|
float fVar2;
|
|
double dVar3;
|
|
Vector screenPos [8];
|
|
|
|
if (param_2->_loaded != 0) {
|
|
fVar1 = (param_2->_color)._tint[3];
|
|
if (this->_state == -1) {
|
|
fVar1 = fVar1 + 0.04;
|
|
fVar2 = 1.0;
|
|
if (fVar1 <= 1.0) {
|
|
fVar2 = fVar1;
|
|
}
|
|
}
|
|
else {
|
|
fVar1 = fVar1 - 0.04;
|
|
fVar2 = 0.0;
|
|
if (0.0 <= fVar1) {
|
|
fVar2 = fVar1;
|
|
}
|
|
if (fVar2 == 0.0) {
|
|
(GHIDRA_CAST<ANM2 *>((param_2)))->ANM2::Reset();
|
|
return;
|
|
}
|
|
}
|
|
(param_2->_color)._tint[3] = fVar2;
|
|
if (0.0 < fVar2) {
|
|
if (this->_variant == 0xe7) {
|
|
collectibleId = this->_subtype;
|
|
index = this->_coins;
|
|
}
|
|
else {
|
|
collectibleId = 0x19;
|
|
index = 0;
|
|
}
|
|
wispEntry = ItemConfig::get_wisp_entry(collectibleId,index);
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(wispEntry) + 0x78)) * 0.45;
|
|
fVar1 = (this->_sizeMulti).x;
|
|
(param_2->_scale).y = fVar2 * (this->_sizeMulti).y;
|
|
(param_2->_scale).x = fVar2 * fVar1;
|
|
if (param_2->_loaded != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((¶m_2->_animState)))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((¶m_2->_overlayAnimState)))->AnimationState::Update();
|
|
}
|
|
fVar1 = g_displayPixelRatio * g_screenPointScale;
|
|
dVar3 = floor((double)(((((this->_pos).x + 0.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5
|
|
) * fVar1 + 0.5));
|
|
screenPos[0].x = (float)dVar3 / fVar1;
|
|
dVar3 = floor((double)(((((this->_pos).y - 25.0) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * fVar1 + 0.5));
|
|
screenPos[0].x = screenPos[0].x + *param_3;
|
|
screenPos[0].y = (float)dVar3 / fVar1 + param_3[1];
|
|
(GHIDRA_CAST<ANM2 *>((param_2)))->ANM2::Render(screenPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0064b920
|
|
void Entity_Familiar::siren_charm(Entity *siren, Entity_Player *player)
|
|
{
|
|
uint32_t uVar1;
|
|
uint32_t seed;
|
|
Entity *sirenHelper;
|
|
uint32_t *helperRef;
|
|
Entity_Familiar *local_c [2];
|
|
int *collectibleCount;
|
|
|
|
if (this->_sirenOriginalPlayer == (void *)0x0) {
|
|
this->_sirenOriginalPlayer = this->_player;
|
|
}
|
|
local_c[0] = this;
|
|
if (this->_player != player) {
|
|
set_player(this,player);
|
|
}
|
|
this->_fireCooldown = 0x2d;
|
|
if (this->_target != 0) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Familiar *>(&this->_target);
|
|
msvc::multiset<unsigned_int>::erase(local_c);
|
|
}
|
|
this->_target = 0;
|
|
seed = Random();
|
|
sirenHelper = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(0x3c6,0,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed,0);
|
|
if (sirenHelper->_parent != 0) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Familiar *>(&sirenHelper->_parent);
|
|
msvc::multiset<unsigned_int>::erase(local_c);
|
|
}
|
|
sirenHelper->_parent = siren;
|
|
if (siren != GHIDRA_CAST<Entity *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(&sirenHelper->_parent);
|
|
}
|
|
if (sirenHelper->_target != 0) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Familiar *>(&sirenHelper->_target);
|
|
msvc::multiset<unsigned_int>::erase(local_c);
|
|
}
|
|
sirenHelper->_target = this;
|
|
msvc::multiset<unsigned_int>::insert(&sirenHelper->_target);
|
|
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&sirenHelper->_flags) + 4));
|
|
*GHIDRA_CAST<uint32_t *>(&sirenHelper->_flags) = GHIDRA_UINT(sirenHelper->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&sirenHelper->_flags) + 4)) = uVar1;
|
|
sirenHelper->_health = sirenHelper->_maxHitPoints;
|
|
sirenHelper->Update();
|
|
if (this->_variant == 0x41) {
|
|
collectibleCount = GHIDRA_CAST<int *>((GHIDRA_INT((player->_collectibleCounts)._begin) + 0x45c));
|
|
*collectibleCount = *collectibleCount + 1;
|
|
}
|
|
else if (this->_variant == 0x20) {
|
|
collectibleCount = GHIDRA_CAST<int *>((GHIDRA_INT((player->_collectibleCounts)._begin) + 0x1c0));
|
|
*collectibleCount = *collectibleCount + 1;
|
|
}
|
|
this->_sirenCharmFrames = 1;
|
|
helperRef = &this->_sirenHelper;
|
|
if (GHIDRA_CAST<Entity *>(*helperRef) != sirenHelper) {
|
|
if (GHIDRA_CAST<Entity *>(*helperRef) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_c[0] = GHIDRA_CAST<Entity_Familiar *>(helperRef);
|
|
msvc::multiset<unsigned_int>::erase(local_c);
|
|
}
|
|
*helperRef = sirenHelper;
|
|
msvc::multiset<unsigned_int>::insert(helperRef);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0064bab0
|
|
void Entity_Familiar::RemoveFromPlayer()
|
|
{
|
|
int *local_8;
|
|
int *familiarCounter;
|
|
void *player;
|
|
uint32_t *sirenHelperRef;
|
|
|
|
if (this->_sirenOriginalPlayer != (void *)0x0) {
|
|
player = this->_player;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(player) + 0x170)) == '\0') {
|
|
if (this->_variant == 0x41) {
|
|
familiarCounter = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x16c8)) + 0x45c));
|
|
*familiarCounter = *familiarCounter + -1;
|
|
}
|
|
else if (this->_variant == 0x20) {
|
|
familiarCounter = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x16c8)) + 0x1c0));
|
|
*familiarCounter = *familiarCounter + -1;
|
|
}
|
|
}
|
|
set_player(this,this->_sirenOriginalPlayer);
|
|
}
|
|
sirenHelperRef = &this->_sirenHelper;
|
|
this->_sirenCharmFrames = 0;
|
|
this->_sirenOriginalPlayer = (void *)0x0;
|
|
if (GHIDRA_CAST<int *>(this->_sirenHelper) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_sirenHelper) + 0x28))();
|
|
if (*sirenHelperRef != 0) {
|
|
local_8 = sirenHelperRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_8);
|
|
*sirenHelperRef = 0;
|
|
}
|
|
}
|
|
if (this->_variant == 0xdc) {
|
|
this->Remove();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0064ca30
|
|
void Entity_Familiar::UpdateDirtColor(uint8_t Immediate)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
uint8_t bVar4;
|
|
LayerState *layer;
|
|
ColorMod *lerpedColor;
|
|
uint8_t *****pppppbVar5;
|
|
uint8_t *****pppppbVar6;
|
|
uint32_t uVar7;
|
|
ColorMod *layerColor;
|
|
uint32_t freeSize;
|
|
ColorMod lerpResult;
|
|
ANM2 *sprite;
|
|
Entity_Familiar *familiar;
|
|
ColorMod *dirtColor;
|
|
LayerState *currentLayer;
|
|
uint8_t *****layerNameBuf;
|
|
uint32_t local_64;
|
|
uint8_t *layerIndex;
|
|
char isDirtLayer;
|
|
uint32_t cleanupFlags;
|
|
uint8_t *****layerName [4];
|
|
uint32_t layerNameSize;
|
|
uint32_t layerNameCapacity;
|
|
uint8_t *****layerNameCopy;
|
|
KColor local_38;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint8_t ****local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((layerName + 0x14));
|
|
local_14 = GHIDRA_CAST<uint8_t ****>(0xffffffff);
|
|
puStack_18 = &LAB_00af739e;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((layerName + 0x11));
|
|
ExceptionList = &local_1c;
|
|
local_64 = 0;
|
|
cleanupFlags = 0;
|
|
familiar = this;
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetFloorColorAt(&local_38,&this->_pos,this->_size);
|
|
dirtColor = &this->_dirtColor;
|
|
(this->_dirtColor)._tint[3] = 1.0;
|
|
dirtColor->_tint[0] = local_38._red * 2.0;
|
|
(this->_dirtColor)._tint[1] = local_38._green * 2.0;
|
|
(this->_dirtColor)._tint[2] = local_38._blue * 2.0;
|
|
layerIndex = GHIDRA_CAST<uint8_t *>(0x0);
|
|
if ((this->_sprite)._layerCount == 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
sprite = &this->_sprite;
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::GetLayer(layerIndex);
|
|
cleanupFlags = cleanupFlags | 4;
|
|
currentLayer = layer;
|
|
if (layer->_layerData == (void *)0x0) {
|
|
layerNameCapacity = 0xf;
|
|
layerNameSize = 0;
|
|
layerName[0] = GHIDRA_CAST<uint8_t *****>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(layerName))))->msvc::string::string((void *)(GHIDRA_INT(layer->_layerData) + 8));
|
|
}
|
|
local_14 = GHIDRA_CAST<uint8_t ****>(0x0);
|
|
local_64 = cleanupFlags | 1;
|
|
pppppbVar6 = GHIDRA_CAST<uint8_t *****>(layerName);
|
|
if (0xf < layerNameCapacity) {
|
|
pppppbVar6 = layerName[0];
|
|
}
|
|
layerNameBuf = layerName[0];
|
|
cleanupFlags = local_64;
|
|
bVar4 = str_eq(GHIDRA_CAST<uint8_t *>(pppppbVar6),layerNameSize,&DAT_00b64428,4);
|
|
if (bVar4 == 0) {
|
|
cleanupFlags = cleanupFlags | 8;
|
|
if (layer->_layerData == (void *)0x0) {
|
|
layerNameCopy = GHIDRA_CAST<uint8_t *****>(0x0);
|
|
local_38._unk = 0xf;
|
|
local_38._alpha = 0.0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&layerNameCopy))))->msvc::string::string((void *)(GHIDRA_INT(layer->_layerData) + 8));
|
|
}
|
|
uVar7 = local_38._unk;
|
|
pppppbVar6 = layerNameCopy;
|
|
cleanupFlags = cleanupFlags | 2;
|
|
pppppbVar5 = GHIDRA_CAST<uint8_t *****>(&layerNameCopy);
|
|
if (0xf < GHIDRA_UINT(local_38._unk)) {
|
|
pppppbVar5 = layerNameCopy;
|
|
}
|
|
bVar4 = str_eq(GHIDRA_CAST<uint8_t *>(pppppbVar5),GHIDRA_UINT(local_38._alpha),&DAT_00b1d57c,4);
|
|
if (bVar4 != 0) goto LAB_0064cbdf;
|
|
isDirtLayer = '\0';
|
|
}
|
|
else {
|
|
pppppbVar6 = layerNameCopy;
|
|
uVar7 = local_38._unk;
|
|
LAB_0064cbdf:
|
|
isDirtLayer = '\x01';
|
|
}
|
|
if (((cleanupFlags & 2) != 0) && (cleanupFlags = cleanupFlags & 0xfffffffd, 0xf < uVar7)) {
|
|
freeSize = uVar7 + 1;
|
|
pppppbVar5 = pppppbVar6;
|
|
if (0xfff < freeSize) {
|
|
pppppbVar5 = GHIDRA_CAST<uint8_t *****>(pppppbVar6[-1]);
|
|
freeSize = uVar7 + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(pppppbVar6) + (-4 - GHIDRA_INT(pppppbVar5))))) goto LAB_0064ccc7;
|
|
}
|
|
operator_delete(pppppbVar5,freeSize);
|
|
}
|
|
local_14 = GHIDRA_CAST<uint8_t ****>(0xffffffff);
|
|
if (((cleanupFlags & 1) != 0) &&
|
|
(cleanupFlags = cleanupFlags & 0xfffffffe, 0xf < layerNameCapacity)) {
|
|
uVar7 = layerNameCapacity + 1;
|
|
pppppbVar6 = layerNameBuf;
|
|
if (0xfff < uVar7) {
|
|
pppppbVar6 = GHIDRA_CAST<uint8_t *****>(layerNameBuf[-1]);
|
|
uVar7 = layerNameCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(layerNameBuf) + (-4 - GHIDRA_INT(pppppbVar6))))) {
|
|
LAB_0064ccc7:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppbVar6,uVar7);
|
|
}
|
|
layer = currentLayer;
|
|
if (isDirtLayer != '\0') {
|
|
layerColor = ¤tLayer->_color;
|
|
lerpedColor = Color::Lerp(&lerpResult,layerColor,dirtColor,1.0);
|
|
if (layerColor != lerpedColor) {
|
|
fVar1 = lerpedColor->_tint[1];
|
|
fVar2 = lerpedColor->_tint[2];
|
|
fVar3 = lerpedColor->_tint[3];
|
|
layerColor->_tint[0] = lerpedColor->_tint[0];
|
|
(layer->_color)._tint[1] = fVar1;
|
|
(layer->_color)._tint[2] = fVar2;
|
|
(layer->_color)._tint[3] = fVar3;
|
|
fVar1 = lerpedColor->_colorize[1];
|
|
fVar2 = lerpedColor->_colorize[2];
|
|
fVar3 = lerpedColor->_colorize[3];
|
|
(layer->_color)._colorize[0] = lerpedColor->_colorize[0];
|
|
(layer->_color)._colorize[1] = fVar1;
|
|
(layer->_color)._colorize[2] = fVar2;
|
|
(layer->_color)._colorize[3] = fVar3;
|
|
fVar1 = lerpedColor->_offset[1];
|
|
(layer->_color)._offset[0] = lerpedColor->_offset[0];
|
|
(layer->_color)._offset[1] = fVar1;
|
|
(layer->_color)._offset[2] = lerpedColor->_offset[2];
|
|
}
|
|
}
|
|
layerIndex = layerIndex + 1;
|
|
if (GHIDRA_CAST<uint8_t *>((familiar->_sprite)._layerCount) <= layerIndex) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 0064d1d0
|
|
void Entity_Familiar::update_star_of_bethlehem_speed(uint8_t isForce)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
int fromRoomIdx;
|
|
short starPathLength;
|
|
short playerPathLength;
|
|
uint32_t toRoomIdx;
|
|
short roomDistances [194];
|
|
uint32_t stackCookie;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((roomDistances + 0xc4));
|
|
if ((isForce == 0) &&
|
|
((fVar1 = (this->_formationOffset).x, fVar1 != g_vectorZero.x ||
|
|
((this->_formationOffset).y != g_vectorZero.y)))) {
|
|
if (g_game->_currentDimensionIdx != 0) {
|
|
LAB_0064d32e:
|
|
this->_orbitAngleOffset = 0.25;
|
|
return;
|
|
}
|
|
fVar2 = (this->_formationOffset).y;
|
|
fromRoomIdx = g_game->_currentRoomIdx;
|
|
toRoomIdx = star_of_bethlehem_get_target_room();
|
|
if (-1 < fromRoomIdx) {
|
|
starPathLength =
|
|
Level::compute_room_distances
|
|
(roomDistances,GHIDRA_INT((fVar2 + 0.5)) * 0xd + GHIDRA_INT((fVar1 + 0.5)),toRoomIdx,
|
|
GHIDRA_CAST<uint32_t *>(0x0));
|
|
playerPathLength =
|
|
Level::compute_room_distances(roomDistances,fromRoomIdx,toRoomIdx,GHIDRA_CAST<uint32_t *>(0x0));
|
|
if (starPathLength + 9 < GHIDRA_INT(playerPathLength)) goto LAB_0064d32e;
|
|
if (starPathLength < playerPathLength) {
|
|
this->_orbitAngleOffset = 0.5;
|
|
return;
|
|
}
|
|
if (playerPathLength + 9 < GHIDRA_INT(starPathLength)) {
|
|
this->_orbitAngleOffset = 8.0;
|
|
return;
|
|
}
|
|
if (playerPathLength < starPathLength) {
|
|
this->_orbitAngleOffset = 4.0;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
this->_orbitAngleOffset = 1.0;
|
|
return;
|
|
}
|
|
|
|
// 0064e0c0
|
|
void Entity_Familiar::ai_blood_clot(uint8_t isPostMove)
|
|
{
|
|
int *piVar1;
|
|
char **ppcVar2;
|
|
uint8_t bVar3;
|
|
char isRottenHeartsPickable;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
uint32_t rngResult;
|
|
Entity *pEVar6;
|
|
int *piVar7;
|
|
int gridCollisionClass;
|
|
LayerState *layer;
|
|
Vector *pVVar8;
|
|
Entity **ppEVar9;
|
|
void *nearbyPlayer;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *player;
|
|
void *nearbyEntity;
|
|
float fVar10;
|
|
float fVar11;
|
|
float fVar12;
|
|
float fVar13;
|
|
float distSq;
|
|
Entity *pEVar14;
|
|
float dx;
|
|
Entity *pEVar15;
|
|
undefined3 in_stack_00000005;
|
|
EntityRef sourceRef;
|
|
Vector local_8c;
|
|
float local_84;
|
|
uint8_t local_80 [12];
|
|
Entity *local_74 [2];
|
|
Entity *local_6c;
|
|
float local_68;
|
|
Entity_Familiar *selfFamiliar;
|
|
uint8_t local_60 [8];
|
|
Vector local_58;
|
|
float local_50;
|
|
Entity *local_4c;
|
|
uint8_t isMoving;
|
|
Entity *local_44;
|
|
Entity *local_40;
|
|
Entity *local_3c;
|
|
Entity *local_38;
|
|
char *walkAnims [4];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
char *local_14;
|
|
ColorMod *effectColor;
|
|
Manager *manager;
|
|
int oldParent;
|
|
code *takeDamageFn;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((walkAnims + 0xc));
|
|
local_14 = GHIDRA_CAST<char *>(0xffffffff);
|
|
puStack_18 = &LAB_00af741d;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((walkAnims + 9));
|
|
oldParent = this->_state;
|
|
walkAnims[0] = "WalkLeft";
|
|
walkAnims[1] = "WalkUp";
|
|
walkAnims[2] = "WalkRight";
|
|
walkAnims[3] = "WalkDown";
|
|
if (oldParent == 1) {
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
return;
|
|
}
|
|
if (isPostMove == 0) {
|
|
this->_entityCollisionClass = 3;
|
|
this->_state = 0;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
selfFamiliar = this;
|
|
local_24 = uVar4;
|
|
if (oldParent < 2) {
|
|
ppcVar2 = walkAnims + 0xc;
|
|
if ((oldParent == -1000) &&
|
|
((ppcVar2 = walkAnims + 0xc, this->_player == (void *)0x0 ||
|
|
(bVar3 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(this->_player) + 0x1508)),0x2c9),
|
|
ppcVar2 = GHIDRA_CAST<char **>(puStack_20), bVar3 == 0)))) {
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(ppcVar2);
|
|
this->_state = 0;
|
|
ppcVar2 = GHIDRA_CAST<char **>(puStack_20);
|
|
}
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(ppcVar2);
|
|
player = this->_player;
|
|
local_40 = GHIDRA_CAST<Entity *>(g_vectorZero.x);
|
|
oldParent = player->_entityGridCollisionClass;
|
|
local_3c = GHIDRA_CAST<Entity *>(g_vectorZero.y);
|
|
if ((((oldParent == 0) || (oldParent == 3)) || (oldParent == 1)) ||
|
|
(fVar10 = 7.00649e-45, oldParent == 2)) {
|
|
fVar10 = 4.2039e-45;
|
|
}
|
|
this->_entityGridCollisionClass = GHIDRA_INT(fVar10);
|
|
local_38 = GHIDRA_CAST<Entity *>(player->_movespeed);
|
|
local_4c = GHIDRA_CAST<Entity *>(0x3f800000);
|
|
local_50 = fVar10;
|
|
if ((player->_isControlsEnabled != 0) && (player->_controlsCooldown < 1)) {
|
|
pVVar8 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetMovementJoystick(&local_58);
|
|
local_40 = GHIDRA_CAST<Entity *>(pVVar8->x);
|
|
local_3c = GHIDRA_CAST<Entity *>(pVVar8->y);
|
|
if (((this->_flags & 0x8000) != 0) && (fVar10 == 7.00649e-45)) {
|
|
local_3c = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
fVar10 = sqrtf((float)local_3c * (float)local_3c + (float)local_40 * (float)local_40);
|
|
player = extraout_ECX;
|
|
if (((float)local_4c < fVar10) && (0.0 < fVar10)) {
|
|
local_40 = GHIDRA_CAST<Entity *>((((float)local_4c / fVar10) * (float)local_40));
|
|
local_3c = GHIDRA_CAST<Entity *>(((float)local_3c * ((float)local_4c / fVar10)));
|
|
}
|
|
}
|
|
bVar3 = input_is_action_pressed
|
|
(0xb,GHIDRA_INT(this->_player[5]._color._colorize[0]),this->_player,GHIDRA_INT(player));
|
|
if (bVar3 == 0) {
|
|
pEVar6 = local_3c;
|
|
}
|
|
else {
|
|
local_40 = GHIDRA_CAST<Entity *>(g_vectorZero.x);
|
|
pEVar6 = GHIDRA_CAST<Entity *>(g_vectorZero.y);
|
|
}
|
|
(this->_targetPosition).x = (float)local_40;
|
|
(this->_targetPosition).y = (float)pEVar6;
|
|
local_3c = GHIDRA_CAST<Entity *>(0x0);
|
|
local_44 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (((float)local_40 != g_vectorZero.x) || ((float)pEVar6 != g_vectorZero.y)) {
|
|
local_44 = local_40;
|
|
local_3c = pEVar6;
|
|
}
|
|
this->_moveDirection = -1;
|
|
local_68 = (float)local_38 * 0.25 + 0.75;
|
|
local_40 = GHIDRA_CAST<Entity *>(((float)local_40 * local_68));
|
|
local_68 = local_68 * (float)pEVar6;
|
|
if (ABS((float)local_40) <= ABS(local_68)) {
|
|
if (local_68 < 0.0) {
|
|
this->_moveDirection = 1;
|
|
goto LAB_0064eea4;
|
|
}
|
|
oldParent = this->_moveDirection;
|
|
if (0.0 < local_68) {
|
|
oldParent = 3;
|
|
}
|
|
}
|
|
else {
|
|
oldParent = 0;
|
|
if (0.0 <= (float)local_40) {
|
|
oldParent = 2;
|
|
}
|
|
}
|
|
this->_moveDirection = oldParent;
|
|
LAB_0064eea4:
|
|
uVar4 = GHIDRA_UINT(this->_flags);
|
|
local_58.x = (float)local_44;
|
|
local_58.y = (float)local_3c;
|
|
if ((((float)local_40 != 0.0) || (local_68 != 0.0)) &&
|
|
(((uVar4 & 0x8000) == 0 || (local_50 != 7.00649e-45)))) {
|
|
local_74[0] = GHIDRA_CAST<Entity *>((this->_velocity).y);
|
|
local_8c.y = (this->_velocity).x;
|
|
fVar10 = local_68 * (float)local_74[0] + (float)local_40 * local_8c.y;
|
|
local_84 = (float)local_40 * fVar10;
|
|
local_6c = GHIDRA_CAST<Entity *>((fVar10 * local_68));
|
|
fVar10 = sqrtf(0.8);
|
|
(this->_velocity).y = ((float)local_74[0] - (float)local_6c) * fVar10 + (float)local_6c;
|
|
(this->_velocity).x = (local_8c.y - local_84) * fVar10 + local_84;
|
|
uVar4 = GHIDRA_UINT(this->_flags);
|
|
}
|
|
local_6c = GHIDRA_CAST<Entity *>(0x0);
|
|
local_74[0] = (Entity *)
|
|
((local_68 * (this->_velocity).y + (float)local_40 * (this->_velocity).x) * -0.2);
|
|
ppEVar9 = local_74;
|
|
if ((float)local_74[0] <= 0.0) {
|
|
ppEVar9 = &local_6c;
|
|
}
|
|
local_74[0] = GHIDRA_CAST<Entity *>((((float)*ppEVar9 / (float)local_38 + 3.0) * 0.4));
|
|
fVar10 = sqrtf(0.775);
|
|
fVar12 = ((float)local_74[0] * 0.25 - (float)local_74[0]) * 0.0 + (float)local_74[0];
|
|
fVar11 = local_68 * 0.5 * fVar12 + (this->_velocity).y;
|
|
(this->_velocity).x = ((float)local_40 * 0.5 * fVar12 + (this->_velocity).x) * fVar10;
|
|
if (((uVar4 & 0x8000) == 0) || (local_50 != 7.00649e-45)) {
|
|
fVar11 = fVar11 * fVar10;
|
|
}
|
|
else {
|
|
fVar11 = fVar11 + 0.225;
|
|
}
|
|
(this->_velocity).y = fVar11;
|
|
local_38 = _isPostMove;
|
|
if (isPostMove == 0) {
|
|
if (((float)local_44 != g_vectorZero.x) ||
|
|
(isMoving = isPostMove, (float)local_3c != g_vectorZero.y)) {
|
|
isMoving = 1;
|
|
}
|
|
pEVar6 = local_44;
|
|
pEVar15 = local_3c;
|
|
fVar10 = g_vectorZero.y;
|
|
fVar11 = g_vectorZero.x;
|
|
if (this->_entityGridCollisionClass == 5) {
|
|
if (((float)local_44 == g_vectorZero.x) && ((float)local_3c == g_vectorZero.y)) {
|
|
local_40 = GHIDRA_CAST<Entity *>(s_Idle);
|
|
}
|
|
else {
|
|
oldParent = vector_to_direction(&local_58);
|
|
local_40 = GHIDRA_CAST<Entity *>(walkAnims[oldParent]);
|
|
pEVar15 = local_3c;
|
|
}
|
|
}
|
|
else {
|
|
local_40 = GHIDRA_CAST<Entity *>(0xb1d4d0);
|
|
}
|
|
fVar12 = 24.0;
|
|
uVar5 = -GHIDRA_UINT((this->_subtype != 0)) & this->_subtype;
|
|
uVar4 = 7;
|
|
if (uVar5 < 7) {
|
|
uVar4 = uVar5;
|
|
}
|
|
pEVar14 = *GHIDRA_CAST<Entity **>((&DAT_00c3423c + uVar4 * 100));
|
|
local_3c = *GHIDRA_CAST<Entity **>((&DAT_00c34240 + uVar4 * 100));
|
|
if (8 < this->_headFrameDelay) {
|
|
local_3c = GHIDRA_CAST<Entity *>(((float)local_3c + 24.0));
|
|
}
|
|
local_74[0] = pEVar14;
|
|
bVar3 = CanPlayerFire(this);
|
|
if (((bVar3 == 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x162c)) == -1)) ||
|
|
(this->_shootDirection == -1)) {
|
|
if (((float)pEVar6 == fVar11) && ((float)pEVar15 == fVar10)) {
|
|
fVar10 = 3.0;
|
|
}
|
|
else {
|
|
oldParent = vector_to_direction(&local_58);
|
|
fVar12 = 24.0;
|
|
fVar10 = (float)oldParent;
|
|
pEVar14 = local_74[0];
|
|
}
|
|
local_50 = (72.0 - fVar10 * fVar12) + (float)pEVar14;
|
|
}
|
|
else {
|
|
local_50 = (72.0 - (float)this->_shootDirection * fVar12) + (float)pEVar14;
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
(layer->_cropOffset).x = local_50;
|
|
(layer->_cropOffset).y = (float)local_3c;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
(layer->_cropOffset).x = local_50;
|
|
(layer->_cropOffset).y = (float)local_3c;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(local_40),0);
|
|
pEVar6 = local_4c;
|
|
if (((isMoving != 0) &&
|
|
(local_74[0] = local_4c, (this->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
fVar10 = (this->_velocity).y;
|
|
fVar11 = (this->_velocity).x;
|
|
fVar10 = sqrtf(fVar11 * fVar11 + fVar10 * fVar10);
|
|
if (2.3 <= fVar10) {
|
|
pEVar15 = local_74[0];
|
|
pEVar6 = local_74[0];
|
|
}
|
|
else {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((fVar10 - (float)local_4c) / 1.3));
|
|
if ((float)pEVar6 <= 0.0) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
if ((float)local_4c <= (float)pEVar6) {
|
|
pEVar6 = local_4c;
|
|
}
|
|
pEVar15 = local_4c;
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((float)pEVar6 * 0.5 + 0.5));
|
|
}
|
|
if (6.0 < fVar10) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((fVar10 - 6.0) * 0.25));
|
|
if ((float)pEVar6 <= 0.0) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
if ((float)pEVar15 <= (float)pEVar6) {
|
|
pEVar6 = pEVar15;
|
|
}
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((float)pEVar6 + (float)pEVar15));
|
|
}
|
|
}
|
|
(this->_sprite)._playbackSpeed = (float)pEVar6;
|
|
pVVar8 = &this->_pos;
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_60),pVVar8,8.0,
|
|
0x21);
|
|
fVar10 = 0.0;
|
|
fVar11 = 0.0;
|
|
fVar12 = 0.0;
|
|
local_3c = GHIDRA_CAST<Entity *>(0x0);
|
|
local_40 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (local_58.y != 0.0) {
|
|
do {
|
|
nearbyEntity = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) + GHIDRA_INT(fVar10) * 4);
|
|
if ((nearbyEntity == (void *)0x0) ||
|
|
(nearbyPlayer = nearbyEntity, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x28)) != 1)) {
|
|
if (nearbyEntity == (void *)0x0) {
|
|
nearbyPlayer = (void *)0x0;
|
|
goto LAB_0064f6c1;
|
|
}
|
|
nearbyPlayer = (void *)0x0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x28)) != 3) goto LAB_0064f6c1;
|
|
LAB_0064f36a:
|
|
if ((nearbyEntity != (void *)0x0) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x2c)) == this->_variant &&
|
|
(*(void **)(GHIDRA_CAST<char *>(nearbyEntity) + 0x410) == this->_player)))) {
|
|
dx = pVVar8->x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x33c));
|
|
fVar13 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x340));
|
|
goto LAB_0064f39d;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0064f6c1:
|
|
nearbyEntity = (void *)0x0;
|
|
if ((nearbyPlayer == (void *)0x0) || (nearbyPlayer != this->_player)) goto LAB_0064f36a;
|
|
dx = pVVar8->x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(nearbyPlayer) + 0x33c));
|
|
fVar13 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(nearbyPlayer) + 0x340));
|
|
LAB_0064f39d:
|
|
if ((dx != g_vectorZero.x) || (fVar13 != g_vectorZero.y)) {
|
|
distSq = fVar13 * fVar13 + dx * dx;
|
|
fVar12 = fVar12 + (dx * 0.5) / distSq;
|
|
fVar11 = fVar11 + (fVar13 * 0.5) / distSq;
|
|
}
|
|
}
|
|
fVar10 = (float)(GHIDRA_INT(fVar10) + 1);
|
|
} while (GHIDRA_UINT(fVar10) < GHIDRA_UINT(local_58.y));
|
|
local_40 = GHIDRA_CAST<Entity *>(fVar12);
|
|
local_3c = GHIDRA_CAST<Entity *>(fVar11);
|
|
}
|
|
fVar10 = sqrtf((float)local_3c * (float)local_3c + (float)local_40 * (float)local_40);
|
|
pEVar6 = local_3c;
|
|
pEVar15 = local_40;
|
|
if ((2.0 < fVar10) && (0.0 < fVar10)) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((float)local_3c * (2.0 / fVar10)));
|
|
pEVar15 = GHIDRA_CAST<Entity *>(((float)local_40 * (2.0 / fVar10)));
|
|
}
|
|
fVar10 = this->_speedMultiplier;
|
|
(this->_velocity).y = fVar10 * (float)pEVar6 + (this->_velocity).y;
|
|
(this->_velocity).x = fVar10 * (float)pEVar15 + (this->_velocity).x;
|
|
if (local_60[0] == '\0') {
|
|
local_14 = GHIDRA_CAST<char *>(0x2);
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_60)) + 0x4))),0);
|
|
local_14 = GHIDRA_CAST<char *>(0xffffffff);
|
|
}
|
|
}
|
|
update_weapon(this,(uint8_t)local_38);
|
|
if ((this->_state + 999U < 999) &&
|
|
(oldParent = this->_state + 1, this->_state = oldParent, -1 < oldParent)) {
|
|
this->_state = 2;
|
|
this->_visible = 0;
|
|
play_sound_with_fart_seed(0x1e,(float)local_4c,2,0,1.0);
|
|
uVar4 = Random();
|
|
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2,uVar4);
|
|
pEVar6->SetColor(&selfFamiliar->_splatColor,0xffffffff,0xff,0,1);
|
|
oldParent = *GHIDRA_CAST<int *>(pEVar6);
|
|
(pEVar6->_sprite)._offset.x = 0.0;
|
|
(pEVar6->_sprite)._offset.y = -6.0;
|
|
pEVar6->_renderDepthOffset = 10.0;
|
|
(**(code **)(oldParent + 0xc))();
|
|
selfFamiliar->_entityCollisionClass = 0;
|
|
selfFamiliar->_entityGridCollisionClass = 0;
|
|
local_58.x = (this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(selfFamiliar->_player) + 0x33c));
|
|
local_58.y = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(selfFamiliar->_player) + 0x340));
|
|
pVVar8 = (GHIDRA_CAST<Vector *>((&local_58)))->Vector::Resized(&local_8c,6.0);
|
|
uVar4 = Random();
|
|
local_74[0] = (Entity *)
|
|
(((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 40.0 - 20.0) * 0.017453292);
|
|
local_6c = GHIDRA_CAST<Entity *>(cos((float)local_74[0]));
|
|
fVar12 = sin((float)local_74[0]);
|
|
fVar10 = pVVar8->x;
|
|
fVar11 = pVVar8->y;
|
|
(selfFamiliar->_velocity).x = fVar10 * (float)local_6c - fVar11 * fVar12;
|
|
(selfFamiliar->_velocity).y = fVar11 * (float)local_6c + fVar10 * fVar12;
|
|
(selfFamiliar->_hitList)._end = (selfFamiliar->_hitList)._begin;
|
|
this = selfFamiliar;
|
|
}
|
|
if ((char)local_38 == '\0') {
|
|
uVar4 = this->_subtype;
|
|
if (uVar4 == 7) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>((this->_health / DAT_00c344f4));
|
|
if ((float)pEVar6 <= 0.0) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
if ((float)local_4c <= (float)pEVar6) {
|
|
pEVar6 = local_4c;
|
|
}
|
|
fVar11 = (float)pEVar6 * 0.39999998 + 0.6;
|
|
fVar10 = fVar11 * g_vectorOne.x;
|
|
(this->_sprite)._scale.y = fVar11 * g_vectorOne.y;
|
|
(this->_sprite)._scale.x = fVar10;
|
|
}
|
|
else {
|
|
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(0xf,0);
|
|
if (bVar3 != 0) {
|
|
if (uVar4 == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = uVar4;
|
|
if (6 < uVar4) {
|
|
uVar5 = 7;
|
|
}
|
|
}
|
|
fVar10 = this->_health;
|
|
if ((float)(&DAT_00c34238)[uVar5 * 0x19] <= fVar10 &&
|
|
fVar10 != (float)(&DAT_00c34238)[uVar5 * 0x19]) {
|
|
fVar10 = fVar10 - 0.2;
|
|
if (uVar4 == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else if (6 < uVar4) {
|
|
uVar4 = 7;
|
|
}
|
|
if (fVar10 <= (float)(&DAT_00c34238)[uVar4 * 0x19]) {
|
|
fVar10 = (float)(&DAT_00c34238)[uVar4 * 0x19];
|
|
}
|
|
this->_health = fVar10;
|
|
}
|
|
}
|
|
nearbyEntity = this->_config;
|
|
fVar10 = this->_health;
|
|
fVar11 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x50));
|
|
(this->_sprite)._color._colorize[0] = 1.0;
|
|
(this->_sprite)._color._colorize[1] = 1.0;
|
|
(this->_sprite)._color._colorize[2] = 1.0;
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((fVar10 * fVar10) / (fVar11 * fVar11)));
|
|
if ((float)pEVar6 <= 0.0) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
if ((float)local_4c <= (float)pEVar6) {
|
|
pEVar6 = local_4c;
|
|
}
|
|
(this->_sprite)._color._colorize[3] = 0.6 - (float)pEVar6 * 1.1;
|
|
pEVar6 = GHIDRA_CAST<Entity *>(sqrtf(fVar10 / *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(nearbyEntity) + 0x50))));
|
|
if ((float)pEVar6 <= 0.0) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
if ((float)local_4c <= (float)pEVar6) {
|
|
pEVar6 = local_4c;
|
|
}
|
|
fVar10 = (float)pEVar6 * 0.5 + 0.6;
|
|
fVar11 = fVar10 * g_vectorOne.x;
|
|
(this->_sprite)._scale.y = fVar10 * g_vectorOne.y;
|
|
(this->_sprite)._scale.x = fVar11;
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (isPostMove != 0) goto LAB_0064ea36;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((walkAnims + 0xc));
|
|
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
if (bVar3 != 0) {
|
|
uVar5 = Random();
|
|
rngResult = Random();
|
|
fVar10 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.25 + 0.25;
|
|
local_58.y = fVar10 * (this->_velocity).y;
|
|
local_58.x = fVar10 * (this->_velocity).x;
|
|
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6f,&this->_pos,&local_58,GHIDRA_CAST<Entity *>(0x0),0,uVar5);
|
|
pEVar6->SetColor(&this->_splatColor,0xffffffff,0xff,0,1,uVar4);
|
|
local_44 = GHIDRA_CAST<Entity *>(g_vectorOne.x);
|
|
local_68 = g_vectorOne.y;
|
|
uVar4 = Random();
|
|
fVar10 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.3 + 0.3;
|
|
(pEVar6->_sprite)._scale.y = fVar10 * local_68;
|
|
(pEVar6->_sprite)._scale.x = fVar10 * (float)local_44;
|
|
fVar10 = (this->_posOffset).y;
|
|
(pEVar6->_posOffset).x = (this->_posOffset).x + 0.0;
|
|
(pEVar6->_posOffset).y = fVar10 - 8.0;
|
|
}
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_80),&this->_pos,20.0,
|
|
8);
|
|
local_14 = GHIDRA_CAST<char *>(0x0);
|
|
local_38 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (local_74[0] != GHIDRA_CAST<Entity *>(0x0)) {
|
|
do {
|
|
pEVar6 = local_38;
|
|
bVar3 = Entity::IsVulnerableEnemy
|
|
(*GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) + GHIDRA_INT(local_38) * 4)),GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar3 != 0) &&
|
|
(pEVar15 = *GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) + GHIDRA_INT(pEVar6) * 4)),
|
|
(pEVar15->_flags & 0x20000000) == 0)) {
|
|
local_44 = GHIDRA_CAST<Entity *>(&this->_hitList);
|
|
bVar3 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_44))))->EntityList::HitListContains(pEVar15);
|
|
if (bVar3 == 0) {
|
|
uVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) + GHIDRA_INT(pEVar6) * 4)))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(local_44,uVar4);
|
|
takeDamageFn = *(code **)(**GHIDRA_CAST<int **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) + GHIDRA_INT(pEVar6) * 4)) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(selfFamiliar));
|
|
(*takeDamageFn)(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(selfFamiliar->_player) + 0x157c)) * 3.0,0,0,&sourceRef,0x1e)
|
|
;
|
|
pEVar6 = local_38;
|
|
this = selfFamiliar;
|
|
}
|
|
}
|
|
local_38 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar6)) + 0x1))));
|
|
} while (local_38 < local_74[0]);
|
|
}
|
|
oldParent = this->_state;
|
|
this->_state = oldParent + 1;
|
|
local_68 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
local_50 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
local_38 = GHIDRA_CAST<Entity *>((local_68 - (this->_pos).x));
|
|
local_3c = GHIDRA_CAST<Entity *>((local_50 - (this->_pos).y));
|
|
fVar10 = sqrtf((float)local_38 * (float)local_38 + (float)local_3c * (float)local_3c);
|
|
pEVar6 = local_38;
|
|
if (0.0 < fVar10) {
|
|
local_3c = GHIDRA_CAST<Entity *>(((float)local_3c * (1.0 / fVar10)));
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((float)local_38 * (1.0 / fVar10)));
|
|
}
|
|
fVar10 = (float)(oldParent + -1);
|
|
local_3c = (Entity *)
|
|
((float)local_3c * fVar10 * fVar10 * this->_speedMultiplier + (this->_velocity).y);
|
|
local_44 = (Entity *)
|
|
(fVar10 * (float)pEVar6 * fVar10 * this->_speedMultiplier + (this->_velocity).x);
|
|
(this->_velocity).y = (float)local_3c;
|
|
(this->_velocity).x = (float)local_44;
|
|
fVar10 = sqrtf((float)local_3c * (float)local_3c + (float)local_44 * (float)local_44);
|
|
pEVar6 = local_3c;
|
|
if ((20.0 < fVar10) && (0.0 < fVar10)) {
|
|
pEVar6 = GHIDRA_CAST<Entity *>(((float)local_3c * (20.0 / fVar10)));
|
|
(this->_velocity).x = (float)local_44 * (20.0 / fVar10);
|
|
(this->_velocity).y = (float)pEVar6;
|
|
}
|
|
fVar10 = (this->_velocity).x;
|
|
fVar10 = sqrtf(fVar10 * fVar10 + (float)pEVar6 * (float)pEVar6);
|
|
local_44 = GHIDRA_CAST<Entity *>((fVar10 + 2.0));
|
|
fVar11 = (this->_pos).x - local_68;
|
|
local_38 = GHIDRA_CAST<Entity *>(0x41200000);
|
|
fVar10 = (this->_pos).y - local_50;
|
|
local_3c = local_44;
|
|
fVar10 = sqrtf(fVar10 * fVar10 + fVar11 * fVar11);
|
|
piVar1 = &this->_state;
|
|
ppEVar9 = &local_44;
|
|
if ((float)local_3c <= 10.0) {
|
|
ppEVar9 = &local_38;
|
|
}
|
|
if (fVar10 <= (float)*ppEVar9) {
|
|
local_44 = GHIDRA_CAST<Entity *>(0x59);
|
|
piVar7 = GHIDRA_CAST<int *>(&local_44);
|
|
if (0x58 < *piVar1) {
|
|
piVar7 = piVar1;
|
|
}
|
|
*piVar1 = *piVar7;
|
|
manager = g_manager;
|
|
switch(this->_subtype) {
|
|
case 0:
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::CanPickRedHearts();
|
|
manager = g_manager;
|
|
if (bVar3 == 0) goto switchD_0064e588_default;
|
|
local_38 = GHIDRA_CAST<Entity *>(0xb9);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddHearts(1,1,0);
|
|
this->Remove();
|
|
break;
|
|
case 1:
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::CanPickSoulHearts();
|
|
if (bVar3 == 0) goto switchD_0064e588_default;
|
|
uVar4 = this->_player->_soulHearts;
|
|
if (((uVar4 & 1) == 0) ||
|
|
(bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IsBlackHeart(uVar4), bVar3 != 0)) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_60),3,
|
|
this->_variant,-1,0,0);
|
|
fVar10 = 0.0;
|
|
if (local_58.y != 0.0) {
|
|
do {
|
|
oldParent = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) + GHIDRA_INT(fVar10) * 4));
|
|
if (((oldParent != 0) && (*GHIDRA_CAST<int *>((oldParent + 0x28)) == 3)) &&
|
|
((*(void **)(oldParent + 0x410) == this->_player && (*GHIDRA_CAST<int *>((oldParent + 0x30)) == 2)
|
|
))) goto LAB_0064e7f1;
|
|
fVar10 = (float)(GHIDRA_INT(fVar10) + 1);
|
|
} while (GHIDRA_UINT(fVar10) < GHIDRA_UINT(local_58.y));
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((local_60)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
manager = g_manager;
|
|
local_38 = GHIDRA_CAST<Entity *>(0x36);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddSoulHearts(1,0);
|
|
this->Remove();
|
|
break;
|
|
case 2:
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::CanPickBlackHearts();
|
|
if (bVar3 == 0) goto switchD_0064e588_default;
|
|
uVar4 = this->_player->_soulHearts;
|
|
if (((uVar4 & 1) != 0) &&
|
|
(bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::IsBlackHeart(uVar4), bVar3 == 0)) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_60),3,
|
|
this->_variant,-1,0,0);
|
|
fVar10 = 0.0;
|
|
if (local_58.y != 0.0) {
|
|
do {
|
|
oldParent = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) + GHIDRA_INT(fVar10) * 4));
|
|
if ((((oldParent != 0) && (*GHIDRA_CAST<int *>((oldParent + 0x28)) == 3)) &&
|
|
(*(void **)(oldParent + 0x410) == this->_player)) &&
|
|
(*GHIDRA_CAST<int *>((oldParent + 0x30)) == 1)) goto LAB_0064e7f1;
|
|
fVar10 = (float)(GHIDRA_INT(fVar10) + 1);
|
|
} while (GHIDRA_UINT(fVar10) < GHIDRA_UINT(local_58.y));
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((local_60)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
manager = g_manager;
|
|
local_38 = GHIDRA_CAST<Entity *>(0x1d4);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBlackHearts(1);
|
|
this->Remove();
|
|
break;
|
|
case 3:
|
|
local_38 = GHIDRA_CAST<Entity *>(0x10a);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddEternalHearts(1);
|
|
this->Remove();
|
|
break;
|
|
case 4:
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::CanPickGoldenHearts();
|
|
manager = g_manager;
|
|
if (bVar3 == 0) goto switchD_0064e588_default;
|
|
local_38 = GHIDRA_CAST<Entity *>(0x1d1);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddGoldenHearts(1,0);
|
|
this->Remove();
|
|
break;
|
|
case 5:
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::CanPickBoneHearts();
|
|
manager = g_manager;
|
|
if (bVar3 == 0) goto switchD_0064e588_default;
|
|
local_38 = GHIDRA_CAST<Entity *>(0x1cd);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddBoneHearts(1);
|
|
this->Remove();
|
|
break;
|
|
case 6:
|
|
isRottenHeartsPickable = (GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::CanPickRottenHearts();
|
|
manager = g_manager;
|
|
if (isRottenHeartsPickable == '\0') goto switchD_0064e588_default;
|
|
local_38 = GHIDRA_CAST<Entity *>(0x1f1);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_38));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_38),1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Entity_Player *>((this->_player)))->Entity_Player::AddRottenHearts(2,0);
|
|
this->Remove();
|
|
break;
|
|
default:
|
|
switchD_0064e588_default:
|
|
if (0x5c < this->_state) {
|
|
this->_state = -1000;
|
|
if (GHIDRA_CAST<int *>(this->_child) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_child) + 0x28))();
|
|
}
|
|
this->_visible = 1;
|
|
oldParent = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_player) + 0x184));
|
|
if ((((oldParent == 0) || (oldParent == 3)) || (oldParent == 1)) ||
|
|
(gridCollisionClass = 5, oldParent == 2)) {
|
|
gridCollisionClass = 3;
|
|
}
|
|
this->_entityGridCollisionClass = gridCollisionClass;
|
|
this->_entityCollisionClass = 3;
|
|
(this->_velocity).x = (this->_velocity).x * 0.25;
|
|
(this->_velocity).y = (this->_velocity).y * 0.25;
|
|
}
|
|
}
|
|
}
|
|
if ((this->_child == 0) && (1 < this->_state)) {
|
|
uVar4 = Random();
|
|
local_38 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xa6,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),0,uVar4);
|
|
uVar5 = -GHIDRA_UINT((this->_subtype != 0)) & this->_subtype;
|
|
uVar4 = 7;
|
|
if (uVar5 < 7) {
|
|
uVar4 = uVar5;
|
|
}
|
|
effectColor = &(local_38->_sprite)._color;
|
|
oldParent = uVar4 * 100;
|
|
if (effectColor != GHIDRA_CAST<ColorMod *>((&DAT_00c34270 + oldParent))) {
|
|
fVar10 = *GHIDRA_CAST<float *>((oldParent + 0xc34274));
|
|
fVar11 = *GHIDRA_CAST<float *>((oldParent + 0xc34278));
|
|
fVar12 = *GHIDRA_CAST<float *>((oldParent + 0xc3427c));
|
|
effectColor->_tint[0] = *GHIDRA_CAST<float *>((&DAT_00c34270 + oldParent));
|
|
(local_38->_sprite)._color._tint[1] = fVar10;
|
|
(local_38->_sprite)._color._tint[2] = fVar11;
|
|
(local_38->_sprite)._color._tint[3] = fVar12;
|
|
fVar10 = *GHIDRA_CAST<float *>((oldParent + 0xc34284));
|
|
fVar11 = *GHIDRA_CAST<float *>((oldParent + 0xc34288));
|
|
fVar12 = *GHIDRA_CAST<float *>((oldParent + 0xc3428c));
|
|
(local_38->_sprite)._color._colorize[0] = *GHIDRA_CAST<float *>((&DAT_00c34280 + oldParent));
|
|
(local_38->_sprite)._color._colorize[1] = fVar10;
|
|
(local_38->_sprite)._color._colorize[2] = fVar11;
|
|
(local_38->_sprite)._color._colorize[3] = fVar12;
|
|
*GHIDRA_CAST<uint64_t *>((local_38->_sprite)._color._offset) = *GHIDRA_CAST<uint64_t *>((&DAT_00c34290 + oldParent))
|
|
;
|
|
(local_38->_sprite)._color._offset[2] = *GHIDRA_CAST<float *>((&DAT_00c34298 + oldParent));
|
|
}
|
|
fVar10 = g_vectorOne.y * 2.0;
|
|
(local_38->_sprite)._scale.x = g_vectorOne.x * 2.0;
|
|
(local_38->_sprite)._scale.y = fVar10;
|
|
uVar4 = g_graphicsManager_flags;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&local_38->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
pEVar6 = local_38;
|
|
oldParent = 1;
|
|
if ((uVar4 & 4) == 0) {
|
|
oldParent = 6;
|
|
}
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[1] = oldParent;
|
|
layer->_blendMode[2] = 7;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 7;
|
|
oldParent = local_38->_parent;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38[1])) + 0x44)))) = 0x3e19999a;
|
|
pEVar15 = local_38 + 1;
|
|
(pEVar15->_sprite)._filename._buf[0] = -0x66;
|
|
(pEVar15->_sprite)._filename._buf[1] = -0x67;
|
|
(pEVar15->_sprite)._filename._buf[2] = '\x19';
|
|
(pEVar15->_sprite)._filename._buf[3] = '>';
|
|
if (oldParent != 0) {
|
|
local_44 = GHIDRA_CAST<Entity *>(&local_38->_parent);
|
|
msvc::multiset<unsigned_int>::erase(&local_44);
|
|
}
|
|
pEVar6->_parent = this;
|
|
msvc::multiset<unsigned_int>::insert(&pEVar6->_parent);
|
|
pEVar6->Update();
|
|
if (this->_child != 0) {
|
|
local_44 = GHIDRA_CAST<Entity *>(&this->_child);
|
|
msvc::multiset<unsigned_int>::erase(&local_44);
|
|
}
|
|
this->_child = pEVar6;
|
|
msvc::multiset<unsigned_int>::insert(&this->_child);
|
|
}
|
|
if (local_80[0] == '\0') {
|
|
local_14 = GHIDRA_CAST<char *>(0x1);
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_80)) + 0x4))),0);
|
|
}
|
|
LAB_0064ea36:
|
|
if (this->_child == 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((this->_child + 0xfc)) = 0x3ecccccd;
|
|
fVar10 = (this->_posOffset).x;
|
|
fVar11 = (this->_pos).x;
|
|
oldParent = this->_child;
|
|
*GHIDRA_CAST<float *>((oldParent + 0x340)) = ((this->_posOffset).y + (this->_pos).y) - 8.0;
|
|
*GHIDRA_CAST<float *>((oldParent + 0x33c)) = fVar10 + fVar11 + 0.0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
LAB_0064e7f1:
|
|
(GHIDRA_CAST<EntityList_Query *>((local_60)))->EntityList_Query::~EntityList_Query();
|
|
goto switchD_0064e588_default;
|
|
}
|
|
|
|
// 00650220
|
|
void Entity_Familiar::predict_player_movement()
|
|
{
|
|
uint8_t isDropPressed;
|
|
Vector *movementJoystick;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *this_00;
|
|
uint32_t extraout_ECX_00;
|
|
Entity_Familiar *chainFamiliar;
|
|
float fVar1;
|
|
float distanceSq;
|
|
float fVar2;
|
|
float fVar3;
|
|
float local_20;
|
|
float local_1c;
|
|
Vector local_18;
|
|
Vector joystickBuf;
|
|
Game *game;
|
|
Entity_Familiar *nextParent;
|
|
Entity_Familiar *parent;
|
|
|
|
local_20 = g_vectorZero.x;
|
|
local_1c = g_vectorZero.y;
|
|
this_00 = this->_player;
|
|
local_18.x = this_00->_movespeed;
|
|
if ((this_00->_isControlsEnabled != 0) && (this_00->_controlsCooldown < 1)) {
|
|
movementJoystick = (GHIDRA_CAST<Entity_Player *>((this_00)))->Entity_Player::GetMovementJoystick(&joystickBuf);
|
|
local_1c = movementJoystick->y;
|
|
local_20 = movementJoystick->x;
|
|
fVar1 = sqrtf(local_1c * local_1c + local_20 * local_20);
|
|
this_00 = extraout_ECX;
|
|
if ((1.0 < fVar1) && (0.0 < fVar1)) {
|
|
local_1c = (1.0 / fVar1) * movementJoystick->y;
|
|
local_20 = (1.0 / fVar1) * movementJoystick->x;
|
|
}
|
|
}
|
|
isDropPressed =
|
|
input_is_action_pressed
|
|
(0xb,GHIDRA_INT(this->_player[5]._color._colorize[0]),this->_player,GHIDRA_INT(this_00));
|
|
if (isDropPressed != 0) {
|
|
local_20 = g_vectorZero.x;
|
|
local_1c = g_vectorZero.y;
|
|
}
|
|
(GHIDRA_CAST<NPCAI_Pathfinder *>((&this->_pathfinder)))->NPCAI_Pathfinder::SimulatePlayerMovement(&local_20,extraout_ECX_00);
|
|
nextParent = GHIDRA_CAST<Entity_Familiar *>(this->_parent);
|
|
chainFamiliar = this;
|
|
while ((parent = nextParent, parent != GHIDRA_CAST<Entity_Familiar *>(0x0) && (parent->_type == 3))) {
|
|
chainFamiliar = parent;
|
|
nextParent = GHIDRA_CAST<Entity_Familiar *>(parent->_parent);
|
|
}
|
|
fVar1 = (this->_pos).x;
|
|
local_20 = 0.0;
|
|
local_18.x = 0.0;
|
|
do {
|
|
if (chainFamiliar->_type != 3) break;
|
|
fVar1 = (this->_pos).x;
|
|
fVar3 = fVar1 - (chainFamiliar->_pos).x;
|
|
fVar2 = (this->_pos).y - (chainFamiliar->_pos).y;
|
|
if ((fVar3 != g_vectorZero.x) || (fVar2 != g_vectorZero.y)) {
|
|
distanceSq = fVar2 * fVar2 + fVar3 * fVar3;
|
|
local_18.x = local_18.x + (fVar3 * 0.5) / distanceSq;
|
|
local_20 = local_20 + (fVar2 * 0.5) / distanceSq;
|
|
}
|
|
chainFamiliar = GHIDRA_CAST<Entity_Familiar *>(chainFamiliar->_child);
|
|
} while (chainFamiliar != GHIDRA_CAST<Entity_Familiar *>(0x0));
|
|
fVar1 = fVar1 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x33c));
|
|
fVar2 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_player) + 0x340));
|
|
if ((fVar1 != g_vectorZero.x) || (fVar2 != g_vectorZero.y)) {
|
|
fVar3 = fVar1 * fVar1 + fVar2 * fVar2;
|
|
local_20 = (fVar2 * 0.5) / fVar3 + local_20;
|
|
local_18.x = local_18.x + (fVar1 * 0.5) / fVar3;
|
|
}
|
|
fVar3 = sqrtf(local_20 * local_20 + local_18.x * local_18.x);
|
|
game = g_game;
|
|
fVar1 = local_20;
|
|
fVar2 = local_18.x;
|
|
if ((2.0 < fVar3) && (0.0 < fVar3)) {
|
|
fVar1 = local_20 * (2.0 / fVar3);
|
|
fVar2 = local_18.x * (2.0 / fVar3);
|
|
}
|
|
fVar3 = this->_speedMultiplier;
|
|
(this->_velocity).x = fVar3 * fVar2 + (this->_velocity).x;
|
|
(this->_velocity).y = fVar3 * fVar1 + (this->_velocity).y;
|
|
Room::GetClampedPositionImpl(game->_room,&local_18,&this->_pos,0.0,0.0,0.0,0.0);
|
|
local_20 = local_18.x - (this->_pos).x;
|
|
local_18.x = local_18.y - (this->_pos).y;
|
|
if ((local_20 != g_vectorZero.x) || (local_18.x != g_vectorZero.y)) {
|
|
fVar1 = sqrtf(local_18.x * local_18.x + local_20 * local_20);
|
|
if (0.0 < fVar1) {
|
|
local_18.x = local_18.x * (1.0 / fVar1);
|
|
local_20 = local_20 * (1.0 / fVar1);
|
|
}
|
|
fVar1 = (this->_velocity).x;
|
|
fVar2 = this->_speedMultiplier;
|
|
fVar3 = -(local_18.x * (this->_velocity).y + fVar1 * local_20);
|
|
if (fVar3 <= 1.0) {
|
|
fVar3 = 1.0;
|
|
}
|
|
if (16.0 <= fVar3) {
|
|
fVar3 = 16.0;
|
|
}
|
|
(this->_velocity).x = local_20 * fVar3 * fVar2 + fVar1;
|
|
(this->_velocity).y = local_18.x * fVar3 * fVar2 + (this->_velocity).y;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00651890
|
|
void Entity_Familiar::guard_check_icall()
|
|
{
|
|
if ((this->_variant == 0xd3) && (this->_state == 2)) {
|
|
this->_state = 0;
|
|
this->Update();
|
|
}
|
|
this->_isHourglassRewound = 1;
|
|
return;
|
|
}
|
|
|
|
// 009615e0
|
|
uint8_t Entity_Familiar::multidimensional_baby_copy_knife(Entity_Knife *knife, Entity *unused)
|
|
{
|
|
Vector direction;
|
|
Entity *rootParent;
|
|
uint32_t rngResult;
|
|
Entity_Knife *copyKnife;
|
|
float sideOffset;
|
|
float sinAngle;
|
|
uint32_t i;
|
|
uint32_t *local_18;
|
|
float local_14;
|
|
uint32_t *local_10;
|
|
float homingDirY;
|
|
float knifeY;
|
|
double uintFixup;
|
|
|
|
if ((((knife->_multidimensionalApplied != 0) || (knife->_visible == 0)) ||
|
|
(knife->_knifeVelocity <= 0.0)) || ((knife->_subtype != 0 && (knife->_subtype != 1)))) {
|
|
return 0;
|
|
}
|
|
knife->_visible = 0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((knife)) + 0x514)))) = knife->_knifeDistance;
|
|
knife->_multidimensionalApplied = 1;
|
|
rootParent = (GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::GetRootParent();
|
|
rootParent[1]._spawnerVariant = GHIDRA_INT(((float)rootParent[1]._spawnerVariant + 5.0));
|
|
i = 0;
|
|
do {
|
|
if (i == 0) {
|
|
sideOffset = 10.0;
|
|
}
|
|
else {
|
|
sideOffset = -10.0;
|
|
}
|
|
rngResult = Random();
|
|
copyKnife = (Entity_Knife *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(8,knife->_variant,&knife->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(knife),0,
|
|
rngResult,1);
|
|
if (copyKnife == GHIDRA_CAST<Entity_Knife *>(0x0)) break;
|
|
if (copyKnife->_parent != 0) {
|
|
local_18 = ©Knife->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
copyKnife->_parent = knife;
|
|
msvc::multiset<unsigned_int>::insert(©Knife->_parent);
|
|
(GHIDRA_CAST<Entity_Knife *>((copyKnife)))->Entity_Knife::copy_parent_state(knife);
|
|
if (knife->_subtype == 1) {
|
|
local_18 = GHIDRA_CAST<uint32_t *>((knife->_rotation * 0.017453292));
|
|
local_14 = cos((float)local_18);
|
|
sinAngle = sin((float)local_18);
|
|
knifeY = (knife->_pos).y;
|
|
(copyKnife->_pos).x = (local_14 * 0.0 - sinAngle * sideOffset) + (knife->_pos).x;
|
|
(copyKnife->_pos).y = local_14 * sideOffset + sinAngle * 0.0 + knifeY;
|
|
rngResult = Random();
|
|
uintFixup = __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
|
|
local_14 = knife->_rotation * 0.017453292;
|
|
local_18 = GHIDRA_CAST<uint32_t *>(cos(local_14));
|
|
homingDirY = sin(local_14);
|
|
local_10 = local_18;
|
|
direction.y = homingDirY;
|
|
direction.x = (float)local_18;
|
|
Entity_Knife::InitHomingPath
|
|
(copyKnife,direction,GHIDRA_CAST<Entity *>(knife),
|
|
(float)((double)GHIDRA_INT(rngResult) + uintFixup) * 2.3283064e-10 * 50.0 - 25.0);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((copyKnife)) + 0x504)))) = knife->_knifeDistance;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((copyKnife)) + 0x50c)))) = 0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((copyKnife)) + 0x510)))) = sideOffset;
|
|
}
|
|
copyKnife->Update();
|
|
i = i + 1;
|
|
} while (i < 2);
|
|
if (knife->_subtype == 1) {
|
|
knife->Remove();
|
|
}
|
|
return 1;
|
|
}
|