The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4900 lines
234 KiB
C++
4900 lines
234 KiB
C++
#include "classes.h"
|
|
|
|
// 004d7790
|
|
float10 Entity_Knife::Rotation()
|
|
{
|
|
return (float10)this->_rotation;
|
|
}
|
|
|
|
// 004d77a0
|
|
float10 Entity_Knife::GetKnifeVelocity()
|
|
{
|
|
return (float10)this->_knifeVelocity;
|
|
}
|
|
|
|
// 0060cf10
|
|
byte Entity_Knife::IsFlying()
|
|
{
|
|
return this->_isFlying;
|
|
}
|
|
|
|
// 0060cfb0
|
|
void Entity_Knife::SetPathFollowSpeed(float param_2)
|
|
{
|
|
this->_pathFollowSpeed = param_2;
|
|
return;
|
|
}
|
|
|
|
// 0085de90
|
|
BitSet128 * Entity_Knife::TearFlags(BitSet128 *outFlags)
|
|
{
|
|
undefined4 uVar1;
|
|
undefined4 uVar2;
|
|
qword qVar3;
|
|
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
qVar3 = (this->_tearFlags)._h;
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
*GHIDRA_CAST<int *>(&outFlags->_l) = GHIDRA_INT((this->_tearFlags)._l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&outFlags->_l) + 4)) = uVar1;
|
|
*GHIDRA_CAST<int *>(&outFlags->_h) = GHIDRA_INT(qVar3);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&outFlags->_h) + 4)) = uVar2;
|
|
return outFlags;
|
|
}
|
|
|
|
// 0085deb0
|
|
float10 Entity_Knife::GetKnifeDistance()
|
|
{
|
|
return (float10)this->_knifeDistance;
|
|
}
|
|
|
|
// 0085dec0
|
|
float10 Entity_Knife::RotationOffset()
|
|
{
|
|
return (float10)this->_rotationOffset;
|
|
}
|
|
|
|
// 00960a20
|
|
int Entity_Knife::GetBaseVariant()
|
|
{
|
|
switch(this->_variant) {
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 8:
|
|
case 9:
|
|
return 1;
|
|
case 5:
|
|
return 0;
|
|
default:
|
|
return this->_variant;
|
|
case 0xb:
|
|
return 10;
|
|
}
|
|
}
|
|
|
|
// 00960a70
|
|
void Entity_Knife::Constructor()
|
|
{
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::constructor();
|
|
*GHIDRA_CAST<undefined ***>(this) = IsaacRepentancePlus::Entity_Knife::vftable;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._l) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._h) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_usedTearFlags)._l) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_usedTearFlags)._l) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_usedTearFlags)._h) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_usedTearFlags)._h) + 4)) = 0;
|
|
(this->_anchorPosition).y = 0.0;
|
|
(this->_anchorPosition).x = 0.0;
|
|
(this->_initPosition).y = 0.0;
|
|
(this->_initPosition).x = 0.0;
|
|
(GHIDRA_CAST<HomingLaser *>((&this->_homingLaser)))->HomingLaser::HomingLaser();
|
|
(this->_hitList)._begin = (void *)0x0;
|
|
(this->_hitList)._end = (void *)0x0;
|
|
(this->_hitList)._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x510)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50c)))) = 0;
|
|
return;
|
|
}
|
|
|
|
// 00960c10
|
|
void Entity_Knife::Init(int type, int variant, int subType, uint initSeed)
|
|
{
|
|
double dVar1;
|
|
undefined4 uVar2;
|
|
float fVar3;
|
|
byte bVar4;
|
|
ANM2 *extraout_EAX;
|
|
LayerState *layer;
|
|
byte *curAnimName;
|
|
char *ptr;
|
|
int iVar5;
|
|
byte *cmpName;
|
|
ANM2 *pAVar6;
|
|
uint uVar7;
|
|
bool isLess;
|
|
ANM2 *local_34;
|
|
byte isLayerVisible;
|
|
std_string anm2Path;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
uint local_8;
|
|
byte *animData;
|
|
byte cmpChar;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c8bf;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(&(&anm2Path)[1]._size);
|
|
ExceptionList = &local_10;
|
|
if (DAT_00c72214 == GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
local_34 = operator_new(0x114);
|
|
local_8 = 0;
|
|
if (local_34 == GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
local_34 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((local_34)))->ANM2::constructor();
|
|
local_34 = extraout_EAX;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (DAT_00c78da8 == DAT_00c78dac) {
|
|
FUN_004156c0(DAT_00c78da8,&local_34);
|
|
}
|
|
else {
|
|
*DAT_00c78da8 = local_34;
|
|
DAT_00c78da8 = DAT_00c78da8 + 1;
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
DAT_00c72214 = local_34;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
anm2Path._size = 0x1a;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/DeadEyeTearEffect.anm2",0x1b);
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((DAT_00c72214)))->ANM2::Load(&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar7 = anm2Path._capacity + 1;
|
|
ptr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar7 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar7);
|
|
}
|
|
uVar7 = g_graphicsManager_flags;
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) & 0xffffff00;
|
|
layer = (GHIDRA_CAST<ANM2 *>((DAT_00c72214)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
pAVar6 = DAT_00c72214;
|
|
iVar5 = 1;
|
|
if ((uVar7 & 4) == 0) {
|
|
iVar5 = 6;
|
|
}
|
|
local_34 = DAT_00c72214;
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[1] = iVar5;
|
|
layer->_blendMode[2] = 1;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 1;
|
|
animData = (pAVar6->_animState)._animData;
|
|
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
|
curAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
cmpName = s_Idle;
|
|
do {
|
|
bVar4 = *curAnimName;
|
|
isLess = bVar4 < *cmpName;
|
|
if (bVar4 != *cmpName) {
|
|
LAB_00960df0:
|
|
uVar7 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00960df5;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimName[1];
|
|
isLess = bVar4 < cmpName[1];
|
|
if (bVar4 != cmpName[1]) goto LAB_00960df0;
|
|
curAnimName = curAnimName + 2;
|
|
cmpName = cmpName + 2;
|
|
} while (bVar4 != 0);
|
|
uVar7 = 0;
|
|
LAB_00960df5:
|
|
if ((uVar7 == 0) && ((animData[0x34] == 0 || ((pAVar6->_animState)._isPlaying != 0))))
|
|
goto LAB_00960e29;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((pAVar6)))->ANM2::SetAnimation(s_Idle,1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&pAVar6->_animState)))->AnimationState::Rewind();
|
|
(pAVar6->_animState)._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_00960e29:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Init(type,variant,subType,initSeed);
|
|
if (this->_config != (void *)0x0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
|
|
local_34 = GHIDRA_CAST<ANM2 *>(&(this->_sprite)._animDefaultName);
|
|
if (0xf < (this->_sprite)._animDefaultName._capacity) {
|
|
local_34 = *GHIDRA_CAST<ANM2 **>((GHIDRA_CAST<std_string *>(local_34))->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
|
curAnimName = animData;
|
|
pAVar6 = local_34;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimName = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
do {
|
|
bVar4 = *curAnimName;
|
|
cmpChar = (pAVar6->_filename)._buf[0];
|
|
isLess = bVar4 < cmpChar;
|
|
if (bVar4 != cmpChar) {
|
|
LAB_00960ea0:
|
|
uVar7 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00960ea5;
|
|
}
|
|
if (bVar4 == 0) break;
|
|
bVar4 = curAnimName[1];
|
|
cmpChar = (pAVar6->_filename)._buf[1];
|
|
isLess = bVar4 < cmpChar;
|
|
if (bVar4 != cmpChar) goto LAB_00960ea0;
|
|
curAnimName = curAnimName + 2;
|
|
pAVar6 = GHIDRA_CAST<ANM2 *>(((pAVar6->_filename)._buf + 2));
|
|
} while (bVar4 != 0);
|
|
uVar7 = 0;
|
|
LAB_00960ea5:
|
|
if ((uVar7 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_00960eda;
|
|
}
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(local_34),1);
|
|
if (bVar4 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_00960eda:
|
|
this->_collisionDamage = 22.0;
|
|
this->_scale = 1.0;
|
|
this->_rotation = 0.0;
|
|
this->_displayRotation = 0.0;
|
|
this->_knifeDepthOffset = 0.0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._l) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._h) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = 0;
|
|
this->_rotationOffset = 0.0;
|
|
this->_entityGridCollisionClass = 0;
|
|
this->_knifeDistance = 0.0;
|
|
this->_knifeVelocity = 0.0;
|
|
this->_maxDistance = 100.0;
|
|
this->_charge = 0.0;
|
|
this->_isFlying = 0;
|
|
(this->_anchorPosition).x = g_vectorZero.x;
|
|
(this->_anchorPosition).y = g_vectorZero.y;
|
|
(this->_initPosition).x = (this->_pos).x;
|
|
(this->_initPosition).y = (this->_pos).y;
|
|
this->_prismApplied = 0;
|
|
this->_multidimensionalApplied = 0;
|
|
this->_isUsingParentHitList = 0;
|
|
this->_pathSegment = 0;
|
|
uVar7 = Random();
|
|
this->_pathProgress = -100.0;
|
|
this->_pathFollowSpeed = 0.1;
|
|
this->_height = 0.0;
|
|
this->_fallingSpeed = 0.0;
|
|
this->_isDeadEyeHit = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&this->_isSwinging) = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4e8)))) = 0;
|
|
this->_isSpinAttack = 0;
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)];
|
|
*GHIDRA_CAST<undefined1 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x504)))) = &DAT_bf800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ec)))) = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f0)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x508)))) = 0;
|
|
this->_pathOffset = (float)((double)GHIDRA_INT(uVar7) + dVar1) * 2.3283064e-10 * 50.0 - 25.0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50c)))) = g_vectorZero.x;
|
|
fVar3 = g_vectorZero.y;
|
|
*GHIDRA_CAST<uint *>(&this->_flags) = GHIDRA_UINT(this->_flags) | 0x4000000;
|
|
this->_isPrimaryClub = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x518)))) = 0;
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_flags) + 4));
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x510)))) = fVar3;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_flags) + 4)) = uVar2;
|
|
*GHIDRA_CAST<undefined1 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x514)))) = &DAT_bf800000;
|
|
(this->_hitList)._end = (this->_hitList)._begin;
|
|
iVar5 = this->_variant;
|
|
switch(iVar5) {
|
|
case 5:
|
|
goto LAB_00961187;
|
|
default:
|
|
if (iVar5 != 1) {
|
|
if (iVar5 != 10) goto LAB_00961187;
|
|
goto code_r0x00961110;
|
|
}
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 8:
|
|
case 9:
|
|
isLayerVisible = this->_subtype != 4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_visible = isLayerVisible;
|
|
isLayerVisible = this->_subtype == 4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x1));
|
|
break;
|
|
case 0xb:
|
|
code_r0x00961110:
|
|
isLayerVisible = this->_subtype != 4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_visible = isLayerVisible;
|
|
isLayerVisible = this->_subtype == 4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x1));
|
|
layer->_visible = isLayerVisible;
|
|
isLayerVisible = this->_subtype == 4;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
|
|
}
|
|
layer->_visible = isLayerVisible;
|
|
LAB_00961187:
|
|
LuaEngine::PostKnifeInit(this);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009611d0
|
|
void Entity_Knife::ClearReferences()
|
|
{
|
|
undefined1 *puVar1;
|
|
Entity_Knife *erasedRef;
|
|
EntityPtr parent;
|
|
undefined1 *secondRef;
|
|
|
|
parent = this->_parent;
|
|
erasedRef = this;
|
|
if ((parent != (EntityPtr)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parent) + 0x28)) == 2)) {
|
|
if ((*GHIDRA_CAST<Entity_Knife **>((GHIDRA_CAST<char *>(parent) + 0x49c)) == this) &&
|
|
(*GHIDRA_CAST<Entity_Knife **>((GHIDRA_CAST<char *>(parent) + 0x49c)) != GHIDRA_CAST<Entity_Knife *>(0x0))) {
|
|
erasedRef = GHIDRA_CAST<Entity_Knife *>((GHIDRA_INT(parent) + 0x49c));
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(parent) + 0x49c)) = 0;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearReferences();
|
|
puVar1 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc)));
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc)))) + 0x28))();
|
|
}
|
|
secondRef = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)));
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) + 0x28))();
|
|
}
|
|
if (*GHIDRA_CAST<int *>(puVar1) != 0) {
|
|
erasedRef = GHIDRA_CAST<Entity_Knife *>(puVar1);
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(puVar1) = 0;
|
|
if (*GHIDRA_CAST<int *>(secondRef) != 0) {
|
|
erasedRef = GHIDRA_CAST<Entity_Knife *>(secondRef);
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(secondRef) = 0;
|
|
puVar1 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f4)));
|
|
if (*GHIDRA_CAST<int *>(puVar1) != 0) {
|
|
erasedRef = GHIDRA_CAST<Entity_Knife *>(puVar1);
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
}
|
|
secondRef = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f8)));
|
|
*GHIDRA_CAST<undefined4 *>(puVar1) = 0;
|
|
if (*GHIDRA_CAST<int *>(secondRef) != 0) {
|
|
erasedRef = GHIDRA_CAST<Entity_Knife *>(secondRef);
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(secondRef) = 0;
|
|
return;
|
|
}
|
|
|
|
// 009612e0
|
|
void * Entity_Knife::GetHitEntities()
|
|
{
|
|
byte isUsingParentHitList;
|
|
EntityPtr parent;
|
|
|
|
isUsingParentHitList = this->_isUsingParentHitList;
|
|
while (((isUsingParentHitList != 0 &&
|
|
(parent = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc)), parent != (EntityPtr)0x0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parent) + 0x28)) == 8))) {
|
|
isUsingParentHitList = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(parent) + 0x4e7));
|
|
this = GHIDRA_CAST<Entity_Knife *>(parent);
|
|
}
|
|
return (void *)(GHIDRA_INT(this) + 0x4d8);
|
|
}
|
|
|
|
// 00961320
|
|
void Entity_Knife::InitHomingPath(Vector direction, Entity *source, float pathOffset)
|
|
{
|
|
uint tearFlagsWord2;
|
|
uint tearFlagsWord3;
|
|
Vector local_10;
|
|
|
|
(this->_homingLaser)._samples._end = (this->_homingLaser)._samples._begin;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x38)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x34))));
|
|
(this->_homingLaser)._nonOptimizedSamples._end = (this->_homingLaser)._nonOptimizedSamples._begin;
|
|
(this->_homingLaser)._bezier._end = (this->_homingLaser)._bezier._begin;
|
|
this->_pathSegment = 0;
|
|
this->_pathOffset = pathOffset;
|
|
this->_pathProgress = -100.0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x18)))) = 0x1e;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x40)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x14)))) = 0x43160000;
|
|
Entity_Laser::CalculateEndPoint(&local_10,&this->_pos,&direction,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),20.0)
|
|
;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x4)))) = (this->_pos).x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x8)))) = (this->_pos).y;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0xc)))) = direction.x * 200.0 + local_10.x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_homingLaser))) + 0x10)))) = direction.y * 200.0 + local_10.y;
|
|
tearFlagsWord3 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
local_10.x = (float)(tearFlagsWord3 & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._h)) + 0x4))));
|
|
tearFlagsWord2 = GHIDRA_UINT((this->_tearFlags)._h);
|
|
if ((!((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagOrbit._l)) == 0 &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._l)) + 0x4)))) == 0)) ||
|
|
(!((tearFlagsWord2 & GHIDRA_UINT(g_tearFlagOrbit._h)) == 0 && local_10.x == 0.0))) {
|
|
(GHIDRA_CAST<HomingLaser *>((&this->_homingLaser)))->HomingLaser::build_curl_path(60.0);
|
|
tearFlagsWord2 = GHIDRA_UINT((this->_tearFlags)._h);
|
|
tearFlagsWord3 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
}
|
|
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagHoming._l)) == 0 &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4)))) == 0) &&
|
|
((tearFlagsWord2 & GHIDRA_UINT(g_tearFlagHoming._h)) == 0 &&
|
|
(tearFlagsWord3 & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4)))) == 0)) {
|
|
(GHIDRA_CAST<HomingLaser *>((&this->_homingLaser)))->HomingLaser::build_bezier_path(0,source);
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<HomingLaser *>((&this->_homingLaser)))->HomingLaser::build_bezier_path(1,source);
|
|
return;
|
|
}
|
|
|
|
// 009614d0
|
|
void Entity_Knife::copy_parent_state(Entity_Knife *source)
|
|
{
|
|
int iVar1;
|
|
float x;
|
|
qword tearFlagsHigh;
|
|
undefined4 tearFlagsHighHigh;
|
|
undefined4 tearFlagsLowHigh;
|
|
|
|
iVar1 = *GHIDRA_CAST<int *>(this);
|
|
(this->_posOffset).x = (source->_posOffset).x;
|
|
(this->_posOffset).y = (source->_posOffset).y;
|
|
(**(code **)(iVar1 + 0x3c))(&source->_color,0xffffffff,0xff,0,1);
|
|
tearFlagsLowHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(source->_tearFlags)._l) + 4));
|
|
tearFlagsHigh = (source->_tearFlags)._h;
|
|
tearFlagsHighHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(source->_tearFlags)._h) + 4));
|
|
iVar1 = *GHIDRA_CAST<int *>(this);
|
|
*GHIDRA_CAST<int *>(&(this->_tearFlags)._l) = GHIDRA_INT((source->_tearFlags)._l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = tearFlagsLowHigh;
|
|
*GHIDRA_CAST<int *>(&(this->_tearFlags)._h) = GHIDRA_INT(tearFlagsHigh);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = tearFlagsHighHigh;
|
|
(**(code **)(iVar1 + 0x40))(source->_collisionDamage);
|
|
x = source->_rotationOffset;
|
|
if (360.0 < ABS(x)) {
|
|
x = fmodf(x,360.0);
|
|
}
|
|
if (x <= 180.0) {
|
|
if (x < -180.0) {
|
|
x = x + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
x = x - 360.0;
|
|
}
|
|
this->_rotationOffset = x;
|
|
(this->_sprite)._scale.x = (source->_sprite)._scale.x;
|
|
(this->_sprite)._scale.y = (source->_sprite)._scale.y;
|
|
this->_multidimensionalApplied = source->_multidimensionalApplied;
|
|
this->_prismApplied = source->_prismApplied;
|
|
return;
|
|
}
|
|
|
|
// 00961870
|
|
undefined4 Entity_Knife::spawn_child_knife()
|
|
{
|
|
double dVar1;
|
|
Vector direction;
|
|
Entity *rootParent;
|
|
uint rngResult;
|
|
Entity_Knife *childKnife;
|
|
float angle;
|
|
int iVar2;
|
|
undefined *local_24;
|
|
float local_20;
|
|
EntityPtr *local_1c [6];
|
|
|
|
if ((((this->_prismApplied != 0) || (this->_visible == 0)) || (this->_knifeVelocity <= 0.0)) ||
|
|
((this->_subtype != 0 && (this->_subtype != 1)))) {
|
|
return 0;
|
|
}
|
|
this->_visible = 0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x514)))) = this->_knifeDistance;
|
|
this->_prismApplied = 1;
|
|
rootParent = GetRootParent(this);
|
|
local_24 = &DAT_00c5d2c8;
|
|
local_20 = 0.0;
|
|
rootParent[1]._spawnerVariant = GHIDRA_INT(((float)rootParent[1]._spawnerVariant + 2.0));
|
|
do {
|
|
rngResult = Random();
|
|
childKnife = (Entity_Knife *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(8,this->_variant,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),
|
|
this->_subtype,rngResult,1);
|
|
if (childKnife == GHIDRA_CAST<Entity_Knife *>(0x0)) break;
|
|
if (childKnife->_parent != (EntityPtr)0x0) {
|
|
local_1c[0] = &childKnife->_parent;
|
|
std::multiset<unsigned_int>::erase(local_1c);
|
|
}
|
|
childKnife->_parent = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(&childKnife->_parent);
|
|
copy_parent_state(childKnife,this);
|
|
iVar2 = 0xff;
|
|
childKnife->SetColor(local_24,0xffffffff,0xff,0,1);
|
|
angle = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 20.0;
|
|
if (this->_subtype == 1) {
|
|
rngResult = Random();
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
|
|
angle = ((this->_rotation - 30.0) + angle) * 0.017453292;
|
|
local_24 = GHIDRA_CAST<undefined *>(cos(angle));
|
|
local_20 = sin(angle);
|
|
direction.y = local_20;
|
|
direction.x = (float)local_24;
|
|
InitHomingPath(childKnife,direction,GHIDRA_CAST<Entity *>(this),
|
|
(float)((double)GHIDRA_INT(rngResult) + dVar1) * 2.3283064e-10 * 50.0 - 25.0);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((childKnife)) + 0x504)))) = this->_knifeDistance;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((childKnife)) + 0x508)))) = angle - 30.0;
|
|
}
|
|
childKnife->Update();
|
|
local_20 = (float)(GHIDRA_INT(local_20) + 0x2c);
|
|
local_24 = local_24 + 0x2c;
|
|
} while (GHIDRA_UINT(local_20) < 0xb0);
|
|
if (this->_subtype == 1) {
|
|
this->Remove();
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00961b00
|
|
void Entity_Knife::Update()
|
|
{
|
|
undefined4 colorOffsetXY;
|
|
code *pcVar2;
|
|
int iVar3;
|
|
void *pvVar4;
|
|
undefined4 uVar5;
|
|
Vector direction;
|
|
BitSet128 flags;
|
|
BitSet128 flags_00;
|
|
BitSet128 flags_01;
|
|
Vector sizeMulti;
|
|
Vector direction_00;
|
|
ANM2 *pAVar6;
|
|
qword qVar7;
|
|
byte bVar8;
|
|
char cVar9;
|
|
uint uVar10;
|
|
Entity_Player *ownerPlayer;
|
|
LayerState *layer;
|
|
BitSet128 *pBVar11;
|
|
EntityPtr EVar12;
|
|
float *pfVar13;
|
|
float *extraout_EAX;
|
|
Entity_Tear *spawnedTear;
|
|
BitSet128 *tearFlagsTmp;
|
|
byte *anim;
|
|
Entity_Knife *rootParent;
|
|
RNG *spawnedTear;
|
|
RNG *spiralRng;
|
|
RNG *squareRng;
|
|
Vector *pVVar14;
|
|
Entity *tmpEntity;
|
|
EntityPtr *ownerPlayer;
|
|
Entity_Laser *techLaser;
|
|
ColorMod *color;
|
|
int fadeFrames;
|
|
TearParams *pTVar16;
|
|
EntityPtr EVar17;
|
|
void *pvVar18;
|
|
Vector *cardinalDir;
|
|
int extraout_EDX;
|
|
code *extraout_EDX_00;
|
|
int extraout_EDX_01;
|
|
Entity_NPC *laser;
|
|
bool bVar19;
|
|
float fVar20;
|
|
float fVar21;
|
|
float fVar22;
|
|
float fVar23;
|
|
float nextBezierB0;
|
|
float fVar24;
|
|
float bezierB2;
|
|
float bezierB3;
|
|
float nextBezierB3;
|
|
BitSet128 *b;
|
|
BitSet128 excludedMask;
|
|
BitSet128 continuumMask;
|
|
BitSet128 local_1d0;
|
|
BitSet128 local_1c0;
|
|
undefined1 local_1ac [12];
|
|
float fadeAlpha;
|
|
BitSet128 flagsScratch;
|
|
undefined1 local_170 [16];
|
|
Entity_Knife *knife;
|
|
EntityPtr local_15c;
|
|
RNG local_158;
|
|
undefined1 wiggleSquareMask [8];
|
|
Vector local_140;
|
|
Entity_Player *player;
|
|
Vector local_134;
|
|
float local_12c;
|
|
undefined1 spiralMask [8];
|
|
Vector local_120;
|
|
Vector local_118;
|
|
undefined1 flagsAnd [8];
|
|
Vector local_108;
|
|
undefined1 local_100 [12];
|
|
EntityPtr local_f4 [2];
|
|
float local_ec;
|
|
Vector local_e8;
|
|
float local_e0;
|
|
char isSwingWeapon;
|
|
char isSword;
|
|
byte local_d9;
|
|
TearParams tearHitParams;
|
|
undefined1 local_6c [44];
|
|
void *local_40 [2];
|
|
BitSet128 local_38;
|
|
uint stackCookie;
|
|
undefined1 *puStack_20;
|
|
void *savedExceptionList;
|
|
undefined1 *puStack_18;
|
|
int ehState;
|
|
undefined8 colorOffsetXY;
|
|
undefined1 flagsByte0;
|
|
undefined1 flagsByte1;
|
|
undefined2 flagsHalf1;
|
|
Room *room;
|
|
short spinsLeft;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((local_40 + 0xf));
|
|
ehState = -1;
|
|
puStack_18 = &LAB_00b0c913;
|
|
savedExceptionList = ExceptionList;
|
|
uVar10 = __security_cookie ^ GHIDRA_UINT((local_40 + 0xc));
|
|
ExceptionList = &savedExceptionList;
|
|
if (this->_isInterpolating == 0) {
|
|
this->_friction = this->_friction * 0.7;
|
|
}
|
|
fadeFrames = this->_variant;
|
|
local_134.y = 5.60519e-45;
|
|
isSwingWeapon = '\0';
|
|
isSword = '\0';
|
|
switch(fadeFrames) {
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 8:
|
|
case 9:
|
|
switchD_00961b98_caseD_2:
|
|
isSwingWeapon = '\x01';
|
|
local_134.y = 1.4013e-44;
|
|
break;
|
|
case 5:
|
|
break;
|
|
default:
|
|
if (fadeFrames == 1) goto switchD_00961b98_caseD_2;
|
|
if (fadeFrames == 10) goto switchD_00961b98_caseD_b;
|
|
break;
|
|
case 0xb:
|
|
switchD_00961b98_caseD_b:
|
|
isSword = '\x01';
|
|
local_134.y = 1.82169e-44;
|
|
}
|
|
knife = this;
|
|
stackCookie = uVar10;
|
|
player = GetPlayer(this);
|
|
EVar12 = this->_parent;
|
|
if (EVar12 == (EntityPtr)0x0) {
|
|
LAB_009652a2:
|
|
fadeFrames = *GHIDRA_CAST<int *>(this);
|
|
LAB_009652a6:
|
|
(**(code **)(fadeFrames + 0x28))();
|
|
}
|
|
else {
|
|
fadeFrames = this->_subtype;
|
|
if (fadeFrames == 0) {
|
|
local_12c = 30.0;
|
|
if (isSwingWeapon != '\0') {
|
|
local_12c = 4.0;
|
|
}
|
|
if (isSword != '\0') {
|
|
local_12c = 0.1;
|
|
}
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x28)) == 2) && (isSwingWeapon == '\0')) && (isSword == '\0')) {
|
|
local_12c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x420)) * 20.0;
|
|
}
|
|
if (extraout_EDX == 9) {
|
|
ownerPlayer = GetPlayer(this);
|
|
if ((ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(bVar8 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(0x3b,0), bVar8 == 0)) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
(layer->_color)._offset[0] = 0.0;
|
|
(layer->_color)._offset[1] = 0.0;
|
|
(layer->_color)._offset[2] = 0.0;
|
|
}
|
|
else {
|
|
local_108.y = (float)g_game->_frameCount * 0.2;
|
|
fVar20 = sin(local_108.y + 0.5);
|
|
local_120.y = fVar20 * 0.17 + 0.17;
|
|
fVar20 = sin(local_108.y + 0.25);
|
|
local_e8.y = fVar20 * 0.1 + 0.1;
|
|
fVar20 = sin(local_108.y + 0.0);
|
|
local_108.y = fVar20 * 0.25 + 0.25;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
(layer->_color)._offset[0] = local_120.y;
|
|
*GHIDRA_CAST<float *>(((layer->_color)._offset + 1)) = local_e8.y;
|
|
*GHIDRA_CAST<float *>(((layer->_color)._offset + 2)) = local_108.y;
|
|
}
|
|
}
|
|
tearFlagsTmp = &this->_tearFlags;
|
|
local_140.y = (float)tearFlagsTmp;
|
|
pBVar11 = BitSet128::operator_and(&local_1d0,tearFlagsTmp,&g_tearFlagLudovico);
|
|
if ((GHIDRA_INT(pBVar11->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar11->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(pBVar11->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar11->_h) + 4)) == 0)) {
|
|
EVar12 = (EntityPtr)GetRootParent(this);
|
|
fadeFrames = this->_variant;
|
|
local_15c = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x3bc));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) = EVar12;
|
|
if ((fadeFrames != 9) && ((fadeFrames != 8 && (fadeFrames != 4)))) {
|
|
if (local_15c == (EntityPtr)0x0) goto LAB_00961f38;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_15c) + 0x28)) == 1) {
|
|
bVar8 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_15c))))->Entity_Player::HasWeaponType(GHIDRA_INT(local_134.y));
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_15c) + 0x28)) != 3) ||
|
|
((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_15c) + 0x2c)) != 0x50 &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_15c) + 0x2c)) == 0xe7)) &&
|
|
(fadeFrames = __RTDynamicCast(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_15c) + 0xee0)),0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::
|
|
RTTI_Type_Descriptor,0,0),
|
|
local_134.y == 5.60519e-45)) && (*GHIDRA_CAST<int *>((fadeFrames + 0x4c)) != 0))))
|
|
goto LAB_00961e18;
|
|
bVar8 = *GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_15c) + 0x410)) + 0x13f0 + GHIDRA_INT(local_134.y)));
|
|
}
|
|
if (bVar8 == 0) goto LAB_00961f38;
|
|
}
|
|
LAB_00961e18:
|
|
if (EVar12 != (EntityPtr)this) {
|
|
if (((isSwingWeapon != '\0') || (isSword != '\0')) &&
|
|
(g_game->_frameCount - this->_spawnFrame < 2)) {
|
|
local_120.y = (float)&this->_sprite;
|
|
local_108.y = (float)(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar12) + 0x78)))))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>(local_40));
|
|
ehState = 0;
|
|
if (0xf < GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x14)))) {
|
|
local_108.y = *GHIDRA_CAST<float *>(local_108.y);
|
|
}
|
|
pfVar13 = *GHIDRA_CAST<float **>((GHIDRA_CAST<char *>(local_120.y) + 0x34));
|
|
if (pfVar13 == GHIDRA_CAST<float *>(0x0)) {
|
|
LAB_00961f64:
|
|
bVar8 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(local_108.y),1);
|
|
if (bVar8 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
EVar12 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((EntityPtr)local_170)) + 0xc)));
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < GHIDRA_UINT(pfVar13[5])) {
|
|
pfVar13 = GHIDRA_CAST<float *>(*pfVar13);
|
|
}
|
|
EVar17 = (EntityPtr)local_108.y;
|
|
do {
|
|
bVar8 = *GHIDRA_CAST<byte *>(pfVar13);
|
|
bVar19 = bVar8 < *GHIDRA_CAST<byte *>(EVar17);
|
|
if (bVar8 != *GHIDRA_CAST<byte *>(EVar17)) {
|
|
LAB_00961f44:
|
|
uVar10 = -GHIDRA_UINT(bVar19) | 1;
|
|
goto LAB_00961f49;
|
|
}
|
|
if (bVar8 == 0) break;
|
|
bVar8 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pfVar13) + 1));
|
|
bVar19 = bVar8 < *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar17) + 1));
|
|
if (bVar8 != *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar17) + 1))) goto LAB_00961f44;
|
|
pfVar13 = GHIDRA_CAST<float *>((GHIDRA_INT(pfVar13) + 2));
|
|
EVar17 = (EntityPtr)(GHIDRA_INT(EVar17) + 2);
|
|
} while (bVar8 != 0);
|
|
uVar10 = 0;
|
|
LAB_00961f49:
|
|
if ((uVar10 != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((this->_sprite)._animState._isPlaying == 0)))) goto LAB_00961f64;
|
|
}
|
|
ehState = -1;
|
|
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38._h)) + 0x4)))) {
|
|
uVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38._h)) + 0x4))) + 1;
|
|
pvVar18 = local_40[0];
|
|
if (0xfff < uVar10) {
|
|
pvVar18 = *(void **)(GHIDRA_INT(local_40[0]) + -4);
|
|
uVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38._h)) + 0x4))) + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_40[0]) + (-4 - GHIDRA_INT(pvVar18))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar18,uVar10);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38._h)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38._h)) + 0x4))) = 0xf;
|
|
local_40[0] = (void *)(GHIDRA_UINT(local_40[0]) & 0xffffff00);
|
|
}
|
|
this->_rotation = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x438));
|
|
this->_displayRotation =
|
|
(this->_rotationOffset + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x440))) -
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x43c));
|
|
this->_charge = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x460));
|
|
if ((this->_isFlying == 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x464)) != 0)) {
|
|
this->_height = (float)*(void **)(GHIDRA_CAST<char *>(EVar12) + 0x4cc);
|
|
this->_fallingSpeed = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x4d0));
|
|
this->_basePosOffsetY = (float)*(void **)(GHIDRA_CAST<char *>(EVar12) + 0x4d4);
|
|
UpdateHomingPath(this);
|
|
}
|
|
}
|
|
local_d9 = 0;
|
|
if (isSword != '\0') {
|
|
if ((((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
(bVar8 = AnimationState::IsEventTriggered
|
|
(&(this->_sprite)._animState,GHIDRA_CAST<byte *>("SwingEnd")), bVar8 == 0)) ||
|
|
(this->_isInterpolating != 0)) {
|
|
if (((EVar12 != (EntityPtr)this) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x4ea)) != 0)) &&
|
|
(this->_isSpinAttack == 0)) {
|
|
SpinAttack(this,*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(EVar12) + 0x4f0)),0);
|
|
local_d9 = 1;
|
|
}
|
|
}
|
|
else {
|
|
bVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x400000);
|
|
if ((bVar8 != 0) || (this->_isSpinAttack != 0)) {
|
|
local_120.y = this->_displayRotation * 0.017453292;
|
|
colorOffsetXY = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&this->_flags) = GHIDRA_UINT(this->_flags) & 0xffbfffff;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_flags) + 4)) = colorOffsetXY;
|
|
local_108.y = sin(local_120.y);
|
|
fVar20 = cos(local_120.y);
|
|
ownerPlayer = player;
|
|
local_120.y = fVar20 * 10.0;
|
|
local_108.y = local_108.y * 10.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = local_120.y;
|
|
local_f4[0] = (EntityPtr)local_108.y;
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
Entity_Player::GetTearMovementInheritance
|
|
(player,&local_e8,GHIDRA_CAST<Vector *>((local_100 + 8)),0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = (local_120.y + *extraout_EAX) * ownerPlayer->_shotspeed;
|
|
local_f4[0] = (EntityPtr)((local_108.y + extraout_EAX[1]) * ownerPlayer->_shotspeed)
|
|
;
|
|
}
|
|
if (this->_isSpinAttack != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_100)) + 0x8))) + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_100)) + 0x8)));
|
|
local_f4[0] = (EntityPtr)((float)local_f4[0] + (float)local_f4[0]);
|
|
}
|
|
fadeFrames = this->_variant;
|
|
uVar10 = Random();
|
|
spawnedTear = (Entity_Tear *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,GHIDRA_UINT((fadeFrames == 0xb)) * 2 + 0x2f,&this->_pos,
|
|
GHIDRA_CAST<Vector *>((local_100 + 8)),GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,
|
|
uVar10);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
spawnedTear->_fallingAccel = player->_tearfallaccel;
|
|
uVar10 = Random();
|
|
spawnedTear->_fallingSpeed =
|
|
(float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 - player->_tearfallspeed;
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(spawnedTear))))->Entity_Projectile::SetHeight(player->_tearheight);
|
|
}
|
|
local_e8.y = *GHIDRA_CAST<float *>(&this->_spawnerEntity);
|
|
if (spawnedTear->_parent != (EntityPtr)0x0) {
|
|
local_120.y = (float)&spawnedTear->_parent;
|
|
std::multiset<unsigned_int>::erase(&local_120.y);
|
|
}
|
|
spawnedTear->_parent = (EntityPtr)local_e8.y;
|
|
if ((EntityPtr)local_e8.y != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::insert(&spawnedTear->_parent);
|
|
}
|
|
tearFlagsTmp = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagFetus)))->BitSet128::__bnot(GHIDRA_CAST<BitSet128 *>(&local_158));
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(local_100),&this->_tearFlags,tearFlagsTmp);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x1))) = (char)(tearFlagsTmp->_h >> 8);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags)) + 0x0))) = *GHIDRA_CAST<unkbyte9 *>(tearFlagsTmp);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x2))) = (short)(tearFlagsTmp->_h >> 0x10);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4));
|
|
(GHIDRA_CAST<Entity_Tear *>((spawnedTear)))->Entity_Tear::SetTearFlags(flags);
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(spawnedTear) + 0x3c);
|
|
spawnedTear->_isFireSoundMuted = 1;
|
|
(*pcVar2)(&this->_color,0xffffffff,0xff,0,1);
|
|
if (this->_isSpinAttack == 0) {
|
|
fVar20 = this->_collisionDamage + 2.0;
|
|
}
|
|
else {
|
|
fVar20 = this->_collisionDamage * 4.0 + 4.0;
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(spawnedTear) + 0x40))(fVar20);
|
|
local_120.y = (this->_sprite)._scale.x;
|
|
local_e8.y = 0.01;
|
|
pVVar14 = &local_120;
|
|
if (local_120.y <= 0.01) {
|
|
pVVar14 = &local_e8;
|
|
}
|
|
fVar20 = pVVar14->y;
|
|
spawnedTear->_baseScale = fVar20;
|
|
spawnedTear->_fScale = fVar20;
|
|
(GHIDRA_CAST<Entity_Tear *>((spawnedTear)))->Entity_Tear::ResetSpriteScale();
|
|
(**(code **)(*GHIDRA_CAST<int *>(spawnedTear) + 0xc))();
|
|
EVar12 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((EntityPtr)local_170)) + 0xc)));
|
|
if ((this->_isSpinAttack != 0) &&
|
|
(spinsLeft = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f0)))), 1 < spinsLeft)) {
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f8)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f8)))) + 0x28))();
|
|
spinsLeft = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f0))));
|
|
}
|
|
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f0)))) = spinsLeft + -1;
|
|
SpinAttack(this,spinsLeft + -1,2);
|
|
local_d9 = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x465)) != 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x464)) == 0)) &&
|
|
(local_d9 == 0)) {
|
|
UpdateSwingHits(this);
|
|
local_d9 = 1;
|
|
}
|
|
if ((isSword != '\0') && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x465)) == 0)) {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar12) + 0x466)) != '\0') {
|
|
local_108.y = this->_displayRotation * 0.017453292;
|
|
local_120.y = sin(local_108.y);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = cos(local_108.y);
|
|
bVar8 = 0;
|
|
local_f4[0] = (EntityPtr)local_120.y;
|
|
fadeFrames = vector_to_direction(GHIDRA_CAST<Vector *>((local_100 + 8)));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar12) + 0x4e8)) == '\0') {
|
|
anim = (&PTR_s_IdleLeft_00b61560)[fadeFrames];
|
|
}
|
|
else {
|
|
anim = (&PTR_s_ChargedLeft_00b7cb28)[fadeFrames];
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(anim,bVar8);
|
|
}
|
|
if (local_d9 == 0) {
|
|
UpdateSwingHits(this);
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x464)) == 0) {
|
|
if (EVar12 == (EntityPtr)this) {
|
|
if ((g_game->_frameCount - this->_spawnFrame < 2) ||
|
|
(ABS(this->_displayRotation - this->_rotation) <= 0.1)) {
|
|
this->_displayRotation = this->_rotationOffset + this->_rotation;
|
|
}
|
|
else {
|
|
if ((player == GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(bVar8 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18d,0), bVar8 == 0)) {
|
|
fVar20 = 0.3;
|
|
}
|
|
else {
|
|
fVar20 = 1.0;
|
|
}
|
|
fVar20 = LerpAngleDeg(this->_displayRotation,this->_rotationOffset + this->_rotation,
|
|
fVar20);
|
|
this->_displayRotation = fVar20;
|
|
}
|
|
}
|
|
else {
|
|
this->_isFlying = 0;
|
|
}
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((0.0 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x504))))) && (EVar12 != (EntityPtr)this)) {
|
|
this->Remove();
|
|
}
|
|
EVar12 = local_15c;
|
|
*GHIDRA_CAST<undefined1 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x504)))) = &DAT_bf800000;
|
|
if (0.0 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x514))))) {
|
|
this->_visible = 1;
|
|
}
|
|
*GHIDRA_CAST<undefined1 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x514)))) = &DAT_bf800000;
|
|
local_e8.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_15c) + 0x33c));
|
|
local_108.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_15c) + 0x340));
|
|
local_f4[0] = (EntityPtr)(this->_displayRotation * 0.017453292);
|
|
local_120.y = sin((float)local_f4[0]);
|
|
fVar20 = cos((float)local_f4[0]);
|
|
(this->_pos).x = local_e8.y + fVar20 * local_12c;
|
|
(this->_pos).y = local_108.y + local_120.y * local_12c;
|
|
fVar20 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x;
|
|
(this->_anchorPosition).y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
(this->_anchorPosition).x = fVar20;
|
|
local_120.y = (this->_pos).x;
|
|
local_12c = (this->_pos).y;
|
|
this->_basePosOffsetY = (this->_posOffset).y;
|
|
local_ec = atan2f((this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)),
|
|
local_120.y - (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x);
|
|
local_ec = local_ec * 57.295776;
|
|
}
|
|
else {
|
|
fVar20 = 0.8;
|
|
if (EVar12 == (EntityPtr)this) {
|
|
EVar17 = (EntityPtr)this->_speedMultiplier;
|
|
local_108.y = (float)EVar17;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagBigSpiral
|
|
);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 == 0) {
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagSpiral)
|
|
;
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
local_108.y = (float)EVar17 * 0.75;
|
|
}
|
|
}
|
|
else {
|
|
local_108.y = (float)EVar17 * 0.5;
|
|
}
|
|
fVar21 = LerpAngleDeg(this->_displayRotation,this->_rotationOffset + this->_rotation,
|
|
fVar20);
|
|
fVar20 = this->_knifeVelocity;
|
|
fVar22 = -2.0;
|
|
fVar24 = -5.0;
|
|
this->_displayRotation = fVar21;
|
|
fVar21 = local_108.y * fVar20 * 0.5 + this->_knifeDistance;
|
|
this->_knifeDistance = fVar21;
|
|
EVar17 = (EntityPtr)local_108.y;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagOrbit);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
fVar22 = -0.5;
|
|
fVar24 = -0.75;
|
|
}
|
|
if (isSwingWeapon != '\0') {
|
|
fVar22 = fVar22 * 0.75;
|
|
fVar24 = fVar24 * 0.75;
|
|
}
|
|
if (this->_isInterpolating == 0) {
|
|
if (fVar20 <= 0.0) {
|
|
fVar22 = fVar24;
|
|
}
|
|
fVar22 = fVar22 * (float)EVar17 + fVar20;
|
|
this->_knifeVelocity = fVar22;
|
|
if (((0.0 < fVar20) && (fVar22 <= 0.0)) && (isSwingWeapon != '\0')) {
|
|
(GHIDRA_CAST<std::vector *>((&this->_hitList)))->std::vector::clear(0);
|
|
fVar21 = this->_knifeDistance;
|
|
}
|
|
}
|
|
if (0.0 <= fVar21) goto LAB_00962723;
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
this->_knifeDistance = 0.0;
|
|
this->_isFlying = 0;
|
|
this->_prismApplied = 0;
|
|
this->_multidimensionalApplied = 0;
|
|
(this->_posOffset).y = this->_basePosOffsetY;
|
|
if (isSwingWeapon != '\0') {
|
|
if (isSword == '\0') {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
}
|
|
LAB_009626f7:
|
|
if (this->_parent == (EntityPtr)player) {
|
|
SoundEffects::PlayWithFartOverride(0xf9,1.0,2,0,1.0);
|
|
}
|
|
goto LAB_00962723;
|
|
}
|
|
if (isSword != '\0') goto LAB_009626f7;
|
|
}
|
|
else {
|
|
LAB_00962723:
|
|
if (((isSwingWeapon != '\0') || (isSword != '\0')) && (EVar12 != (EntityPtr)this)) {
|
|
if (this->_isFlying == 0) {
|
|
if (isSword == '\0') {
|
|
(this->_sprite)._rotation = 0.0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b602e8,0);
|
|
fadeFrames = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::GetAnimationLength();
|
|
fadeFrames = Isaac::Random(fadeFrames);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(fadeFrames);
|
|
EVar12 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((EntityPtr)local_170)) + 0xc)));
|
|
}
|
|
(GHIDRA_CAST<std::vector *>((&this->_hitList)))->std::vector::clear(0);
|
|
}
|
|
if ((0.0 < this->_knifeVelocity) && (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x448)) <= 0.0)) {
|
|
(GHIDRA_CAST<std::vector *>((&this->_hitList)))->std::vector::clear(0);
|
|
}
|
|
}
|
|
}
|
|
fVar20 = 0.0;
|
|
bVar8 = (GHIDRA_CAST<Vector *>((&this->_anchorPosition)))->Vector::operator_eq(&g_vectorZero);
|
|
pVVar14 = &this->_anchorPosition;
|
|
if (bVar8 != 0) {
|
|
fVar21 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_15c) + 0x340));
|
|
pVVar14->x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_15c) + 0x33c)))->x;
|
|
(this->_anchorPosition).y = fVar21;
|
|
}
|
|
if (EVar12 == (EntityPtr)this) {
|
|
fVar24 = this->_knifeDistance;
|
|
fVar21 = this->_maxDistance;
|
|
fVar22 = this->_charge;
|
|
}
|
|
else {
|
|
this->_isFlying = 1;
|
|
fVar24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x444));
|
|
this->_knifeDistance = fVar24;
|
|
fVar21 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x45c));
|
|
this->_maxDistance = fVar21;
|
|
fVar22 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x460));
|
|
this->_charge = fVar22;
|
|
this->_knifeVelocity = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x448));
|
|
}
|
|
fVar23 = fVar24 / fVar21;
|
|
if (fVar24 / fVar21 <= fVar20) {
|
|
fVar23 = fVar20;
|
|
}
|
|
if (1.0 <= fVar23) {
|
|
fVar23 = 1.0;
|
|
}
|
|
fVar20 = 1.0 - fVar22 * fVar23 * 0.8;
|
|
local_e0 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_15c) + 0x340)) - (this->_anchorPosition).y) * fVar20 +
|
|
(this->_anchorPosition).y;
|
|
local_108.y = fVar20 * ((GHIDRA_CAST<Vector *>((GHIDRA_INT(local_15c) + 0x33c)))->x - pVVar14->x) + pVVar14->x
|
|
;
|
|
(this->_anchorPosition).y = local_e0;
|
|
pVVar14->x = local_108.y;
|
|
fVar20 = this->_displayRotation;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagOrbit);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 == 0) {
|
|
local_120.y = fVar20 * 0.017453292;
|
|
local_118.y = sin(local_120.y);
|
|
local_e8.y = this->_knifeDistance + local_12c;
|
|
fVar20 = cos(local_120.y);
|
|
(this->_pos).x = fVar20 * local_e8.y + local_108.y;
|
|
(this->_pos).y = local_118.y * local_e8.y + local_e0;
|
|
}
|
|
else {
|
|
local_120.y = normalize_angle_degrees(this->_rotationOffset);
|
|
fVar20 = this->_knifeDistance * 3.1415927;
|
|
local_e8.y = ((fVar20 + fVar20) * (local_120.y * 0.002 + 1.0) + this->_displayRotation)
|
|
* 0.017453292;
|
|
local_118.y = sin(local_e8.y);
|
|
local_120.y = (1.0 - local_120.y * 0.02) * this->_knifeDistance * 0.25 + local_12c;
|
|
fVar20 = cos(local_e8.y);
|
|
(this->_pos).x = fVar20 * local_120.y + local_108.y;
|
|
(this->_pos).y = local_118.y * local_120.y + local_e0;
|
|
local_e8.y = this->_knifeDistance * 0.0002 * ABS(this->_knifeVelocity) + 1.0;
|
|
local_120.y = this->_knifeDistance * 0.0014 * ABS(this->_knifeVelocity) + 1.0;
|
|
pVVar14 = &local_120;
|
|
if (local_120.y <= local_e8.y) {
|
|
pVVar14 = &local_e8;
|
|
}
|
|
fVar20 = pVVar14->y;
|
|
local_f4[0] = (EntityPtr)(local_120.y / fVar20);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = local_e8.y / fVar20;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sizeMulti.y)) + 0x0))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_f4[0])) + 0x0)));
|
|
sizeMulti.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_100)) + 0x8)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sizeMulti.y)) + 0x1))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_f4[0])) + 0x1)));
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(sizeMulti.y)) + 0x2))) = (*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_f4[0])) + 0x2)));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetSize(fVar20 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_config) + 0x38)),sizeMulti,
|
|
-1);
|
|
}
|
|
fVar20 = atan2f((this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_15c) + 0x340)),
|
|
(this->_pos).x - (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_15c) + 0x33c)))->x);
|
|
fVar20 = fVar20 * 57.295776;
|
|
local_ec = fVar20;
|
|
local_e0 = fVar20;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagOrbit);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
local_ec = fVar20 + 90.0;
|
|
local_e0 = local_ec;
|
|
}
|
|
fVar20 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x504))));
|
|
fVar21 = (this->_pos).y;
|
|
if (0.0 <= fVar20) {
|
|
if (this->_knifeDistance <= fVar20) {
|
|
if ((this->_knifeDistance < fVar20) && (EVar12 != (EntityPtr)this)) {
|
|
LAB_00961f38:
|
|
this->Remove();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
local_108.y = (float)this;
|
|
while( true ) {
|
|
EVar12 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_108.y) + 0x504));
|
|
local_118.y = (float)EVar12;
|
|
if ((float)EVar12 < 0.0) break;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagOrbit
|
|
);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(tearFlagsTmp->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) == 0)) {
|
|
local_120.y = this->_displayRotation * 0.017453292;
|
|
local_134.y = sin(local_120.y);
|
|
}
|
|
else {
|
|
local_120.y = ((float)EVar12 * 3.1415927 * 0.5 + this->_displayRotation) *
|
|
0.017453292;
|
|
local_134.y = sin(local_120.y);
|
|
local_118.y = local_118.y * 0.7;
|
|
}
|
|
local_118.y = local_118.y + local_12c;
|
|
fVar20 = cos(local_120.y);
|
|
local_134.y = local_134.y * local_118.y;
|
|
local_118.y = fVar20 * local_118.y + (this->_anchorPosition).x;
|
|
local_134.y = local_134.y + (this->_anchorPosition).y;
|
|
local_e0 = (this->_pos).x - local_118.y;
|
|
local_f4[0] = (EntityPtr)((this->_pos).y - local_134.y);
|
|
local_120.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x508)) * 0.017453292;
|
|
local_e8.y = cos(local_120.y);
|
|
fVar20 = sin(local_120.y);
|
|
local_118.y = local_118.y + (local_e8.y * local_e0 - fVar20 * (float)local_f4[0]);
|
|
local_134.y = local_134.y + local_e8.y * (float)local_f4[0] + fVar20 * local_e0;
|
|
(this->_pos).x = local_118.y;
|
|
(this->_pos).y = local_134.y;
|
|
local_ec = local_ec + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x508));
|
|
local_f4[0] = (EntityPtr)(local_ec * 0.017453292);
|
|
local_e0 = local_ec;
|
|
local_120.y = cos((float)local_f4[0]);
|
|
fVar24 = sin((float)local_f4[0]);
|
|
fVar20 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x50c));
|
|
fVar22 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x510));
|
|
fVar21 = fVar20 * fVar24 + fVar22 * local_120.y + local_134.y;
|
|
(this->_pos).y = fVar21;
|
|
(this->_pos).x = local_118.y + (fVar20 * local_120.y - fVar22 * fVar24);
|
|
local_108.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x3bc));
|
|
if (((EntityPtr)local_108.y == (EntityPtr)0x0) ||
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0x28)) != 1.12104e-44)) break;
|
|
}
|
|
EVar12 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((EntityPtr)local_170)) + 0xc)));
|
|
}
|
|
}
|
|
fVar20 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x514))));
|
|
local_12c = fVar21;
|
|
if (((0.0 <= fVar20) && (this->_visible == 0)) &&
|
|
(this->_knifeDistance <= fVar20 && fVar20 != this->_knifeDistance)) {
|
|
this->_visible = 1;
|
|
local_12c = (this->_pos).y;
|
|
}
|
|
local_120.y = (this->_pos).x;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagContinuum);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
screen_wrap(this);
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagHoming);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
update_target(this,&local_e0);
|
|
local_ec = local_e0;
|
|
}
|
|
fVar20 = local_ec;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagWiggle);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
apply_wiggle(this,&local_e0);
|
|
local_ec = local_e0;
|
|
fVar20 = local_e0;
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagBigSpiral);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 == 0) {
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagSpiral);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
rootParent = GHIDRA_CAST<Entity_Knife *>(GetRootParent(this));
|
|
if (rootParent == this) {
|
|
local_108.y = 0.0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<RNG *>((&local_158)))->RNG::game_constructor(this->_initSeed,0x23);
|
|
fVar20 = (GHIDRA_CAST<RNG *>((spiralRng)))->RNG::RandomFloat();
|
|
local_108.y = fVar20 * 360.0;
|
|
fVar20 = local_ec;
|
|
}
|
|
local_f4[0] = (EntityPtr)(fVar20 * 0.017453292);
|
|
local_118.y = sin((float)local_f4[0]);
|
|
local_e0 = cos((float)local_f4[0]);
|
|
local_134.y = this->_knifeDistance;
|
|
local_f4[0] = (EntityPtr)((local_134.y * 3.0 + local_108.y) * 0.017453292);
|
|
local_e8.y = cos((float)local_f4[0]);
|
|
fVar20 = sin((float)local_f4[0]);
|
|
fVar21 = local_134.y * 0.5;
|
|
if (fVar21 <= 0.0) {
|
|
fVar21 = 0.0;
|
|
}
|
|
if (50.0 <= fVar21) {
|
|
fVar21 = 50.0;
|
|
}
|
|
(this->_pos).y =
|
|
fVar21 * (fVar20 * local_e0 + local_e8.y * local_118.y) + (this->_pos).y;
|
|
(this->_pos).x =
|
|
fVar21 * (local_e8.y * local_e0 - fVar20 * local_118.y) + (this->_pos).x;
|
|
local_ec = this->_knifeDistance * 3.0 + 90.0 + local_108.y + local_ec;
|
|
}
|
|
}
|
|
else {
|
|
rootParent = GHIDRA_CAST<Entity_Knife *>(GetRootParent(this));
|
|
if (rootParent == this) {
|
|
local_108.y = 0.0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<RNG *>((&local_158)))->RNG::game_constructor(this->_initSeed,0x23);
|
|
fVar20 = (GHIDRA_CAST<RNG *>((spawnedTear)))->RNG::RandomFloat();
|
|
local_108.y = fVar20 * 360.0;
|
|
fVar20 = local_ec;
|
|
}
|
|
local_f4[0] = (EntityPtr)(fVar20 * 0.017453292);
|
|
local_118.y = sin((float)local_f4[0]);
|
|
local_e0 = cos((float)local_f4[0]);
|
|
local_134.y = this->_knifeDistance;
|
|
local_f4[0] = (EntityPtr)((local_134.y + local_134.y + local_108.y) * 0.017453292);
|
|
local_e8.y = cos((float)local_f4[0]);
|
|
fVar20 = sin((float)local_f4[0]);
|
|
fVar21 = local_134.y * 0.5;
|
|
if (fVar21 <= 0.0) {
|
|
fVar21 = 0.0;
|
|
}
|
|
if (180.0 <= fVar21) {
|
|
fVar21 = 180.0;
|
|
}
|
|
(this->_pos).y =
|
|
fVar21 * (fVar20 * local_e0 + local_e8.y * local_118.y) + (this->_pos).y;
|
|
(this->_pos).x =
|
|
fVar21 * (local_e8.y * local_e0 - fVar20 * local_118.y) + (this->_pos).x;
|
|
local_ec = this->_knifeDistance + this->_knifeDistance + 90.0 + local_108.y + local_ec;
|
|
}
|
|
EVar17 = (EntityPtr)0x0;
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagSquare);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
rootParent = GHIDRA_CAST<Entity_Knife *>(GetRootParent(this));
|
|
if (rootParent != this) {
|
|
(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_100))))->RNG::game_constructor(this->_initSeed,0x23);
|
|
fVar20 = (GHIDRA_CAST<RNG *>((squareRng)))->RNG::RandomFloat();
|
|
EVar17 = (EntityPtr)(fVar20 * 120.0);
|
|
}
|
|
local_f4[0] = (EntityPtr)(local_ec * 0.017453292);
|
|
local_e8.y = (float)EVar17;
|
|
local_118.y = sin((float)local_f4[0]);
|
|
local_e0 = cos((float)local_f4[0]);
|
|
local_f4[0] = (EntityPtr)cos(1.5707964);
|
|
fVar20 = sin(1.5707964);
|
|
local_134.y = fVar20 * local_e0 + (float)local_f4[0] * local_118.y;
|
|
local_108.y = (float)local_f4[0] * local_e0 - fVar20 * local_118.y;
|
|
fVar20 = fmodf(local_e8.y + this->_knifeDistance,120.0);
|
|
if (40.0 <= fVar20) {
|
|
if (60.0 <= fVar20) {
|
|
if (fVar20 < 100.0) {
|
|
fVar21 = ((fVar20 - 60.0) * 20.0) / 40.0;
|
|
fVar20 = fVar21 * local_e0 + local_108.y * 15.0;
|
|
fVar21 = fVar21 * local_118.y + local_134.y * 15.0;
|
|
goto LAB_0096357e;
|
|
}
|
|
fVar21 = ((120.0 - fVar20) * 20.0) / 20.0;
|
|
fVar20 = 15.0 - ((fVar20 - 100.0) * 30.0) / 20.0;
|
|
(this->_pos).y = fVar20 * local_134.y + fVar21 * local_118.y + (this->_pos).y;
|
|
(this->_pos).x = fVar20 * local_108.y + fVar21 * local_e0 + (this->_pos).x;
|
|
local_ec = local_ec - 90.0;
|
|
}
|
|
else {
|
|
fVar21 = ((60.0 - fVar20) * 20.0) / 20.0;
|
|
fVar20 = 15.0 - ((fVar20 - 40.0) * 30.0) / 20.0;
|
|
(this->_pos).x = (fVar21 * local_e0 - local_108.y * fVar20) + (this->_pos).x;
|
|
local_ec = local_ec + 90.0;
|
|
(this->_pos).y = (fVar21 * local_118.y - local_134.y * fVar20) + (this->_pos).y;
|
|
}
|
|
}
|
|
else {
|
|
fVar21 = (fVar20 * 20.0) / 40.0;
|
|
fVar20 = fVar21 * local_e0 - local_108.y * 15.0;
|
|
fVar21 = fVar21 * local_118.y - local_134.y * 15.0;
|
|
LAB_0096357e:
|
|
(this->_pos).x = fVar20 + (this->_pos).x;
|
|
(this->_pos).y = fVar21 + (this->_pos).y;
|
|
}
|
|
}
|
|
if ((EVar12 == (EntityPtr)this) && (player != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
bVar8 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x76,0);
|
|
if ((bVar8 != 0) && (this->_knifeVelocity <= 0.0 && this->_knifeVelocity != 0.0)) {
|
|
bVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0);
|
|
if (bVar8 != 0) {
|
|
uVar10 = Random();
|
|
local_108.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_parent) + 0x33c));
|
|
local_e0 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_parent) + 0x340));
|
|
local_f4[0] = (EntityPtr)(this->_rotation * 0.017453292);
|
|
local_e8.y = sin((float)local_f4[0]);
|
|
fVar20 = cos((float)local_f4[0]);
|
|
local_118.x = local_108.y + fVar20 * 30.0;
|
|
local_118.y = local_e0 + local_e8.y * 30.0;
|
|
EVar12 = (EntityPtr)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(8,0,&local_118,&g_vectorZero,GHIDRA_CAST<Entity *>(player),1,uVar10
|
|
,1);
|
|
local_108.y = (float)EVar12;
|
|
if (EVar12 != (EntityPtr)0x0) {
|
|
fadeFrames = *GHIDRA_CAST<int *>(EVar12);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x34c)))->x = 0.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x350)) = -10.0;
|
|
(**(code **)(fadeFrames + 0x40))(this->_collisionDamage * 0.4);
|
|
(**(code **)(*GHIDRA_CAST<int *>(EVar12) + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1);
|
|
HomingLaser::operator_assign
|
|
(GHIDRA_CAST<HomingLaser *>((GHIDRA_INT(EVar12) + 0x468)),&this->_homingLaser);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
|
|
colorOffsetXY = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
pvVar18 = *(void **)&(this->_tearFlags)._h;
|
|
pvVar4 = *(void **)(GHIDRA_INT(&(this->_tearFlags)._h) + 4);
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_108.y) + 0x410)) = GHIDRA_INT((this->_tearFlags)._l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_108.y) + 0x414)) = colorOffsetXY;
|
|
(GHIDRA_CAST<std_vector *>((GHIDRA_INT(local_108.y) + 0x418)))->_begin = pvVar18;
|
|
*(void **)(GHIDRA_CAST<char *>(local_108.y) + 0x41c) = pvVar4;
|
|
uVar10 = Random();
|
|
local_e0 = (float)((double)GHIDRA_INT(uVar10) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]) * 2.3283064e-10
|
|
* 50.0 - 25.0;
|
|
local_f4[0] = (EntityPtr)(this->_rotation * 0.017453292);
|
|
local_e8.y = sin((float)local_f4[0]);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = cos((float)local_f4[0]);
|
|
local_f4[0] = (EntityPtr)local_e8.y;
|
|
direction.y = local_e8.y;
|
|
direction.x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_100)) + 0x8)));
|
|
InitHomingPath(GHIDRA_CAST<Entity_Knife *>(local_108.y),direction,GHIDRA_CAST<Entity *>(this),local_e0);
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_108.y) + 0xe4)))->x = (this->_sprite)._scale.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_108.y) + 0xe8)) = (this->_sprite)._scale.y;
|
|
(**(code **)(GHIDRA_INT(*GHIDRA_CAST<float *>(local_108.y)) + 0xc))();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isSwingWeapon == '\0') {
|
|
if (isSword != '\0') goto LAB_00963b53;
|
|
fVar20 = normalize_angle_degrees(local_ec - 90.0);
|
|
(this->_sprite)._rotation = fVar20;
|
|
local_d9 = 0.0 < fVar20;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_flipX = local_d9;
|
|
}
|
|
else {
|
|
if (isSword == '\0') {
|
|
if (this->_isFlying != 0) goto LAB_00963c34;
|
|
}
|
|
else {
|
|
LAB_00963b53:
|
|
if (this->_isFlying != 0) {
|
|
fVar20 = normalize_angle_degrees(local_ec - 90.0);
|
|
(this->_sprite)._rotation = fVar20;
|
|
goto LAB_00963c34;
|
|
}
|
|
}
|
|
fVar20 = atan2f(local_12c - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_15c) + 0x340)),
|
|
local_120.y - (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_15c) + 0x33c)))->x);
|
|
fVar20 = normalize_angle_degrees(fVar20 * 57.295776 - 90.0);
|
|
(this->_sprite)._rotation = fVar20;
|
|
local_e8.y = (float)(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayerFrame(0);
|
|
if ((EntityPtr)local_e8.y != (EntityPtr)0x0) {
|
|
local_f4[0] = (EntityPtr)((this->_sprite)._rotation * 0.017453292);
|
|
local_120.y = cos((float)local_f4[0]);
|
|
fVar20 = sin((float)local_f4[0]);
|
|
this->_knifeDepthOffset =
|
|
local_120.y * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_e8.y) + 4)) + fVar20 * *GHIDRA_CAST<float *>(local_e8.y);
|
|
}
|
|
}
|
|
LAB_00963c34:
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x518)))) = local_ec;
|
|
if ((this->_isFlying != 0) && (this->_visible != 0)) {
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(flagsAnd),&this->_tearFlags,
|
|
&g_tearFlagMysteriousLiquidCreep);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if ((bVar8 != 0) &&
|
|
((bVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(2,0), bVar8 != 0 &&
|
|
(uVar10 = Random(), (uVar10 & 1) == 0)))) {
|
|
local_e8.x = (this->_pos).x;
|
|
local_e8.y = (this->_pos).y;
|
|
pVVar14 = Room::GetClampedPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((local_100 + 8)),&local_e8,15.0);
|
|
local_e8.x = pVVar14->x;
|
|
local_e8.y = pVVar14->y;
|
|
uVar10 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x35,&local_e8,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,uVar10);
|
|
fVar20 = (this->_sprite)._scale.x;
|
|
fVar21 = g_vectorOne.x * 0.4;
|
|
fadeFrames = *GHIDRA_CAST<int *>(tmpEntity);
|
|
fVar22 = g_vectorOne.y * 0.4;
|
|
pAVar6 = &tmpEntity[1]._sprite;
|
|
(pAVar6->_filename)._buf[4] = '\x1e';
|
|
(pAVar6->_filename)._buf[5] = '\0';
|
|
(pAVar6->_filename)._buf[6] = '\0';
|
|
(pAVar6->_filename)._buf[7] = '\0';
|
|
pAVar6 = &tmpEntity[1]._sprite;
|
|
(pAVar6->_filename)._buf[8] = '\x1e';
|
|
(pAVar6->_filename)._buf[9] = '\0';
|
|
(pAVar6->_filename)._buf[10] = '\0';
|
|
(pAVar6->_filename)._buf[0xb] = '\0';
|
|
(tmpEntity->_sprite)._scale.x = fVar20 * fVar21;
|
|
(tmpEntity->_sprite)._scale.y = fVar20 * fVar22;
|
|
(**(code **)(fadeFrames + 0xc))();
|
|
}
|
|
}
|
|
if ((((((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Knife *>(local_170))) + 0xc))) != this) || (this->_variant == 8)) ||
|
|
(this->_variant == 4)) &&
|
|
((*GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x464)) == 0 &&
|
|
(*GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x466)) == '\0')))) &&
|
|
(*GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x465)) == 0)) {
|
|
this->Remove();
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_parent) + 0x28)) == 1) {
|
|
ownerPlayer = (Entity_Player *)
|
|
__RTDynamicCast(this->_parent,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,0xdc,0);
|
|
bVar8 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasWeaponType(GHIDRA_INT(local_134.y));
|
|
if (bVar8 == 0) {
|
|
this->Remove();
|
|
}
|
|
this->_isFlying = 0;
|
|
fVar20 = (this->_velocity).y;
|
|
fVar21 = (this->_velocity).x;
|
|
if (fVar21 * fVar21 + fVar20 * fVar20 <= 0.1) {
|
|
fVar20 = (this->_sprite)._rotation;
|
|
}
|
|
else {
|
|
fVar20 = atan2f(fVar20,fVar21);
|
|
fVar20 = LerpAngleDeg((this->_sprite)._rotation,fVar20 * 57.295776 - 90.0,0.24);
|
|
(this->_sprite)._rotation = fVar20;
|
|
}
|
|
local_d9 = 0.0 < fVar20;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_flipX = local_d9;
|
|
pBVar11 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_158),tearFlagsTmp,&g_tearFlagContinuum)
|
|
;
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((pBVar11)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
screen_wrap(this);
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),tearFlagsTmp,&g_tearFlagHoming);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
EVar12 = this->_target;
|
|
if (EVar12 == (EntityPtr)0x0) {
|
|
local_120.y = 22500.0;
|
|
local_108.y = (float)EVar12;
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(&local_158),
|
|
&this->_pos,150.0,8);
|
|
ehState = 1;
|
|
local_e8.y = 0.0;
|
|
if ((EntityPtr)local_158._shift3 != (EntityPtr)0x0) {
|
|
do {
|
|
EVar12 = *GHIDRA_CAST<EntityPtr *>((local_158._shift1 + GHIDRA_INT(local_e8.y) * 4));
|
|
bVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar8 != 0) {
|
|
fVar20 = (this->_pos).x - (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x;
|
|
fVar21 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
EVar17 = (EntityPtr)(fVar21 * fVar21 + fVar20 * fVar20);
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x14)) < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x380))) {
|
|
if ((float)EVar17 < local_120.y) {
|
|
local_120.y = (float)EVar17;
|
|
local_108.y = (float)EVar12;
|
|
}
|
|
}
|
|
}
|
|
local_e8.y = (float)(GHIDRA_INT(local_e8.y) + 1);
|
|
} while (GHIDRA_UINT(local_e8.y) < GHIDRA_UINT(local_158._shift3));
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(local_108.y));
|
|
(GHIDRA_CAST<EntityList_Query *>((&local_158)))->EntityList_Query::~EntityList_Query();
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = (this->_pos).x - (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x;
|
|
local_f4[0] = (EntityPtr)((this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)));
|
|
pVVar14 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((local_100 + 8)))))->Vector::Normalized(&local_120);
|
|
fVar20 = pVVar14->y;
|
|
EVar12 = this->_target;
|
|
(this->_velocity).x = (this->_velocity).x - pVVar14->x;
|
|
(this->_velocity).y = (this->_velocity).y - fVar20;
|
|
fVar20 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
fVar21 = (this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x33c));
|
|
if (22500.0 < fVar20 * fVar20 + fVar21 * fVar21) {
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_158),&this->_tearFlags,&g_tearFlagWiggle);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(tearFlagsTmp->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) != 0)) {
|
|
local_e8.x = (this->_velocity).y;
|
|
local_e8.y = (float)(GHIDRA_UINT((this->_velocity).x) ^ 0x80000000);
|
|
(GHIDRA_CAST<Vector *>((&local_e8)))->Vector::Normalize();
|
|
fVar20 = (this->_velocity).y;
|
|
fVar21 = (this->_velocity).x;
|
|
fVar20 = sqrtf(fVar21 * fVar21 + fVar20 * fVar20);
|
|
local_f4[0] = (EntityPtr)(fVar20 * 0.5);
|
|
local_120.y = 30.0;
|
|
ownerPlayer = local_f4;
|
|
if (30.0 <= (float)local_f4[0]) {
|
|
ownerPlayer = GHIDRA_CAST<EntityPtr *>(&local_120.y);
|
|
}
|
|
fVar20 = sin((float)g_game->_frameCount * 0.4);
|
|
EVar12 = *ownerPlayer;
|
|
(this->_pos).x = local_e8.x * fVar20 * (float)EVar12 + (this->_pos).x;
|
|
(this->_pos).y = local_e8.y * fVar20 * (float)EVar12 + (this->_pos).y;
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_and
|
|
(&continuumMask,&this->_tearFlags,&g_tearFlagContinuum);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(tearFlagsTmp->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) == 0)) {
|
|
pVVar14 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetClampedPosition(&local_134,&this->_pos,0.0);
|
|
(this->_pos).x = pVVar14->x;
|
|
(this->_pos).y = pVVar14->y;
|
|
}
|
|
EVar12 = (EntityPtr)0x0;
|
|
local_158._shift1 = 0;
|
|
local_118.y = 0.0;
|
|
local_158._shift2 = 0;
|
|
local_158._shift3 = 0;
|
|
ehState = 2;
|
|
local_108.y = *GHIDRA_CAST<float *>(&this->_child);
|
|
if ((EntityPtr)local_108.y != (EntityPtr)0x0) {
|
|
do {
|
|
if ((EntityPtr)local_158._shift2 == EVar12) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate((char)local_158._shift2,&local_108.y);
|
|
EVar12 = (EntityPtr)local_158._shift3;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(local_158._shift2) = local_108.y;
|
|
local_158._shift2 = local_158._shift2 + 4;
|
|
}
|
|
local_108.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(local_108.y) + 0x3c0))))) + 0x0))));
|
|
} while ((EntityPtr)local_108.y != (EntityPtr)0x0);
|
|
local_108.y = 0.0;
|
|
local_118.y = (float)EVar12;
|
|
}
|
|
local_e0 = (float)g_game->_frameCount;
|
|
if (this->_isInterpolating != 0) {
|
|
local_e0 = local_e0 + 0.5;
|
|
}
|
|
fadeFrames = local_158._shift2 - local_158._shift1;
|
|
local_e8.y = 0.0;
|
|
EVar12 = (EntityPtr)(fadeFrames >> 2);
|
|
if (EVar12 != (EntityPtr)0x0) {
|
|
local_12c = local_e0 * 6.0;
|
|
do {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) = *GHIDRA_CAST<EntityPtr *>((local_158._shift1 + GHIDRA_INT(local_e8.y) * 4));
|
|
(GHIDRA_CAST<Vector *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x360)))->x = (this->_velocity).x;
|
|
*GHIDRA_CAST<float *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x364)) = (this->_velocity).y;
|
|
local_108.y = this->_size * 5.0;
|
|
EVar17 = (EntityPtr)
|
|
(((float)((double)GHIDRA_INT(local_e8.y) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_e8.y) >> 0x1f)]) * 360.0) /
|
|
(float)((double)GHIDRA_INT(EVar12) + __uint_to_double_fixup[-(fadeFrames >> 0x1f)]) +
|
|
local_12c);
|
|
fVar20 = local_e0;
|
|
local_120.y = (float)EVar17;
|
|
tearFlagsTmp = BitSet128::operator_and(&local_1c0,&this->_tearFlags,&g_tearFlagPulse);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(tearFlagsTmp->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) != 0)) {
|
|
fVar20 = sin(fVar20 * 0.3);
|
|
local_108.y = ((fVar20 + 1.0) * 0.5 * 0.5 + 1.0) * local_108.y;
|
|
EVar17 = (EntityPtr)local_120.y;
|
|
}
|
|
local_f4[0] = (EntityPtr)((float)EVar17 * 0.017453292);
|
|
local_15c = (EntityPtr)sin((float)local_f4[0]);
|
|
fVar21 = cos((float)local_f4[0]);
|
|
fVar20 = (this->_pos).y;
|
|
(GHIDRA_CAST<Vector *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x33c)))->x = fVar21 * local_108.y + (this->_pos).x;
|
|
fVar21 = local_120.y - 90.0;
|
|
*GHIDRA_CAST<float *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x340)) = (float)local_15c * local_108.y + fVar20;
|
|
if (360.0 < ABS(fVar21)) {
|
|
fVar21 = fmodf(fVar21,360.0);
|
|
}
|
|
if (fVar21 <= 180.0) {
|
|
if (fVar21 < -180.0) {
|
|
fVar21 = fVar21 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar21 = fVar21 - 360.0;
|
|
}
|
|
*GHIDRA_CAST<float *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0xec)) = fVar21;
|
|
(**(code **)(GHIDRA_INT(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<float *>(local_170))) + 0xc)))) + 0x3c))
|
|
(&(this->_sprite)._color,0xffffffff,0xff,0,1);
|
|
fVar21 = *GHIDRA_CAST<float *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
pvVar18 = *(void **)&(this->_tearFlags)._h;
|
|
pvVar4 = *(void **)(GHIDRA_INT(&(this->_tearFlags)._h) + 4);
|
|
fVar20 = *(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<float *>(local_170))) + 0xc)));
|
|
*GHIDRA_CAST<float *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x410)) = *GHIDRA_CAST<float *>(&(this->_tearFlags)._l);
|
|
*GHIDRA_CAST<float *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x414)) = fVar21;
|
|
(GHIDRA_CAST<std_vector *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x418)))->_begin = pvVar18;
|
|
*(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x41c) = pvVar4;
|
|
(**(code **)(GHIDRA_CAST<char *>(fVar20) + 0x40))(this->_collisionDamage);
|
|
local_e8.y = (float)(GHIDRA_INT(local_e8.y) + 1);
|
|
} while (GHIDRA_UINT(local_e8.y) < GHIDRA_UINT(EVar12));
|
|
}
|
|
ehState = -1;
|
|
if ((void *)local_158._shift1 != (void *)0x0) {
|
|
deallocate((void *)local_158._shift1,GHIDRA_INT(local_118.y) - local_158._shift1 >> 2);
|
|
}
|
|
}
|
|
if ((this->_isFlying != 0) &&
|
|
((tearFlagsTmp = BitSet128::operator_and
|
|
(&local_1c0,&this->_tearFlags,&g_tearFlagHydrobounce),
|
|
GHIDRA_INT(tearFlagsTmp->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) != 0 ||
|
|
(GHIDRA_INT(tearFlagsTmp->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) != 0)))) {
|
|
fVar20 = this->_height;
|
|
EVar12 = (EntityPtr)&this->_fallingSpeed;
|
|
if ((fVar20 < 0.0) || (*GHIDRA_CAST<float *>(EVar12) <= 0.0 && *GHIDRA_CAST<float *>(EVar12) != 0.0)) {
|
|
fVar21 = *GHIDRA_CAST<float *>(EVar12);
|
|
local_120.y = (float)EVar12;
|
|
fVar20 = fVar20 + fVar21;
|
|
this->_height = fVar20;
|
|
if (this->_knifeVelocity <= 0.0) {
|
|
local_f4[0] = (EntityPtr)(fVar20 * -0.1);
|
|
ownerPlayer = local_f4;
|
|
if (fVar20 * -0.1 < fVar21) {
|
|
ownerPlayer = GHIDRA_CAST<EntityPtr *>(&this->_fallingSpeed);
|
|
}
|
|
EVar17 = *ownerPlayer;
|
|
}
|
|
else {
|
|
EVar17 = (EntityPtr)(fVar21 + 1.5);
|
|
}
|
|
this->_fallingSpeed = (float)EVar17;
|
|
if (0.0 <= fVar20) {
|
|
this->_height = 0.0;
|
|
if ((this->_knifeVelocity <= 0.0) || ((float)EVar17 <= 0.5)) {
|
|
fVar20 = 0.0;
|
|
}
|
|
else {
|
|
fVar20 = (float)EVar17 * -0.8;
|
|
}
|
|
*GHIDRA_CAST<float *>(EVar12) = fVar20;
|
|
uVar10 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xe,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar10);
|
|
fVar20 = g_vectorOne.y * 0.75;
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x3c);
|
|
(tmpEntity->_sprite)._scale.x = g_vectorOne.x * 0.75;
|
|
(tmpEntity->_sprite)._scale.y = fVar20;
|
|
(*pcVar2)(&(knife->_sprite)._color,0xffffffff,0xff,0,1);
|
|
tmpEntity->Update();
|
|
SoundEffects::PlayWithFartOverride(0x96,0.5,2,0,1.0);
|
|
pvVar18 = (GHIDRA_CAST<std_vector *>((GHIDRA_INT(local_140.y) + 8)))->_begin;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x1))) = (char)(GHIDRA_UINT(pvVar18) >> 8);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_00)) + 0x0))) = *GHIDRA_CAST<unkbyte9 *>(local_140.y);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x2))) = (short)(GHIDRA_UINT(pvVar18) >> 0x10);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = *(void **)(GHIDRA_CAST<char *>(local_140.y) + 0xc);
|
|
tear_flags_area_apply(&this->_pos,GHIDRA_CAST<Entity *>(knife),30.0,knife->_collisionDamage,flags_00)
|
|
;
|
|
fVar20 = knife->_height;
|
|
EVar12 = (EntityPtr)local_120.y;
|
|
this = knife;
|
|
}
|
|
}
|
|
(this->_posOffset).y = fVar20 + this->_basePosOffsetY;
|
|
if ((isSwingWeapon == '\0') && (isSword == '\0')) {
|
|
local_f4[0] = (EntityPtr)this->_knifeVelocity;
|
|
local_140.y = atan2f(-*GHIDRA_CAST<float *>(EVar12),(float)local_f4[0]);
|
|
fVar20 = sin((this->_sprite)._rotation * 0.017453292);
|
|
(this->_sprite)._rotation = local_140.y * 57.295776 * fVar20 + (this->_sprite)._rotation;
|
|
if ((float)local_f4[0] < 0.0) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
local_d9 = layer->_flipX == 0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_flipX = local_d9;
|
|
}
|
|
}
|
|
}
|
|
if (this->_isInterpolating == 0) {
|
|
if ((this->_isFlying == 0) || (this->_dead != 0)) {
|
|
fadeFrames = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc))));
|
|
if (fadeFrames != 0) {
|
|
iVar3 = *GHIDRA_CAST<int *>((fadeFrames + 0x458));
|
|
if (iVar3 < 9) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_1ac))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>((fadeFrames + 0xf0)));
|
|
fadeFrames = 8;
|
|
if (iVar3 < 8) {
|
|
fadeFrames = iVar3;
|
|
}
|
|
fadeAlpha = (float)fadeFrames * (this->_color)._tint[3] * 0.125;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((extraout_EDX_01 + 0x48)))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_1ac));
|
|
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc)))) + 0x4bc)) =
|
|
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4fc)))) + 0x4bc)) + 4.0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>((fadeFrames + 0x458)) = 8;
|
|
}
|
|
}
|
|
}
|
|
else if ((player != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(bVar8 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x44,0), bVar8 != 0)) {
|
|
laser = *GHIDRA_CAST<Entity_NPC **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500))));
|
|
local_d9 = 0;
|
|
if (laser == GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = (player->_pos).x;
|
|
local_f4[0] = (EntityPtr)(player->_pos).y;
|
|
local_140.x = (player->_posOffset).x + 0.0;
|
|
local_140.y = (player->_posOffset).y - 8.0;
|
|
techLaser = Entity_Laser::ShootAngle
|
|
(2,GHIDRA_CAST<Vector *>((local_100 + 8)),0.0,-1,&local_140,GHIDRA_CAST<Entity *>(player),0)
|
|
;
|
|
b = &g_tearFlagOrbit;
|
|
flagsByte0 = 0xe0;
|
|
flagsByte1 = 0x48;
|
|
flagsHalf1 = 0xc3;
|
|
pBVar11 = &g_tearFlagSpiral;
|
|
tearFlagsTmp = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>(wiggleSquareMask),&g_tearFlagWiggle,
|
|
&g_tearFlagSquare);
|
|
tearFlagsTmp = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(spiralMask),tearFlagsTmp,pBVar11);
|
|
tearFlagsTmp = BitSet128::operator_or
|
|
(GHIDRA_CAST<BitSet128 *>(local_170),tearFlagsTmp,
|
|
(BitSet128 *)
|
|
CONCAT22(flagsHalf1,CONCAT11(flagsByte1,flagsByte0)));
|
|
tearFlagsTmp = BitSet128::operator_or(&excludedMask,tearFlagsTmp,b);
|
|
tearFlagsTmp = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::__bnot(&flagsScratch);
|
|
tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,tearFlagsTmp);
|
|
colorOffsetXY = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4));
|
|
qVar7 = tearFlagsTmp->_h;
|
|
uVar5 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4));
|
|
*GHIDRA_CAST<int *>(&(techLaser->_tearFlags)._l) = GHIDRA_INT(tearFlagsTmp->_l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(techLaser->_tearFlags)._l) + 4)) = colorOffsetXY;
|
|
*GHIDRA_CAST<int *>(&(techLaser->_tearFlags)._h) = GHIDRA_INT(qVar7);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(techLaser->_tearFlags)._h) + 4)) = uVar5;
|
|
color = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::get_laser_color_copy(GHIDRA_CAST<ColorMod *>(local_6c));
|
|
(*extraout_EDX_00)(color,0xffffffff,0xff,0,1);
|
|
techLaser->SetCollisionDamage(this->_charge * this->_collisionDamage);
|
|
techLaser->_mass = 0.0;
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(techLaser));
|
|
laser = *GHIDRA_CAST<Entity_NPC **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500))));
|
|
local_d9 = 1;
|
|
if (laser != GHIDRA_CAST<Entity_NPC *>(0x0)) goto LAB_0096499b;
|
|
}
|
|
else {
|
|
LAB_0096499b:
|
|
local_140.y = (this->_pos).x - (laser->_pos).x;
|
|
local_120.y = (this->_pos).y - (laser->_pos).y;
|
|
fVar20 = atan2f(local_120.y,local_140.y);
|
|
(GHIDRA_CAST<Entity_NPC *>((laser)))->Entity_NPC::SetAimAngle(fVar20 * 57.295776);
|
|
fadeFrames = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500))));
|
|
fVar20 = sqrtf(local_140.y * local_140.y + local_120.y * local_120.y);
|
|
*GHIDRA_CAST<float *>((fadeFrames + 0x4d0)) = fVar20;
|
|
if (-0.5 <= local_120.y) {
|
|
*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) + 0x358)) = 0x453b8000;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) + 0x358)) = 0xc1200000;
|
|
}
|
|
}
|
|
if (local_d9 != 0) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) + 0xc))();
|
|
}
|
|
}
|
|
if (((this->_isFlying == 0) || (this->_dead != 0)) &&
|
|
(*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500)))) != GHIDRA_CAST<int *>(0x0))) {
|
|
fadeFrames = **GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x500))));
|
|
goto LAB_009652a6;
|
|
}
|
|
}
|
|
}
|
|
else if (fadeFrames == 1) {
|
|
local_108.y = -100.0;
|
|
EVar12 = (EntityPtr)this->_pathSegment;
|
|
local_118.y = 0.0;
|
|
local_120.y = 1e+07;
|
|
if (GHIDRA_UINT(EVar12) <
|
|
GHIDRA_UINT(((GHIDRA_INT((this->_homingLaser)._bezier._end) - GHIDRA_INT((this->_homingLaser)._bezier._begin))
|
|
/ 0x18 + -1))) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) = GHIDRA_INT(EVar12) * 0x18;
|
|
do {
|
|
pvVar18 = (void *)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + GHIDRA_INT((this->_homingLaser)._bezier._begin));
|
|
EVar17 = (EntityPtr)
|
|
bezier_closest_point
|
|
(&this->_pos,pvVar18,(void *)(GHIDRA_INT(pvVar18) + 0x18),&local_140.y);
|
|
if ((float)EVar17 < local_120.y) {
|
|
if (EVar12 == (EntityPtr)this->_pathSegment) {
|
|
if (!(this->_pathProgress <= local_140.y && local_140.y != this->_pathProgress))
|
|
goto LAB_00964bdf;
|
|
}
|
|
local_108.y = local_140.y;
|
|
local_120.y = (float)EVar17;
|
|
local_118.y = (float)EVar12;
|
|
}
|
|
LAB_00964bdf:
|
|
EVar12 = (EntityPtr)(GHIDRA_INT(EVar12) + 1);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) + 0x18;
|
|
} while (GHIDRA_UINT(EVar12) <
|
|
GHIDRA_UINT(((GHIDRA_INT((this->_homingLaser)._bezier._end) -
|
|
GHIDRA_INT((this->_homingLaser)._bezier._begin)) / 0x18 + -1)));
|
|
}
|
|
EVar12 = (EntityPtr)&this->_tearFlags;
|
|
local_140.y = (float)EVar12;
|
|
tearFlagsTmp = BitSet128::operator_and(&local_38,GHIDRA_CAST<BitSet128 *>(EVar12),&g_tearFlagHydrobounce);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(tearFlagsTmp->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) != 0)) {
|
|
if (g_game->_frameCount - this->_spawnFrame == 1) {
|
|
uVar10 = Random();
|
|
this->_fallingSpeed =
|
|
-5.0 - (float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.0;
|
|
}
|
|
fVar20 = this->_height;
|
|
if ((fVar20 < 0.0) || (this->_fallingSpeed <= 0.0 && this->_fallingSpeed != 0.0)) {
|
|
fVar21 = this->_fallingSpeed + 1.5;
|
|
fVar20 = fVar20 + this->_fallingSpeed;
|
|
this->_fallingSpeed = fVar21;
|
|
this->_height = fVar20;
|
|
if (0.0 <= fVar20) {
|
|
this->_height = 0.0;
|
|
if (fVar21 <= 0.5) {
|
|
fVar21 = 0.0;
|
|
}
|
|
else {
|
|
fVar21 = fVar21 * -0.8;
|
|
}
|
|
this->_fallingSpeed = fVar21;
|
|
uVar10 = Random();
|
|
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xe,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar10);
|
|
fVar20 = g_vectorOne.y * 0.75;
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(tmpEntity) + 0x3c);
|
|
(tmpEntity->_sprite)._scale.x = g_vectorOne.x * 0.75;
|
|
(tmpEntity->_sprite)._scale.y = fVar20;
|
|
(*pcVar2)(&(knife->_sprite)._color,0xffffffff,0xff,0,1);
|
|
tmpEntity->Update();
|
|
SoundEffects::PlayWithFartOverride(0x96,0.5,2,0,1.0);
|
|
EVar12 = (EntityPtr)local_140.y;
|
|
pvVar18 = (GHIDRA_CAST<std_vector *>((GHIDRA_INT(local_140.y) + 8)))->_begin;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x1))) = (char)(GHIDRA_UINT(pvVar18) >> 8);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01)) + 0x0))) = *GHIDRA_CAST<unkbyte9 *>(local_140.y);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x2))) = (short)(GHIDRA_UINT(pvVar18) >> 0x10);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x4))) = *(void **)(GHIDRA_CAST<char *>(local_140.y) + 0xc);
|
|
tear_flags_area_apply(&this->_pos,GHIDRA_CAST<Entity *>(knife),30.0,knife->_collisionDamage,flags_01)
|
|
;
|
|
fVar20 = knife->_height;
|
|
this = knife;
|
|
}
|
|
}
|
|
(this->_posOffset).y = fVar20 + this->_basePosOffsetY;
|
|
}
|
|
if (local_108.y <= -99.0) {
|
|
this->Remove();
|
|
}
|
|
else {
|
|
fVar20 = 1.0 - local_108.y;
|
|
pvVar18 = (this->_homingLaser)._bezier._begin;
|
|
fVar23 = fVar20 * fVar20 * fVar20;
|
|
fVar21 = fVar20 * fVar20 * 3.0 * local_108.y;
|
|
bezierB2 = fVar20 * 3.0 * local_108.y * local_108.y;
|
|
bezierB3 = local_108.y * local_108.y * local_108.y;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) =
|
|
bezierB2 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x24)) +
|
|
fVar23 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 4)) +
|
|
fVar21 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x14)) +
|
|
bezierB3 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x1c));
|
|
fVar20 = local_108.y + this->_pathFollowSpeed;
|
|
fVar22 = 1.0 - fVar20;
|
|
nextBezierB0 = fVar22 * fVar22 * fVar22;
|
|
fVar24 = fVar22 * 3.0 * fVar20 * fVar20;
|
|
nextBezierB3 = fVar20 * fVar20 * fVar20;
|
|
fVar20 = fVar22 * fVar22 * 3.0 * fVar20;
|
|
local_e0 = nextBezierB3 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x1c)) +
|
|
nextBezierB0 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 4)) +
|
|
fVar20 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x14)) +
|
|
fVar24 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x24));
|
|
local_f4[0] = (EntityPtr)
|
|
(nextBezierB0 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18)) +
|
|
fVar20 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x10)) +
|
|
fVar24 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x20)) +
|
|
nextBezierB3 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x18)));
|
|
local_140.y = local_e0 - (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_170)) + 0xc)));
|
|
local_140.x = (float)local_f4[0] -
|
|
(bezierB2 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x20)) +
|
|
fVar21 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x10)) +
|
|
fVar23 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18)) +
|
|
bezierB3 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar18) + GHIDRA_INT(local_118.y) * 0x18 + 0x18)));
|
|
(GHIDRA_CAST<Vector *>((&local_140)))->Vector::Normalized(&local_120);
|
|
bVar8 = 0;
|
|
local_140.x = (local_120.y * this->_pathOffset + (float)local_f4[0]) - (this->_pos).x;
|
|
local_140.y = (-local_120.x * this->_pathOffset + local_e0) - (this->_pos).y;
|
|
pVVar14 = (GHIDRA_CAST<Vector *>((&local_140)))->Vector::Resized(GHIDRA_CAST<Vector *>((local_100 + 8)),8.0);
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity_divided(pVVar14,bVar8);
|
|
fVar20 = atan2f(this->_fallingSpeed + (this->_velocity).y,(this->_velocity).x + 0.0);
|
|
fVar20 = normalize_angle_degrees(fVar20 * 57.295776 - 90.0);
|
|
(this->_sprite)._rotation = fVar20;
|
|
local_d9 = 0.0 < fVar20;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_flipX = local_d9;
|
|
this->_pathSegment = GHIDRA_INT(local_118.y);
|
|
this->_pathProgress = local_108.y;
|
|
}
|
|
Room::GetClampedPositionImpl(g_game->_room,&local_140,&this->_pos,-200.0,-200.0,-200.0,-200.0)
|
|
;
|
|
fVar20 = (this->_pos).y - local_140.y;
|
|
fVar21 = (this->_pos).x - local_140.x;
|
|
if (1.0 < fVar20 * fVar20 + fVar21 * fVar21) {
|
|
tearFlagsTmp = BitSet128::operator_and(&local_38,GHIDRA_CAST<BitSet128 *>(EVar12),&g_tearFlagContinuum);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(tearFlagsTmp->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) == 0)) {
|
|
this->Remove();
|
|
}
|
|
else {
|
|
pVVar14 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::ScreenWrapPosition(&local_140,&this->_pos,-200.0);
|
|
(this->_pos).x = pVVar14->x;
|
|
(this->_pos).y = pVVar14->y;
|
|
tearFlagsTmp = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagContinuum)))->BitSet128::__bnot(&local_38);
|
|
tearFlagsTmp = BitSet128::operator_and(&flagsScratch,GHIDRA_CAST<BitSet128 *>(EVar12),tearFlagsTmp);
|
|
colorOffsetXY = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4));
|
|
pvVar18 = *(void **)&tearFlagsTmp->_h;
|
|
pvVar4 = *(void **)(GHIDRA_INT(&tearFlagsTmp->_h) + 4);
|
|
*GHIDRA_CAST<int *>(EVar12) = GHIDRA_INT(tearFlagsTmp->_l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar12) + 4)) = colorOffsetXY;
|
|
(GHIDRA_CAST<std_vector *>((GHIDRA_INT(EVar12) + 8)))->_begin = pvVar18;
|
|
*(void **)(GHIDRA_CAST<char *>(EVar12) + 0xc) = pvVar4;
|
|
tearFlagsTmp = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagOrbit)))->BitSet128::__bnot(&local_38);
|
|
tearFlagsTmp = BitSet128::operator_and(&flagsScratch,GHIDRA_CAST<BitSet128 *>(EVar12),tearFlagsTmp);
|
|
colorOffsetXY = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4));
|
|
pvVar18 = *(void **)&tearFlagsTmp->_h;
|
|
pvVar4 = *(void **)(GHIDRA_INT(&tearFlagsTmp->_h) + 4);
|
|
EVar17 = this->_parent;
|
|
*GHIDRA_CAST<int *>(EVar12) = GHIDRA_INT(tearFlagsTmp->_l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar12) + 4)) = colorOffsetXY;
|
|
(GHIDRA_CAST<std_vector *>((GHIDRA_INT(EVar12) + 8)))->_begin = pvVar18;
|
|
*(void **)(GHIDRA_CAST<char *>(EVar12) + 0xc) = pvVar4;
|
|
tmpEntity = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar17) + 0x3bc));
|
|
uVar10 = Random();
|
|
local_140.y = (float)((double)GHIDRA_INT(uVar10) + __uint_to_double_fixup[-(GHIDRA_INT(uVar10) >> 0x1f)]
|
|
) * 2.3283064e-10 * 50.0 - 25.0;
|
|
pVVar14 = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::Normalized(&local_120);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = pVVar14->x;
|
|
local_f4[0] = (EntityPtr)pVVar14->y;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(direction_00.y)) + 0x1))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_f4[0])) + 0x1)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(direction_00)) + 0x0))) = *GHIDRA_CAST<undefined5 *>(pVVar14);
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(direction_00.y)) + 0x2))) = (*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_f4[0])) + 0x2)));
|
|
InitHomingPath(this,direction_00,tmpEntity,local_140.y);
|
|
}
|
|
}
|
|
if (300 < g_game->_frameCount - this->_spawnFrame) goto LAB_009652a2;
|
|
}
|
|
else if (fadeFrames == 3) {
|
|
local_140.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x33c));
|
|
local_f4[0] = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
local_108.x = local_140.y - (this->_pos).x;
|
|
local_120.y = (float)local_f4[0] - (this->_pos).y;
|
|
local_108.y = local_120.y;
|
|
local_e8.y = local_108.x;
|
|
if (900.0 < local_108.x * local_108.x + local_120.y * local_120.y) {
|
|
pVVar14 = (GHIDRA_CAST<Vector *>((&local_108)))->Vector::Resized(GHIDRA_CAST<Vector *>((local_170 + 8)),30.0);
|
|
fVar20 = pVVar14->y;
|
|
(this->_pos).x = local_140.y - pVVar14->x;
|
|
(this->_pos).y = (float)local_f4[0] - fVar20;
|
|
}
|
|
fVar20 = atan2f(local_120.y,local_e8.y);
|
|
fVar20 = normalize_angle_degrees(fVar20 * 57.295776 + 90.0);
|
|
(this->_sprite)._rotation = fVar20;
|
|
local_d9 = 0.0 < fVar20;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_flipX = local_d9;
|
|
this->_friction = this->_friction * 0.7;
|
|
}
|
|
else if (fadeFrames == 4) {
|
|
if (this->_isSwinging != 0) {
|
|
UpdateSwingHits(this,uVar10);
|
|
EVar12 = this->_parent;
|
|
if (EVar12 == (EntityPtr)0x0) goto LAB_009652a2;
|
|
}
|
|
fVar20 = 0.017453292;
|
|
local_f4[0] = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x33c));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,&g_tearFlagWait);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsZero();
|
|
if (((bVar8 == 0) && (4 < g_game->_frameCount - this->_spawnFrame)) ||
|
|
(bVar8 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_ne(&g_vectorZero), bVar8 == 0)) {
|
|
tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,&g_tearFlagWait);
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if (bVar8 != 0) {
|
|
fadeFrames = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame();
|
|
if (fadeFrames < 5) {
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
}
|
|
else {
|
|
local_140.y = this->_displayRotation * 0.017453292;
|
|
local_f4[0] = (EntityPtr)sin(local_140.y);
|
|
fVar20 = cos(local_140.y);
|
|
(this->_velocity).x = fVar20 * 16.0;
|
|
(this->_velocity).y = (float)local_f4[0] * 16.0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
fadeFrames = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f4))));
|
|
local_108.y = this->_rotation * fVar20;
|
|
EVar12 = (EntityPtr)sin(local_108.y);
|
|
if (fadeFrames == 0) {
|
|
local_140.y = (float)EVar12;
|
|
fVar21 = cos(local_108.y);
|
|
fVar20 = (this->_targetPosition).x;
|
|
fVar21 = (((float)local_f4[0] + fVar21 * fVar20) - (this->_pos).x) / this->_friction;
|
|
fVar20 = (((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_170)) + 0xc))) + fVar20 * local_140.y) - (this->_pos).y) /
|
|
this->_friction;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_170)) + 0xc))) = EVar12;
|
|
fVar21 = cos(local_108.y);
|
|
fVar20 = (this->_targetPosition).x;
|
|
fVar21 = (fVar21 * fVar20 + *GHIDRA_CAST<float *>((fadeFrames + 0x33c))) - (this->_pos).x;
|
|
fVar20 = ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_170)) + 0xc))) * fVar20 + *GHIDRA_CAST<float *>((fadeFrames + 0x340))) -
|
|
(this->_pos).y;
|
|
}
|
|
(this->_velocity).x = fVar21;
|
|
(this->_velocity).y = fVar20;
|
|
this->_displayRotation = this->_rotation;
|
|
(this->_sprite)._rotation = this->_rotation - 90.0;
|
|
pfVar13 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayerFrame(0);
|
|
if (pfVar13 != GHIDRA_CAST<float *>(0x0)) {
|
|
local_140.y = (this->_sprite)._rotation * 0.017453292;
|
|
local_f4[0] = (EntityPtr)cos(local_140.y);
|
|
fVar20 = sin(local_140.y);
|
|
this->_knifeDepthOffset = (float)local_f4[0] * pfVar13[1] + fVar20 * *pfVar13;
|
|
}
|
|
}
|
|
if ((this->_isSwinging == 0) &&
|
|
(this->Remove(), *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f4)))) != 0)) {
|
|
std::vector<int>::assign(&this->_hitList);
|
|
}
|
|
}
|
|
}
|
|
local_d9 = this->_isInterpolating;
|
|
if ((local_d9 == 0) && (this->_multidimensionalApplied != 0)) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c94188) &&
|
|
(_Init_thread_header(&DAT_00c94188), DAT_00c94188 == -1)) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&DAT_00c94190))))->Color::Color(-1.0,-1.0,-1.0,1.0,1.0,1.0);
|
|
fVar21 = -0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&DAT_00c941bc))))->Color::Color(-0.33,-0.33,-0.33,0.66,0.66,0.66);
|
|
fVar20 = 0.33;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&DAT_00c941e8))))->Color::Color(0.33,0.33,0.33,0.33,0.33,0.33);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&DAT_00c94214))))->Color::Color(1.0,1.0,1.0,0.0,0.0,0.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&DAT_00c94240))))->Color::Color(fVar20,fVar20,fVar20,0.33,0.33,0.33);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&DAT_00c9426c))))->Color::Color(fVar21,fVar21,fVar21,0.66,0.66,0.66);
|
|
_Init_thread_footer(&DAT_00c94188);
|
|
}
|
|
colorOffsetXY = *GHIDRA_CAST<undefined8 *>((knife->_color)._offset);
|
|
color = (ColorMod *)
|
|
FUN_004072e0((knife->_color)._tint[0],(knife->_color)._tint[1],(knife->_color)._tint[2],
|
|
(knife->_color)._tint[3],(knife->_color)._colorize[0],
|
|
(knife->_color)._colorize[1],(knife->_color)._colorize[2],
|
|
(knife->_color)._colorize[3],GHIDRA_INT(colorOffsetXY),
|
|
(char)((ulonglong)colorOffsetXY >> 0x20),(knife->_color)._offset[2]);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetColor(color);
|
|
local_d9 = knife->_isInterpolating;
|
|
this = knife;
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,&g_tearFlagAttractor);
|
|
if (((GHIDRA_INT(tearFlagsTmp->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(tearFlagsTmp->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) != 0)) && (local_d9 == 0))
|
|
{
|
|
if (this->_subtype == 4) {
|
|
fVar20 = 20.0;
|
|
}
|
|
else if (this->_isFlying == 0) {
|
|
fVar20 = 1.0;
|
|
}
|
|
else {
|
|
fVar20 = (this->_knifeDistance - 0.0) / 100.0;
|
|
if (fVar20 <= 0.0) {
|
|
fVar20 = 0.0;
|
|
}
|
|
if (1.0 <= fVar20) {
|
|
fVar20 = 1.0;
|
|
}
|
|
fVar20 = fVar20 * 29.0 + 1.0;
|
|
}
|
|
Game::AttractEntities(g_game,&this->_pos,(void *)0x0,(void *)0x0,fVar20,250.0);
|
|
}
|
|
if ((isSwingWeapon == '\0') && (isSword == '\0')) {
|
|
LAB_009658dd:
|
|
bVar8 = 3;
|
|
LAB_009658e1:
|
|
bVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(GHIDRA_UINT(bVar8),0);
|
|
if (bVar8 != 0) {
|
|
(GHIDRA_CAST<std::vector *>((&this->_hitList)))->std::vector::clear(0);
|
|
}
|
|
}
|
|
else {
|
|
if (this->_isFlying != 0) {
|
|
this->_size = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_config) + 0x38)) * (this->_sprite)._scale.x;
|
|
}
|
|
if (isSwingWeapon == '\0') {
|
|
if (isSword == '\0') goto LAB_009658dd;
|
|
}
|
|
else if (this->_variant == 2) {
|
|
tearFlagsTmp = BitSet128::operator_and(&flagsScratch,&this->_tearFlags,&g_tearFlagWait);
|
|
if ((GHIDRA_INT(tearFlagsTmp->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(tearFlagsTmp->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlagsTmp->_h) + 4)) == 0)) {
|
|
bVar19 = false;
|
|
}
|
|
else {
|
|
bVar19 = true;
|
|
}
|
|
bVar8 = 5;
|
|
if (bVar19) {
|
|
bVar8 = 10;
|
|
}
|
|
goto LAB_009658e1;
|
|
}
|
|
}
|
|
FUN_00861970(this);
|
|
if (this->_isInterpolating != 0) {
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
if ((((isSwingWeapon == '\0') && (isSword == '\0')) || (this->_isFlying != 0)) &&
|
|
(this->_visible != 0)) {
|
|
room = g_game->_room;
|
|
local_140.y = (float)(GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&this->_pos);
|
|
if (-1 < GHIDRA_INT(local_140.y)) {
|
|
if (GHIDRA_INT(local_140.y) < 0x1c0) {
|
|
EVar12 = *GHIDRA_CAST<EntityPtr *>((room->_gridEntities + GHIDRA_INT(local_140.y)));
|
|
local_120.y = (float)EVar12;
|
|
if (((EVar12 != (EntityPtr)0x0) && (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x3c)) != 1.4013e-45)) &&
|
|
((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x3c)) != 0.0 && (uVar10 = Random(), (uVar10 & 3) == 0)))) {
|
|
local_158._seed = GHIDRA_INT((this->_tearFlags)._l);
|
|
local_158._shift1 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
local_158._shift2 = *GHIDRA_CAST<int *>(&(this->_tearFlags)._h);
|
|
local_158._shift3 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pTVar16 = Entity_Player::GetTearHitParams
|
|
(player,&tearHitParams,4,1.0,0,GHIDRA_CAST<Entity *>(this->_spawnerEntity));
|
|
local_158._seed = local_158._seed | GHIDRA_UINT((pTVar16->_flags)._l);
|
|
local_158._shift1 = local_158._shift1 | *GHIDRA_CAST<uint *>((GHIDRA_INT(&(pTVar16->_flags)._l) + 4));
|
|
local_158._shift2 = local_158._shift2 | GHIDRA_UINT((pTVar16->_flags)._h);
|
|
local_158._shift3 = local_158._shift3 | *GHIDRA_CAST<uint *>((GHIDRA_INT(&(pTVar16->_flags)._h) + 4));
|
|
}
|
|
tearFlagsTmp = BitSet128::operator_or(&local_38,&g_tearFlagAcid,&g_tearFlagRock);
|
|
tearFlagsTmp = BitSet128::operator_and(&flagsScratch,GHIDRA_CAST<BitSet128 *>(&local_158),tearFlagsTmp)
|
|
;
|
|
bVar8 = (GHIDRA_CAST<BitSet128 *>((tearFlagsTmp)))->BitSet128::IsNonZero();
|
|
if ((bVar8 != 0) && (cVar9 = (**(code **)(GHIDRA_INT(*GHIDRA_CAST<float *>(EVar12)) + 0x1c))(), cVar9 != '\0')
|
|
) {
|
|
pcVar2 = *(code **)(GHIDRA_INT(*GHIDRA_CAST<float *>(EVar12)) + 0x14);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_6c + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
cVar9 = (*pcVar2)(0,local_6c + 4);
|
|
if (cVar9 != '\0') {
|
|
local_140.y = ((this->_sprite)._rotation + 90.0) * 0.017453292;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = cos(local_140.y);
|
|
local_f4[0] = (EntityPtr)sin(local_140.y);
|
|
Vector::ToCardinal(&local_140,GHIDRA_CAST<Vector *>((local_100 + 8)));
|
|
bVar8 = (GHIDRA_CAST<Vector *>((cardinalDir)))->Vector::operator_ne(&g_vectorZero);
|
|
fVar20 = local_120.y;
|
|
if (bVar8 != 0) {
|
|
pVVar14 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_120.y))))->GridEntity::Position(&local_e8);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_100)) + 0x8))) = local_140.x * 40.0 + pVVar14->x;
|
|
local_f4[0] = (EntityPtr)(local_140.y * 40.0 + pVVar14->y);
|
|
local_120.y = (float)g_game->_room;
|
|
fadeFrames = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_120.y))))->Room::GetGridIndex(GHIDRA_CAST<Vector *>((local_100 + 8)));
|
|
if (-1 < fadeFrames) {
|
|
if (fadeFrames < 0x1c0) {
|
|
(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_120.y))))->Room::TryMakeBridge(*GHIDRA_CAST<GridEntity **>((GHIDRA_CAST<char *>(local_120.y) + 0x24 + fadeFrames * 4)),
|
|
GHIDRA_CAST<GridEntity *>(fVar20));
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_120.y))))->Room::TryMakeBridge(GHIDRA_CAST<GridEntity *>(0x0),GHIDRA_CAST<GridEntity *>(fVar20));
|
|
}
|
|
}
|
|
}
|
|
goto LAB_00965b8b;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
room = g_game->_room;
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_1ac + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<Room *>((room)))->Room::DamageGridWithSource(GHIDRA_INT(local_140.y),1,GHIDRA_CAST<EntityRef *>((local_1ac + 4)));
|
|
}
|
|
}
|
|
LAB_00965b8b:
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 00965d30
|
|
void Entity_Knife::Render(Vector *offset)
|
|
{
|
|
Entity_Player *player;
|
|
int iVar1;
|
|
Entity *rootParent;
|
|
Vector *position;
|
|
AnimationState *secondAnimState;
|
|
int deadEyeLevel;
|
|
float extraout_EDX;
|
|
float savedColorOffsetZ;
|
|
float savedColorizeR;
|
|
float savedColorizeG;
|
|
float savedColorizeB;
|
|
float savedColorizeA;
|
|
float savedTintR;
|
|
float savedTintG;
|
|
float savedTintB;
|
|
float savedTintA;
|
|
Vector savedColorOffset;
|
|
float fVar2;
|
|
float savedRotation;
|
|
double dVar3;
|
|
float local_e8;
|
|
float local_e4;
|
|
float *local_e0;
|
|
float local_dc;
|
|
float local_d8;
|
|
float local_d4;
|
|
EntityPtr local_d0;
|
|
float rotationOffset;
|
|
float trailDistanceBase;
|
|
int trailIndex;
|
|
Vector trailRenderPos;
|
|
Vector local_b8;
|
|
float local_b0;
|
|
float fStack_ac;
|
|
float fStack_a8;
|
|
float fStack_a4;
|
|
float local_a0;
|
|
float fStack_9c;
|
|
float fStack_98;
|
|
float fStack_94;
|
|
ColorMod trailColor;
|
|
ColorMod savedColor;
|
|
ColorMod deadEyeColor;
|
|
uint local_c;
|
|
Sprite *deadEyeSprite;
|
|
ColorMod *spriteColor;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_e8);
|
|
if (this->_visible != 0) {
|
|
player = GetPlayer(this);
|
|
if ((player == GHIDRA_CAST<Entity_Player *>(0x0)) || (*GHIDRA_CAST<int *>(&g_game->_stageTransition) == 0)) {
|
|
fVar2 = 0.5;
|
|
if ((((GHIDRA_UINT(g_tearFlagOrbit._l) & GHIDRA_UINT((this->_tearFlags)._l)) != 0 ||
|
|
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._l)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4))) != 0) ||
|
|
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagOrbit._h)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._h)) + 0x4)))) != 0)) &&
|
|
((this->_isFlying != 0 && (this->_subtype == 0)))) {
|
|
savedTintR = (this->_sprite)._color._tint[0];
|
|
savedTintG = (this->_sprite)._color._tint[1];
|
|
savedTintB = (this->_sprite)._color._tint[2];
|
|
savedTintA = (this->_sprite)._color._tint[3];
|
|
local_e0 = GHIDRA_CAST<float *>((this->_sprite)._color._offset[2]);
|
|
spriteColor = &(this->_sprite)._color;
|
|
savedColorizeR = (this->_sprite)._color._colorize[0];
|
|
savedColorizeG = (this->_sprite)._color._colorize[1];
|
|
savedColorizeB = (this->_sprite)._color._colorize[2];
|
|
savedColorizeA = (this->_sprite)._color._colorize[3];
|
|
savedColorOffset.x = (this->_sprite)._color._offset[0];
|
|
savedColorOffset.y = (this->_sprite)._color._offset[1];
|
|
savedRotation = (this->_sprite)._rotation;
|
|
local_e4 = savedRotation;
|
|
local_b8 = savedColorOffset;
|
|
local_b0 = savedTintR;
|
|
fStack_ac = savedTintG;
|
|
fStack_a8 = savedTintB;
|
|
fStack_a4 = savedTintA;
|
|
local_a0 = savedColorizeR;
|
|
fStack_9c = savedColorizeG;
|
|
fStack_98 = savedColorizeB;
|
|
fStack_94 = savedColorizeA;
|
|
savedColor._tint[0] = savedTintR;
|
|
savedColor._tint[1] = savedTintG;
|
|
savedColor._tint[2] = savedTintB;
|
|
savedColor._tint[3] = savedTintA;
|
|
iVar1 = GetBaseVariant(this);
|
|
if (iVar1 == 1) {
|
|
trailDistanceBase = 4.0;
|
|
}
|
|
else {
|
|
trailDistanceBase = 30.0;
|
|
}
|
|
rootParent = GetRootParent(this);
|
|
local_d0 = rootParent->_parent;
|
|
savedColorOffsetZ = extraout_EDX;
|
|
if (local_d0 != (EntityPtr)0x0) {
|
|
trailIndex = 1;
|
|
do {
|
|
trailColor._tint[3] = (0.6 - (float)trailIndex * 0.3) * savedColor._tint[3];
|
|
fVar2 = this->_rotationOffset;
|
|
local_d4 = ABS(fVar2);
|
|
local_d8 = this->_knifeDistance - (float)(trailIndex + 1) * this->_knifeVelocity * 0.2;
|
|
rotationOffset = fVar2;
|
|
trailColor._tint[0] = savedTintR;
|
|
trailColor._tint[1] = savedTintG;
|
|
trailColor._tint[2] = savedTintB;
|
|
if (360.0 < local_d4) {
|
|
fVar2 = fmodf(fVar2,360.0);
|
|
}
|
|
if (fVar2 <= 180.0) {
|
|
if (fVar2 < -180.0) {
|
|
fVar2 = fVar2 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar2 = fVar2 - 360.0;
|
|
}
|
|
local_dc = ((local_d8 * 3.1415927 + local_d8 * 3.1415927) * (fVar2 * 0.002 + 1.0) +
|
|
this->_displayRotation) * 0.017453292;
|
|
local_e8 = cos(local_dc);
|
|
local_dc = sin(local_dc);
|
|
fVar2 = rotationOffset;
|
|
if (360.0 < local_d4) {
|
|
fVar2 = fmodf(rotationOffset,360.0);
|
|
}
|
|
if (fVar2 <= 180.0) {
|
|
if (fVar2 < -180.0) {
|
|
fVar2 = fVar2 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar2 = fVar2 - 360.0;
|
|
}
|
|
fVar2 = (1.0 - fVar2 * 0.02) * local_d8 * 0.25 + trailDistanceBase;
|
|
local_d4 = fVar2 * local_dc + (this->_anchorPosition).y;
|
|
local_e8 = fVar2 * local_e8 + (this->_anchorPosition).x;
|
|
fVar2 = atan2f(local_d4 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d0) + 0x340)),
|
|
local_e8 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d0) + 0x33c)));
|
|
if (spriteColor != &trailColor) {
|
|
spriteColor->_tint[0] = trailColor._tint[0];
|
|
(this->_sprite)._color._tint[1] = trailColor._tint[1];
|
|
(this->_sprite)._color._tint[2] = trailColor._tint[2];
|
|
(this->_sprite)._color._tint[3] = trailColor._tint[3];
|
|
(this->_sprite)._color._colorize[0] = local_a0;
|
|
(this->_sprite)._color._colorize[1] = fStack_9c;
|
|
(this->_sprite)._color._colorize[2] = fStack_98;
|
|
(this->_sprite)._color._colorize[3] = fStack_94;
|
|
(this->_sprite)._color._offset[0] = local_b8.x;
|
|
(this->_sprite)._color._offset[1] = local_b8.y;
|
|
(this->_sprite)._color._offset[2] = (float)local_e0;
|
|
}
|
|
local_d8 = g_displayPixelRatio;
|
|
(this->_sprite)._rotation = fVar2 * 57.295776;
|
|
local_d8 = local_d8 * g_screenPointScale;
|
|
local_e8 = (((local_e8 + (this->_posOffset).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * local_d8 + 0.5;
|
|
dVar3 = floor((double)local_e8);
|
|
local_dc = (float)dVar3 / local_d8;
|
|
local_e8 = (((local_d4 + (this->_posOffset).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * local_d8 + 0.5;
|
|
dVar3 = floor((double)local_e8);
|
|
local_e8 = (float)dVar3;
|
|
trailRenderPos.x = local_dc + offset->x;
|
|
trailRenderPos.y = local_e8 / local_d8 + offset->y;
|
|
if ((this->_sprite)._loaded != 0) {
|
|
if ((this->_sprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(this->_sprite)._animState,&trailRenderPos,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = &(this->_sprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(this->_sprite)._overlayAnimState,&trailRenderPos,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = &(this->_sprite)._animState;
|
|
}
|
|
AnimationState::Render(secondAnimState,&trailRenderPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
trailIndex = trailIndex + -1;
|
|
savedTintR = local_b0;
|
|
savedTintG = fStack_ac;
|
|
savedTintB = fStack_a8;
|
|
} while (-1 < trailIndex);
|
|
fVar2 = 0.5;
|
|
savedColorOffsetZ = (float)local_e0;
|
|
savedRotation = local_e4;
|
|
savedColorOffset = local_b8;
|
|
savedTintA = fStack_a4;
|
|
savedColorizeR = local_a0;
|
|
savedColorizeG = fStack_9c;
|
|
savedColorizeB = fStack_98;
|
|
savedColorizeA = fStack_94;
|
|
}
|
|
if (spriteColor != &savedColor) {
|
|
(this->_sprite)._color._offset[0] = savedColorOffset.x;
|
|
(this->_sprite)._color._offset[1] = savedColorOffset.y;
|
|
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._offset[2] = savedColorOffsetZ;
|
|
(this->_sprite)._color._colorize[0] = savedColorizeR;
|
|
(this->_sprite)._color._colorize[1] = savedColorizeG;
|
|
(this->_sprite)._color._colorize[2] = savedColorizeB;
|
|
(this->_sprite)._color._colorize[3] = savedColorizeA;
|
|
}
|
|
(this->_sprite)._rotation = savedRotation;
|
|
}
|
|
local_e0 = GHIDRA_CAST<float *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_e4 = ((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * fVar2) * (float)local_e0 + fVar2;
|
|
dVar3 = floor((double)local_e4);
|
|
local_d0 = (EntityPtr)((float)dVar3 / (float)local_e0);
|
|
local_e4 = ((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * (float)local_e0 + 0.5;
|
|
dVar3 = floor((double)local_e4);
|
|
local_e4 = (float)dVar3;
|
|
fVar2 = offset->y;
|
|
(this->_renderPosition).x = (float)local_d0 + offset->x;
|
|
(this->_renderPosition).y = local_e4 / (float)local_e0 + fVar2;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero);
|
|
iVar1 = GetBaseVariant(this);
|
|
if ((iVar1 == 1) && (this->_subtype != 4)) {
|
|
player = GetPlayer(this);
|
|
if ((player != GHIDRA_CAST<Entity_Player *>(0x0)) && (iVar1 = player->_deadEyeCharges, 0 < iVar1)) {
|
|
local_e0 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayerFrame(0);
|
|
deadEyeSprite = DAT_00c72214;
|
|
deadEyeColor._tint[0] = 1.0;
|
|
deadEyeColor._tint[1] = 1.0;
|
|
deadEyeLevel = 8;
|
|
if (iVar1 < 8) {
|
|
deadEyeLevel = iVar1;
|
|
}
|
|
deadEyeColor._tint[2] = 1.0;
|
|
deadEyeColor._colorize[0] = 0.0;
|
|
deadEyeColor._colorize[1] = 0.0;
|
|
deadEyeColor._colorize[2] = 0.0;
|
|
deadEyeColor._colorize[3] = 0.0;
|
|
deadEyeColor._offset[0] = 0.0;
|
|
deadEyeColor._offset[1] = 0.0;
|
|
deadEyeColor._offset[2] = 0.0;
|
|
deadEyeColor._tint[3] = (float)deadEyeLevel * 0.125;
|
|
(GHIDRA_CAST<Sprite *>((DAT_00c72214)))->Sprite::SetColor(&deadEyeColor);
|
|
if ((this->_isFlying == 0) && (local_e0 != GHIDRA_CAST<float *>(0x0))) {
|
|
local_e4 = (this->_sprite)._rotation * 0.017453292;
|
|
local_d0 = (EntityPtr)cos(local_e4);
|
|
local_d4 = sin(local_e4);
|
|
local_dc = (this->_sprite)._scale.x;
|
|
local_e8 = local_e0[1];
|
|
local_e4 = *local_e0;
|
|
local_e0 = GHIDRA_CAST<float *>((this->_sprite)._scale.y);
|
|
fVar2 = atan2f(local_e8,local_e4);
|
|
position = &local_b8;
|
|
deadEyeSprite->_rotation = fVar2 * 57.295776 + (this->_sprite)._rotation;
|
|
fVar2 = (this->_sprite)._scale.y;
|
|
(deadEyeSprite->_scale).x = (this->_sprite)._scale.x * 0.9;
|
|
(deadEyeSprite->_scale).y = fVar2 * 0.5;
|
|
local_b8.y = (local_e8 * (float)local_d0 + local_e4 * local_d4) * (float)local_e0 * 0.5
|
|
+ (this->_renderPosition).y;
|
|
local_b8.x = (local_e4 * (float)local_d0 - local_e8 * local_d4) * local_dc * 0.5 +
|
|
(this->_renderPosition).x;
|
|
}
|
|
else {
|
|
deadEyeSprite->_rotation = 0.0;
|
|
(deadEyeSprite->_scale).x = (this->_sprite)._scale.x;
|
|
(deadEyeSprite->_scale).y = (this->_sprite)._scale.y;
|
|
position = &this->_renderPosition;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(deadEyeSprite))))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
FUN_00861a50(this,offset);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009665e0
|
|
int Entity_Knife::GetRenderZ()
|
|
{
|
|
int iVar1;
|
|
|
|
floor((double)((this->_knifeDepthOffset + (this->_pos).y) * 100.0 + 10030.0 + 0.5));
|
|
iVar1 = __ftoui3();
|
|
return iVar1;
|
|
}
|
|
|
|
// 00966650
|
|
Entity_Player * Entity_Knife::GetPlayer()
|
|
{
|
|
EntityPtr owner;
|
|
int ownerType;
|
|
|
|
owner = this->_parent;
|
|
if ((owner != (EntityPtr)0x0) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(owner) + 0x28)) != 8 ||
|
|
(owner = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(owner) + 0x3bc)), owner != (EntityPtr)0x0)))) {
|
|
ownerType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(owner) + 0x28));
|
|
if (ownerType == 1) {
|
|
return GHIDRA_CAST<Entity_Player *>(owner);
|
|
}
|
|
if (ownerType == 3) {
|
|
return *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(owner) + 0x410));
|
|
}
|
|
if (ownerType == 1000) {
|
|
owner = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(owner) + 0x3bc));
|
|
if ((owner != (EntityPtr)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(owner) + 0x28)) == 1)) {
|
|
return GHIDRA_CAST<Entity_Player *>(owner);
|
|
}
|
|
}
|
|
else if (((ownerType == 2) &&
|
|
(owner = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(owner) + 0x3c8)), owner != (EntityPtr)0x0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(owner) + 0x28)) == 1)) {
|
|
return GHIDRA_CAST<Entity_Player *>(owner);
|
|
}
|
|
}
|
|
return GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
|
|
// 009666c0
|
|
Entity * Entity_Knife::GetRootParent()
|
|
{
|
|
EntityPtr nextParent;
|
|
EntityPtr parent;
|
|
|
|
nextParent = this->_parent;
|
|
while ((parent = nextParent, parent != (EntityPtr)0x0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parent) + 0x28)) == 8))) {
|
|
this = GHIDRA_CAST<Entity_Knife *>(parent);
|
|
nextParent = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(parent) + 0x3bc));
|
|
}
|
|
return GHIDRA_CAST<Entity *>(this);
|
|
}
|
|
|
|
// 00966ef0
|
|
void Entity_Knife::Shoot(float charge, float range)
|
|
{
|
|
byte bVar1;
|
|
byte *curAnimChar;
|
|
uint uVar2;
|
|
uint startFrame;
|
|
void *curAnimData;
|
|
byte *wantAnimChar;
|
|
bool bVar3;
|
|
double launchSpeed;
|
|
float gravity;
|
|
float savedGravity;
|
|
byte *animData;
|
|
int variant;
|
|
|
|
gravity = -2.0;
|
|
savedGravity = -2.0;
|
|
this->_maxDistance = charge * range;
|
|
uVar2 = GHIDRA_UINT((this->_tearFlags)._h);
|
|
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagOrbit._l)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._l)) + 0x4)))) != 0) ||
|
|
((uVar2 & GHIDRA_UINT(g_tearFlagOrbit._h)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._h)) + 0x4)))) != 0)) {
|
|
gravity = (float)&DAT_bf800000;
|
|
savedGravity = (float)&DAT_bf800000;
|
|
}
|
|
variant = this->_variant;
|
|
switch(variant) {
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 8:
|
|
case 9:
|
|
switchD_00966f89_caseD_2:
|
|
gravity = gravity * 0.75;
|
|
savedGravity = gravity;
|
|
break;
|
|
case 5:
|
|
case 0xb:
|
|
break;
|
|
default:
|
|
if (variant == 1) goto switchD_00966f89_caseD_2;
|
|
}
|
|
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagHydrobounce._l)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._l)) + 0x4)))) != 0) ||
|
|
((uVar2 & GHIDRA_UINT(g_tearFlagHydrobounce._h)) != 0 ||
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._h)) + 0x4)))) != 0)) {
|
|
gravity = gravity * 0.75;
|
|
this->_height = 0.0;
|
|
this->_fallingSpeed = -10.0;
|
|
savedGravity = gravity;
|
|
}
|
|
launchSpeed = (double)ABS((charge * range) / (gravity * -0.5));
|
|
if (launchSpeed < 0.0) {
|
|
libm_sse2_sqrt_precise();
|
|
}
|
|
else {
|
|
launchSpeed = SQRT(launchSpeed);
|
|
}
|
|
this->_knifeDistance = 0.0;
|
|
this->_isFlying = 1;
|
|
this->_knifeVelocity = (float)launchSpeed * -savedGravity;
|
|
this->_charge = charge;
|
|
switch(variant) {
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 8:
|
|
case 9:
|
|
break;
|
|
case 5:
|
|
case 0xb:
|
|
goto switchD_00967064_caseD_5;
|
|
default:
|
|
if (this->_variant != 1) goto switchD_00967064_caseD_5;
|
|
}
|
|
(this->_sprite)._rotation = 0.0;
|
|
this->_knifeDepthOffset = 0.0;
|
|
(this->_hitList)._end = (this->_hitList)._begin;
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_009670ee:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b602e8,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<byte **>(animData);
|
|
}
|
|
wantAnimChar = &DAT_00b602e8;
|
|
do {
|
|
bVar1 = *curAnimChar;
|
|
bVar3 = bVar1 < *wantAnimChar;
|
|
if (bVar1 != *wantAnimChar) {
|
|
LAB_009670d0:
|
|
uVar2 = -GHIDRA_UINT(bVar3) | 1;
|
|
goto LAB_009670d5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = curAnimChar[1];
|
|
bVar3 = bVar1 < wantAnimChar[1];
|
|
if (bVar1 != wantAnimChar[1]) goto LAB_009670d0;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantAnimChar = wantAnimChar + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009670d5:
|
|
if ((uVar2 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_009670ee;
|
|
}
|
|
curAnimData = (this->_sprite)._animState._animData;
|
|
if ((curAnimData == (void *)0x0) || (uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(curAnimData) + 0x30)), uVar2 == 0)) {
|
|
startFrame = 0;
|
|
}
|
|
else {
|
|
startFrame = Random();
|
|
startFrame = startFrame % uVar2;
|
|
curAnimData = (this->_sprite)._animState._animData;
|
|
}
|
|
if (curAnimData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(startFrame));
|
|
}
|
|
switchD_00967064_caseD_5:
|
|
UpdateHomingPath(this);
|
|
return;
|
|
}
|
|
|
|
// 00967180
|
|
void Entity_Knife::UpdateHomingPath()
|
|
{
|
|
double dVar1;
|
|
undefined4 uVar2;
|
|
undefined4 uVar3;
|
|
undefined4 uVar4;
|
|
int iVar5;
|
|
int iVar6;
|
|
Vector direction;
|
|
byte bVar7;
|
|
Entity_Player *player;
|
|
int iVar8;
|
|
uint rngResult;
|
|
uint seed;
|
|
Entity *spawned;
|
|
Entity_Knife *spawnedKnife;
|
|
int *laser;
|
|
char extraout_DL;
|
|
int unaff_EDI;
|
|
float fVar9;
|
|
float fVar10;
|
|
EntityPtr EVar11;
|
|
undefined1 auVar12 [12];
|
|
float fVar13;
|
|
undefined1 auStack_5e [2];
|
|
EntityPtr local_5c;
|
|
int knifeCount;
|
|
Vector spawnPos;
|
|
ColorMod laserColor;
|
|
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_usedTearFlags)._l) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_usedTearFlags)._l) + 4)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(this->_usedTearFlags)._h) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_usedTearFlags)._h) + 4)) = 0;
|
|
player = GetPlayer(this);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar8 = GetBaseVariant(this);
|
|
if ((((iVar8 != 1) && (iVar8 = GetBaseVariant(this), iVar8 != 10)) && (extraout_DL != '\0')) &&
|
|
((bVar7 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xe5,0), bVar7 != 0 && (0.25 < this->_charge))
|
|
)) {
|
|
rngResult = Random();
|
|
knifeCount = GHIDRA_INT((((float)(rngResult % 3 + 3) + 0.0) * this->_charge));
|
|
local_5c = (EntityPtr)this;
|
|
if (0 < knifeCount) {
|
|
do {
|
|
rngResult = Random();
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
|
|
seed = Random();
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x3bc));
|
|
fVar13 = *GHIDRA_CAST<float *>((iVar8 + 0x340));
|
|
fVar9 = ((float)((double)GHIDRA_INT(rngResult) + dVar1) * 2.3283064e-10 * 360.0 - 180.0) *
|
|
0.017453292;
|
|
fVar10 = cos(fVar9);
|
|
spawnPos.x = fVar10 * 30.0 + *GHIDRA_CAST<float *>((iVar8 + 0x33c));
|
|
fVar9 = sin(fVar9);
|
|
spawnPos.y = fVar9 * 30.0 + fVar13;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(8,0,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(player),1,seed,0);
|
|
spawnedKnife = GHIDRA_CAST<Entity_Knife *>(__RTDynamicCast(spawned,0));
|
|
iVar8 = *GHIDRA_CAST<int *>(spawnedKnife);
|
|
(spawnedKnife->_posOffset).x = 0.0;
|
|
(spawnedKnife->_posOffset).y = -10.0;
|
|
(**(code **)(iVar8 + 0x40))();
|
|
fVar13 = 1.4013e-45;
|
|
spawnedKnife->SetColor(GHIDRA_INT(local_5c) + 0xf0,0xffffffff,0xff);
|
|
HomingLaser::operator_assign
|
|
(&spawnedKnife->_homingLaser,GHIDRA_CAST<HomingLaser *>((GHIDRA_INT(local_5c) + 0x468)));
|
|
if (spawnedKnife->_parent != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase(auStack_5e + -0xe);
|
|
}
|
|
spawnedKnife->_parent = local_5c;
|
|
std::multiset<unsigned_int>::insert(&spawnedKnife->_parent);
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_5c) + 0x414));
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_5c) + 0x418));
|
|
uVar4 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_5c) + 0x41c));
|
|
*GHIDRA_CAST<undefined4 *>(&(spawnedKnife->_tearFlags)._l) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_5c) + 0x410));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(spawnedKnife->_tearFlags)._l) + 4)) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>(&(spawnedKnife->_tearFlags)._h) = uVar3;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(spawnedKnife->_tearFlags)._h) + 4)) = uVar4;
|
|
fVar9 = cos(fVar13);
|
|
EVar11 = (EntityPtr)sin(fVar13);
|
|
direction.y = (float)EVar11;
|
|
direction.x = fVar9;
|
|
InitHomingPath(spawnedKnife,direction,GHIDRA_CAST<Entity *>(local_5c),0.0);
|
|
spawnedKnife->_pathFollowSpeed = 0.05;
|
|
spawnedKnife->Update();
|
|
knifeCount = knifeCount + -1;
|
|
this = GHIDRA_CAST<Entity_Knife *>(local_5c);
|
|
local_5c = EVar11;
|
|
} while (knifeCount != 0);
|
|
}
|
|
}
|
|
bVar7 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18b,0);
|
|
if (bVar7 != 0) {
|
|
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x4fc)) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x4fc)) + 0x28))();
|
|
}
|
|
rngResult = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(7,2,GHIDRA_CAST<Vector *>((GHIDRA_INT(this) + 0x33c)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(player),3,rngResult,0);
|
|
laser = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,0));
|
|
laserColor._tint[0] = (player->_laserColor)._tint[0];
|
|
laserColor._tint[1] = (player->_laserColor)._tint[1];
|
|
laserColor._tint[2] = (player->_laserColor)._tint[2];
|
|
laserColor._tint[3] = (player->_laserColor)._tint[3];
|
|
laserColor._colorize[0] = (player->_laserColor)._colorize[0];
|
|
laserColor._colorize[1] = (player->_laserColor)._colorize[1];
|
|
laserColor._colorize[2] = (player->_laserColor)._colorize[2];
|
|
laserColor._colorize[3] = (player->_laserColor)._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(laserColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((player->_laserColor)._offset);
|
|
laserColor._offset[2] = (player->_laserColor)._offset[2];
|
|
(**(code **)(*laser + 0x3c))(&laserColor,0xffffffff);
|
|
laser[0xd3] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x34c));
|
|
laser[0xd4] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x350));
|
|
if (laser[0xef] != 0) {
|
|
std::multiset<unsigned_int>::erase(auStack_5e + -0x12);
|
|
}
|
|
*GHIDRA_CAST<EntityPtr *>((laser + 0xef)) = (EntityPtr)this;
|
|
std::multiset<unsigned_int>::insert(GHIDRA_CAST<EntityPtr *>((laser + 0xef)));
|
|
laser[0xd6] = 0x453b8000;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414));
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x418));
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x41c));
|
|
laser[0x10a] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410));
|
|
laser[0x10b] = iVar8;
|
|
laser[0x10c] = iVar5;
|
|
laser[0x10d] = iVar6;
|
|
auVar12 = ZEXT812(0x3ea8f5c3);
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0))) < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x460))) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x4))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0))) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x460));
|
|
}
|
|
(**(code **)(*laser + 0x40))((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0))) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x388)));
|
|
laser[0x116] = 600;
|
|
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x460));
|
|
if (fVar13 <= 0.0) {
|
|
fVar13 = 0.0;
|
|
}
|
|
if (1.0 <= fVar13) {
|
|
fVar13 = 1.0;
|
|
}
|
|
laser[0x12f] = GHIDRA_INT((fVar13 * 60.0 + 20.0));
|
|
if (laser[0xf2] != 0) {
|
|
std::multiset<unsigned_int>::erase(auStack_5e + -0x16);
|
|
}
|
|
laser[0xf2] = unaff_EDI;
|
|
std::multiset<unsigned_int>::insert(laser + 0xf2);
|
|
(**(code **)(*laser + 0xc))();
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x4fc)) != 0) {
|
|
std::multiset<unsigned_int>::erase();
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x4fc)) = GHIDRA_INT(laser);
|
|
std::multiset<unsigned_int>::insert();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00967650
|
|
void Entity_Knife::update_target(float *outAngle)
|
|
{
|
|
byte bVar1;
|
|
EntityPtr targetEntity;
|
|
uint entityIndex;
|
|
bool bVar2;
|
|
float fVar3;
|
|
float fVar4;
|
|
float fVar5;
|
|
EntityPtr *pEVar6;
|
|
float fVar7;
|
|
EntityPtr *local_24;
|
|
float local_20;
|
|
float local_1c;
|
|
EntityPtr local_18;
|
|
char isVulnerable;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c94d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
targetEntity = this->_target;
|
|
local_1c = 22500.0;
|
|
bVar2 = false;
|
|
if (targetEntity == (EntityPtr)0x0) {
|
|
local_24 = *GHIDRA_CAST<EntityPtr **>((GHIDRA_CAST<char *>(g_game->_room) + 0x125c));
|
|
local_20 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1264));
|
|
entityIndex = 0;
|
|
local_8 = 0;
|
|
local_18 = (EntityPtr)0x0;
|
|
if (local_20 != 0.0) {
|
|
do {
|
|
targetEntity = local_24[entityIndex];
|
|
bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(targetEntity))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(this));
|
|
if ((bVar1 == 0) ||
|
|
(isVulnerable = '\x01', (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(targetEntity) + 0x168)) & 0x20000010) != 0)) {
|
|
isVulnerable = '\0';
|
|
}
|
|
if ((((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(targetEntity) + 0x28)) != 3)
|
|
) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(targetEntity) + 0x2c)) != 0x43)) ||
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(targetEntity))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(this->_spawnerEntity)),
|
|
bVar1 != 0)) {
|
|
bVar2 = false;
|
|
}
|
|
else {
|
|
bVar2 = true;
|
|
}
|
|
if (((isVulnerable != '\0') || (bVar2)) &&
|
|
((fVar3 = (this->_pos).x - (GHIDRA_CAST<Vector *>((GHIDRA_INT(targetEntity) + 0x33c)))->x,
|
|
fVar5 = (this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x340)),
|
|
fVar3 = fVar5 * fVar5 + fVar3 * fVar3,
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x14)) < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x380)) &&
|
|
(fVar3 < local_1c)))) {
|
|
local_1c = fVar3;
|
|
local_18 = targetEntity;
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < GHIDRA_UINT(local_20));
|
|
if (this->_target != (EntityPtr)0x0) {
|
|
local_24 = &this->_target;
|
|
std::multiset<unsigned_int>::erase(&local_24);
|
|
}
|
|
}
|
|
pEVar6 = &this->_target;
|
|
*pEVar6 = local_18;
|
|
bVar2 = local_18 == (EntityPtr)0x0;
|
|
targetEntity = (EntityPtr)0x0;
|
|
if (!bVar2) {
|
|
std::multiset<unsigned_int>::insert(pEVar6);
|
|
targetEntity = *pEVar6;
|
|
bVar2 = targetEntity == (EntityPtr)0x0;
|
|
}
|
|
}
|
|
if (!bVar2) {
|
|
fVar3 = (this->_targetPosition).x;
|
|
if ((fVar3 == g_vectorZero.x) && ((this->_targetPosition).y == g_vectorZero.y)) {
|
|
fVar4 = this->_knifeDistance / this->_maxDistance;
|
|
fVar3 = (this->_pos).y;
|
|
fVar5 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x33c));
|
|
if (fVar4 <= 0.0) {
|
|
fVar4 = 0.0;
|
|
}
|
|
if (1.0 <= fVar4) {
|
|
fVar4 = 1.0;
|
|
}
|
|
fVar7 = (this->_pos).x;
|
|
(this->_targetPosition).y =
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x340)) - fVar3) * (1.0 - fVar4) + fVar3;
|
|
(this->_targetPosition).x = (fVar5 - fVar7) * (1.0 - fVar4) + fVar7;
|
|
}
|
|
else {
|
|
fVar5 = (this->_targetPosition).y;
|
|
fVar4 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x340));
|
|
(this->_targetPosition).x = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(targetEntity) + 0x33c)) - fVar3) * 0.04 + fVar3;
|
|
(this->_targetPosition).y = (fVar4 - fVar5) * 0.04 + fVar5;
|
|
}
|
|
}
|
|
local_20 = (this->_targetPosition).x;
|
|
if (((local_20 != g_vectorZero.x) || ((this->_targetPosition).y != g_vectorZero.y)) &&
|
|
(0.0 < this->_knifeDistance)) {
|
|
fVar3 = (this->_anchorPosition).x;
|
|
local_20 = local_20 - fVar3;
|
|
fVar5 = (this->_anchorPosition).y;
|
|
local_18 = (EntityPtr)((this->_pos).x - fVar3);
|
|
local_1c = (this->_pos).y - fVar5;
|
|
local_24 = GHIDRA_CAST<EntityPtr *>(((this->_targetPosition).y - fVar5));
|
|
fVar3 = sqrtf(local_20 * local_20 + (float)local_24 * (float)local_24);
|
|
if (0.0001 < fVar3) {
|
|
fVar4 = this->_maxDistance * 0.25;
|
|
fVar5 = local_20;
|
|
pEVar6 = local_24;
|
|
if (fVar3 < fVar4) {
|
|
pEVar6 = GHIDRA_CAST<EntityPtr *>(((float)local_24 * (fVar4 / fVar3)));
|
|
fVar5 = local_20 * (fVar4 / fVar3);
|
|
fVar3 = fVar4;
|
|
}
|
|
fVar3 = this->_knifeDistance / fVar3;
|
|
local_18 = (EntityPtr)((float)local_18 / fVar3);
|
|
local_1c = local_1c / fVar3;
|
|
fVar7 = (1.0 - fVar3) * fVar3;
|
|
fVar4 = (this->_anchorPosition).y;
|
|
(this->_pos).x = (float)local_18 * fVar7 + (this->_anchorPosition).x + fVar5 * fVar3 * fVar3;
|
|
(this->_pos).y = local_1c * fVar7 + fVar4 + (float)pEVar6 * fVar3 * fVar3;
|
|
fVar3 = atan2f((((float)pEVar6 - local_1c) + ((float)pEVar6 - local_1c)) * fVar3 + local_1c,
|
|
((fVar5 - (float)local_18) + (fVar5 - (float)local_18)) * fVar3 +
|
|
(float)local_18);
|
|
*outAngle = fVar3 * 57.295776;
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00967a70
|
|
void Entity_Knife::apply_wiggle(float *param_2)
|
|
{
|
|
code *pcVar1;
|
|
Vector *normalizedDir;
|
|
BitSet128 *maskedFlags;
|
|
EntityPtr rootKnife;
|
|
uint rngState;
|
|
EntityPtr ancestor;
|
|
float fVar2;
|
|
float perpX;
|
|
double wiggleSlope;
|
|
float wigglePhase;
|
|
BitSet128 local_24;
|
|
float local_14;
|
|
Vector local_10;
|
|
float local_8;
|
|
int grandParent;
|
|
EntityPtr *parentSlot;
|
|
|
|
ancestor = this->_parent;
|
|
if (ancestor == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
local_14 = 0.0;
|
|
local_8 = 0.0;
|
|
fVar2 = 0.0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(ancestor) + 0x28)) == 1) {
|
|
local_8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(ancestor) + 0x33c)) - (this->_pos).x;
|
|
local_10.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(ancestor) + 0x340)) - (this->_pos).y;
|
|
fVar2 = sqrtf(local_8 * local_8 + local_10.y * local_10.y);
|
|
if (fVar2 <= 0.0) {
|
|
fVar2 = local_10.y;
|
|
goto LAB_00967b6b;
|
|
}
|
|
local_8 = local_8 * (1.0 / fVar2);
|
|
fVar2 = local_10.y * (1.0 / fVar2);
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(ancestor) + 0x28)) != 8) ||
|
|
(grandParent = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(ancestor) + 0x3bc)), *GHIDRA_CAST<int *>((grandParent + 0x28)) != 1))
|
|
goto LAB_00967b6b;
|
|
local_10.x = *GHIDRA_CAST<float *>((grandParent + 0x33c)) - (this->_pos).x;
|
|
local_10.y = *GHIDRA_CAST<float *>((grandParent + 0x340)) - (this->_pos).y;
|
|
normalizedDir = (GHIDRA_CAST<Vector *>((&local_10)))->Vector::Normalized(GHIDRA_CAST<Vector *>(&local_24._h));
|
|
local_8 = normalizedDir->x;
|
|
fVar2 = normalizedDir->y;
|
|
}
|
|
LAB_00967b6b:
|
|
wigglePhase = 0.0;
|
|
perpX = local_8;
|
|
maskedFlags = BitSet128::operator_and(&local_24,&this->_tearFlags,&g_tearFlagOrbit);
|
|
if ((GHIDRA_INT(maskedFlags->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(maskedFlags->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) == 0)) {
|
|
perpX = -fVar2;
|
|
}
|
|
else {
|
|
local_8 = fVar2;
|
|
}
|
|
rootKnife = (EntityPtr)this;
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(ancestor) + 0x28)) != 8) break;
|
|
parentSlot = GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(ancestor) + 0x3bc));
|
|
rootKnife = ancestor;
|
|
ancestor = *parentSlot;
|
|
} while (*parentSlot != (EntityPtr)0x0);
|
|
local_10.y = perpX;
|
|
if (rootKnife != (EntityPtr)this) {
|
|
rngState = this->_initSeed;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = 0x900000005;
|
|
local_14 = 9.80909e-45;
|
|
if (rngState == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
rngState = rngState >> 5 ^ rngState;
|
|
rngState = rngState << 9 ^ rngState;
|
|
rngState = rngState >> 7 ^ rngState;
|
|
fVar2 = (float)((double)GHIDRA_INT(rngState) + __uint_to_double_fixup[-(GHIDRA_INT(rngState) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
wigglePhase = (fVar2 + fVar2) * 3.1415927;
|
|
local_14 = wigglePhase;
|
|
}
|
|
fVar2 = sin(this->_knifeDistance / 20.0 + wigglePhase);
|
|
fVar2 = ((fVar2 * 30.0 * this->_knifeDistance) / this->_maxDistance) * this->_charge;
|
|
(this->_pos).x = local_10.y * fVar2 + (this->_pos).x;
|
|
(this->_pos).y = local_8 * fVar2 + (this->_pos).y;
|
|
fVar2 = cos(this->_knifeDistance / 20.0 + local_14);
|
|
wiggleSlope = (double)((((fVar2 / 20.0) * 30.0 * this->_knifeDistance) / this->_maxDistance) *
|
|
this->_charge);
|
|
libm_sse2_atan_precise();
|
|
*param_2 = *param_2 - ((float)wiggleSlope * 180.0) / 3.1415927;
|
|
return;
|
|
}
|
|
|
|
// 00967d20
|
|
void Entity_Knife::screen_wrap()
|
|
{
|
|
Vector *position;
|
|
uint pass;
|
|
Vector wrappedPos;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
pass = 0;
|
|
position = &this->_pos;
|
|
while ((Room::ScreenWrapPositionImpl(game->_room,&wrappedPos,position,-100.0,-100.0,-100.0,-100.0)
|
|
, wrappedPos.x != position->x || (wrappedPos.y != (this->_pos).y))) {
|
|
pass = pass + 1;
|
|
position->x = wrappedPos.x;
|
|
(this->_pos).y = wrappedPos.y;
|
|
if (3 < pass) {
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00967db0
|
|
void Entity_Knife::Interpolate()
|
|
{
|
|
Vector *resizedOffset;
|
|
LayerState *layer;
|
|
float y;
|
|
float parentX;
|
|
float x;
|
|
Vector toParent;
|
|
Vector resizedBuf;
|
|
float offsetY;
|
|
EntityPtr parent;
|
|
float parentX;
|
|
int subtype;
|
|
|
|
subtype = this->_subtype;
|
|
if (subtype == 0) {
|
|
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagLudovico._l)) == 0 &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4)))) == 0) &&
|
|
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagLudovico._h)) == 0 &&
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4)))) == 0)) {
|
|
this->_isInterpolating = 1;
|
|
this->Update();
|
|
(this->_preInterpolatePos).x = (this->_pos).x;
|
|
(this->_preInterpolatePos).y = (this->_pos).y;
|
|
return;
|
|
}
|
|
this->_isInterpolating = 1;
|
|
this->Update();
|
|
}
|
|
else {
|
|
if ((subtype != 1) && (subtype != 4)) {
|
|
if (subtype != 3) {
|
|
return;
|
|
}
|
|
parent = this->_parent;
|
|
if (parent == (EntityPtr)0x0) {
|
|
return;
|
|
}
|
|
parentX = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x340));
|
|
parentX = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x33c));
|
|
y = parentX - (this->_pos).y;
|
|
x = parentX - (this->_pos).x;
|
|
toParent.x = x;
|
|
toParent.y = y;
|
|
if (900.0 < y * y + x * x) {
|
|
resizedOffset = (GHIDRA_CAST<Vector *>((&toParent)))->Vector::Resized(&resizedBuf,30.0);
|
|
offsetY = resizedOffset->y;
|
|
(this->_pos).x = parentX - resizedOffset->x;
|
|
(this->_pos).y = parentX - offsetY;
|
|
}
|
|
parentX = atan2f(y,x);
|
|
parentX = normalize_angle_degrees(parentX * 57.295776 + 90.0);
|
|
(this->_sprite)._rotation = parentX;
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_flipX = 0.0 < parentX;
|
|
return;
|
|
}
|
|
this->_isInterpolating = 1;
|
|
}
|
|
(this->_preInterpolatePos).x = (this->_pos).x;
|
|
(this->_preInterpolatePos).y = (this->_pos).y;
|
|
parentX = this->_friction;
|
|
(this->_pos).x = parentX * (this->_velocity).x * 0.5 + (this->_pos).x;
|
|
(this->_pos).y = parentX * (this->_velocity).y * 0.5 + (this->_pos).y;
|
|
return;
|
|
}
|
|
|
|
// 00967fc0
|
|
void Entity_Knife::Reset()
|
|
{
|
|
byte *animNameCursor;
|
|
uint cmpResult;
|
|
byte *idleCursor;
|
|
bool isLess;
|
|
EntityPtr *erasedRef;
|
|
byte ch;
|
|
EntityPtr *targetRef;
|
|
|
|
(this->_targetPosition).x = g_vectorZero.x;
|
|
targetRef = &this->_target;
|
|
(this->_targetPosition).y = g_vectorZero.y;
|
|
if (*targetRef != (EntityPtr)0x0) {
|
|
erasedRef = targetRef;
|
|
std::multiset<unsigned_int>::erase(&erasedRef);
|
|
}
|
|
*targetRef = (EntityPtr)0x0;
|
|
this->_knifeDistance = 0.0;
|
|
this->_isFlying = 0;
|
|
this->_knifeVelocity = 0.0;
|
|
this->_prismApplied = 0;
|
|
this->_multidimensionalApplied = 0;
|
|
switch(this->_variant) {
|
|
default:
|
|
if (this->_variant != 1) {
|
|
return;
|
|
}
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 8:
|
|
case 9:
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
animNameCursor = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((animNameCursor + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<byte **>(animNameCursor);
|
|
}
|
|
idleCursor = &DAT_00b602e8;
|
|
do {
|
|
ch = *animNameCursor;
|
|
isLess = ch < *idleCursor;
|
|
if (ch != *idleCursor) {
|
|
LAB_00968090:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00968095;
|
|
}
|
|
if (ch == 0) break;
|
|
ch = animNameCursor[1];
|
|
isLess = ch < idleCursor[1];
|
|
if (ch != idleCursor[1]) goto LAB_00968090;
|
|
animNameCursor = animNameCursor + 2;
|
|
idleCursor = idleCursor + 2;
|
|
} while (ch != 0);
|
|
cmpResult = 0;
|
|
LAB_00968095:
|
|
if (cmpResult == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
|
|
}
|
|
}
|
|
case 5:
|
|
case 0xb:
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 009680d0
|
|
void Entity_Knife::SetAttackAnimation()
|
|
{
|
|
byte isAnimSet;
|
|
char *animName;
|
|
byte *****pppppbVar1;
|
|
uint size;
|
|
float fVar2;
|
|
float fVar3;
|
|
float cosRot;
|
|
float sinRot;
|
|
byte *****curAnim [4];
|
|
uint curAnimSize;
|
|
uint curAnimCapacity;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
byte ****local_14;
|
|
void *animData;
|
|
EntityPtr parent;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((curAnim + 0xe));
|
|
local_14 = GHIDRA_CAST<byte ****>(0xffffffff);
|
|
puStack_18 = &LAB_00af85cd;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((curAnim + 0xb));
|
|
ExceptionList = &local_1c;
|
|
if (g_game->_frameCount == this->_spawnFrame) {
|
|
this->_displayRotation = this->_rotation;
|
|
}
|
|
switch(this->_variant) {
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 8:
|
|
case 9:
|
|
break;
|
|
default:
|
|
if (this->_variant == 10) goto LAB_00968177;
|
|
break;
|
|
case 0xb:
|
|
LAB_00968177:
|
|
fVar2 = this->_displayRotation * 0.017453292;
|
|
fVar3 = cos(fVar2);
|
|
fVar2 = sin(fVar2);
|
|
if (ABS(fVar3) <= ABS(fVar2)) {
|
|
animName = "AttackDown";
|
|
if (fVar2 < 0.0) {
|
|
animName = "AttackUp";
|
|
}
|
|
}
|
|
else {
|
|
animName = "AttackRight";
|
|
if (fVar3 < 0.0) {
|
|
animName = "AttackLeft";
|
|
}
|
|
}
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(animName),1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
goto LAB_0096829f;
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == (void *)0x0) {
|
|
curAnimSize = 0;
|
|
curAnimCapacity = 0xf;
|
|
curAnim[0] = GHIDRA_CAST<byte *****>(0x0);
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((curAnim + 0xe));
|
|
}
|
|
else {
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((curAnim + 0xe));
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(curAnim))))->std::string::string(animData);
|
|
}
|
|
local_14 = GHIDRA_CAST<byte ****>(0x0);
|
|
pppppbVar1 = GHIDRA_CAST<byte *****>(curAnim);
|
|
if (0xf < curAnimCapacity) {
|
|
pppppbVar1 = curAnim[0];
|
|
}
|
|
isAnimSet = str_eq(GHIDRA_CAST<byte *>(pppppbVar1),curAnimSize,GHIDRA_CAST<byte *>("Swing"),5);
|
|
animName = "Swing2";
|
|
if (isAnimSet == 0) {
|
|
animName = "Swing";
|
|
}
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(animName),1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
if (0xf < curAnimCapacity) {
|
|
size = curAnimCapacity + 1;
|
|
pppppbVar1 = curAnim[0];
|
|
if (0xfff < size) {
|
|
pppppbVar1 = GHIDRA_CAST<byte *****>(curAnim[0][-1]);
|
|
size = curAnimCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(curAnim[0]) + (-4 - GHIDRA_INT(pppppbVar1))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppbVar1,size);
|
|
}
|
|
LAB_0096829f:
|
|
parent = this->_parent;
|
|
if ((parent != (EntityPtr)0x0) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parent) + 0x28)) == 1 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(parent) + 0x28)) == 3)))) {
|
|
fVar3 = this->_displayRotation * 0.017453292;
|
|
cosRot = cos(fVar3);
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x33c));
|
|
sinRot = sin(fVar3);
|
|
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x340));
|
|
(this->_pos).x = cosRot * 5.0 + fVar2;
|
|
(this->_pos).y = sinRot * 5.0 + fVar3;
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x340));
|
|
(this->_anchorPosition).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x33c));
|
|
(this->_anchorPosition).y = fVar2;
|
|
fVar2 = atan2f((this->_pos).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x340)),
|
|
(this->_pos).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(parent) + 0x33c)));
|
|
fVar2 = fVar2 * 57.295776 - 90.0;
|
|
if (360.0 < ABS(fVar2)) {
|
|
fVar2 = fmodf(fVar2,360.0);
|
|
}
|
|
if (fVar2 <= 180.0) {
|
|
if (fVar2 < -180.0) {
|
|
fVar2 = fVar2 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar2 = fVar2 - 360.0;
|
|
}
|
|
(this->_sprite)._rotation = fVar2;
|
|
}
|
|
this->_isDeadEyeHit = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&this->_isSwinging) = 0x101;
|
|
this->_isSpinAttack = 0;
|
|
(this->_hitList)._end = (this->_hitList)._begin;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00968430
|
|
void Entity_Knife::SpinAttack(short remainingSpins, int startFrame)
|
|
{
|
|
byte isAnimSet;
|
|
char *anim;
|
|
uint rngResult;
|
|
float sinAngle;
|
|
float local_10;
|
|
float local_c;
|
|
Manager *manager;
|
|
|
|
if (g_game->_frameCount == this->_spawnFrame) {
|
|
this->_displayRotation = this->_rotation;
|
|
}
|
|
switch(this->_variant) {
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 8:
|
|
case 9:
|
|
goto switchD_0096846e_caseD_2;
|
|
default:
|
|
if (this->_variant == 10) goto switchD_0096846e_caseD_b;
|
|
switchD_0096846e_caseD_2:
|
|
KAGE_LogMessage(4,GHIDRA_CAST<byte *>("Tried to use spin attack on an unsupported knife variant! (%d)\n"));
|
|
return;
|
|
case 0xb:
|
|
switchD_0096846e_caseD_b:
|
|
local_10 = this->_displayRotation * 0.017453292;
|
|
local_c = cos(local_10);
|
|
sinAngle = sin(local_10);
|
|
if (ABS(local_c) <= ABS(sinAngle)) {
|
|
anim = "SpinDown";
|
|
if (sinAngle < 0.0) {
|
|
anim = "SpinUp";
|
|
}
|
|
}
|
|
else {
|
|
anim = "SpinRight";
|
|
if (local_c < 0.0) {
|
|
anim = "SpinLeft";
|
|
}
|
|
}
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(anim),1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
if ((0 < startFrame) && ((this->_sprite)._animState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)startFrame);
|
|
}
|
|
local_c = 1.0 / ((this->_sprite)._scale.x * 0.5 + 0.5);
|
|
rngResult = Random();
|
|
manager = g_manager;
|
|
if (local_c <= 0.5) {
|
|
local_c = 0.5;
|
|
}
|
|
local_10 = 7.53899e-43;
|
|
local_c = ((float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.9) * local_c;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_10));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_10),1.0,2,0,local_c,0.0);
|
|
this->_isDeadEyeHit = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&this->_isSwinging) = 1;
|
|
this->_isSpinAttack = 1;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ec)))) = 1;
|
|
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f0)))) = remainingSpins;
|
|
(this->_hitList)._end = (this->_hitList)._begin;
|
|
UpdateSwingHits(this);
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 00968660
|
|
byte Entity_Knife::drain_notched_axe(int charge)
|
|
{
|
|
Entity_Knife *player = this;
|
|
char cVar1;
|
|
Entity_Player *player;
|
|
uint uVar2;
|
|
int iVar3;
|
|
ColorMod *color;
|
|
ColorMod *color_00;
|
|
float local_3c;
|
|
Color particleColor;
|
|
uint local_c;
|
|
Manager *manager;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_3c);
|
|
player = GetPlayer(player);
|
|
if ((((player == GHIDRA_CAST<Entity_Player *>(0x0)) || (iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x4f4)))), iVar3 == 0)) ||
|
|
(*GHIDRA_CAST<int *>((iVar3 + 0x28)) != 8)) || (*GHIDRA_CAST<char *>((iVar3 + 0x171)) == '\0')) {
|
|
return 0;
|
|
}
|
|
cVar1 = FUN_00961ad0();
|
|
if ((cVar1 != '\0') && (uVar2 = Random(), (uVar2 & 3) != 0)) {
|
|
return 0;
|
|
}
|
|
uVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetActiveItemSlot(0x93);
|
|
if (-1 < GHIDRA_INT(uVar2)) {
|
|
Entity_Player::AddActiveCharge(player,-charge,uVar2,0,0,0);
|
|
iVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetActiveItem(uVar2);
|
|
if (0 < iVar3) {
|
|
return 0;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::DischargeActiveItem(uVar2,0);
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x93,-1);
|
|
manager = g_manager;
|
|
local_3c = 6.474e-43;
|
|
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);
|
|
manager = g_manager;
|
|
local_3c = 1.93379e-43;
|
|
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);
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
uVar2 = Random();
|
|
Game::SpawnParticles
|
|
(g_game,&player->_pos,0x1b,2,
|
|
(float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10 * 4.0 + 3.0,color,100000.0,0);
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
uVar2 = Random();
|
|
local_3c = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.0 + 2.0;
|
|
uVar2 = Random();
|
|
Game::SpawnParticles(g_game,&player->_pos,0x56,(uVar2 & 1) + 2,local_3c,color_00,100000.0,0);
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x4f4))));
|
|
if ((iVar3 != 0) && (*GHIDRA_CAST<int *>((iVar3 + 0x28)) == 8)) {
|
|
*GHIDRA_CAST<undefined1 *>((iVar3 + 0x171)) = 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 009688d0
|
|
void Entity_Knife::UpdateSwingHits()
|
|
{
|
|
uint *puVar1;
|
|
float fVar2;
|
|
EntityPtr EVar3;
|
|
BitSet128 flags;
|
|
byte bVar4;
|
|
char cVar5;
|
|
BitSet128 *maskedFlags;
|
|
int iVar6;
|
|
EntityRef *nullCapsule;
|
|
int iVar7;
|
|
uint uVar8;
|
|
GridEntity *gridEntity;
|
|
Capsule *entityCapsule;
|
|
EntityList *hitList;
|
|
void *pvVar9;
|
|
Vector *pushDelta;
|
|
Entity_Player *ownerPlayer;
|
|
int *piVar10;
|
|
std_string *curAnimName;
|
|
Entity *spawnedEntity;
|
|
Entity_Knife *pEVar11;
|
|
char *anim;
|
|
Entity *ownerPlayer;
|
|
ColorMod *laserColor;
|
|
EntityPtr EVar12;
|
|
int iVar13;
|
|
Room *room;
|
|
Entity *unused;
|
|
int extraout_EDX;
|
|
float fVar14;
|
|
float fVar15;
|
|
float fVar16;
|
|
undefined1 auVar17 [12];
|
|
float bridgeDirX;
|
|
float bridgeDirY;
|
|
double dVar18;
|
|
undefined4 uVar19;
|
|
undefined4 uVar20;
|
|
Capsule gridCapsule [10];
|
|
BitSet128 hitTearFlags;
|
|
EntityList_EL queryResults;
|
|
Vector tipPos;
|
|
EntityRef extraCapsule;
|
|
undefined1 maskResult [8];
|
|
Vector scratchVec;
|
|
Vector local_15c;
|
|
EntityRef tipCapsule;
|
|
float scaleY;
|
|
Vector local_128;
|
|
BitSet128 tearFlagsCopy;
|
|
float tipDistance;
|
|
float tipRadius;
|
|
float swingDistance;
|
|
Vector local_100;
|
|
Vector local_f8;
|
|
Vector local_f0;
|
|
float local_e8;
|
|
Vector *knockbackOrigin;
|
|
Vector local_e0;
|
|
uint isHitAnything;
|
|
EntityPtr local_d4;
|
|
EntityPtr local_d0;
|
|
int baseVariant;
|
|
float damage;
|
|
float knockbackStrength;
|
|
Entity_Knife *local_c0;
|
|
GridEntity *local_bc;
|
|
undefined8 local_b8;
|
|
char isToolVariant;
|
|
undefined8 local_a8;
|
|
Room *local_9c;
|
|
float local_98;
|
|
void *local_94;
|
|
char isBurningAxe;
|
|
Entity_Knife *knife;
|
|
Entity_Player *player;
|
|
float local_84;
|
|
char local_7d;
|
|
uint loopIndex;
|
|
undefined4 local_78;
|
|
undefined4 local_74;
|
|
undefined4 local_70;
|
|
undefined4 local_6c;
|
|
undefined1 local_68 [8];
|
|
float local_60;
|
|
float local_5c;
|
|
uint local_58;
|
|
uint local_54;
|
|
undefined1 local_50 [44];
|
|
uint stackCookie;
|
|
undefined1 *puStack_20;
|
|
void *savedExceptionList;
|
|
undefined1 *puStack_18;
|
|
undefined4 ehState;
|
|
TypeDescriptor *castDstType;
|
|
TypeDescriptor *castSrcType;
|
|
bool isHitFrame;
|
|
Manager *manager;
|
|
short swingIndex;
|
|
float targetVelocityY;
|
|
qword tearFlagsHigh;
|
|
code *virtualFn;
|
|
|
|
puStack_20 = local_50 + 0x4c;
|
|
ehState = 0xffffffff;
|
|
puStack_18 = &LAB_00b0c980;
|
|
savedExceptionList = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((local_50 + 0x40));
|
|
local_e8 = 0.0;
|
|
if (this->_isInterpolating != 0) {
|
|
return;
|
|
}
|
|
if (this->_dead != 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &savedExceptionList;
|
|
knife = this;
|
|
ownerPlayer = GetPlayer(this);
|
|
local_d4 = (EntityPtr)0x0;
|
|
EVar12 = this->_parent;
|
|
if (EVar12 != (EntityPtr)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x28)) == 8) {
|
|
EVar12 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x3bc));
|
|
if (EVar12 == (EntityPtr)0x0) goto LAB_00968980;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x28));
|
|
if (((iVar6 == 1) || (iVar6 == 3)) || (iVar6 == 2)) {
|
|
local_d4 = EVar12;
|
|
}
|
|
}
|
|
LAB_00968980:
|
|
player = ownerPlayer;
|
|
baseVariant = GetBaseVariant(this);
|
|
fVar14 = this->_mass;
|
|
if (this->_variant == 2) {
|
|
tipDistance = 40.0;
|
|
tipRadius = 45.0;
|
|
knockbackStrength = fVar14 * 9.0;
|
|
}
|
|
else {
|
|
tipDistance = 28.0;
|
|
tipRadius = 30.0;
|
|
knockbackStrength = fVar14 * 18.0;
|
|
}
|
|
knockbackStrength = knockbackStrength / 3.0;
|
|
swingDistance = 4.0;
|
|
scaleY = (this->_sprite)._scale.y;
|
|
local_d0 = (EntityPtr)((fVar14 * 4.0) / 3.0);
|
|
local_94 = (GHIDRA_CAST<DebugRenderer *>((&g_game->_debugRenderer)))->DebugRenderer::Get(this->_index,1);
|
|
if ((baseVariant == 10) && (this->_isSwinging == 0)) {
|
|
local_7d = '\x01';
|
|
}
|
|
else {
|
|
local_7d = '\0';
|
|
}
|
|
iVar6 = this->_variant;
|
|
if (((iVar6 == 4) || (iVar6 == 5)) || ((iVar6 == 9 || (iVar6 == 8)))) {
|
|
isToolVariant = '\x01';
|
|
if (iVar6 == 4) {
|
|
knockbackStrength = 36.0;
|
|
isToolVariant = '\x01';
|
|
}
|
|
}
|
|
else {
|
|
isToolVariant = '\0';
|
|
}
|
|
if ((ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) && (ownerPlayer->_playerType == 0x23)) {
|
|
local_d0 = (EntityPtr)0x0;
|
|
}
|
|
if ((this->_subtype == 4) || (local_7d != '\0')) {
|
|
maskedFlags = BitSet128::operator_and(&hitTearFlags,&this->_tearFlags,&g_tearFlagWait);
|
|
if (((GHIDRA_INT(maskedFlags->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) == 0) &&
|
|
(GHIDRA_INT(maskedFlags->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) == 0)) ||
|
|
((iVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame(), iVar6 < 5 ||
|
|
(0x1d < g_game->_frameCount - this->_spawnFrame)))) {
|
|
LAB_00968b38:
|
|
if ((this->_sprite)._animState._animData == (void *)0x0) goto LAB_00968b3e;
|
|
local_c0 = GHIDRA_CAST<Entity_Knife *>((this->_sprite)._animState._animFrame);
|
|
dVar18 = floor((double)(float)local_c0);
|
|
local_c0 = GHIDRA_CAST<Entity_Knife *>((float)dVar18);
|
|
local_a8 = CONCAT44(GHIDRA_INT(dVar18),GHIDRA_CAST<GridEntity *>(local_a8));
|
|
if (5 < GHIDRA_INT(dVar18) - 2U) goto LAB_00968b48;
|
|
isHitFrame = true;
|
|
}
|
|
else {
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(4.0);
|
|
goto LAB_00968b38;
|
|
}
|
|
LAB_00968b3e:
|
|
local_a8 = CONCAT44(0xffffffff,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
LAB_00968b48:
|
|
isHitFrame = false;
|
|
}
|
|
if ((baseVariant == 10) || (isHitFrame)) {
|
|
if (this->_variant == 9) {
|
|
DAT_00c7ac6c = ownerPlayer;
|
|
LAB_00968b6e:
|
|
damage = 3.0;
|
|
}
|
|
else {
|
|
if (this->_variant != 2) goto LAB_00968b6e;
|
|
damage = 1.5;
|
|
}
|
|
damage = damage * this->_collisionDamage;
|
|
isHitAnything = isHitAnything & 0xffffff00;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x0))) = GHIDRA_UINT((this->_tearFlags)._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x4))) = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x0))) = GHIDRA_UINT((this->_tearFlags)._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x4))) = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
if (ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_f8.x = (this->_pos).x;
|
|
local_f8.y = (this->_pos).y;
|
|
}
|
|
else {
|
|
local_f8.x = (ownerPlayer->_pos).x;
|
|
local_f8.y = (ownerPlayer->_pos).y;
|
|
}
|
|
local_84 = this->_displayRotation * 0.017453292;
|
|
knockbackOrigin = &local_f8;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x0))) = GHIDRA_UINT(hitTearFlags._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x0))) = GHIDRA_UINT(hitTearFlags._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x4)));
|
|
local_c0 = GHIDRA_CAST<Entity_Knife *>(&this->_pos);
|
|
local_100.y = sin(local_84);
|
|
fVar14 = cos(local_84);
|
|
tipPos.x = fVar14 * tipDistance * scaleY + (this->_pos).x;
|
|
local_f0.x = 1.0;
|
|
tipPos.y = local_100.y * tipDistance * scaleY + (this->_pos).y;
|
|
local_f0.y = 1.0;
|
|
(GHIDRA_CAST<Capsule *>((GHIDRA_CAST<Capsule *>(&tipCapsule))))->Capsule::constructor(&tipPos,&local_f0,0.0,scaleY * tipRadius);
|
|
(GHIDRA_CAST<Capsule *>((GHIDRA_CAST<Capsule *>(&extraCapsule))))->Capsule::constructor(&g_vectorZero,&g_vectorZero,0.0,0.0);
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (this->_variant != 3)) {
|
|
if (this->_variant == 0xb) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x0))) = GHIDRA_UINT(tearFlagsCopy._l) | GHIDRA_UINT(g_tearFlagShielded._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagShielded._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x0))) = GHIDRA_UINT(tearFlagsCopy._h) | GHIDRA_UINT(g_tearFlagShielded._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagShielded._h)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x0))) = GHIDRA_UINT(hitTearFlags._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x0))) = GHIDRA_UINT(hitTearFlags._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x4)));
|
|
}
|
|
}
|
|
else {
|
|
damage = this->_collisionDamage * 1.5;
|
|
}
|
|
if (baseVariant == 10) {
|
|
nullCapsule = (EntityRef *)
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetNullCapsule(GHIDRA_CAST<Capsule *>((local_50 + 4)),&DAT_00b1d3b0)
|
|
;
|
|
(GHIDRA_CAST<EntityRef *>((&tipCapsule)))->EntityRef::operator_(nullCapsule);
|
|
nullCapsule = (EntityRef *)
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetNullCapsule(GHIDRA_CAST<Capsule *>((local_50 + 4)),&DAT_00b7cb20)
|
|
;
|
|
(GHIDRA_CAST<EntityRef *>((&extraCapsule)))->EntityRef::operator_(nullCapsule);
|
|
damage = this->_collisionDamage;
|
|
if (local_7d == '\0') {
|
|
if (this->_isSpinAttack == 0) {
|
|
damage = damage * 3.0 + 3.5;
|
|
goto LAB_00968f51;
|
|
}
|
|
local_98 = 1.8;
|
|
damage = damage * 8.0 + 10.0;
|
|
}
|
|
else {
|
|
local_98 = 0.8;
|
|
}
|
|
tipCapsule._entity =
|
|
(void *)(((float)tipCapsule._flags + (float)tipCapsule._entity) * local_98 -
|
|
(float)tipCapsule._flags);
|
|
extraCapsule._entity =
|
|
(void *)(((float)extraCapsule._flags + (float)extraCapsule._entity) * local_98 -
|
|
(float)extraCapsule._flags);
|
|
tipCapsule._spawnerType =
|
|
GHIDRA_INT(((float)tipCapsule._type - (float)tipCapsule._entity * tipCapsule._velocity.x));
|
|
tipCapsule._spawnerVariant =
|
|
GHIDRA_INT(((float)tipCapsule._variant - (float)tipCapsule._entity * tipCapsule._velocity.y));
|
|
tipCapsule._position.x =
|
|
(float)tipCapsule._type + (float)tipCapsule._entity * tipCapsule._velocity.x;
|
|
tipCapsule._position.y =
|
|
(float)tipCapsule._variant + (float)tipCapsule._entity * tipCapsule._velocity.y;
|
|
extraCapsule._spawnerType =
|
|
GHIDRA_INT(((float)extraCapsule._type -
|
|
(float)extraCapsule._entity * extraCapsule._velocity.x));
|
|
extraCapsule._spawnerVariant =
|
|
GHIDRA_INT(((float)extraCapsule._variant -
|
|
(float)extraCapsule._entity * extraCapsule._velocity.y));
|
|
extraCapsule._position.x =
|
|
(float)extraCapsule._type + (float)extraCapsule._entity * extraCapsule._velocity.x;
|
|
extraCapsule._position.y =
|
|
(float)extraCapsule._variant + (float)extraCapsule._entity * extraCapsule._velocity.y;
|
|
}
|
|
LAB_00968f51:
|
|
pvVar9 = local_94;
|
|
if ((GHIDRA_UINT(g_game->_debugFlags) >> 5 & 1) != 0) {
|
|
if (0.0 < (float)tipCapsule._flags) {
|
|
push_shape_points(local_94,GHIDRA_CAST<Capsule *>(&tipCapsule));
|
|
}
|
|
if (0.0 < (float)extraCapsule._flags) {
|
|
push_shape_points(pvVar9,GHIDRA_CAST<Capsule *>(&extraCapsule));
|
|
}
|
|
}
|
|
if ((float)extraCapsule._flags <= 0.0) {
|
|
local_98 = (float)tipCapsule._flags + (float)tipCapsule._entity;
|
|
uVar8 = g_game->_debugFlags;
|
|
local_e0.x = (float)tipCapsule._type;
|
|
local_e0.y = (float)tipCapsule._variant;
|
|
}
|
|
else {
|
|
local_100.y = (float)extraCapsule._variant - (float)tipCapsule._variant;
|
|
local_84 = (float)extraCapsule._type - (float)tipCapsule._type;
|
|
fVar14 = sqrtf(local_100.y * local_100.y + local_84 * local_84);
|
|
local_e0.x = (float)tipCapsule._type;
|
|
local_e0.y = (float)tipCapsule._variant;
|
|
local_98 = (fVar14 + (float)tipCapsule._flags + (float)tipCapsule._entity +
|
|
(float)extraCapsule._flags + (float)extraCapsule._entity) * 0.5;
|
|
if (0.0 < fVar14) {
|
|
fVar15 = (local_98 - (float)tipCapsule._flags) - (float)tipCapsule._entity;
|
|
local_e0.y = (float)tipCapsule._variant + (fVar15 * local_100.y) / fVar14;
|
|
local_e0.x = (float)tipCapsule._type + (fVar15 * local_84) / fVar14;
|
|
}
|
|
uVar8 = g_game->_debugFlags;
|
|
}
|
|
if ((uVar8 >> 5 & 1) != 0) {
|
|
FUN_0042ede0(&local_e0);
|
|
}
|
|
local_f0.y = 0.0;
|
|
local_f0.x = 0.0;
|
|
room = g_game->_room;
|
|
local_9c = room;
|
|
iVar6 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(&local_e0);
|
|
if (-1 < iVar6) {
|
|
local_94 = (void *)room->_gridWidth;
|
|
local_84 = local_98 / 40.0;
|
|
iVar7 = iVar6 / GHIDRA_INT(local_94);
|
|
iVar6 = iVar6 % GHIDRA_INT(local_94);
|
|
dVar18 = ceil((double)local_84);
|
|
iVar13 = GHIDRA_INT(dVar18);
|
|
uVar8 = iVar6 - iVar13;
|
|
loopIndex = 0;
|
|
if (0 < GHIDRA_INT(uVar8)) {
|
|
loopIndex = uVar8;
|
|
}
|
|
fVar15 = (float)(iVar7 - iVar13);
|
|
fVar14 = 0.0;
|
|
if (0 < GHIDRA_INT(fVar15)) {
|
|
fVar14 = fVar15;
|
|
}
|
|
pvVar9 = (void *)(iVar13 + iVar6);
|
|
if (GHIDRA_INT(pvVar9) < GHIDRA_INT(local_94)) {
|
|
local_94 = pvVar9;
|
|
}
|
|
fVar15 = (float)(iVar13 + iVar7);
|
|
fVar16 = (float)local_9c->_gridHeight;
|
|
if (GHIDRA_INT(fVar15) < local_9c->_gridHeight) {
|
|
fVar16 = fVar15;
|
|
}
|
|
local_100.y = fVar16;
|
|
local_84 = fVar14;
|
|
if (GHIDRA_INT(loopIndex) <= GHIDRA_INT(local_94)) {
|
|
room = local_9c;
|
|
do {
|
|
uVar8 = loopIndex;
|
|
local_128.y = fVar14;
|
|
if (GHIDRA_INT(fVar14) <= GHIDRA_INT(fVar16)) {
|
|
do {
|
|
if ((((GHIDRA_INT(uVar8) < 0) || (room->_gridWidth <= GHIDRA_INT(uVar8))) ||
|
|
(GHIDRA_INT(local_128.y) < 0)) ||
|
|
((room->_gridHeight <= GHIDRA_INT(local_128.y) ||
|
|
(iVar6 = room->_gridWidth * GHIDRA_INT(local_128.y) + uVar8, iVar6 < 0)))) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
gridEntity = room->_gridEntities[iVar6];
|
|
}
|
|
local_bc = gridEntity;
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
scratchVec.x = (float)(gridEntity->_gridIndex % iVar6) * 40.0 + 40.0;
|
|
scratchVec.y = (float)(gridEntity->_gridIndex / iVar6) * 40.0 + 120.0;
|
|
(GHIDRA_CAST<Capsule *>((gridCapsule)))->Capsule::constructor(&scratchVec,&g_vectorOne,0.0,20.0);
|
|
bVar4 = Capsule::Collide(gridCapsule,GHIDRA_CAST<Capsule *>(&tipCapsule),&local_f0);
|
|
if ((bVar4 != 0) ||
|
|
((0.0 < (float)extraCapsule._flags &&
|
|
(bVar4 = Capsule::Collide(gridCapsule,GHIDRA_CAST<Capsule *>(&extraCapsule),&local_f0),
|
|
bVar4 != 0)))) {
|
|
pEVar11 = knife;
|
|
if (knife->_variant == 9) {
|
|
if (0 < gridEntity->_collisionClass) {
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(gridEntity) + 0x14);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_50 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(knife));
|
|
cVar5 = (*virtualFn)(0,local_50 + 4);
|
|
if (cVar5 != '\0') {
|
|
local_15c.y = ((pEVar11->_sprite)._rotation + 90.0) * 0.017453292;
|
|
fVar14 = sin(local_15c.y);
|
|
local_b8 = CONCAT44(fVar14,(undefined4)local_b8);
|
|
fVar14 = cos(local_15c.y);
|
|
if (ABS(fVar14) <= ABS((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4))))) {
|
|
bridgeDirX = 0.0;
|
|
if (0.0 <= (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4)))) {
|
|
bridgeDirY = 1.0;
|
|
}
|
|
else {
|
|
bridgeDirY = (float)&DAT_bf800000;
|
|
}
|
|
}
|
|
else {
|
|
bridgeDirY = 0.0;
|
|
if (0.0 <= fVar14) {
|
|
bridgeDirX = 1.0;
|
|
}
|
|
else {
|
|
bridgeDirX = (float)&DAT_bf800000;
|
|
}
|
|
}
|
|
if ((bridgeDirX != g_vectorZero.x) || (bridgeDirY != g_vectorZero.y)) {
|
|
room = g_game->_room;
|
|
fVar14 = (((float)(local_bc->_gridIndex % room->_gridWidth) * 40.0 +
|
|
40.0 + bridgeDirX * 40.0) - 40.0) / 40.0 + 0.5;
|
|
iVar7 = GHIDRA_INT(fVar14);
|
|
iVar6 = GHIDRA_INT(((((float)(local_bc->_gridIndex / room->_gridWidth) * 40.0
|
|
+ 120.0 + bridgeDirY * 40.0) - 120.0) / 40.0 + 0.5));
|
|
local_b8 = CONCAT44(iVar7,(undefined4)local_b8);
|
|
if (((-1 < iVar7) &&
|
|
(((iVar7 < room->_gridWidth && (-1 < iVar6)) &&
|
|
(iVar6 < room->_gridHeight)))) &&
|
|
(iVar6 = iVar6 * room->_gridWidth + GHIDRA_INT(fVar14), -1 < iVar6)) {
|
|
if (iVar6 < 0x1c0) {
|
|
gridEntity = room->_gridEntities[iVar6];
|
|
}
|
|
else {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
(GHIDRA_CAST<Room *>((room)))->Room::TryMakeBridge(gridEntity,local_bc);
|
|
}
|
|
}
|
|
bVar4 = drain_notched_axe(pEVar11,1);
|
|
if (bVar4 != 0) {
|
|
if (pEVar11->_variant == 9) {
|
|
DAT_00c7ac6c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
isHitAnything = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(isHitAnything)) + 0x1))),1);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
local_78 = 0;
|
|
local_74 = 0;
|
|
local_70 = 0;
|
|
local_6c = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_68)) + 0x0))) = g_vectorZero.x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))) = g_vectorZero.y;
|
|
local_60 = g_vectorZero.x;
|
|
local_5c = g_vectorZero.y;
|
|
local_58 = 0;
|
|
local_54 = 0;
|
|
cVar5 = gridEntity->Hurt(1,&local_78);
|
|
isHitAnything = isHitAnything & 0xff;
|
|
if (cVar5 != '\0') {
|
|
isHitAnything = 1;
|
|
}
|
|
}
|
|
}
|
|
room = local_9c;
|
|
uVar8 = loopIndex;
|
|
}
|
|
local_128.y = (float)(GHIDRA_INT(local_128.y) + 1);
|
|
} while (GHIDRA_INT(local_128.y) <= GHIDRA_INT(local_100.y));
|
|
fVar16 = local_100.y;
|
|
fVar14 = local_84;
|
|
}
|
|
loopIndex = uVar8 + 1;
|
|
} while (GHIDRA_INT(loopIndex) <= GHIDRA_INT(local_94));
|
|
}
|
|
this = knife;
|
|
}
|
|
uVar8 = 0x1d;
|
|
maskedFlags = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(maskResult),&tearFlagsCopy,&g_tearFlagShielded);
|
|
if (((((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(maskedFlags->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) != 0)) ||
|
|
((this->_variant == 4 || (this->_variant == 3)))) ||
|
|
((baseVariant == 10 && (this->_isSpinAttack != 0)))) && ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_a8))) + 0x4))) < 5)) {
|
|
uVar8 = 0x1f;
|
|
}
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&queryResults,&local_e0,local_98,uVar8)
|
|
;
|
|
ehState = 0;
|
|
loopIndex = 0;
|
|
if (queryResults._size != 0) {
|
|
fVar14 = 0.0;
|
|
do {
|
|
EVar12 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(queryResults._data) + loopIndex * 4));
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x370)) != fVar14) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x188)) != 0)) {
|
|
if (fVar14 < (float)tipCapsule._entity) {
|
|
entityCapsule =
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetCollisionCapsule(local_50 + 4,&g_vectorZero);
|
|
bVar4 = Capsule::Collide(entityCapsule,GHIDRA_CAST<Capsule *>(&tipCapsule),&local_f0);
|
|
fVar14 = 0.0;
|
|
if ((bVar4 == 0) && (0.0 < (float)extraCapsule._flags)) {
|
|
entityCapsule =
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetCollisionCapsule(local_50 + 4,&g_vectorZero);
|
|
bVar4 = Capsule::Collide(entityCapsule,GHIDRA_CAST<Capsule *>(&extraCapsule),&local_f0);
|
|
fVar14 = 0.0;
|
|
if (bVar4 == 0) goto LAB_0096a6af;
|
|
}
|
|
}
|
|
piVar10 = GHIDRA_CAST<int *>((GHIDRA_INT(EVar12) + 0x28));
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
LAB_00969714:
|
|
iVar6 = *piVar10;
|
|
local_a8 = CONCAT44(piVar10,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
if (iVar6 - 10U < 0x3de) {
|
|
if (iVar6 == 1) goto LAB_0096972f;
|
|
goto LAB_0096973b;
|
|
}
|
|
LAB_00969f92:
|
|
if (local_7d == '\0') {
|
|
if (iVar6 == 4) {
|
|
if (((*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x3bc)) != (EntityPtr)player) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar12) + 0x448)) == '\0')) ||
|
|
(fVar14 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x350)) ||
|
|
fVar14 == *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x350)))) {
|
|
hitList = GetHitEntities(this);
|
|
bVar4 = (GHIDRA_CAST<EntityList *>((hitList)))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(EVar12));
|
|
if (bVar4 == 0) {
|
|
pvVar9 = GetHitEntities(this);
|
|
uVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(pvVar9,uVar8);
|
|
fVar14 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - knockbackOrigin->x;
|
|
local_84 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) - knockbackOrigin->y;
|
|
local_a8 = CONCAT44(fVar14,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
fVar15 = sqrtf(fVar14 * fVar14 + local_84 * local_84);
|
|
fVar14 = 0.0;
|
|
if (fVar15 <= 0.0) {
|
|
fVar16 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4)));
|
|
fVar15 = local_84;
|
|
}
|
|
else {
|
|
fVar16 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4))) * (1.0 / fVar15);
|
|
fVar15 = (1.0 / fVar15) * local_84;
|
|
}
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x36c));
|
|
if (fVar2 != 0.0) {
|
|
targetVelocityY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x =
|
|
(fVar16 * knockbackStrength) / fVar2 +
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) =
|
|
(fVar15 * knockbackStrength) / fVar2 + targetVelocityY;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LAB_0096a33e:
|
|
if ((player == GHIDRA_CAST<Entity_Player *>(0x0)) || (iVar6 != 2)) {
|
|
if ((((iVar6 == 5) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c)) != 100)) &&
|
|
((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x534)) == 0 || (this->_variant == 4)) &&
|
|
(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x173)) == 0)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x188)) != 0 &&
|
|
((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x168)) & 0x4000000) == 0)))))) &&
|
|
((local_d4 == (EntityPtr)0x0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d4) + 0x28)) != 2)))) {
|
|
hitList = GetHitEntities(this);
|
|
bVar4 = (GHIDRA_CAST<EntityList *>((hitList)))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(EVar12));
|
|
if (bVar4 == 0) {
|
|
pvVar9 = GetHitEntities(this);
|
|
uVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(pvVar9,uVar8);
|
|
fVar14 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - *GHIDRA_CAST<float *>(local_c0);
|
|
local_84 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) -
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_c0)) + 0x4))));
|
|
local_a8 = CONCAT44(fVar14,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
fVar15 = sqrtf(fVar14 * fVar14 + local_84 * local_84);
|
|
fVar14 = 0.0;
|
|
if (fVar15 <= 0.0) {
|
|
fVar16 = local_84;
|
|
fVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4)));
|
|
}
|
|
else {
|
|
fVar16 = local_84 * (1.0 / fVar15);
|
|
fVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4))) * (1.0 / fVar15);
|
|
}
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x36c));
|
|
if (fVar2 != 0.0) {
|
|
targetVelocityY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x =
|
|
(fVar15 * knockbackStrength) / fVar2 +
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) =
|
|
(fVar16 * knockbackStrength) / fVar2 + targetVelocityY;
|
|
}
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar6 = knife->_variant;
|
|
bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(EVar12))))->Entity_Pickup::CanBePickedUp(iVar6 == 4)
|
|
;
|
|
if ((bVar4 != 0) ||
|
|
(bVar4 = Entity_Pickup::IsChest(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c))),
|
|
bVar4 != 0)) {
|
|
ownerPlayer = player;
|
|
if ((iVar6 != 4) ||
|
|
(cVar5 = Entity_Player::bag_of_crafting_collect(EVar12),
|
|
cVar5 == '\0')) {
|
|
g_forceCollideDepth = g_forceCollideDepth + 1;
|
|
ownerPlayer->HandleCollision(EVar12,1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(EVar12) + 0x5c))(ownerPlayer,0);
|
|
g_forceCollideDepth = g_forceCollideDepth + -1;
|
|
}
|
|
fVar14 = 0.0;
|
|
}
|
|
}
|
|
bVar4 = Entity_Pickup::IsChest(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c)));
|
|
if (bVar4 != 0) {
|
|
local_b8 = 0;
|
|
if (*GHIDRA_CAST<int *>((extraout_EDX + 0x2c)) == 9) {
|
|
local_84 = 2.3509887e-38;
|
|
}
|
|
else {
|
|
local_84 = 0.0;
|
|
}
|
|
local_a8 = local_a8 & 0xffffffff;
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(EVar12) + 0x20);
|
|
EntityRef::constructor
|
|
(GHIDRA_CAST<EntityRef *>((local_50 + 4)),
|
|
*GHIDRA_CAST<Entity **>((extraout_EDX + 0x3bc)));
|
|
(*virtualFn)(damage,local_84,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a8)) + 0x4))),local_50 + 4,0x1e);
|
|
goto LAB_0096a6a9;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x3bc)) == (EntityPtr)player) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x0))) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<std_string *>((GHIDRA_INT(EVar12) + 0x428)))->_buf);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._l)) + 0x4))) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x42c));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x0))) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x430));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlagsCopy._h)) + 0x4))) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x434));
|
|
maskedFlags = BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(&local_60),&tearFlagsCopy,
|
|
&g_tearFlagLudovico);
|
|
if ((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(maskedFlags->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) != 0)) {
|
|
hitList = GetHitEntities(this);
|
|
bVar4 = (GHIDRA_CAST<EntityList *>((hitList)))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(EVar12));
|
|
if (bVar4 == 0) {
|
|
pvVar9 = GetHitEntities(this);
|
|
uVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(pvVar9,uVar8);
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_c0)) + 0x4))));
|
|
local_84 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - *GHIDRA_CAST<float *>(local_c0);
|
|
local_a8 = CONCAT44(fVar14,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
fVar15 = sqrtf(fVar14 * fVar14 + local_84 * local_84);
|
|
fVar14 = 0.0;
|
|
if (fVar15 <= 0.0) {
|
|
fVar16 = local_84;
|
|
fVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4)));
|
|
}
|
|
else {
|
|
fVar16 = local_84 * (1.0 / fVar15);
|
|
fVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4))) * (1.0 / fVar15);
|
|
}
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x = fVar16 * knockbackStrength * 1.25;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) = fVar15 * knockbackStrength * 1.25;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (iVar6 == 3) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c)) == 0xef) {
|
|
hitList = GetHitEntities(this);
|
|
bVar4 = (GHIDRA_CAST<EntityList *>((hitList)))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(EVar12));
|
|
if (bVar4 == 0) {
|
|
pvVar9 = GetHitEntities(this);
|
|
uVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(pvVar9,uVar8);
|
|
local_84 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - knockbackOrigin->x;
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) - knockbackOrigin->y;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a8)) + 0x4))) = GHIDRA_CAST<Room *>(fVar14);
|
|
fVar15 = sqrtf(local_84 * local_84 + fVar14 * fVar14);
|
|
fVar14 = local_84;
|
|
if (0.0 < fVar15) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a8)) + 0x4))) = GHIDRA_CAST<Room *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4))) * (1.0 / fVar15)));
|
|
fVar14 = local_84 * (1.0 / fVar15);
|
|
}
|
|
fVar15 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364));
|
|
fVar16 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x * 0.25;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x = fVar16;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) = fVar15 * 0.25;
|
|
fVar15 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x36c));
|
|
if (fVar15 != 0.0) {
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x =
|
|
fVar16 + (fVar14 * knockbackStrength) / fVar15;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) =
|
|
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4))) * knockbackStrength) / fVar15 + fVar2;
|
|
}
|
|
manager = g_manager;
|
|
local_a8 = CONCAT44(0x354,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>((GHIDRA_INT(&local_a8) + 4)));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_a8))) + 0x4))),1.0,2,0,1.0,0.0);
|
|
goto LAB_0096a6a9;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (iVar6 != 9) goto LAB_0096a33e;
|
|
if (((player != GHIDRA_CAST<Entity_Player *>(0x0)) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x173)) == 0)) &&
|
|
(-50.0 < *GHIDRA_CAST<float *>(((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar12) + 0x410)))->_filename)._buf))) {
|
|
local_84 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) - knockbackOrigin->y;
|
|
fVar14 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - knockbackOrigin->x;
|
|
local_a8 = CONCAT44(fVar14,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
fVar15 = sqrtf(local_84 * local_84 + fVar14 * fVar14);
|
|
fVar14 = 0.0;
|
|
if (fVar15 <= 0.0) {
|
|
fVar16 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4)));
|
|
fVar15 = local_84;
|
|
}
|
|
else {
|
|
fVar16 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a8)) + 0x4))) * (1.0 / fVar15);
|
|
fVar15 = local_84 * (1.0 / fVar15);
|
|
}
|
|
if (this->_variant != 4) {
|
|
local_128.x = fVar16 * knockbackStrength;
|
|
local_128.y = fVar15 * knockbackStrength;
|
|
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar12))))->Entity_Projectile::Reflect(unused,&local_128);
|
|
goto LAB_0096a6a9;
|
|
}
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x438)) = 0;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x43c)) = 0;
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x173)) = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
local_a8 = CONCAT44(piVar10,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
if (*piVar10 != 1) goto LAB_00969714;
|
|
iVar6 = 1;
|
|
LAB_0096972f:
|
|
if (EVar12 == this->_spawnerEntity) goto LAB_00969f92;
|
|
LAB_0096973b:
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x168)) & 0x20000000) != 0) goto LAB_00969f92;
|
|
hitList = GetHitEntities(this);
|
|
bVar4 = (GHIDRA_CAST<EntityList *>((hitList)))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(EVar12));
|
|
if (bVar4 != 0) goto LAB_0096a6af;
|
|
iVar6 = *(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a8))) + 0x4)));
|
|
if ((iVar6 != 0xf5) && (iVar6 != 0x124)) {
|
|
pvVar9 = GetHitEntities(this);
|
|
uVar8 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::GetHitListIndex();
|
|
sorted_vector_insert_unique(pvVar9,uVar8);
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x28));
|
|
this = knife;
|
|
}
|
|
ownerPlayer = player;
|
|
if (iVar6 == 0x21) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c)) == 0xb) goto LAB_009699e7;
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(EVar12) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_50 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(knife->_parent));
|
|
(*virtualFn)(0x447a0000,0,0,local_50 + 4,0x1e);
|
|
isHitAnything = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(isHitAnything)) + 0x1))),1);
|
|
}
|
|
else if (iVar6 == 0x3c3) {
|
|
g_forceCollideDepth = g_forceCollideDepth + 1;
|
|
player->HandleCollision(EVar12,1);
|
|
(**(code **)(*GHIDRA_CAST<int *>(EVar12) + 0x5c))(ownerPlayer,0);
|
|
g_forceCollideDepth = g_forceCollideDepth + -1;
|
|
}
|
|
else {
|
|
if (iVar6 == 0x390) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c)) == 100) {
|
|
fVar14 = 0.0;
|
|
if ((0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364))) &&
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) < (this->_pos).y)) {
|
|
EVar3 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar12) + 0x3bc));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar12) + 0xb64)) = 0x10;
|
|
if (EVar3 == (EntityPtr)0x0) {
|
|
pushDelta = &local_e0;
|
|
local_e0.x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - (this->_pos).x;
|
|
local_e0.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) - (this->_pos).y;
|
|
}
|
|
else {
|
|
pushDelta = &scratchVec;
|
|
scratchVec.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar3) + 0x33c)) - (this->_pos).x;
|
|
scratchVec.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar3) + 0x340)) - (this->_pos).y;
|
|
}
|
|
local_94 = (void *)pushDelta->x;
|
|
local_98 = pushDelta->y;
|
|
fVar14 = sqrtf((float)local_94 * (float)local_94 + local_98 * local_98);
|
|
local_b8 = CONCAT44(fVar14,(undefined4)local_b8);
|
|
if (fVar14 <= 0.0) {
|
|
fVar15 = local_98;
|
|
pvVar9 = local_94;
|
|
}
|
|
else {
|
|
fVar15 = local_98 * (18.0 / fVar14);
|
|
pvVar9 = (void *)((float)local_94 * (18.0 / fVar14));
|
|
}
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x = (float)pvVar9;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) = fVar15;
|
|
fVar14 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x334)))->x;
|
|
fVar15 = sqrtf(fVar14 * fVar14 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x338)) *
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x338)));
|
|
fVar14 = 0.0;
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4))) <= 0.0) {
|
|
pvVar9 = local_94;
|
|
fVar15 = local_98;
|
|
}
|
|
else {
|
|
fVar15 = (fVar15 + 0.1) / (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4)));
|
|
pvVar9 = (void *)((float)local_94 * fVar15);
|
|
fVar15 = local_98 * fVar15;
|
|
}
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x334)))->x = (float)pvVar9;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x338)) = fVar15;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x37c)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x37c)) + 1.0;
|
|
}
|
|
goto LAB_0096a6af;
|
|
}
|
|
}
|
|
else if (iVar6 == 0x11) goto LAB_0096a6a9;
|
|
LAB_009699e7:
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar12) + 0x173)) == 0) {
|
|
local_98 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x - knockbackOrigin->x;
|
|
local_94 = (void *)(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340)) - knockbackOrigin->y);
|
|
fVar14 = sqrtf(local_98 * local_98 + (float)local_94 * (float)local_94);
|
|
if (0.0 < fVar14) {
|
|
local_98 = (1.0 / fVar14) * local_98;
|
|
local_94 = (void *)((float)local_94 * (1.0 / fVar14));
|
|
}
|
|
if (((this->_variant == 9) &&
|
|
(ownerPlayer = GetPlayer(this), ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(0x3b,0), bVar4 != 0)) {
|
|
isBurningAxe = '\x01';
|
|
}
|
|
else {
|
|
isBurningAxe = '\0';
|
|
}
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar12) + 0x168)) & 0x4000000) == 0) {
|
|
fVar14 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x36c));
|
|
fVar15 = (knockbackStrength * 50.0) / (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x37c)) + 50.0);
|
|
if (fVar14 != 0.0) {
|
|
fVar16 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) =
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x39c)) * (float)local_94 * fVar15) / fVar14 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x360)))->x =
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x39c)) * local_98 * fVar15) / fVar14 + fVar16;
|
|
}
|
|
if (isBurningAxe != '\0') {
|
|
fVar14 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x37c)) - 10.0) / 70.0;
|
|
if (fVar14 <= 0.0) {
|
|
fVar14 = 0.0;
|
|
}
|
|
if (1.0 <= fVar14) {
|
|
fVar14 = 1.0;
|
|
}
|
|
fVar14 = 20.0 - fVar14 * 19.0;
|
|
local_b8 = CONCAT44(fVar14,(undefined4)local_b8);
|
|
dVar18 = floor((double)fVar14);
|
|
local_15c.x = local_98 * 16.0;
|
|
local_15c.y = (float)local_94 * 16.0;
|
|
local_b8 = CONCAT44((float)dVar18,(undefined4)local_b8);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_50 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
Entity::AddKnockback
|
|
(GHIDRA_CAST<Entity *>(EVar12),GHIDRA_CAST<EntityRef *>((local_50 + 4)),&local_15c,GHIDRA_INT(dVar18)
|
|
,1);
|
|
this = knife;
|
|
}
|
|
}
|
|
local_a8 = 0;
|
|
local_b8 = CONCAT44(GHIDRA_UINT((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) * 2 + 4,
|
|
(undefined4)local_b8);
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar4 == 0) || (player == GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
LAB_00969c8e:
|
|
local_9c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a8)) + 0x4)));
|
|
local_bc = GHIDRA_CAST<GridEntity *>(local_a8);
|
|
}
|
|
else {
|
|
if ((player->_hasCurseMistEffect != 0) ||
|
|
((player->_isCoopGhost != 0 || (player->_playerForms[0] < 3)))) {
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x97,0);
|
|
if (bVar4 != 0) {
|
|
uVar8 = Random();
|
|
if (uVar8 % (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_b8))) + 0x4))) == 0) goto LAB_00969c7c;
|
|
}
|
|
goto LAB_00969c8e;
|
|
}
|
|
LAB_00969c7c:
|
|
if (0x1d < player->_numBlueFlies) goto LAB_00969c8e;
|
|
local_9c = GHIDRA_CAST<Room *>(0x0);
|
|
local_bc = GHIDRA_CAST<GridEntity *>(0x4000);
|
|
}
|
|
if (this->_variant == 9) {
|
|
local_bc = GHIDRA_CAST<GridEntity *>((GHIDRA_UINT(local_bc) | 0x1000000));
|
|
}
|
|
if ((this->_flags & 0x400000000) != 0) {
|
|
local_bc = GHIDRA_CAST<GridEntity *>((GHIDRA_UINT(local_bc) | 0x20000000));
|
|
}
|
|
if (isBurningAxe != '\0') {
|
|
local_9c = GHIDRA_CAST<Room *>((GHIDRA_UINT(local_9c) | 2));
|
|
}
|
|
virtualFn = *(code **)(*GHIDRA_CAST<int *>(EVar12) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_50 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(knife->_parent));
|
|
cVar5 = (*virtualFn)(damage,local_bc,local_9c,local_50 + 4,0x1e);
|
|
if (cVar5 == '\0') {
|
|
pEVar11 = knife;
|
|
}
|
|
else {
|
|
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
manager = g_manager;
|
|
if (bVar4 == 0) {
|
|
pEVar11 = knife;
|
|
}
|
|
else {
|
|
local_a8 = CONCAT44(0x4d,GHIDRA_CAST<GridEntity *>(local_a8));
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>((GHIDRA_INT(&local_a8) + 4)));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_a8))) + 0x4))),1.0,10,0,1.5,0.0)
|
|
;
|
|
pEVar11 = knife;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = GHIDRA_UINT(hitTearFlags._l);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = GHIDRA_UINT(hitTearFlags._h);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(hitTearFlags._h)) + 0x4)));
|
|
Entity_Tear::ApplyTearFlagEffects
|
|
(GHIDRA_CAST<Entity *>(EVar12),&knife->_pos,flags,GHIDRA_CAST<Entity *>(knife),damage);
|
|
if (pEVar11->_variant == 3) {
|
|
iVar6 = player->_damageCooldown;
|
|
if (iVar6 < 1) {
|
|
*GHIDRA_CAST<int *>(&player->_flags) = GHIDRA_INT(player->_flags);
|
|
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&player->_flags) + 4));
|
|
*puVar1 = *puVar1 | 0x10;
|
|
pEVar11 = knife;
|
|
}
|
|
local_b8 = CONCAT44(0xf,(undefined4)local_b8);
|
|
piVar10 = GHIDRA_CAST<int *>((GHIDRA_INT(&local_b8) + 4));
|
|
if (0xe < iVar6) {
|
|
piVar10 = &player->_damageCooldown;
|
|
}
|
|
player->_damageCooldown = *piVar10;
|
|
}
|
|
if (isBurningAxe != '\0') {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>((local_50 + 4)))))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar12))))->Entity::AddBurn(GHIDRA_CAST<EntityRef *>((local_50 + 4)),0x5a,0.0,0);
|
|
}
|
|
}
|
|
if ((pEVar11->_variant == 9) &&
|
|
(bVar4 = drain_notched_axe(pEVar11,2), bVar4 != 0)) {
|
|
DAT_00c7ac6c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
(GHIDRA_CAST<EntityList_Query *>((&queryResults)))->EntityList_Query::~EntityList_Query();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
local_100.x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar12) + 0x33c)))->x;
|
|
local_100.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
apply_hit_effects(pEVar11,&tipPos,GHIDRA_CAST<Entity *>(EVar12),&local_100,
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x370)),damage,
|
|
CONCAT44(local_9c,local_bc),0);
|
|
}
|
|
if ((((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x14)) < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x380))) &&
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar11)) + 0x4e9))) == '\0')) && (pEVar11->_isFlying == 0)) &&
|
|
(fVar14 = 0.0, local_d4 != (EntityPtr)0x0)) {
|
|
fVar15 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d4) + 0x36c));
|
|
if (fVar15 != 0.0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d4) + 0x360)) =
|
|
(-local_98 * (float)local_d0) / fVar15 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d4) + 0x360));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d4) + 0x364)) =
|
|
(-(float)local_94 * (float)local_d0) / fVar15 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d4) + 0x364));
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar11)) + 0x4e9))) = 1;
|
|
if ((local_7d != '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d4) + 0x28)) != 2)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar11)) + 0x466))) = 0;
|
|
isHitAnything = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(isHitAnything)) + 0x1))),1);
|
|
goto LAB_0096a6af;
|
|
}
|
|
}
|
|
fVar14 = 0.0;
|
|
isHitAnything = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(isHitAnything)) + 0x1))),1);
|
|
goto LAB_0096a6af;
|
|
}
|
|
}
|
|
LAB_0096a6a9:
|
|
fVar14 = 0.0;
|
|
}
|
|
}
|
|
LAB_0096a6af:
|
|
loopIndex = loopIndex + 1;
|
|
if (GHIDRA_UINT(queryResults._size) <= loopIndex) break;
|
|
this = knife;
|
|
} while( true );
|
|
}
|
|
if (((char)isHitAnything == '\0') || (player == GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
this = knife;
|
|
}
|
|
else {
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x175,0);
|
|
this = knife;
|
|
if (bVar4 != 0) {
|
|
iVar6 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((knife)) + 0x4f4))));
|
|
if (iVar6 != 0) {
|
|
if (*GHIDRA_CAST<char *>((iVar6 + 0x4e4)) == '\0') {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddDeadEyeCharge();
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((iVar6 + 0x4e4)) = 1;
|
|
}
|
|
}
|
|
}
|
|
ehState = 0xffffffff;
|
|
if (this->_variant == 9) {
|
|
DAT_00c7ac6c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(queryResults)) + 0x0))) == '\0') {
|
|
ehState = 1;
|
|
tracked_alloc(1,queryResults._data,0);
|
|
ehState = 0xffffffff;
|
|
}
|
|
}
|
|
}
|
|
if (this->_subtype == 4) goto LAB_0096ae0c;
|
|
if (0 < *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ec))))) {
|
|
swingIndex = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ee))));
|
|
if ((GHIDRA_INT(swingIndex) & 1U) == 0) {
|
|
local_d0 = this->_parent;
|
|
if ((local_d0 != (EntityPtr)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d0) + 0x28)) == 8)) {
|
|
local_d0 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_d0) + 0x3bc));
|
|
}
|
|
EVar12 = local_d0;
|
|
local_d4 = (EntityPtr)(GHIDRA_INT(swingIndex) / 2 & 0xffffff01);
|
|
if (baseVariant == 1) {
|
|
curAnimName = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>(local_68))
|
|
;
|
|
local_e8 = 1.4013e-45;
|
|
puVar1 = &curAnimName->_size;
|
|
if (0xf < curAnimName->_capacity) {
|
|
curAnimName = *GHIDRA_CAST<std_string **>(curAnimName->_buf);
|
|
}
|
|
bVar4 = str_eq(GHIDRA_CAST<byte *>(curAnimName),*puVar1,GHIDRA_CAST<byte *>("Swing2"),6);
|
|
local_7d = '\x01';
|
|
if (bVar4 == 0) goto LAB_0096a80d;
|
|
}
|
|
else {
|
|
LAB_0096a80d:
|
|
local_7d = '\0';
|
|
}
|
|
if ((GHIDRA_UINT(local_e8) & 1) != 0) {
|
|
(GHIDRA_CAST<std::string *>((local_68)))->std::string::_Tidy_deallocate();
|
|
}
|
|
if (local_7d != '\0') {
|
|
local_d4 = (EntityPtr)(GHIDRA_UINT(local_d4) ^ 1);
|
|
}
|
|
if (EVar12 != (EntityPtr)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x28)) == 1) {
|
|
local_e8 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x1480)) - 260.0) * 0.15;
|
|
if (local_e8 <= 0.0) {
|
|
local_e8 = 0.0;
|
|
}
|
|
local_e8 = local_e8 + 4.0;
|
|
swingDistance = local_e8;
|
|
}
|
|
else {
|
|
local_e8 = 4.0;
|
|
}
|
|
if (this->_variant == 3) {
|
|
auVar17 = ZEXT812(0x41a00000);
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar17)) + 0x0))) <= local_e8) {
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar17)) + 0x4))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar17)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar17)) + 0x0))) = local_e8;
|
|
}
|
|
swingDistance = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar17)) + 0x0)));
|
|
local_e8 = swingDistance;
|
|
}
|
|
local_b8 = CONCAT44((this->_sprite)._scale.x,(undefined4)local_b8);
|
|
uVar8 = Random();
|
|
scratchVec.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x33c));
|
|
scratchVec.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x340));
|
|
uVar20 = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Knife::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar19 = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(8,this->_variant,&scratchVec,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this->_spawnerEntity),4,uVar8);
|
|
pEVar11 = (Entity_Knife *)
|
|
__RTDynamicCast(spawnedEntity,uVar19,castSrcType,castDstType,uVar20);
|
|
local_c0 = pEVar11;
|
|
if (pEVar11 == this) {
|
|
this->Remove();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar11))))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_d0));
|
|
swingIndex = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ee))));
|
|
(pEVar11->_targetPosition).y = 0.0;
|
|
if (swingIndex == 0) {
|
|
(pEVar11->_targetPosition).x = swingDistance;
|
|
pEVar11->_rotation = this->_rotation + this->_rotationOffset;
|
|
}
|
|
else {
|
|
(pEVar11->_targetPosition).x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4))) * 5.0 * (float)GHIDRA_INT(swingIndex) + local_e8;
|
|
uVar8 = Random();
|
|
pEVar11->_rotation =
|
|
((float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 30.0 - 15.0) + this->_rotation + this->_rotationOffset;
|
|
uVar8 = Random();
|
|
SoundEffects::PlayWithFartOverride
|
|
(0xfc,1.0,1,0,
|
|
(float)((double)GHIDRA_INT(uVar8) + __uint_to_double_fixup[-(GHIDRA_INT(uVar8) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.9);
|
|
}
|
|
pEVar11->_mass = this->_mass;
|
|
(pEVar11->_posOffset).x = (this->_posOffset).x;
|
|
(pEVar11->_posOffset).y = (this->_posOffset).y;
|
|
pEVar11->SetColor(&(this->_sprite)._color,0xffffffff,0xff,0,1);
|
|
(pEVar11->_sprite)._scale.x = (this->_sprite)._scale.x;
|
|
(pEVar11->_sprite)._scale.y = (this->_sprite)._scale.y;
|
|
uVar19 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
tearFlagsHigh = (this->_tearFlags)._h;
|
|
uVar20 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
iVar6 = *GHIDRA_CAST<int *>(pEVar11);
|
|
*GHIDRA_CAST<int *>(&(pEVar11->_tearFlags)._l) = GHIDRA_INT((this->_tearFlags)._l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(pEVar11->_tearFlags)._l) + 4)) = uVar19;
|
|
*GHIDRA_CAST<int *>(&(pEVar11->_tearFlags)._h) = GHIDRA_INT(tearFlagsHigh);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(pEVar11->_tearFlags)._h) + 4)) = uVar20;
|
|
(**(code **)(iVar6 + 0x40))(this->_collisionDamage);
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pEVar11)) + 0x4f4)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(this));
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4f8)))))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(pEVar11));
|
|
if (baseVariant == 1) {
|
|
anim = "Swing";
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_d4)) + 0x0))) == '\0') {
|
|
anim = "Swing2";
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((&pEVar11->_sprite)))->ANM2::Play(GHIDRA_CAST<byte *>(anim),1);
|
|
SetAttackAnimation(pEVar11);
|
|
}
|
|
else if (baseVariant == 10) {
|
|
if (this->_isFlying != 0) {
|
|
(pEVar11->_pos).x = (this->_pos).x;
|
|
(pEVar11->_pos).y = (this->_pos).y;
|
|
}
|
|
if (this->_isSpinAttack == 0) {
|
|
SetAttackAnimation(pEVar11);
|
|
}
|
|
else {
|
|
iVar6 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame();
|
|
SpinAttack(pEVar11,1,iVar6);
|
|
}
|
|
(pEVar11->_sprite)._rotation = (this->_sprite)._rotation;
|
|
}
|
|
pEVar11->Update();
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x44,0);
|
|
if (bVar4 != 0) {
|
|
fVar14 = normalize_angle_degrees(this->_rotationOffset);
|
|
local_b8 = CONCAT44(((fVar14 * 60.0) / 180.0 + tipRadius + tipDistance) * scaleY,
|
|
(undefined4)local_b8);
|
|
uVar8 = Random();
|
|
ownerPlayer = player;
|
|
local_f8.x = (pEVar11->_pos).x;
|
|
local_f8.y = (pEVar11->_pos).y;
|
|
uVar20 = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar19 = 0;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(7,2,&local_f8,&g_vectorZero,GHIDRA_CAST<Entity *>(player),3,uVar8)
|
|
;
|
|
ownerPlayer = GHIDRA_CAST<Entity *>(__RTDynamicCast(spawnedEntity,uVar19,castSrcType,castDstType,uVar20))
|
|
;
|
|
laserColor = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::get_laser_color_copy(GHIDRA_CAST<ColorMod *>(local_50));
|
|
ownerPlayer->SetColor(laserColor,0xffffffff,0xff,0,1);
|
|
this = knife;
|
|
(ownerPlayer->_posOffset).x = (knife->_posOffset).x;
|
|
(ownerPlayer->_posOffset).y = (knife->_posOffset).y;
|
|
(GHIDRA_CAST<Entity *>((ownerPlayer)))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_c0));
|
|
iVar6 = *GHIDRA_CAST<int *>(ownerPlayer);
|
|
ownerPlayer->_renderDepthOffset = 3000.0;
|
|
uVar19 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
|
|
tearFlagsHigh = (this->_tearFlags)._h;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
|
|
*GHIDRA_CAST<int *>(&ownerPlayer[1]._pendingDamageFlags) = GHIDRA_INT((this->_tearFlags)._l);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&ownerPlayer[1]._pendingDamageFlags) + 4)) = uVar19;
|
|
ownerPlayer[1]._index = GHIDRA_INT(tearFlagsHigh);
|
|
ownerPlayer[1]._collisionIndex = iVar7;
|
|
(**(code **)(iVar6 + 0x40))(this->_collisionDamage);
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ownerPlayer[1]._sprite._color._colorize) + 5)) = 1;
|
|
spawnedEntity = ownerPlayer + 1;
|
|
(spawnedEntity->_sprite)._filename._buf[0] = '\x03';
|
|
(spawnedEntity->_sprite)._filename._buf[1] = '\0';
|
|
(spawnedEntity->_sprite)._filename._buf[2] = '\0';
|
|
(spawnedEntity->_sprite)._filename._buf[3] = '\0';
|
|
*GHIDRA_CAST<float *>(&ownerPlayer[1]._sprite._overlayAnimState._isPlaying) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4)));
|
|
(GHIDRA_CAST<Entity *>((ownerPlayer)))->Entity::SetSpawnerEntity(GHIDRA_CAST<Entity *>(player));
|
|
ownerPlayer->Update();
|
|
pEVar11 = local_c0;
|
|
}
|
|
if ((((EntityPtr)player == local_d0) && (isToolVariant == '\0')) &&
|
|
(bVar4 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x19a,0), bVar4 != 0)) {
|
|
iVar7 = 0xf - GHIDRA_INT(player->_luck);
|
|
iVar6 = 5;
|
|
if (5 < iVar7) {
|
|
iVar6 = iVar7;
|
|
}
|
|
iVar6 = Isaac::Random(iVar6);
|
|
if (iVar6 == 0) {
|
|
uVar8 = Random();
|
|
fVar14 = pEVar11->_rotation * 0.017453292;
|
|
local_b8 = CONCAT44(fVar14,(undefined4)local_b8);
|
|
local_f8.x = cos(fVar14);
|
|
local_f8.x = local_f8.x * 3.0;
|
|
local_f8.y = sin((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4))));
|
|
this = knife;
|
|
local_f0.x = (pEVar11->_pos).x;
|
|
local_f8.y = local_f8.y * 3.0;
|
|
local_f0.y = (pEVar11->_pos).y;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x54,&local_f0,&local_f8,GHIDRA_CAST<Entity *>(knife->_spawnerEntity),
|
|
10,uVar8);
|
|
(GHIDRA_CAST<Entity *>((spawnedEntity)))->Entity::SetParent(GHIDRA_CAST<Entity *>(player));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ec)))) = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ec)))) + -1;
|
|
swingIndex = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ee))));
|
|
}
|
|
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4ee)))) = swingIndex + 1;
|
|
}
|
|
if ((((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) &&
|
|
((player != GHIDRA_CAST<Entity_Player *>(0x0) && (this->_isPrimaryClub != 0)))) {
|
|
if (this->_isDeadEyeHit == 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::ClearDeadEyeCharge();
|
|
}
|
|
this->_isDeadEyeHit = 0;
|
|
}
|
|
LAB_0096ae0c:
|
|
if ((((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) ||
|
|
((baseVariant == 10 &&
|
|
(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x466))) != '\0' &&
|
|
(bVar4 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST<byte *>("SwingEnd")),
|
|
bVar4 != 0)))))) {
|
|
this->_isSwinging = 0;
|
|
}
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|