Files
isaac-port/generated-src/weapon_bone.cpp
T
shweetandClaude Opus 5.5 69a354f843 Curation round 8: the first room plays: Isaac walks and shoots tears
Eight agents took over Room::Init's pieces, RailManager, Room::Render/render_lighting/Update, the GridEntity hierarchy
(walls, doors, rocks, pits, poop ...), Game::Update and interpolate_update, the run's save, update_ingame_input,
Game::Spawn with the entity factory and grid collision, the player's movement and tears through Weapon/Weapon_Tears,
PlayerManager's positions, the camera focus, MinimapConfig, PlayerHUD, mod shader rendering, Entity_Tear and
Entity_Effect. Integration wrote Level::get_secret_exit_kind, shared the secret-exit enum (four copies merged) and
fixed the generator's vtable-stub check (word boundary and namespace, not a substring).
Under gdb a run reaches the first room: doors, HUD with hearts and minimap, WASD movement with acceleration, arrow-key
tears that fly and splash. Floor and walls (Backdrop::RenderFloor/RenderWalls) and room transitions are next.
The official build/isaac reaches the start room and stops at Entity_NPC::Redirect. 2770 functions taken over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 06:43:01 -05:00

2762 lines
132 KiB
C++

#include "classes.h"
// 009fa220
void Weapon_Bone::Update(uint8_t isInterpolated)
{
void *player = this;
int iVar1;
uint8_t isCheck;
Entity_Player *owner;
float *extraout_EAX;
Entity_Player *player;
Entity_Player *playerOwner;
float fVar2;
float offsetX;
float chargeStep;
float flyingOffsetX;
Vector flyingOffset;
owner = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(player) + 4));
playerOwner = owner;
if (owner == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_009fa24f:
player = GHIDRA_CAST<Entity_Player *>(0x0);
if ((owner != GHIDRA_CAST<Entity_Player *>(0x0)) && (owner->_type == 1)) goto LAB_009fa25f;
}
else {
if (owner->_type == 1) {
player = owner;
goto LAB_009fa25f;
}
if (owner->_type != 3) goto LAB_009fa24f;
player = *GHIDRA_CAST<Entity_Player **>(&owner->_isControlsEnabled);
}
playerOwner = GHIDRA_CAST<Entity_Player *>(0x0);
LAB_009fa25f:
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x30)) == 0xb) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(player) + 0x10)) = 0x41700000;
if ((player != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(isCheck = Entity_Player::HasCollectible(player,0x3b,0), isCheck != 0)) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(player) + 0x10)) = 0x40c00000;
}
owner = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(player) + 4));
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(player) + 0x34)) = 0x80000000;
}
fVar2 = -10.0;
offsetX = 0.0;
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (playerOwner == GHIDRA_CAST<Entity_Player *>(0x0)) {
offsetX = (owner->_sprite)._scale.x * 0.0;
if (owner->_type == 3) {
fVar2 = (owner->_sprite)._scale.y * -20.0;
}
else {
fVar2 = (owner->_sprite)._scale.y * -10.0;
}
}
else {
fVar2 = (playerOwner->_playerSpriteScale).x;
if (fVar2 <= 1.0) {
fVar2 = 1.0;
}
iVar1 = playerOwner->_entityGridCollisionClass;
if ((((iVar1 == 0) || (iVar1 == 3)) || (iVar1 == 1)) || (iVar1 == 2)) {
Entity_Player::GetFlyingOffset(playerOwner,&flyingOffset);
flyingOffsetX = *extraout_EAX / 0.65 + 0.0;
flyingOffset.x = extraout_EAX[1] / 0.65 - 10.0;
}
else {
flyingOffsetX = 0.0;
flyingOffset.x = -10.0;
}
isCheck = TemporaryEffects::HasCollectibleEffect(&playerOwner->_temporaryeffects,0x271);
if (isCheck != 0) {
fVar2 = fVar2 * 4.0;
}
offsetX = flyingOffsetX * fVar2 + (playerOwner->_posOffset).x;
fVar2 = flyingOffset.x * fVar2 + (playerOwner->_posOffset).y;
}
}
chargeStep = 1.0;
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x44));
if (iVar1 != 0) {
*GHIDRA_CAST<float *>((iVar1 + 0x34c)) = offsetX;
*GHIDRA_CAST<float *>((iVar1 + 0x350)) = fVar2;
}
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x48));
if (iVar1 != 0) {
*GHIDRA_CAST<float *>((iVar1 + 0x34c)) = offsetX;
*GHIDRA_CAST<float *>((iVar1 + 0x350)) = fVar2;
}
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x4c));
if (iVar1 != 0) {
*GHIDRA_CAST<float *>((iVar1 + 0x34c)) = offsetX;
*GHIDRA_CAST<float *>((iVar1 + 0x350)) = fVar2;
}
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x50));
if (iVar1 != 0) {
*GHIDRA_CAST<float *>((iVar1 + 0x34c)) = offsetX;
*GHIDRA_CAST<float *>((iVar1 + 0x350)) = fVar2;
}
if ((isInterpolated == 0) && (-1.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0xc)))) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 4)) != 0) {
chargeStep = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 4)) + 0x39c));
}
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0xc)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0xc)) - chargeStep;
}
return;
}
// 009fa450
void Weapon_Bone::Fire(Vector *direction, uint8_t isShooting, uint8_t isInterpolated)
{
Entity_Bomb *pEVar1;
code *pcVar2;
Manager *pMVar3;
uint8_t bVar4;
Vector *pVVar5;
uint32_t uVar6;
TearParams *pTVar7;
BitSet128 *pBVar8;
Vector *pVVar9;
Entity_Player **ppEVar10;
int *effectIt;
std_string *anim;
float *clampedValue;
uint32_t rngResult;
Entity_Bomb **ppEVar11;
Entity_Tear *fetusTear;
Entity_Knife *club;
char cVar12;
uint8_t extraout_CL;
uint8_t extraout_CL_00;
Entity_Player *pEVar13;
int unusedCollectibleId;
int extraout_ECX;
int extraout_ECX_00;
undefined3 uVar20;
uint32_t rngResult;
int *piVar15;
int extraout_ECX_01;
uint3 uVar21;
int iVar16;
float *extraout_ECX_02;
float *extraout_ECX_03;
float *extraout_ECX_04;
void *pvVar17;
float *pfVar18;
int unused;
float *extraout_ECX_05;
Entity_Player *pEVar19;
float *extraout_ECX_06;
float *extraout_ECX_07;
float *extraout_ECX_08;
int extraout_ECX_09;
int extraout_ECX_10;
float *extraout_ECX_11;
int unused_00;
float *extraout_ECX_12;
Entity_Knife *extraout_ECX_13;
Entity_Knife *extraout_ECX_14;
Entity_Knife *extraout_ECX_15;
Entity_Knife *unused_01;
float *extraout_ECX_16;
int extraout_ECX_17;
int extraout_ECX_18;
float *extraout_ECX_19;
float *extraout_ECX_20;
float *extraout_ECX_21;
uint8_t *puVar22;
int *extraout_EDX;
Entity_Player *this_00;
void **heldEntitySlot;
float fVar23;
uint8_t auVar24 [16];
float fVar25;
float fVar26;
Entity_Bomb *pEVar27;
float fVar28;
double dVar29;
undefined3 in_stack_00000009;
undefined3 in_stack_0000000d;
int iVar30;
BitSet128 *b;
Entity *pEVar31;
uint8_t local_2f8 [36];
uint32_t uStack_2d4;
uint8_t *local_2d0;
float fStack_2cc;
int lanesPerEye;
float fStack_2c4;
float fStack_2c0;
float local_2bc;
void *pvStack_2b8;
float fStack_2b4;
uint8_t *puStack_2b0;
uint8_t local_2ac [8];
Vector local_2a4;
uint32_t local_29c;
Entity_Bomb *local_298;
Entity_Player *maxCharge;
uint32_t isBrimstone;
Vector *aimDirection;
uint32_t local_288;
Entity_Bomb *local_284;
float damageMultiplier;
uint8_t local_27c [8];
Vector local_274;
Vector ownerVelocityX;
Vector local_264;
uint32_t isCursedEye;
Vector local_258;
float local_250;
Vector local_24c;
uint32_t isCSection;
Vector ownerPos;
Vector local_238;
Entity_Player *shotSpeed;
int weaponType;
Entity_Player *chargeThreshold;
Entity_Player *maxFireDelay;
Vector local_220;
Vector local_218;
Entity_Player *newCharge;
Entity_Player *clubScale;
uint8_t *local_208;
char isEpicFetus;
char isReleased;
Entity_Player *local_200;
char local_1f9;
Vector shotDirection;
Vector local_1f0;
Entity_Player *ownerPlayer;
Vector local_1e4;
uint8_t isChocolateMilk;
Entity_Bomb *local_1d8;
uint16_t local_1d2;
Entity_Knife *heldClub;
Entity_Player *player;
char isChargeMode;
char isDrFetus;
uint8_t local_1c6;
uint8_t local_1c5;
uint8_t local_1c4 [8];
int tearBombVariant;
Color tearColor;
BitSet128 tearFlags;
Entity_Player *tearDamage;
float tearScale;
float tearHeight;
uint32_t uStack_16c;
uint32_t local_168;
float local_164;
float local_160;
TearParams local_158;
Color flashColor;
uint8_t local_c4 [24];
float fStack_ac;
float fStack_a8;
Vector local_a4;
uint8_t *local_9c;
uint8_t chargeColor [40];
uint8_t *puStack_70;
uint8_t local_6c [28];
uint8_t local_50 [4];
void *pvStack_4c;
void *pvStack_48;
uint8_t *puStack_44;
uint8_t clubFlashColor [32];
Vector VStack_20;
uint8_t *puStack_18;
void *securityCookie;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
uint32_t *bombFlagsHigh;
int *effectsEnd;
Entity_Player *owner;
uint64_t savedBombFlags;
local_8 = -NAN;
puStack_c = &LAB_00b106ce;
local_10 = ExceptionList;
securityCookie = (void *)(__security_cookie ^ GHIDRA_UINT((clubFlashColor + 0x3c)));
ExceptionList = &local_10;
aimDirection = direction;
iVar30 = _isShooting;
owner = _isInterpolated;
ownerVelocityX.y = (float)this;
Weapon::Fire(this,direction,isShooting,isInterpolated);
weaponType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x30));
pEVar19 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 4));
pEVar13 = pEVar19;
if (pEVar19 == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_009fa53d:
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
player = pEVar19;
if (pEVar19 == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_009fa4db:
}
else {
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
if (pEVar19->_type == 1) goto LAB_009fa525;
}
this_00 = ownerPlayer;
if (pEVar19 != GHIDRA_CAST<Entity_Player *>(0x0)) {
player = GHIDRA_CAST<Entity_Player *>(0x0);
if (pEVar19->_type == 1) goto LAB_009fa525;
ownerPlayer = this_00;
if (pEVar19->_type == 3) {
player = GHIDRA_CAST<Entity_Player *>(0x0);
pEVar13 = *GHIDRA_CAST<Entity_Player **>(&pEVar19->_isControlsEnabled);
if (*GHIDRA_CAST<Entity_Player **>(&pEVar19->_isControlsEnabled) != GHIDRA_CAST<Entity_Player *>(0x0))
goto LAB_009fa525;
}
}
shotSpeed = GHIDRA_CAST<Entity_Player *>(0x3f800000);
player = GHIDRA_CAST<Entity_Player *>(0x0);
if (pEVar19 != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009fa572;
ownerPos.x = g_vectorZero.x;
player = GHIDRA_CAST<Entity_Player *>(0x0);
shotSpeed = GHIDRA_CAST<Entity_Player *>(0x3f800000);
ownerPos.y = g_vectorZero.y;
}
else {
if (pEVar19->_type != 1) {
if (pEVar19->_type != 3) goto LAB_009fa53d;
ownerPlayer = *GHIDRA_CAST<Entity_Player **>(&pEVar19->_isControlsEnabled);
goto LAB_009fa4db;
}
player = pEVar19;
ownerPlayer = pEVar19;
LAB_009fa525:
shotSpeed = GHIDRA_CAST<Entity_Player *>(pEVar13->_shotspeed);
this_00 = ownerPlayer;
LAB_009fa572:
ownerPos.x = (pEVar19->_pos).x;
ownerPos.y = (pEVar19->_pos).y;
}
local_200 = player;
uVar6 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x34));
isChocolateMilk = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 0x34)) & 1;
isCursedEye = uVar6 >> 1 & 0xffffff01;
isBrimstone = uVar6 >> 2 & 0xffffff01;
local_1f0.y = (float)this_00;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = shotSpeed;
local_250 = (float)(uVar6 >> 3 & 0xffffff01);
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x30)) == 0xb) || (this_00 == GHIDRA_CAST<Entity_Player *>(0x0))) {
LAB_009fa64b:
isDrFetus = '\0';
if ((weaponType != 0xb) && (this_00 != GHIDRA_CAST<Entity_Player *>(0x0))) goto LAB_009fa65b;
LAB_009fa671:
isEpicFetus = '\0';
}
else {
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0x34;
bVar4 = Entity_Player::HasCollectible(this_00,0x34,0);
if (bVar4 == 0) goto LAB_009fa64b;
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0xa8;
bVar4 = Entity_Player::HasCollectible(this_00,0xa8,0);
if (bVar4 != 0) goto LAB_009fa64b;
isDrFetus = '\x01';
LAB_009fa65b:
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0xa8;
bVar4 = Entity_Player::HasCollectible(this_00,0xa8,0);
if (bVar4 == 0) goto LAB_009fa671;
isEpicFetus = '\x01';
}
if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x34)) >> 4 & 1) == 0) || (local_1f9 = '\x01', isEpicFetus != '\0')) {
local_1f9 = '\0';
}
if ((weaponType == 0xb) || (this_00 == GHIDRA_CAST<Entity_Player *>(0x0))) {
LAB_009fa6bd:
local_1c6 = '\0';
}
else {
owner = GHIDRA_CAST<Entity_Player *>(0x2c0);
iVar30 = 0x9fa6b2;
bVar4 = TemporaryEffects::HasCollectibleEffect(&this_00->_temporaryeffects,0x2c0);
local_1c6 = '\x01';
if (bVar4 == 0) goto LAB_009fa6bd;
}
isCSection = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x34)) >> 0xb & 0xffffff01;
uVar6 = isCSection;
if (((isChocolateMilk == 0) && ((char)isCursedEye == '\0')) && ((char)isBrimstone == '\0')) {
isChargeMode = '\0';
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_250)) + 0x0))) != '\0') goto LAB_009fa703;
}
else {
LAB_009fa703:
isChargeMode = '\x01';
}
if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x34)) >> 7 & 1) != 0) || (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x10)) <= 0.0)) {
pfVar18 = GHIDRA_CAST<float *>((GHIDRA_INT(this) + 0x10));
local_1e4.y = 0.001;
local_1c5 = 1;
player = local_200;
shotSpeed = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0)));
clampedValue = &local_1e4.y;
if (0.001 < *pfVar18 || *pfVar18 == 0.001) {
clampedValue = pfVar18;
}
ownerPlayer = GHIDRA_CAST<Entity_Player *>(local_1f0.y);
chargeThreshold = GHIDRA_CAST<Entity_Player *>(*clampedValue);
local_1e4.y = (float)chargeThreshold;
maxFireDelay = chargeThreshold;
this_00 = GHIDRA_CAST<Entity_Player *>(local_1f0.y);
if ((char)isCSection != '\0') {
isChargeMode = '\x01';
local_1c5 = 1;
isDrFetus = isDrFetus;
goto LAB_009fa822;
}
}
else {
pfVar18 = GHIDRA_CAST<float *>((GHIDRA_INT(this) + 0x10));
local_1e4.y = 0.001;
local_1c5 = 0;
clampedValue = &local_1e4.y;
if (0.001 < *pfVar18 || *pfVar18 == 0.001) {
clampedValue = pfVar18;
}
chargeThreshold = GHIDRA_CAST<Entity_Player *>(*clampedValue);
maxFireDelay = chargeThreshold;
LAB_009fa822:
local_1e4.y = (float)chargeThreshold;
}
isReleased = '\0';
isCSection = uVar6;
chargeThreshold = GHIDRA_CAST<Entity_Player *>(local_1e4.y);
maxFireDelay = GHIDRA_CAST<Entity_Player *>(local_1e4.y);
if (this_00 == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_009fa84b:
local_200 = GHIDRA_CAST<Entity_Player *>(0x1);
if (local_1c6 != '\0') {
local_200 = GHIDRA_CAST<Entity_Player *>(0x3);
}
}
else {
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0x72;
bVar4 = Entity_Player::HasCollectible(this_00,0x72,0);
if (bVar4 == 0) goto LAB_009fa84b;
local_200 = GHIDRA_CAST<Entity_Player *>(0x2);
}
fVar23 = 2.0;
if (weaponType == 0xb) {
local_200 = GHIDRA_CAST<Entity_Player *>(&DAT_00000009);
}
if ((((char)isCursedEye == '\0') && ((char)isCSection == '\0')) || (isChocolateMilk != 0)) {
fVar23 = 3.0;
}
local_1c6 = isShooting;
maxCharge = GHIDRA_CAST<Entity_Player *>((fVar23 * (float)maxFireDelay));
local_258.y = fVar23 * (float)maxFireDelay;
chargeThreshold = GHIDRA_CAST<Entity_Player *>(((float)chargeThreshold + local_1e4.y));
if ((isEpicFetus != '\0') && (player != GHIDRA_CAST<Entity_Player *>(0x0))) {
if ((isShooting == 0) ||
((((pvVar17 = player->_heldEntity, pvVar17 == (void *)0x0 ||
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar17) + 0x171)) != '\0')) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar17) + 0x28)) != 1000)) ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar17) + 0x2c)) != 0x76)))) {
if ((*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x58)) != GHIDRA_CAST<int *>(0x0)) && (isInterpolated == 0)) {
owner = GHIDRA_CAST<Entity_Player *>(0x9fab42);
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x58)) + 0x28))();
}
}
else {
iVar30 = 10;
owner = player;
Weapon::SetBlinkTime(this,10,GHIDRA_INT(player));
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x58)) == 0) {
if (isInterpolated == 0) {
owner = GHIDRA_CAST<Entity_Player *>(Random());
iVar30 = 0;
local_1f0.y = (float)Game::Spawn(g_game,1000,0x1e,&ownerPos,&g_vectorZero,
*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4)),0,GHIDRA_UINT(owner));
((GHIDRA_CAST<Entity_Player *>(local_1f0.y))->_bodySprite)._animState._animFrame = 0.0;
*GHIDRA_CAST<uint32_t *>(&((GHIDRA_CAST<Entity_Player *>(local_1f0.y))->_bodySprite)._animState._isPlaying) = 0;
pEVar19 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x58));
if (pEVar19 != GHIDRA_CAST<Entity_Player *>(local_1f0.y)) {
if (pEVar19 != GHIDRA_CAST<Entity_Player *>(0x0)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(this) + 0x58));
msvc::multiset<unsigned_int>::erase();
}
owner = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(this) + 0x58));
*GHIDRA_CAST<float *>(owner) = local_1f0.y;
iVar30 = 0x9fa9ca;
msvc::multiset<unsigned_int>::insert();
pEVar19 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x58));
}
if (pEVar19 != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009fa9d5;
}
}
else {
LAB_009fa9d5:
local_238.x = aimDirection->x;
local_238.y = aimDirection->y;
local_208 = GHIDRA_CAST<uint8_t *>(local_238.y);
local_1e4.y = local_238.x;
if (1.0 < local_238.x * local_238.x + local_238.y * local_238.y) {
(GHIDRA_CAST<Vector *>((&local_238)))->Vector::Normalize();
local_208 = GHIDRA_CAST<uint8_t *>(local_238.y);
local_1e4.y = local_238.x;
}
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0x166;
local_238.x = local_1e4.y;
local_238.y = (float)local_208;
bVar4 = Entity_Player::HasCollectible(player,0x166,0);
if (bVar4 == 0) {
LAB_009faadb:
pEVar19 = GHIDRA_CAST<Entity_Player *>(local_1e4.y);
}
else {
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0xf5;
bVar4 = Entity_Player::HasCollectible(player,0xf5,0);
if (bVar4 != 0) goto LAB_009faadb;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = cos(0.7853982);
owner = GHIDRA_CAST<Entity_Player *>(0x9faa98);
fVar23 = sin(0.7853982);
fVar25 = fVar23 * (float)local_208;
local_208 = (uint8_t *)
(fVar23 * local_1e4.y + (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) * (float)local_208);
pEVar19 = GHIDRA_CAST<Entity_Player *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) * local_1e4.y - fVar25));
}
iVar16 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x58));
*GHIDRA_CAST<float *>((iVar16 + 0x360)) =
(float)pEVar19 * 8.0 * *GHIDRA_CAST<float *>((iVar16 + 0x39c)) + *GHIDRA_CAST<float *>((iVar16 + 0x360));
*GHIDRA_CAST<float *>((iVar16 + 0x364)) =
(float)local_208 * 8.0 * *GHIDRA_CAST<float *>((iVar16 + 0x39c)) + *GHIDRA_CAST<float *>((iVar16 + 0x364));
}
}
}
iVar16 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
clubScale = GHIDRA_CAST<Entity_Player *>(0x3f800000);
if (iVar16 != 0) {
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
pVVar9 = GHIDRA_CAST<Vector *>((iVar16 + 0xe4));
pVVar5 = GHIDRA_CAST<Vector *>(local_1c4);
if (*GHIDRA_CAST<int *>((iVar16 + 0x28)) != 3) {
if (1.0 < pVVar9->x) {
pVVar5 = pVVar9;
}
goto LAB_009fabed;
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = pVVar9->x * 0.8;
local_1f0.y = 0.8;
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) <= 0.8) {
pVVar5 = GHIDRA_CAST<Vector *>(&local_1f0.y);
}
}
else {
local_238.x = (player->_playerSpriteScale).x;
local_238.y = (player->_playerSpriteScale).y;
pVVar5 = &local_238;
if (local_238.x <= 1.0) {
pVVar5 = GHIDRA_CAST<Vector *>(local_1c4);
}
LAB_009fabed:
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x3f800000);
}
clubScale = GHIDRA_CAST<Entity_Player *>(pVVar5->x);
}
if ((this_00 != GHIDRA_CAST<Entity_Player *>(0x0)) && (weaponType != 0xb)) {
bVar4 = TemporaryEffects::HasCollectibleEffect(&this_00->_temporaryeffects,0x271);
if (bVar4 != 0) {
clubScale = GHIDRA_CAST<Entity_Player *>(((float)clubScale * 4.0));
}
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0xa9;
bVar4 = Entity_Player::HasCollectible(this_00,0xa9,0);
if (bVar4 == 0) {
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0x213;
bVar4 = Entity_Player::HasCollectible(this_00,0x213,0);
if (bVar4 != 0) {
clubScale = GHIDRA_CAST<Entity_Player *>(((float)clubScale * 1.5));
}
}
else {
clubScale = GHIDRA_CAST<Entity_Player *>(((float)clubScale + (float)clubScale));
}
}
if ((local_1f9 != '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x54)) == 0)) {
TearParams::constructor(GHIDRA_CAST<TearParams *>((local_1c4 + 4)));
if (this_00 != GHIDRA_CAST<Entity_Player *>(0x0)) {
pEVar31 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4));
uVar6 = Random();
this_00 = ownerPlayer;
pTVar7 = Entity_Player::GetTearHitParams
(ownerPlayer,&local_158,8,1.0,(uVar6 & 1) * 2 + -1,pEVar31);
TearParams::operator_(GHIDRA_CAST<TearParams *>((local_1c4 + 4)),pTVar7);
}
uVar6 = Random();
local_238.x = ownerPos.x + 0.0;
local_238.y = ownerPos.y + 5.0;
local_1d8 = (Entity_Bomb *)
Game::Spawn(g_game,2,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))),&local_238,&g_vectorZero,
*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4)),2,uVar6);
if ((local_1d8 == GHIDRA_CAST<Entity_Bomb *>(0x0)) || (local_1d8->_type != 2)) {
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(0x0);
}
local_1f0.y = (float)&local_1d8->_parent;
local_218.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 4));
if (local_1d8->_parent != 0) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = local_1f0.y;
msvc::multiset<unsigned_int>::erase();
}
*GHIDRA_CAST<float *>(local_1f0.y) = local_218.y;
if (GHIDRA_CAST<Entity_Knife *>(local_218.y) != GHIDRA_CAST<Entity_Knife *>(0x0)) {
msvc::multiset<unsigned_int>::insert();
}
Entity_Projectile::SetHeight(GHIDRA_CAST<Entity_Projectile *>(local_1d8),-40.0);
owner = tearDamage;
(**(code **)(*GHIDRA_CAST<int *>(local_1d8) + 0x40))();
b = &g_tearFlagSpectral;
pBVar8 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(local_50),&tearFlags,&g_tearFlagLudovico);
pBVar8 = BitSet128::operator_or(GHIDRA_CAST<BitSet128 *>(&local_2bc),pBVar8,b);
Entity_Tear::SetTearFlags(GHIDRA_CAST<Entity_Tear *>(local_1d8),*pBVar8);
iVar30 = 1;
(**(code **)(*GHIDRA_CAST<int *>(local_1d8) + 0x3c))();
fVar23 = sqrtf((float)tearDamage);
local_1f0.y = 0.01;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (float)tearDamage * 0.04 + 1.5 + fVar23 * 0.15;
pfVar18 = GHIDRA_CAST<float *>(local_1c4);
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) <= 0.01) {
pfVar18 = &local_1f0.y;
}
fVar23 = *pfVar18;
local_1d8->_bounceCount = GHIDRA_INT(fVar23);
local_1d8->_fallAcceleration = fVar23;
Entity_Tear::ResetSpriteScale(GHIDRA_CAST<Entity_Tear *>(local_1d8));
(**(code **)(*GHIDRA_CAST<int *>(local_1d8) + 0xc))();
if (*GHIDRA_CAST<Entity_Bomb **>((GHIDRA_CAST<char *>(this) + 0x54)) != local_1d8) {
if (*GHIDRA_CAST<Entity_Bomb **>((GHIDRA_CAST<char *>(this) + 0x54)) != GHIDRA_CAST<Entity_Bomb *>(0x0)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(this) + 0x54));
msvc::multiset<unsigned_int>::erase();
}
owner = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(this) + 0x54));
*GHIDRA_CAST<Entity_Bomb **>(owner) = local_1d8;
iVar30 = 0x9faefd;
msvc::multiset<unsigned_int>::insert();
}
}
if ((weaponType == 0xb) || (this_00 == GHIDRA_CAST<Entity_Player *>(0x0))) {
LAB_009faf2a:
local_1f9 = '\0';
if ((weaponType != 0xb) && (this_00 != GHIDRA_CAST<Entity_Player *>(0x0))) goto LAB_009faf3a;
LAB_009faf4d:
cVar12 = '\0';
}
else {
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0x57;
bVar4 = Entity_Player::HasCollectible(this_00,0x57,0);
if (bVar4 == 0) goto LAB_009faf2a;
local_1f9 = '\x01';
LAB_009faf3a:
owner = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = 0x37;
bVar4 = Entity_Player::HasCollectible(this_00,0x37,0);
if (bVar4 == 0) goto LAB_009faf4d;
cVar12 = '\x01';
}
pEVar19 = local_200;
local_1d2 = CONCAT11(cVar12,(uint8_t)local_1d2);
local_208 = GHIDRA_CAST<uint8_t *>(0x0);
do {
if ((local_208 == GHIDRA_CAST<uint8_t *>(0x0)) ||
(((local_208 == GHIDRA_CAST<uint8_t *>(0x1) && (cVar12 != '\0')) || (local_1f9 != '\0')))) {
local_1f0.y = (float)(GHIDRA_INT(this) + GHIDRA_INT(local_208) * 4 + 0x44);
piVar15 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + GHIDRA_INT(local_208) * 4 + 0x44));
if (piVar15 != GHIDRA_CAST<int *>(0x0)) {
if ((piVar15[10] == 8) && (GHIDRA_CAST<Entity_Player *>(piVar15[0xb]) == pEVar19)) goto LAB_009fb07f;
owner = GHIDRA_CAST<Entity_Player *>(0x9faff5);
(**(code **)(*piVar15 + 0x28))();
}
local_218.y = (float)Weapon::fire_bone_club
(this,*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4)),GHIDRA_UINT(pEVar19),1,iVar30,
GHIDRA_INT(owner),0.0);
if (*GHIDRA_CAST<Entity_Knife **>(local_1f0.y) != GHIDRA_CAST<Entity_Knife *>(local_218.y)) {
if (*GHIDRA_CAST<Entity_Knife **>(local_1f0.y) != GHIDRA_CAST<Entity_Knife *>(0x0)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = local_1f0.y;
iVar30 = 0x9fb038;
msvc::multiset<unsigned_int>::erase();
}
*GHIDRA_CAST<float *>(local_1f0.y) = local_218.y;
if (GHIDRA_CAST<Entity_Knife *>(local_218.y) != GHIDRA_CAST<Entity_Knife *>(0x0)) {
iVar30 = 0x9fb050;
msvc::multiset<unsigned_int>::insert();
}
}
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_218.y) + 0x438)) = (&DAT_00b81710)[GHIDRA_INT(local_208)];
*GHIDRA_CAST<bool *>((GHIDRA_CAST<char *>(local_218.y) + 0x467)) = local_208 == GHIDRA_CAST<uint8_t *>(0x0);
owner = GHIDRA_CAST<Entity_Player *>(0x9fb079);
(**(code **)(*GHIDRA_CAST<int *>(local_218.y) + 0xc))();
}
else {
local_1f0.y = (float)(GHIDRA_INT(this) + GHIDRA_INT(local_208) * 4 + 0x44);
if (*GHIDRA_CAST<int **>(local_1f0.y) != GHIDRA_CAST<int *>(0x0)) {
owner = GHIDRA_CAST<Entity_Player *>(0x9faf94);
(**(code **)(**GHIDRA_CAST<int **>(local_1f0.y) + 0x28))();
if (*GHIDRA_CAST<int *>(local_1f0.y) != 0) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = local_1f0.y;
owner = GHIDRA_CAST<Entity_Player *>(local_1c4);
iVar30 = 0x9fafbc;
msvc::multiset<unsigned_int>::erase();
*GHIDRA_CAST<int *>(local_1f0.y) = 0;
}
}
}
LAB_009fb07f:
pEVar13 = ownerPlayer;
local_208 = local_208 + 1;
cVar12 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_1d2)) + 0x1)));
} while (local_208 < &DAT_00000004);
heldClub = *GHIDRA_CAST<Entity_Knife **>((GHIDRA_CAST<char *>(this) + 0x44));
shotDirection.y = aimDirection->y;
shotDirection.x = aimDirection->x;
if (shotDirection.y == 0.0) {
if (shotDirection.x == 0.0) {
shotDirection.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x20));
shotDirection.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x24));
}
if (((shotDirection.y == 0.0) && (shotDirection.x == 0.0)) && (player != GHIDRA_CAST<Entity_Player *>(0x0)))
{
switch(player->_headDirection) {
case 0:
shotDirection.x = (float)&DAT_bf800000;
break;
case 1:
shotDirection.y = (float)&DAT_bf800000;
break;
case 2:
shotDirection.x = 1.0;
break;
case 3:
shotDirection.y = 1.0;
}
}
}
bVar4 = Weapon::IsAxisAligned(this);
if (bVar4 != 0) {
pVVar9 = Vector::ToCardinal(&local_274,&shotDirection);
shotDirection.x = (float)pVVar9->x;
shotDirection.y = (float)pVVar9->y;
}
local_218.y = shotDirection.y;
local_1f0.y = shotDirection.x;
if ((((player != GHIDRA_CAST<Entity_Player *>(0x0)) && (iVar30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)), iVar30 != 0)) &&
(*GHIDRA_CAST<int *>((iVar30 + 0x28)) == 1)) &&
((0 < *GHIDRA_CAST<int *>((iVar30 + 0x145c)) ||
((*GHIDRA_CAST<int *>((iVar30 + 0x2c)) == 1 && (*GHIDRA_CAST<int *>((iVar30 + 0x1aec)) == 8)))))) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (float)GHIDRA_INT(*GHIDRA_CAST<char *>((iVar30 + 0x1578))) * 45.0 * 0.017453292;
local_2a4.y = cos((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))));
fVar23 = sin((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))));
shotDirection.x = (float)(local_2a4.y * local_1f0.y - fVar23 * local_218.y);
shotDirection.y = (float)(local_2a4.y * local_218.y + fVar23 * local_1f0.y);
ownerPlayer = pEVar13;
}
if ((heldClub->_isSwinging == 0) && (heldClub->_isFlying == 0)) {
local_1f0.y = (float)(GHIDRA_INT(this) + 0x44);
local_1e4.y = 0.0;
owner = GHIDRA_CAST<Entity_Player *>(shotDirection.y);
pEVar19 = GHIDRA_CAST<Entity_Player *>(shotDirection.x);
do {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = *GHIDRA_CAST<uint32_t *>(local_1f0.y);
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))) != GHIDRA_CAST<Entity_Player *>(0x0)) {
fVar23 = atan2f((float)owner,(float)pEVar19);
fVar23 = fVar23 * 57.295776 +
*GHIDRA_CAST<float *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_1e4.y) + 0xb7f600))))) + 0x1c08))) + 0x508))
;
if (360.0 < ABS(fVar23)) {
fVar23 = fmodf(fVar23,360.0);
}
if (fVar23 <= 180.0) {
if (fVar23 < -180.0) {
fVar23 = fVar23 + 360.0;
}
}
else {
fVar23 = fVar23 - 360.0;
}
*GHIDRA_CAST<float *>((((GHIDRA_CAST<ANM2 *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) + 0x41c)))->_animDefaultName)._buf + 4)) = fVar23;
owner = GHIDRA_CAST<Entity_Player *>(shotDirection.y);
pEVar19 = GHIDRA_CAST<Entity_Player *>(shotDirection.x);
}
local_1e4.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(local_1e4.y)))) + 0x4)));
local_1f0.y = (float)(GHIDRA_INT(local_1f0.y) + 4);
} while (GHIDRA_UINT(local_1e4.y) < GHIDRA_CAST<uint8_t *>(0x10));
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((heldClub)) + 0x466))) == '\0') {
heldClub->_rotationOffset = 0.0;
}
iVar30 = g_game->_frameCount - heldClub->_spawnFrame;
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)) <= 0.0) {
if (iVar30 < 2) {
local_1f0.y = (float)clubScale;
}
else {
fVar23 = (heldClub->_sprite)._scale.x;
local_1f0.y = ((float)clubScale - fVar23) * 0.5 + fVar23;
}
}
else {
if (1 < iVar30) goto LAB_009fb512;
local_1f0.y = (float)clubScale;
}
local_1e4.y = (float)(GHIDRA_INT(this) + 0x44);
local_218.y = 5.60519e-45;
do {
if (*GHIDRA_CAST<int *>(local_1e4.y) != 0) {
init_club();
iVar30 = *GHIDRA_CAST<int *>(local_1e4.y);
fVar23 = local_1f0.y * g_vectorOne.y;
*GHIDRA_CAST<float *>((iVar30 + 0xe4)) = local_1f0.y * g_vectorOne.x;
*GHIDRA_CAST<float *>((iVar30 + 0xe8)) = fVar23;
}
owner = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_218.y) + -0x2f00));
local_1e4.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(local_1e4.y)))) + 0x4)));
local_218.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((owner)) + 0x2eff)));
} while (&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((owner)) + 0x2eff))) != GHIDRA_CAST<uint8_t *>(0x0));
}
LAB_009fb512:
if (local_1c6 == 0) {
if (((char)isBrimstone != '\0') && (bVar4 = Weapon::IsItemAnimFinished(this,0x76), bVar4 != 0))
{
Weapon::stop_costume_item_anim(this,0x76);
}
if ((char)isCursedEye != '\0') {
Weapon::stop_costume_item_anim(this,0x13c);
}
if ((isChocolateMilk != 0) && (bVar4 = Weapon::IsItemAnimFinished(this,0x45), bVar4 != 0)) {
Weapon::stop_costume_item_anim(this,0x45);
}
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_250)) + 0x0))) != '\0') && (bVar4 = Weapon::IsItemAnimFinished(this,0xe5), bVar4 != 0)) {
Weapon::stop_costume_item_anim(this,0xe5);
}
if (((char)isCSection != '\0') &&
(bVar4 = Weapon::is_c_section_anim_finished(this,isCSection), bVar4 != 0)) {
Weapon::update_c_section_charge_anim(this,unusedCollectibleId,0,aimDirection,0.0);
}
}
if (isInterpolated != 0) {
ExceptionList = local_10;
return;
}
owner = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x14));
newCharge = owner;
if (local_1c6 == 0) {
if ((isChargeMode != '\0') ||
(((player != GHIDRA_CAST<Entity_Player *>(0x0) && (player->_heldEntity != (void *)0x0)) ||
((char)isCSection != '\0')))) {
if (0.0 < (float)owner) {
newCharge = GHIDRA_CAST<Entity_Player *>(0x0);
if (0.0 <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc))) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x5c)) = 0;
}
}
goto LAB_009fba4f;
}
if (1.0 < (float)owner) {
EntityList::QuerySublist
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(&local_2bc),8,1,-1,0,0)
;
local_8 = 5.60519e-45;
local_200 = GHIDRA_CAST<Entity_Player *>(0x0);
iVar30 = extraout_ECX;
if (puStack_2b0 != GHIDRA_CAST<uint8_t *>(0x0)) {
do {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvStack_2b8) + GHIDRA_INT(local_200) * 4));
iVar30 = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))))->_parent;
if ((iVar30 != 0) &&
((iVar30 == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)) ||
(*GHIDRA_CAST<int *>((iVar30 + 0x3bc)) == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)))))) {
fVar23 = *GHIDRA_CAST<float *>(((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))))->_bodySprite)._animDefaultName.
_buf + 8)) * 0.5;
if (360.0 < ABS(fVar23)) {
fVar23 = fmodf(fVar23,360.0);
iVar30 = extraout_ECX_00;
}
if (fVar23 <= 180.0) {
if (fVar23 < -180.0) {
fVar23 = fVar23 + 360.0;
}
}
else {
fVar23 = fVar23 - 360.0;
}
*GHIDRA_CAST<float *>((((GHIDRA_CAST<ANM2 *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) + 0x41c)))->_animDefaultName)._buf + 8)) = fVar23;
}
local_200 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_200)) + 0x1))));
} while (local_200 < puStack_2b0);
pEVar13 = ownerPlayer;
}
Weapon::SetBlinkTime(this,7 - GHIDRA_INT(((float)maxFireDelay * -0.45)),iVar30);
Weapon::TriggerTearEffects(this,&shotDirection,1);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (float)maxFireDelay * 3.0;
local_1f0.y = 300.0;
maxFireDelay = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0)));
pfVar18 = GHIDRA_CAST<float *>(local_1c4);
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)) <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0)))) {
pfVar18 = GHIDRA_CAST<float *>((GHIDRA_INT(this) + 0x14));
}
local_200 = GHIDRA_CAST<Entity_Player *>(*pfVar18);
if ((pEVar13 == GHIDRA_CAST<Entity_Player *>(0x0)) ||
(bVar4 = Entity_Player::HasCollectible(pEVar13,0xe9,0), bVar4 == 0)) {
fVar23 = 300.0;
local_1e4.y = 0.2;
local_250 = (float)local_200 / (float)maxFireDelay;
pfVar18 = &local_250;
if ((float)local_200 / (float)maxFireDelay <= 0.2) {
pfVar18 = &local_1e4.y;
}
local_218.y = (float)*pfVar18;
if (pEVar13 == GHIDRA_CAST<Entity_Player *>(0x0)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x43820000);
}
else {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = pEVar13->_tearrange;
}
}
else {
local_1e4.y = 0.2;
local_1f0.y = 100000.0;
fVar23 = 100000.0;
local_250 = (float)local_200 / (float)maxFireDelay;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = pEVar13->_tearrange;
pfVar18 = &local_250;
if ((float)local_200 / (float)maxFireDelay <= 0.2) {
pfVar18 = &local_1e4.y;
}
local_218.y = (float)*pfVar18;
}
local_1e4.y = 0.2;
local_200 = GHIDRA_CAST<Entity_Player *>(0x43480000);
pfVar18 = GHIDRA_CAST<float *>(local_1c4);
if (fVar23 <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0)))) {
pfVar18 = &local_1f0.y;
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>((*pfVar18 * 0.9));
ppEVar10 = GHIDRA_CAST<Entity_Player **>(local_1c4);
if (*pfVar18 * 0.9 <= 200.0) {
ppEVar10 = &local_200;
}
uVar6 = 0;
owner = *ppEVar10;
local_200 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(this) + 0x44));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = owner;
do {
club = *GHIDRA_CAST<Entity_Knife **>(local_200);
if ((club != GHIDRA_CAST<Entity_Knife *>(0x0)) && ((uVar6 == 0 || ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((club)) + 0x466))) != '\0')))) {
Entity_Knife::Shoot(club,local_218.y,(float)owner);
owner = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0)));
}
uVar6 = uVar6 + 1;
local_200 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_200)) + 0x4))));
} while (uVar6 < 4);
Weapon::SetHeadLockTime(this,2);
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::TryForgottenThrow(player,&shotDirection);
}
local_8 = -NAN;
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_2bc)) + 0x0))) == '\0') {
local_8 = 7.00649e-45;
tracked_alloc(1,pvStack_2b8,0);
}
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) != 0) {
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) + 0x466)) = 0;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x48)) != 0) {
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x48)) + 0x466)) = 0;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x4c)) != 0) {
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x4c)) + 0x466)) = 0;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x50)) != 0) {
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x50)) + 0x466)) = 0;
}
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x20)) = g_vectorZero.x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x24)) = g_vectorZero.y;
owner = GHIDRA_CAST<Entity_Player *>(0x0);
LAB_009fb9ec:
club = heldClub;
goto LAB_009fb9f2;
}
LAB_009fba4f:
iVar30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
if (((iVar30 == 0) || (*GHIDRA_CAST<int *>((iVar30 + 0x28)) != 1)) ||
(piVar15 = GHIDRA_CAST<int *>(isCSection), *GHIDRA_CAST<int *>((iVar30 + 0x18f8)) < 1)) {
uVar20 = (undefined3)(GHIDRA_UINT(player) >> 8);
if ((player == GHIDRA_CAST<Entity_Player *>(0x0)) || ((player->_temporaryeffects)._disabled != 0)) {
rngResult = CONCAT31(uVar20,local_1c5);
}
else {
effectIt = (player->_temporaryeffects)._effects._begin;
effectsEnd = (player->_temporaryeffects)._effects._end;
if (effectIt == effectsEnd) {
rngResult = CONCAT31(uVar20,local_1c5);
}
else {
do {
piVar15 = GHIDRA_CAST<int *>(*effectIt);
if ((*piVar15 == 0) && (piVar15[1] == 0x78)) goto LAB_009fbb0b;
effectIt = effectIt + 4;
rngResult = CONCAT31(CONCAT21((short)(GHIDRA_UINT(player) >> 0x10),isDrFetus),local_1c5);
ownerPlayer = pEVar13;
} while (effectIt != effectsEnd);
isDrFetus = isDrFetus;
player = player;
}
}
if ((char)rngResult == '\0') {
if ((char)isCSection != '\0') goto LAB_009fbb7b;
}
else {
if (isChargeMode == '\0') goto LAB_009fbb11;
LAB_009fbb7b:
if ((((local_1c6 != 0) && ((float)maxCharge <= (float)owner)) &&
(local_1c6 = 0, 0.0 < (float)owner)) &&
(newCharge = GHIDRA_CAST<Entity_Player *>(0x0), 0.0 <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)))) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x5c)) = 0;
}
isReleased = '\x01';
}
}
else {
LAB_009fbb0b:
rngResult = CONCAT31((int3)(GHIDRA_UINT(piVar15) >> 8),local_1c5);
LAB_009fbb11:
isChargeMode = '\0';
newCharge = owner;
local_1f0.y = (float)owner;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x14)) = 0;
if ((char)rngResult != '\0') {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x3f800000);
isReleased = '\x01';
pfVar18 = GHIDRA_CAST<float *>(local_1c4);
if (1.0 <= (float)owner) {
pfVar18 = &local_1f0.y;
}
newCharge = GHIDRA_CAST<Entity_Player *>(*pfVar18);
}
}
pEVar19 = player;
pfVar18 = GHIDRA_CAST<float *>((GHIDRA_INT(this) + 0x14));
iVar30 = CONCAT22((short)(GHIDRA_UINT(rngResult) >> 0x10),CONCAT11(local_1c6,(char)rngResult));
if ((local_1c6 == 0) || ((heldClub->_isSwinging != 0 && ((char)rngResult == '\0')))) {
if ((isChargeMode == '\0') && (local_1c6 != 0)) goto LAB_009fbc0f;
LAB_009fbc27:
if ((((player != GHIDRA_CAST<Entity_Player *>(0x0)) && (player->_heldEntity != (void *)0x0)) &&
(local_1c6 == 0)) ||
((((char)isCSection != '\0' && (local_1c6 == 0)) &&
((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) <= 0.0 && *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) != 0.0 &&
(1.0 < *pfVar18)))))) goto LAB_009fbcd3;
owner = newCharge;
if (((isChocolateMilk == 0) && ((char)isBrimstone == '\0')) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_250)) + 0x0))) == '\0')) {
if ((char)isCursedEye != '\0') goto LAB_009fbc86;
goto LAB_009fdeca;
}
if ((char)isCursedEye == '\0') {
if (local_1c6 == 0) {
if ((0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) || *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) == 0.0) ||
(*pfVar18 <= 1.0)) goto LAB_009fb9ec;
goto LAB_009fbcd3;
}
}
else {
LAB_009fbc86:
if (local_1c6 == 0) {
if ((0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) || *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) == 0.0) ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x5c)) < 1)) goto LAB_009fb9ec;
goto LAB_009fbcd3;
}
}
}
else {
if (isChargeMode != '\0') {
if (*pfVar18 <= 1.0 && *pfVar18 != 1.0) {
*pfVar18 = 1.0;
newCharge = GHIDRA_CAST<Entity_Player *>(0x3f800000);
}
goto LAB_009fbc27;
}
LAB_009fbc0f:
if (((0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) || *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) == 0.0) ||
(0.0 < *pfVar18)) || (heldClub->_isFlying != 0)) goto LAB_009fbc27;
LAB_009fbcd3:
Weapon::GetMultiShotParams(this,local_2f8 + 8,iVar30);
iVar30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0xc)) = maxFireDelay;
iVar16 = extraout_ECX_01;
if (iVar30 != 0) {
uVar21 = (uint3)(GHIDRA_UINT(extraout_ECX_01) >> 8);
if (*GHIDRA_CAST<int *>((iVar30 + 0x28)) == 1) {
iVar16 = CONCAT31(uVar21,*GHIDRA_CAST<uint8_t *>((iVar30 + 0x1578)));
}
else if ((iVar30 == 0) || (iVar16 = GHIDRA_UINT(uVar21) << 8, *GHIDRA_CAST<int *>((iVar30 + 0x28)) != 1))
goto LAB_009fbd18;
cVar12 = (char)iVar16;
iVar16 = CONCAT31((int3)(GHIDRA_UINT(iVar16) >> 8),-cVar12);
*GHIDRA_CAST<char *>((iVar30 + 0x1578)) = -cVar12;
}
LAB_009fbd18:
Weapon::SetBlinkTime(this,7 - GHIDRA_INT(((float)maxFireDelay * -0.45)),iVar16);
Weapon::TriggerTearEffects(this,&shotDirection,1);
pfVar18 = &local_1f0.y;
local_1f0.y = 0.5;
damageMultiplier = 1.0;
local_2bc = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_2f8)) + 0x8)));
pvStack_2b8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_2f8)) + 0xc)));
fStack_2b4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_2f8)) + 0x10)));
puStack_2b0 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *>(local_2f8))) + 0x14)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = 1.0 / ((float)clubScale * 0.5 + 0.5);
clampedValue = GHIDRA_CAST<float *>(local_1c4);
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) <= 0.5) {
clampedValue = pfVar18;
}
fStack_2cc = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_2f8)) + 0x18)));
lanesPerEye = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x1c)));
fStack_2c4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_2f8)) + 0x20)));
fStack_2c0 = uStack_2d4;
local_208 = local_2d0;
local_238.y = *clampedValue;
local_1d2 = (*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x8)));
if (pEVar19 != GHIDRA_CAST<Entity_Player *>(0x0)) {
pvVar17 = pEVar19->_heldEntity;
local_1f0.y = (float)&pEVar19->_heldEntity;
if (pvVar17 != (void *)0x0) {
fVar23 = (pEVar19->_pos).y;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x33c)) = (pEVar19->_pos).x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x340)) = fVar23;
owner = pEVar19->_heldEntity;
local_1e4.y = (float)owner;
if (owner->_type == 4) {
savedBombFlags = owner->_flags;
bombFlagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&owner->_flags) + 4));
*bombFlagsHigh = *bombFlagsHigh & 0xfdffffdf;
*GHIDRA_CAST<int *>(&owner->_flags) = GHIDRA_INT(savedBombFlags);
owner->_renderZOffset = 0;
local_218.y = 0.0;
if (0 < (*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&((short)local_2f8)) + 0x8)))) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT((short)local_2f8))) + 0x8))) / 2;
do {
owner = GHIDRA_CAST<Entity_Player *>(local_1e4.y);
FUN_009f4230(local_27c,local_218.y,5,shotDirection.x,shotDirection.y,shotSpeed);
if (local_218.y == (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0)))) {
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_1e4.y) + 0x41c)))->_animState))) + 0x15))) = 1;
}
else {
owner = GHIDRA_CAST<Entity_Player *>(Weapon)::fire_bomb(this,&ownerPos,&g_vectorZero);
iVar30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player->_heldEntity) + 0x410));
*GHIDRA_CAST<int *>(&owner->_isControlsEnabled) = iVar30;
owner->_controlsCooldown = iVar30;
anim = ANM2::GetAnimation(GHIDRA_CAST<ANM2 *>(&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_1e4.y) + 0x48)))->_animState),
GHIDRA_CAST<std_string *>((local_c4 + 0x14)));
local_8 = 0.0;
if (0xf < anim->_capacity) {
anim = *GHIDRA_CAST<std_string **>(anim->_buf);
}
ANM2::Play(&owner->_sprite,GHIDRA_CAST<uint8_t *>(anim),0);
local_8 = -NAN;
(GHIDRA_CAST<msvc::string *>((local_c4 + 0x14)))->msvc::string::_Tidy_deallocate();
if ((owner->_sprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat
(&(owner->_sprite)._animState,
(float)GHIDRA_INT(((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_1e4.y) + 0x48)))->_animState)).
_animFrame);
}
}
owner->_entityCollisionClass = 4;
owner->_entityGridCollisionClass = 6;
local_2a4.y = local_274.y;
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(local_274.x);
if ((owner->_variant == 0x13) || (owner->_variant == 0x14)) {
fVar23 = atan2f(local_274.y,local_274.x);
*GHIDRA_CAST<float *>((GHIDRA_INT((owner->_bodySprite)._filename._buf) + 0xc)) = fVar23 * 57.295776;
}
else {
*GHIDRA_CAST<float *>((owner->_bodySprite)._filename._buf) = -5.0;
}
(owner->_posOffset).x = 0.0;
(owner->_posOffset).y = -14.0;
fVar25 = sqrtf(local_2a4.y * local_2a4.y + (float)local_1d8 * (float)local_1d8);
pEVar27 = local_1d8;
fVar23 = local_2a4.y;
if (0.0 < fVar25) {
pEVar27 = GHIDRA_CAST<Entity_Bomb *>(((float)local_1d8 * (1.0 / fVar25)));
fVar23 = local_2a4.y * (1.0 / fVar25);
}
fVar25 = (player->_lastVelocity).x * 0.6;
iVar30 = *GHIDRA_CAST<int *>(owner);
fVar26 = (player->_lastVelocity).y * 0.6;
(owner->_velocity).x = (float)pEVar27 * 20.0 + fVar25 + fVar25;
(owner->_velocity).y = fVar23 * 20.0 + fVar26 + fVar26;
(**(code **)(iVar30 + 0x40))();
local_218.y = (float)(GHIDRA_INT(local_218.y) + 1);
(owner->_bodySprite)._filename._size = 0x41700000;
} while (GHIDRA_INT(local_218.y) < GHIDRA_INT(local_1d2));
}
}
else if ((owner->_type == 1000) && (owner->_variant == 0x76)) {
iVar30 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x58));
if (iVar30 == 0) {
local_220.x = ownerPos.x + shotDirection.x * 80.0;
local_220.y = ownerPos.y + shotDirection.y * 80.0;
}
else {
local_220.x = *GHIDRA_CAST<float *>((iVar30 + 0x33c));
local_220.y = *GHIDRA_CAST<float *>((iVar30 + 0x340));
}
bombFlagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&owner->_flags) + 4));
*bombFlagsHigh = *bombFlagsHigh & 0xffffffdf;
*GHIDRA_CAST<int *>(&owner->_flags) = GHIDRA_INT(owner->_flags);
local_218.y = (float)(local_220.x - ownerPos.x);
local_1d8 = GHIDRA_CAST<Entity_Bomb *>((local_220.y - ownerPos.y));
owner->_renderZOffset = 0;
(owner->_posOffset).x = 0.0;
(owner->_posOffset).y = 0.0;
(owner->_bodySprite)._animState._animData = (void *)0x1;
local_1e4.y = 0.0;
if (0 < (*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&((short)local_2f8)) + 0x8)))) {
local_220.x = 1.0;
local_24c.y = (float)((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT((short)local_2f8))) + 0x8))) / 2);
local_220.y = 0.0;
do {
FUN_009f4230(local_27c,local_1e4.y,5,local_220.x,local_220.y,shotSpeed);
fVar23 = atan2f(local_274.y,local_274.x);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = fVar23 * 57.295776 * 0.017453292;
local_2a4.y = cos((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))));
fVar23 = sin((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = ownerPos.x + (local_218.y * local_2a4.y - (float)local_1d8 * fVar23)
;
local_2a4.y = ownerPos.y + (float)local_1d8 * local_2a4.y + local_218.y * fVar23;
if (local_1e4.y == local_24c.y) {
pEVar19 = owner;
}
else {
uVar6 = Random();
pEVar19 = (Entity_Player *)
Game::Spawn(g_game,1000,0x76,&ownerPos,&g_vectorZero,
*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4)),0,uVar6);
}
local_1e4.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(local_1e4.y)))) + 0x1)));
(pEVar19->_targetPosition).y = local_2a4.y;
(pEVar19->_bodySprite)._animState._animData = (void *)local_1e4.y;
(pEVar19->_targetPosition).x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0)));
} while (GHIDRA_INT(local_1e4.y) < GHIDRA_INT(local_1d2));
}
}
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(local_1f0.y) + 0x171)) = 1;
pfVar18 = GHIDRA_CAST<float *>(0x0);
if (*GHIDRA_CAST<int *>(local_1f0.y) != 0) {
local_24c.y = local_1f0.y;
msvc::multiset<unsigned_int>::erase();
pfVar18 = extraout_ECX_02;
}
*GHIDRA_CAST<int *>(local_1f0.y) = 0;
}
}
if (isChocolateMilk != 0) {
pfVar18 = GHIDRA_CAST<float *>(local_1c4);
local_24c.y = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)) / (float)maxFireDelay - 1.0) + 1.0;
clampedValue = &local_24c.y;
if (1.0 <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0)))) {
clampedValue = pfVar18;
}
damageMultiplier = *clampedValue;
}
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_250)) + 0x0))) != '\0') && ((float)chargeThreshold <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)))) {
Weapon::UpdateHeadChargeAnimation(this,0xe5,2,&shotDirection,-1.0);
local_220.x = shotDirection.x * 10.0;
local_220.y = shotDirection.y * 10.0;
local_1e4.y = local_220.y;
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(local_220.x);
pVVar9 = Weapon::get_tear_movement_inheritance(this,&local_274,&local_220);
owner = ownerPlayer;
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(((float)local_1d8 + pVVar9->x));
local_1e4.y = local_1e4.y + pVVar9->y;
if ((ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) ||
(bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x95,0), bVar4 == 0)) {
local_1f0.y = 1.68156e-44;
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009fc57a;
}
else {
uVar6 = Random();
fVar23 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 0.2 + 0.7;
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(((float)local_1d8 * fVar23));
local_1e4.y = local_1e4.y * fVar23;
LAB_009fc57a:
local_1f0.y = 1.68156e-44;
bVar4 = Entity_Player::HasCollectible(owner,0x213,0);
if (bVar4 != 0) {
bVar4 = Entity_Player::HasCollectible(owner,0x76,0);
local_1f0.y = (float)(GHIDRA_UINT((bVar4 == 0)) * 2 + 5);
}
}
bVar4 = Entity_Player::HasCollectible(owner,0x34,0);
owner = GHIDRA_CAST<Entity_Player *>(local_1f0.y);
if (bVar4 != 0) {
owner = GHIDRA_CAST<Entity_Player *>(&DAT_00000005);
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = lanesPerEye;
local_24c.y = (float)(GHIDRA_INT((&(owner->_sprite)._filename + -3)) +
GHIDRA_INT((((float)GHIDRA_INT(owner) / 5.0) * (float)GHIDRA_INT(local_1d2)))) /
(float)lanesPerEye;
iVar30 = 0x9fc63a;
dVar29 = ceil((double)local_24c.y);
local_218.y = (float)dVar29;
local_2a4.y = 0.0;
pfVar18 = extraout_ECX_03;
if (0 < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_1c4))) + 0x0)))) {
do {
fVar25 = local_2a4.y;
fVar23 = 0.0;
if (1 < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_1c4))) + 0x0)))) {
local_1f0.y = (float)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x20))) ^ 0x80000000);
local_24c.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)GHIDRA_INT(local_1c4))) + 0x0))) - 1.0;
if (local_24c.y == 0.0) {
iVar30 = 0x9fc6b2;
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Start and End parameters cannot be the same!"));
}
fVar23 = ((float)GHIDRA_INT(fVar25) - 0.0) / (local_24c.y - 0.0);
auVar24 = ZEXT416(GHIDRA_UINT(fVar23));
if (fVar23 <= 0.0) {
auVar24 = ZEXT816(0);
}
if (1.0 <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar24)) + 0x0)))) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar24)) + 0x0))) = 0x3f800000;
}
fVar23 = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_2f8)) + 0x20))) - local_1f0.y) * (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar24)) + 0x0))) + local_1f0.y;
}
local_24c.y = fVar23 * 0.017453292;
local_1f0.y = cos(local_24c.y);
fVar23 = sin(local_24c.y);
fVar28 = (float)local_1d8 * local_1f0.y;
fVar26 = local_1e4.y * local_1f0.y;
local_1f0.y = 0.0;
pfVar18 = extraout_ECX_04;
if (0 < GHIDRA_INT(local_218.y)) {
local_264.y = (fVar28 - local_1e4.y * fVar23) * (float)shotSpeed;
local_220.y = (fVar26 + (float)local_1d8 * fVar23) * (float)shotSpeed;
do {
uVar6 = Random();
fVar23 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 3.14;
local_24c.y = fVar23 + fVar23;
local_284 = GHIDRA_CAST<Entity_Bomb *>(sin(local_24c.y));
uVar6 = Random();
local_298 = (Entity_Bomb *)
((float)((double)GHIDRA_INT(uVar6) +
__uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) * 2.3283064e-10);
fVar23 = cos(local_24c.y);
local_274.x = fVar23 * (float)local_298 * 3.5 + local_264.y;
local_274.y = (float)local_298 * (float)local_284 * 3.5 + local_220.y;
pEVar27 = GHIDRA_CAST<Entity_Bomb *>(Weapon)::fire_tear(this,&ownerPos,&local_274,0,iVar30,1.0,0.0)
;
local_284 = pEVar27;
if ((pEVar27->_variant == 0x1d) && (uVar6 = Random(), (uVar6 & 3) != 0)) {
pvStack_48 = (void *)0x0;
puStack_44 = &DAT_0000000f;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0x14))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((local_6c + 0x14)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/tears_brokenbone.png"),0x18);
local_8 = 1.4013e-45;
iVar30 = 0x9fc8f0;
Sprite::ReplaceSpritesheet
(GHIDRA_CAST<Sprite *>(&pEVar27->_sprite),0,GHIDRA_CAST<std_string *>((local_6c + 0x14)));
local_8 = -NAN;
bVar4 = extraout_CL;
if (&DAT_0000000f < puStack_44) {
puVar22 = puStack_44 + 1;
pvVar17 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_6c)) + 0x14)));
if (GHIDRA_CAST<uint8_t *>(0xfff) < puVar22) {
pvVar17 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0x14))) + -4);
puVar22 = puStack_44 + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0x14))) + (-4 - GHIDRA_INT(pvVar17))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
iVar30 = 0x9fc928;
operator_delete(pvVar17,GHIDRA_UINT(puVar22));
bVar4 = extraout_CL_00;
}
ANM2::LoadGraphics(&pEVar27->_sprite,bVar4);
}
if (ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_009fc98a:
pEVar27->_explosionDamage = ownerPlayer->_tearfallaccel + 0.5;
uVar6 = Random();
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar27)) + 0x414)))) =
(ownerPlayer->_tearfallspeed -
(float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 15.0) + 5.0;
}
else {
iVar30 = 0x9fc94c;
bVar4 = Entity_Player::HasCollectible(ownerPlayer,0x95,0);
if (bVar4 == 0) {
local_50 = *(uint8_t (*) [4])&(GHIDRA_CAST<BitSet128 *>(&pEVar27->_rocketAngle))->_l;
pvStack_4c = (void *)pEVar27->_rocketSpeed;
pvStack_48 = *(void **)&pEVar27->_collisionCooldown;
puStack_44 = GHIDRA_CAST<uint8_t *>(pEVar27->_scale);
pBVar8 = BitSet128::operator_and
(GHIDRA_CAST<BitSet128 *>(&fStack_a8),GHIDRA_CAST<BitSet128 *>(local_50),
&g_tearFlagHydrobounce);
if ((GHIDRA_INT(pBVar8->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar8->_l) + 4)) == 0) &&
(GHIDRA_INT(pBVar8->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar8->_h) + 4)) == 0))
goto LAB_009fc98a;
}
}
uVar6 = Random();
rngResult = Random();
pEVar27 = local_284;
local_298 = GHIDRA_CAST<Entity_Bomb *>(0x3c23d70a);
local_284 = (Entity_Bomb *)
((((float)(uVar6 & 1) + 0.0) * 0.4 + 0.9 +
(float)((double)GHIDRA_INT(rngResult) +
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10
* 0.05) * local_284->_fallAcceleration);
ppEVar11 = &local_284;
if ((float)local_284 <= 0.01) {
ppEVar11 = &local_298;
}
pEVar1 = *ppEVar11;
pEVar27->_bounceCount = GHIDRA_INT(pEVar1);
pEVar27->_fallAcceleration = (float)pEVar1;
Entity_Tear::ResetSpriteScale(GHIDRA_CAST<Entity_Tear *>(pEVar27));
pfVar18 = GHIDRA_CAST<float *>(GHIDRA_INT(local_218.y));
local_1f0.y = (float)(GHIDRA_INT(local_1f0.y) + 1);
} while (GHIDRA_INT(local_1f0.y) < GHIDRA_INT(pfVar18));
fVar25 = local_2a4.y;
}
local_2a4.y = (float)(GHIDRA_INT(fVar25) + 1);
} while (GHIDRA_INT(local_2a4.y) < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_1c4))) + 0x0))));
}
}
if (((char)isBrimstone != '\0') && ((float)chargeThreshold <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)))) {
Weapon::UpdateHeadChargeAnimation(this,0x76,2,&shotDirection,-1.0);
local_220.y = atan2f(shotDirection.y,shotDirection.x);
local_220.y = local_220.y * 57.295776;
local_1e4.y = 0.0;
do {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT(local_1e4.y) * 4 + 0x44));
pEVar27 = GHIDRA_CAST<Entity_Bomb *>(local_1e4.y);
if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))) != GHIDRA_CAST<Entity_Player *>(0x0)) &&
((GHIDRA_CAST<Entity_Bomb *>(local_1e4.y) == GHIDRA_CAST<Entity_Bomb *>(0x0) ||
(((GHIDRA_CAST<Entity_Bomb *>(local_1e4.y) == GHIDRA_CAST<Entity_Bomb *>(0x1) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_2d4)) + 0x1))) != '\0')) ||
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_2d4)) + 0x2))) != '\0')))))) {
pcVar2 = *(code **)(*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_1c4))) + 0x0))) + 0x3c);
if (ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
(GHIDRA_CAST<Color *>((&flashColor)))->Color::Reset();
flashColor._tint[0] = 1.0;
flashColor._tint[1] = 0.0;
flashColor._tint[2] = 0.0;
flashColor._tint[3] = 1.0;
flashColor._offset[0] = 0.0;
flashColor._offset[1] = 0.0;
flashColor._offset[2] = 0.0;
}
else {
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_6c))))->Color::Reset();
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0x0))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0x4))) = 0.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0x8))) = 0.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_6c)) + 0xc))) = 1.0;
pvStack_4c = (void *)0x0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x0))) = (ownerPlayer->_laserColor)._tint[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x4))) = (ownerPlayer->_laserColor)._tint[1];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x8))) = (ownerPlayer->_laserColor)._tint[2];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0xc))) = (ownerPlayer->_laserColor)._tint[3];
pvStack_48 = (void *)0x0;
puStack_44 = GHIDRA_CAST<uint8_t *>(0x0);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x10))) = (ownerPlayer->_laserColor)._colorize[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x14))) = (ownerPlayer->_laserColor)._colorize[1];
fStack_ac = (ownerPlayer->_laserColor)._colorize[2];
fStack_a8 = (ownerPlayer->_laserColor)._colorize[3];
local_a4.x = (ownerPlayer->_laserColor)._offset[0];
local_a4.y = (ownerPlayer->_laserColor)._offset[1];
local_9c = GHIDRA_CAST<uint8_t *>((ownerPlayer->_laserColor)._offset[2]);
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c4))))->Color::__mul(GHIDRA_CAST<ColorMod *>(local_6c));
puStack_70 = local_9c;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x0)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x4)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x8))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x8)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0xc))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0xc)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x10))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x10)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x14))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x14)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x18))) = fStack_ac;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x1c))) = fStack_a8;
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x20))) = local_a4;
}
rngResult = 1;
uVar6 = 1;
(*pcVar2)();
pEVar27 = GHIDRA_CAST<Entity_Bomb *>(local_1e4.y);
if (GHIDRA_CAST<Entity_Bomb *>(local_1e4.y) == GHIDRA_CAST<Entity_Bomb *>(0x0)) {
if (0 < local_1d2) {
local_29c = 0x3f800000;
local_298 = GHIDRA_CAST<Entity_Bomb *>(local_1e4.y);
iVar30 = 0;
do {
fVar23 = fStack_2c4;
fVar25 = fStack_2c0;
FUN_009f4230(local_2ac,iVar30,10,local_29c,local_298,shotSpeed);
fVar26 = atan2f(local_2a4.y,local_2a4.x);
local_264.y = (fVar26 * 57.295776 + local_220.y) * 0.017453292;
local_284 = GHIDRA_CAST<Entity_Bomb *>(sin(local_264.y));
pEVar31 = GHIDRA_CAST<Entity *>(0x9fcd6b);
fVar26 = cos(local_264.y);
local_274.y = (float)local_284 * 6.0;
local_274.x = fVar26 * 6.0;
local_24c.x = ownerPos.x + fVar26 * 30.0;
local_24c.y = ownerPos.y + (float)local_284 * 30.0;
Weapon::fire_brimstone_ball
(this,&local_24c,&local_274,GHIDRA_CAST<Vector *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) + 0x34c))
,GHIDRA_UINT(fVar23),GHIDRA_UINT(fVar25),pEVar31);
iVar30 = iVar30 + 1;
} while (iVar30 < local_1d2);
}
pEVar27 = GHIDRA_CAST<Entity_Bomb *>(local_1e4.y);
}
else {
fVar23 = atan2f(shotDirection.y,shotDirection.x);
fVar23 = fVar23 * 57.295776 + (float)(&DAT_00b81710)[GHIDRA_INT(pEVar27)];
if (360.0 < ABS(fVar23)) {
fVar23 = fmodf(fVar23,360.0);
}
if (fVar23 <= 180.0) {
if (fVar23 < -180.0) {
fVar23 = fVar23 + 360.0;
}
}
else {
fVar23 = fVar23 - 360.0;
}
local_264.y = fVar23 * 0.017453292;
local_284 = GHIDRA_CAST<Entity_Bomb *>(sin(local_264.y));
pEVar31 = GHIDRA_CAST<Entity *>(0x9fd007);
fVar23 = cos(local_264.y);
local_1f0.y = (float)local_284 * 6.0;
local_1f0.x = fVar23 * 6.0;
local_218.x = ownerPos.x + fVar23 * 30.0;
local_218.y = ownerPos.y + (float)local_284 * 30.0;
Weapon::fire_brimstone_ball
(this,&local_218,&local_1f0,
GHIDRA_CAST<Vector *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT(pEVar27) * 4 + 0x44)) + 0x34c)),uVar6,
rngResult,pEVar31);
}
}
pMVar3 = g_manager;
local_1e4.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar27)) + 0x1)));
} while (GHIDRA_UINT(local_1e4.y) < &DAT_00000004);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x7);
seed_fart_sound_override(GHIDRA_CAST<int *>(local_1c4));
(GHIDRA_CAST<SoundEffects *>((&pMVar3->_sfxManager)))->SoundEffects::Play((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))),0.5,2,0,1.0,0.0);
Weapon::SetBlinkTime(this,0x24,unused);
pfVar18 = extraout_ECX_05;
}
if (((char)isCSection != '\0') && ((float)chargeThreshold <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)))) {
Weapon::update_c_section_charge_anim(this,GHIDRA_INT(pfVar18),2,aimDirection,-1.0);
fVar23 = atan2f(shotDirection.y,shotDirection.x);
local_284 = GHIDRA_CAST<Entity_Bomb *>((fVar23 * 57.295776));
local_1f0.y = 0.0;
do {
fVar23 = local_1f0.y;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT(local_1f0.y) * 4 + 0x44)) != 0) {
if (local_1f0.y == 0.0) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x0);
if (0 < local_1d2) {
local_24c.x = 1.0;
local_24c.y = 0.0;
local_298 = GHIDRA_CAST<Entity_Bomb *>(0x3c23d70a);
do {
FUN_009f4230(local_50,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))),10,local_24c.x,local_24c.y,shotSpeed);
fVar23 = atan2f((float)puStack_44,(float)pvStack_48);
local_220.y = (fVar23 * 57.295776 + (float)local_284) * 0.017453292;
local_264.y = sin(local_220.y);
iVar30 = 0x9fd2a2;
fVar23 = cos(local_220.y);
local_2a4.y = local_264.y * 10.0;
local_2a4.x = fVar23 * 10.0;
local_1e4.x = ownerPos.x + fVar23 * 4.0;
local_1e4.y = ownerPos.y + local_264.y * 4.0;
fetusTear = fire_fetus_tear(this,&local_1e4,&local_2a4,0,*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4))
,1.0,iVar30);
local_220.y = fetusTear->_fScale * 1.2;
pfVar18 = &local_220.y;
if (local_220.y <= 0.01) {
pfVar18 = GHIDRA_CAST<float *>(&local_298);
}
fVar23 = *pfVar18;
fetusTear->_baseScale = fVar23;
fetusTear->_fScale = fVar23;
Entity_Tear::ResetSpriteScale(fetusTear);
fetusTear->_tearRange = fetusTear->_tearRange + fetusTear->_tearRange;
(**(code **)(*GHIDRA_CAST<int *>(fetusTear) + 0xc))();
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) + 1;
} while ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_1c4))) + 0x0))) < GHIDRA_INT(local_1d2));
}
}
else if (((local_1f0.y == 1.4013e-45) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_2d4)) + 0x1))) != '\0')) ||
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_2d4)) + 0x2))) != '\0')) {
fVar25 = atan2f(shotDirection.y,shotDirection.x);
fVar23 = fVar25 * 57.295776 + (float)(&DAT_00b81710)[GHIDRA_INT(fVar23)];
if (360.0 < ABS(fVar23)) {
fVar23 = fmodf(fVar23,360.0);
}
if (fVar23 <= 180.0) {
if (fVar23 < -180.0) {
fVar23 = fVar23 + 360.0;
}
}
else {
fVar23 = fVar23 - 360.0;
}
local_220.y = fVar23 * 0.017453292;
local_264.y = sin(local_220.y);
iVar30 = 0x9fd0d2;
fVar23 = cos(local_220.y);
local_274.y = local_264.y * 10.0;
local_274.x = fVar23 * 10.0;
local_218.x = ownerPos.x + fVar23 * 4.0;
local_218.y = ownerPos.y + local_264.y * 4.0;
fetusTear = fire_fetus_tear(this,&local_218,&local_274,0,*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 4)),1.0
,iVar30);
local_264.y = 0.01;
local_220.y = fetusTear->_fScale * 1.2;
pVVar9 = &local_220;
if (local_220.y <= 0.01) {
pVVar9 = &local_264;
}
fVar23 = pVVar9->y;
fetusTear->_baseScale = fVar23;
fetusTear->_fScale = fVar23;
Entity_Tear::ResetSpriteScale(fetusTear);
fetusTear->_tearRange = fetusTear->_tearRange + fetusTear->_tearRange;
(**(code **)(*GHIDRA_CAST<int *>(fetusTear) + 0xc))();
}
}
local_1f0.y = (float)(GHIDRA_INT(local_1f0.y) + 1);
} while (GHIDRA_UINT(local_1f0.y) < &DAT_00000004);
}
if ((char)isCursedEye == '\0') {
local_1e4.y = 1.4013e-45;
}
else {
local_1e4.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x5c));
}
fVar23 = 0.0;
EntityList::QuerySublist
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_27c),8,1,-1,0,0);
rngResult = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_27c)) + 0x4)));
local_8 = 2.8026e-45;
fVar25 = 0.0;
if (local_274.y != 0.0) {
fVar26 = local_274.y;
club = heldClub;
do {
piVar15 = *GHIDRA_CAST<int **>((rngResult + GHIDRA_INT(fVar25) * 4));
if (GHIDRA_CAST<Entity_Knife *>(piVar15[0xef]) == club) {
(**(code **)(*piVar15 + 0x28))();
fVar26 = local_274.y;
club = heldClub;
}
fVar25 = (float)(GHIDRA_INT(fVar25) + 1);
} while (GHIDRA_UINT(fVar25) < GHIDRA_UINT(fVar26));
this = (void *)ownerVelocityX.y;
}
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(0x0);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x0);
do {
owner = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0)));
if ((*GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) * 4)) != 0) &&
(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))) == GHIDRA_CAST<Entity_Player *>(0x0) ||
((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))) == GHIDRA_CAST<Entity_Player *>(0x1) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_2d4)) + 0x1))) != '\0'))
|| ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_2d4)) + 0x2))) != '\0')))))) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))) = 0.0;
tearBombVariant = 0;
(GHIDRA_CAST<Color *>((&tearColor)))->Color::Color();
tearFlags._l = 0;
tearFlags._h = 0;
tearDamage = GHIDRA_CAST<Entity_Player *>(0x40600000);
tearScale = 1.0;
tearHeight = -23.75;
uStack_16c = 0x3f800000;
local_168 = 0x3fd9999a;
local_164 = 1.0;
local_160 = 0.0;
piVar15 = extraout_EDX;
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
pEVar31 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x4))));
uVar6 = Random();
pTVar7 = Entity_Player::GetTearHitParams
(ownerPlayer,&local_158,10,1.0,(uVar6 & 1) * 2 + -1,pEVar31);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))) = pTVar7->_tearVariant;
tearBombVariant = pTVar7->_bombVariant;
if (&tearColor != GHIDRA_CAST<Color *>(&pTVar7->_tearColor)) {
tearColor._tint[0] = (pTVar7->_tearColor)._tint[0];
tearColor._tint[1] = (pTVar7->_tearColor)._tint[1];
tearColor._tint[2] = (pTVar7->_tearColor)._tint[2];
tearColor._tint[3] = (pTVar7->_tearColor)._tint[3];
tearColor._colorize[0] = (pTVar7->_tearColor)._colorize[0];
tearColor._colorize[1] = (pTVar7->_tearColor)._colorize[1];
tearColor._colorize[2] = (pTVar7->_tearColor)._colorize[2];
tearColor._colorize[3] = (pTVar7->_tearColor)._colorize[3];
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(tearColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((pTVar7->_tearColor)._offset);
tearColor._offset[2] = (pTVar7->_tearColor)._offset[2];
}
tearFlags._l = (pTVar7->_flags)._l;
tearFlags._h = (pTVar7->_flags)._h;
tearDamage = GHIDRA_CAST<Entity_Player *>(pTVar7->_tearDamage);
tearScale = pTVar7->_tearScale;
tearHeight = pTVar7->_tearHeight;
uStack_16c = pTVar7[1]._tearVariant;
local_168 = pTVar7[1]._bombVariant;
local_164 = pTVar7[1]._tearColor._tint[0];
piVar15 = *GHIDRA_CAST<int **>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) * 4));
local_160 = pTVar7[1]._tearColor._tint[1];
owner = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0)));
}
fVar23 = 0.0;
ownerVelocityX.y = damageMultiplier * (float)tearDamage;
pfVar18 = &ownerVelocityX.y;
if ((float)(damageMultiplier * (float)tearDamage) <= (float)local_1d8) {
pfVar18 = GHIDRA_CAST<float *>(&local_1d8);
}
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(*pfVar18);
(**(code **)(*piVar15 + 0x3c))();
iVar30 = *GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + GHIDRA_INT(owner) * 4));
*GHIDRA_CAST<uint32_t *>((iVar30 + 0x410)) = (uint32_t)tearFlags._l;
*GHIDRA_CAST<uint32_t *>((iVar30 + 0x414)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)));
*GHIDRA_CAST<uint32_t *>((iVar30 + 0x418)) = (uint32_t)tearFlags._h;
*GHIDRA_CAST<uint32_t *>((iVar30 + 0x41c)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)));
(**(code **)(**GHIDRA_CAST<int **>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + GHIDRA_INT(owner) * 4)) + 0x40))();
fVar25 = atan2f(shotDirection.y,shotDirection.x);
fVar25 = fVar25 * 57.295776 + (float)(&DAT_00b81710)[GHIDRA_INT(owner)];
if (360.0 < ABS(fVar25)) {
fVar25 = fmodf(fVar25,360.0);
}
if (fVar25 <= 180.0) {
if (fVar25 < -180.0) {
fVar25 = fVar25 + 360.0;
}
}
else {
fVar25 = fVar25 - 360.0;
}
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + GHIDRA_INT(owner) * 4)) + 0x438)) = fVar25
;
iVar30 = *GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + GHIDRA_INT(owner) * 4));
*GHIDRA_CAST<short *>((iVar30 + 0x4ec)) = SUB42(local_1e4.y,0);
*GHIDRA_CAST<uint16_t *>((iVar30 + 0x4ee)) = 0;
Entity_Knife::SetAttackAnimation
(*GHIDRA_CAST<Entity_Knife **>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + GHIDRA_INT(owner) * 4)));
*GHIDRA_CAST<bool *>((*GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + GHIDRA_INT(owner) * 4)) + 0x466)) =
isChargeMode == '\0';
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((owner)) + 0x1)));
} while ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_1c4))) + 0x0))) < GHIDRA_CAST<uint8_t *>(0x4));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0x0);
if (0 < local_1d2) {
local_288 = 0x3f800000;
ownerVelocityX.y = (float)(GHIDRA_INT(local_1d2) / 2);
local_284 = GHIDRA_CAST<Entity_Bomb *>(0x0);
do {
rngResult = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0)));
fVar23 = fStack_2c0;
FUN_009f4230(local_50,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))),10,local_288,local_284,shotSpeed);
fVar25 = atan2f((float)puStack_44,(float)pvStack_48);
fVar25 = fVar25 * 57.295776;
local_264.y = fVar25;
if ((float)rngResult == ownerVelocityX.y) {
if (360.0 < ABS(fVar25)) {
fVar25 = fmodf(fVar25,360.0);
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = rngResult;
if (fVar25 <= 180.0) {
if (fVar25 < -180.0) {
fVar25 = fVar25 + 360.0;
}
heldClub->_rotationOffset = fVar25;
}
else {
heldClub->_rotationOffset = fVar25 - 360.0;
}
}
else {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))) = 0.0;
tearBombVariant = 0;
pEVar31 = GHIDRA_CAST<Entity *>(0x9fd86a);
(GHIDRA_CAST<Color *>((&tearColor)))->Color::Color();
tearFlags._l = 0;
tearFlags._h = 0;
tearDamage = GHIDRA_CAST<Entity_Player *>(0x40600000);
tearScale = 1.0;
tearHeight = -23.75;
uStack_16c = 0x3f800000;
local_168 = 0x3fd9999a;
local_164 = 1.0;
local_160 = 0.0;
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
pEVar31 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x4))));
uVar6 = Random();
fVar23 = (float)((uVar6 & 1) * 2 - 1);
pTVar7 = Entity_Player::GetTearHitParams
(ownerPlayer,&local_158,10,1.0,GHIDRA_INT(fVar23),pEVar31);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))) = pTVar7->_tearVariant;
tearBombVariant = pTVar7->_bombVariant;
if (&tearColor != GHIDRA_CAST<Color *>(&pTVar7->_tearColor)) {
tearColor._tint[0] = (pTVar7->_tearColor)._tint[0];
tearColor._tint[1] = (pTVar7->_tearColor)._tint[1];
tearColor._tint[2] = (pTVar7->_tearColor)._tint[2];
tearColor._tint[3] = (pTVar7->_tearColor)._tint[3];
tearColor._colorize[0] = (pTVar7->_tearColor)._colorize[0];
tearColor._colorize[1] = (pTVar7->_tearColor)._colorize[1];
tearColor._colorize[2] = (pTVar7->_tearColor)._colorize[2];
tearColor._colorize[3] = (pTVar7->_tearColor)._colorize[3];
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(tearColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((pTVar7->_tearColor)._offset);
tearColor._offset[2] = (pTVar7->_tearColor)._offset[2];
}
tearFlags._l = (pTVar7->_flags)._l;
tearFlags._h = (pTVar7->_flags)._h;
tearDamage = GHIDRA_CAST<Entity_Player *>(pTVar7->_tearDamage);
tearScale = pTVar7->_tearScale;
tearHeight = pTVar7->_tearHeight;
uStack_16c = pTVar7[1]._tearVariant;
local_168 = pTVar7[1]._bombVariant;
local_164 = pTVar7[1]._tearColor._tint[0];
local_160 = pTVar7[1]._tearColor._tint[1];
}
local_220.y = damageMultiplier * (float)tearDamage;
pfVar18 = &local_220.y;
if (damageMultiplier * (float)tearDamage <= (float)local_1d8) {
pfVar18 = GHIDRA_CAST<float *>(&local_1d8);
}
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(*pfVar18);
club = Weapon::fire_bone_club
(this,GHIDRA_CAST<Entity *>(heldClub),GHIDRA_UINT(local_200),0,GHIDRA_INT(fVar23),GHIDRA_INT(pEVar31),
local_264.y);
fVar23 = 0.0;
(**(code **)(*GHIDRA_CAST<int *>(club) + 0x3c))();
iVar30 = *GHIDRA_CAST<int *>(club);
*GHIDRA_CAST<uint32_t *>(&(club->_tearFlags)._l) = (uint32_t)tearFlags._l;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(club->_tearFlags)._l) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)));
*GHIDRA_CAST<uint32_t *>(&(club->_tearFlags)._h) = (uint32_t)tearFlags._h;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(club->_tearFlags)._h) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)));
(**(code **)(iVar30 + 0x40))();
(club->_sprite)._scale.x = (heldClub->_sprite)._scale.x;
(club->_sprite)._scale.y = (heldClub->_sprite)._scale.y;
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((club)) + 0x4ec)))) = SUB42(local_1e4.y,0);
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((club)) + 0x4ee)))) = 0;
Entity_Knife::SetAttackAnimation(club);
(**(code **)(*GHIDRA_CAST<int *>(club) + 0xc))();
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = &((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0)))(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(()))) + 0x1));
} while ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_1c4))) + 0x0))) < GHIDRA_INT(local_1d2));
}
for ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_UINT(local_208) & 0xffff;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))) != GHIDRA_CAST<Entity_Player *>(0x0);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = &(GHIDRA_CAST<Entity_Player *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0)))(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(( + -0x2f00))))) + 0x2eff)))) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))) = 0.0;
tearBombVariant = 0;
(GHIDRA_CAST<Color *>((&tearColor)))->Color::Color();
tearFlags._l = 0;
tearFlags._h = 0;
tearDamage = GHIDRA_CAST<Entity_Player *>(0x40600000);
tearScale = 1.0;
tearHeight = -23.75;
uStack_16c = 0x3f800000;
local_168 = 0x3fd9999a;
local_164 = 1.0;
local_160 = 0.0;
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
pEVar31 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x4))));
uVar6 = Random();
fVar23 = (float)((uVar6 & 1) * 2 - 1);
pTVar7 = Entity_Player::GetTearHitParams(ownerPlayer,&local_158,10,1.0,GHIDRA_INT(fVar23),pEVar31);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x4))) = pTVar7->_tearVariant;
tearBombVariant = pTVar7->_bombVariant;
if (&tearColor != GHIDRA_CAST<Color *>(&pTVar7->_tearColor)) {
tearColor._tint[0] = (pTVar7->_tearColor)._tint[0];
tearColor._tint[1] = (pTVar7->_tearColor)._tint[1];
tearColor._tint[2] = (pTVar7->_tearColor)._tint[2];
tearColor._tint[3] = (pTVar7->_tearColor)._tint[3];
tearColor._colorize[0] = (pTVar7->_tearColor)._colorize[0];
tearColor._colorize[1] = (pTVar7->_tearColor)._colorize[1];
tearColor._colorize[2] = (pTVar7->_tearColor)._colorize[2];
tearColor._colorize[3] = (pTVar7->_tearColor)._colorize[3];
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(tearColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((pTVar7->_tearColor)._offset);
tearColor._offset[2] = (pTVar7->_tearColor)._offset[2];
}
tearFlags._l = (pTVar7->_flags)._l;
tearFlags._h = (pTVar7->_flags)._h;
tearDamage = GHIDRA_CAST<Entity_Player *>(pTVar7->_tearDamage);
tearScale = pTVar7->_tearScale;
tearHeight = pTVar7->_tearHeight;
uStack_16c = pTVar7[1]._tearVariant;
local_168 = pTVar7[1]._bombVariant;
local_164 = pTVar7[1]._tearColor._tint[0];
local_160 = pTVar7[1]._tearColor._tint[1];
}
ownerVelocityX.y = damageMultiplier * (float)tearDamage;
pfVar18 = &ownerVelocityX.y;
if ((float)(damageMultiplier * (float)tearDamage) <= (float)local_1d8) {
pfVar18 = GHIDRA_CAST<float *>(&local_1d8);
}
local_1d8 = GHIDRA_CAST<Entity_Bomb *>(*pfVar18);
iVar30 = 0x9fdc3d;
uVar6 = Random();
club = Weapon::fire_bone_club
(this,GHIDRA_CAST<Entity *>(heldClub),GHIDRA_UINT(local_200),0,GHIDRA_INT(fVar23),iVar30,
(float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)])
* 2.3283064e-10 * 360.0);
fVar23 = 0.0;
(**(code **)(*GHIDRA_CAST<int *>(club) + 0x3c))();
iVar30 = *GHIDRA_CAST<int *>(club);
*GHIDRA_CAST<uint32_t *>(&(club->_tearFlags)._l) = (uint32_t)tearFlags._l;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(club->_tearFlags)._l) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)));
*GHIDRA_CAST<uint32_t *>(&(club->_tearFlags)._h) = (uint32_t)tearFlags._h;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(club->_tearFlags)._h) + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)));
(**(code **)(iVar30 + 0x40))();
(club->_sprite)._scale.x = (heldClub->_sprite)._scale.x;
(club->_sprite)._scale.y = (heldClub->_sprite)._scale.y;
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((club)) + 0x4ec)))) = SUB42(local_1e4.y,0);
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((club)) + 0x4ee)))) = 0;
Entity_Knife::SetAttackAnimation(club);
(**(code **)(*GHIDRA_CAST<int *>(club) + 0xc))();
}
uVar6 = Random();
pMVar3 = g_manager;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0xfc);
local_238.y = ((float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 0.2 + 0.9) * local_238.y;
seed_fart_sound_override(GHIDRA_CAST<int *>(local_1c4));
(GHIDRA_CAST<SoundEffects *>((&pMVar3->_sfxManager)))->SoundEffects::Play((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))),1.0,1,0,local_238.y,0.0);
if ((20.0 < (float)local_1d8) && (1.5 < (float)clubScale)) {
Game::ShakeScreen(g_game,GHIDRA_INT(((float)clubScale * 5.0)));
}
if (isChargeMode == '\0') {
owner = GHIDRA_CAST<Entity_Player *>(0x3f800000);
if (isReleased == '\0') goto LAB_009fde0f;
if ((GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage <= 1.0 &&
(GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage != 1.0) {
(GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage = 1.0;
}
}
else {
owner = GHIDRA_CAST<Entity_Player *>(0x0);
LAB_009fde0f:
newCharge = owner;
}
*GHIDRA_CAST<uint32_t *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + 0x18)) = 0;
(GHIDRA_CAST<Entity_Player *>(this))->_index = GHIDRA_INT(g_vectorZero.x);
(GHIDRA_CAST<Entity_Player *>(this))->_collisionIndex = GHIDRA_INT(g_vectorZero.y);
if ((char)isCursedEye != '\0') {
owner = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x4))));
if (((owner == GHIDRA_CAST<Entity_Player *>(0x0)) || (pEVar19 = owner, owner->_type != 1)) &&
((pEVar19 = GHIDRA_CAST<Entity_Player *>(0x0), owner != GHIDRA_CAST<Entity_Player *>(0x0) && (owner->_type == 3)))) {
owner->_chargeBarSprites[5]._numEvents = 0;
}
else if (pEVar19 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::stop_costume_item_anims(pEVar19);
}
}
pEVar19 = player;
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::TryForgottenThrow(player,&shotDirection);
}
if (local_27c[0] == '\0') {
local_8 = 4.2039e-45;
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_27c)) + 0x4))),0);
}
local_8 = -NAN;
iVar30 = GHIDRA_UINT(local_1c6) << 8;
pfVar18 = &(GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage;
LAB_009fdeca:
owner = newCharge;
if ((char)(GHIDRA_UINT(iVar30) >> 8) == '\0') goto LAB_009fb9ec;
}
owner = newCharge;
if (weaponType == 0xb) goto LAB_009fb9ec;
if (((heldClub->_isSwinging != 0) && (isReleased == '\0')) || (*pfVar18 < 1.0)) {
club = heldClub;
goto LAB_009fb9f2;
}
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(clubFlashColor))))->Color::Reset();
pfVar18 = &local_258.y;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x0))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x4))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x8))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0xc))) = (void *)0x0;
local_238.y = 1.001;
owner = GHIDRA_CAST<Entity_Player *>(((float)newCharge + 1.0));
clampedValue = &local_238.y;
if (1.001 <= (float)maxCharge) {
clampedValue = pfVar18;
}
newCharge = GHIDRA_CAST<Entity_Player *>(*clampedValue);
if ((float)owner <= (float)newCharge) {
newCharge = owner;
}
if (pEVar19 == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009fe321;
pfVar18 = GHIDRA_CAST<float *>(CONCAT31((int3)(GHIDRA_UINT(pfVar18) >> 8),isEpicFetus));
if ((isDrFetus != '\0') || (isEpicFetus != '\0')) {
heldEntitySlot = &pEVar19->_heldEntity;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = heldEntitySlot;
if (*heldEntitySlot == (void *)0x0) {
if (isChargeMode == '\0') {
fVar23 = 1.0;
}
else {
fVar23 = (float)maxCharge - 30.0;
if (fVar23 <= 2.0) {
fVar23 = 2.0;
}
}
if ((GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage == fVar23) {
if (isEpicFetus == '\0') {
local_274.x = (player->_pos).x;
local_274.y = (player->_pos).y;
pEVar27 = Weapon::fire_bomb(this,&local_274,&g_vectorZero);
if (*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void **)local_1c4)) + 0x0))) != (void *)0x0) {
local_258.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0)));
msvc::multiset<unsigned_int>::erase();
}
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Bomb **>(local_1c4))) + 0x0))) = pEVar27;
if (pEVar27 != GHIDRA_CAST<Entity_Bomb *>(0x0)) {
msvc::multiset<unsigned_int>::insert();
}
savedBombFlags = pEVar27->_flags;
bombFlagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pEVar27->_flags) + 4));
*bombFlagsHigh = *bombFlagsHigh | 0x2000020;
*GHIDRA_CAST<int *>(&pEVar27->_flags) = GHIDRA_INT(savedBombFlags);
pEVar27->_explosionCountdown1 = 0x2d;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar27)) + 0x414)))) = 0x2d;
pEVar27->_entityCollisionClass = 0;
pEVar27->_entityGridCollisionClass = 0;
pEVar27->_visible = 0;
fVar23 = atan2f(shotDirection.y,shotDirection.x);
pEVar27->_rocketAngle = fVar23 * 57.295776;
if ((pEVar27->_variant == 0x13) || (pEVar27->_variant == 0x14)) {
ANM2::Play(&pEVar27->_sprite,s_Idle,0);
(pEVar27->_sprite)._rotation = 0.0;
}
}
else {
uVar6 = Random();
local_274.x = (player->_pos).x;
local_274.y = (player->_pos).y;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) =
Game::Spawn(g_game,1000,0x76,&local_274,&g_vectorZero,
*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x4)))),0,uVar6);
if (*heldEntitySlot != (void *)0x0) {
local_258.y = (float)heldEntitySlot;
msvc::multiset<unsigned_int>::erase();
}
*heldEntitySlot = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_1c4)) + 0x0)));
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))) != GHIDRA_CAST<Entity_Player *>(0x0)) {
msvc::multiset<unsigned_int>::insert();
}
savedBombFlags = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))))->_flags;
bombFlagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))))->_flags) + 4));
*bombFlagsHigh = *bombFlagsHigh | 0x20;
((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))))->_visible = 0;
*GHIDRA_CAST<int *>(&((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(local_1c4))) + 0x0))))->_flags) = GHIDRA_INT(savedBombFlags);
}
pMVar3 = g_manager;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = GHIDRA_CAST<Entity_Player *>(0xc9);
seed_fart_sound_override(GHIDRA_CAST<int *>(local_1c4));
(GHIDRA_CAST<SoundEffects *>((&pMVar3->_sfxManager)))->SoundEffects::Play((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))),1.0,2,0,1.0,0.0);
pfVar18 = extraout_ECX_06;
}
}
pEVar19 = player;
}
pvVar17 = pEVar19->_heldEntity;
if (pvVar17 == (void *)0x0) goto LAB_009fe321;
fVar23 = (pEVar19->_pos).y;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x33c)) = (pEVar19->_pos).x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x340)) = fVar23;
pvVar17 = pEVar19->_heldEntity;
fVar23 = (pEVar19->_velocity).y;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x360)) = (pEVar19->_velocity).x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x364)) = fVar23;
switch(pEVar19->_headDirection) {
case 0:
fVar23 = (pEVar19->_sprite)._scale.x * 8.0;
break;
case 1:
fVar23 = (pEVar19->_sprite)._scale.x * -12.0;
goto LAB_009fe24e;
case 2:
fVar23 = (pEVar19->_sprite)._scale.x * -8.0;
LAB_009fe24e:
fVar25 = (pEVar19->_sprite)._scale.y;
pvVar17 = pEVar19->_heldEntity;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x34c)) = fVar23;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x350)) = fVar25 * -4.0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pEVar19->_heldEntity) + 0x354)) = 0xffffffff;
goto LAB_009fe2f0;
default:
fVar23 = (pEVar19->_sprite)._scale.x * 12.0;
}
fVar25 = (pEVar19->_sprite)._scale.y;
pvVar17 = pEVar19->_heldEntity;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x34c)) = fVar23;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x350)) = fVar25 * -4.0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pEVar19->_heldEntity) + 0x354)) = 0;
LAB_009fe2f0:
pvVar17 = pEVar19->_heldEntity;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar17) + 0x28)) == 4) {
fVar23 = atan2f(shotDirection.y,shotDirection.x);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar17) + 0x428)) = fVar23 * 57.295776;
pfVar18 = extraout_ECX_07;
}
LAB_009fe321:
club = heldClub;
if ((char)isCursedEye == '\0') {
if (isChocolateMilk != 0) goto LAB_009fe472;
if ((char)isBrimstone != '\0') goto LAB_009fe5d9;
if ((float)maxCharge <= (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0xc))) = (void *)0x3f800000;
VStack_20.x = 0.2;
VStack_20.y = 0.2;
puStack_18 = GHIDRA_CAST<uint8_t *>(0x3e4ccccd);
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(clubFlashColor))))->Color::__mul(&heldClub->_color);
pfVar18 = extraout_ECX_08;
}
}
else {
if ((float)maxCharge < (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage ||
(float)maxCharge == (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage) {
Weapon::UpdateHeadChargeAnimation(this,0x13c,1,&shotDirection,-1.0);
club = heldClub;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0xc))) = (void *)0x3f800000;
VStack_20.x = 0.2;
VStack_20.y = 0.2;
puStack_18 = GHIDRA_CAST<uint8_t *>(0x3e4ccccd);
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(clubFlashColor))))->Color::__mul(&heldClub->_color);
iVar30 = extraout_ECX_10;
}
else {
Weapon::UpdateHeadChargeAnimation(this,0x13c,0,&shotDirection,0.0);
iVar30 = extraout_ECX_09;
club = heldClub;
}
Weapon::SetBlinkTime(this,1,iVar30);
uVar6 = GHIDRA_UINT((((float)newCharge * 5.0) / (float)maxCharge));
*GHIDRA_CAST<uint32_t *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + 0x18)) = uVar6;
if ((1.0 < (float)newCharge) && (uVar6 == 0)) {
*GHIDRA_CAST<uint32_t *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + 0x18)) = 1;
}
pfVar18 = extraout_ECX_11;
if (isChocolateMilk != 0) {
LAB_009fe472:
fVar23 = (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage;
if ((float)maxCharge <= fVar23) {
puVar22 = &DAT_bf800000;
}
else {
puVar22 = GHIDRA_CAST<uint8_t *>(((fVar23 / (float)maxCharge) * 18.0));
}
Weapon::UpdateHeadChargeAnimation
(this,0x45,GHIDRA_UINT(((float)maxCharge <= fVar23)),&shotDirection,(float)puVar22);
Weapon::SetBlinkTime(this,1,unused_00);
fVar25 = ((float)newCharge / (float)maxFireDelay - 1.0) * 0.5 + 1.0;
fVar23 = 1.0;
if (1.0 <= fVar25) {
fVar23 = fVar25;
}
fVar23 = fVar23 * (float)clubScale;
fVar25 = fVar23;
if ((heldClub->_isSwinging != 0) && (fVar25 = (heldClub->_sprite)._scale.x, fVar25 <= fVar23))
{
fVar25 = fVar23;
}
iVar30 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))));
if (iVar30 != 0) {
fVar23 = fVar25 * g_vectorOne.y;
*GHIDRA_CAST<float *>((iVar30 + 0xe4)) = fVar25 * g_vectorOne.x;
*GHIDRA_CAST<float *>((iVar30 + 0xe8)) = fVar23;
}
iVar30 = *GHIDRA_CAST<int *>(((GHIDRA_CAST<ANM2 *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + 4)))->_filename)._buf);
if (iVar30 != 0) {
fVar23 = fVar25 * g_vectorOne.y;
*GHIDRA_CAST<float *>((iVar30 + 0xe4)) = fVar25 * g_vectorOne.x;
*GHIDRA_CAST<float *>((iVar30 + 0xe8)) = fVar23;
}
iVar30 = *GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + 8));
if (iVar30 != 0) {
fVar23 = fVar25 * g_vectorOne.y;
*GHIDRA_CAST<float *>((iVar30 + 0xe4)) = fVar25 * g_vectorOne.x;
*GHIDRA_CAST<float *>((iVar30 + 0xe8)) = fVar23;
}
iVar30 = *GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x44))) + 0xc));
pfVar18 = extraout_ECX_12;
club = heldClub;
if (iVar30 != 0) {
fVar23 = fVar25 * g_vectorOne.y;
*GHIDRA_CAST<float *>((iVar30 + 0xe4)) = fVar25 * g_vectorOne.x;
*GHIDRA_CAST<float *>((iVar30 + 0xe8)) = fVar23;
}
}
if ((char)isBrimstone != '\0') {
LAB_009fe5d9:
if ((float)chargeThreshold <= (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage) {
Weapon::UpdateHeadChargeAnimation(this,0x76,1,&shotDirection,-1.0);
owner = ownerPlayer;
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(chargeColor))))->Color::Reset();
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x0))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x4))) = 0.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x8))) = 0.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0xc))) = (void *)0x3f800000;
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x0))) = (owner->_laserColor)._tint[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x4))) = (owner->_laserColor)._tint[1];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x8))) = (owner->_laserColor)._tint[2];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0xc))) = (owner->_laserColor)._tint[3];
local_2d0 = GHIDRA_CAST<uint8_t *>((owner->_laserColor)._offset[2]);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x10))) = (owner->_laserColor)._colorize[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x14))) = (owner->_laserColor)._colorize[1];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x18))) = (owner->_laserColor)._colorize[2];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x1c))) = (owner->_laserColor)._colorize[3];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x20))) = (owner->_laserColor)._offset[0];
uStack_2d4 = (owner->_laserColor)._offset[1];
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_2f8))))->Color::__mul(GHIDRA_CAST<ColorMod *>(chargeColor));
puStack_70 = local_2d0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x0)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x4)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x8))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x8)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0xc))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0xc)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x10))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x10)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x14))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x14)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x18))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x18)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x1c))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x1c)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x20))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2f8)) + 0x20)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x24))) = uStack_2d4;
}
club = heldClub;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x0)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x4)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x8))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x8)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0xc))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0xc)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x10))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x10)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x14))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x14)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x18))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x18)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x1c))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x1c)));
VStack_20.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)chargeColor)) + 0x20)));
VStack_20.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)chargeColor)) + 0x24)));
puStack_18 = puStack_70;
iVar30 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(heldClub),2.0,0.0);
unused_01 = extraout_ECX_14;
if (iVar30 != 0) {
unused_01 = extraout_ECX_14;
if ((club->_sprite)._animState._animData != (void *)0x0) {
pfVar18 = AnimationState::GetNullFrameById(&(club->_sprite)._animState,0);
unused_01 = extraout_ECX_15;
if (pfVar18 != GHIDRA_CAST<float *>(0x0)) {
local_238.y = *pfVar18 / 0.65;
local_1e4.y = pfVar18[1] / 0.65;
local_258.y = (club->_sprite)._rotation * 0.017453292;
ownerVelocityX.y = cos(local_258.y);
fVar23 = sin(local_258.y);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = (local_238.y * ownerVelocityX.y - local_1e4.y * fVar23) * 1.2;
local_1e4.y = (local_1e4.y * ownerVelocityX.y + local_238.y * fVar23) * 1.2;
local_258.y = cos(1.5707964);
fVar23 = sin(1.5707964);
local_200 = (Entity_Player *)
(local_258.y * (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) - local_1e4.y * fVar23);
local_1f0.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) * fVar23 + local_258.y * local_1e4.y;
fVar23 = sqrtf((float)local_200 * (float)local_200 + local_1f0.y * local_1f0.y);
if (0.0 < fVar23) {
local_200 = GHIDRA_CAST<Entity_Player *>(((float)local_200 * (1.0 / fVar23)));
local_1f0.y = local_1f0.y * (1.0 / fVar23);
}
local_238.y = (club->_sprite)._scale.y;
uVar6 = Random();
local_258.y = (float)((double)GHIDRA_INT(uVar6) +
__uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) * 2.3283064e-10;
ownerVelocityX.y = (club->_pos).x;
local_220.y = (club->_pos).y;
uVar6 = Random();
fVar23 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10;
local_264.x = fVar23 * (float)local_200 * local_258.y * local_238.y * 10.0 +
local_258.y * (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))) + ownerVelocityX.y;
local_264.y = fVar23 * local_1f0.y * local_258.y * local_238.y * 10.0 +
local_258.y * local_1e4.y + local_220.y;
local_238.y = (float)Random();
iVar30 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(this)))) + 0x4))));
pVVar9 = &ownerVelocityX;
if (iVar30 == 0) {
local_274.x = g_vectorZero.x;
local_274.y = g_vectorZero.y;
pVVar9 = &local_274;
}
else {
ownerVelocityX.x = *GHIDRA_CAST<float *>((iVar30 + 0x360));
ownerVelocityX.y = *GHIDRA_CAST<float *>((iVar30 + 0x364));
}
uVar6 = Random();
fVar23 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 3.14;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c4)) + 0x0))) = fVar23 + fVar23;
uVar6 = Random();
local_200 = (Entity_Player *)
((float)((double)GHIDRA_INT(uVar6) +
__uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) * 2.3283064e-10);
fVar23 = cos((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))));
local_258.y = fVar23 * (float)local_200;
fVar23 = sin((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_1c4)) + 0x0))));
local_258.x = local_258.y + local_258.y + pVVar9->x * 0.2 + 0.0;
local_258.y = (fVar23 * (float)local_200 + fVar23 * (float)local_200 + pVVar9->y * 0.2
) - 1.0;
pEVar31 = Game::Spawn(g_game,1000,0x6f,&local_264,&local_258,GHIDRA_CAST<Entity *>(0x0),0,
GHIDRA_UINT(local_238.y));
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x0))) = (ownerPlayer->_laserColor)._tint[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x4))) = (ownerPlayer->_laserColor)._tint[1];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x8))) = (ownerPlayer->_laserColor)._tint[2];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0xc))) = (ownerPlayer->_laserColor)._tint[3];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x10))) = (ownerPlayer->_laserColor)._colorize[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x14))) = (ownerPlayer->_laserColor)._colorize[1];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x18))) = (ownerPlayer->_laserColor)._colorize[2];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x1c))) = (ownerPlayer->_laserColor)._colorize[3];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x20))) = (ownerPlayer->_laserColor)._offset[0];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeColor)) + 0x24))) = (ownerPlayer->_laserColor)._offset[1];
puStack_70 = GHIDRA_CAST<uint8_t *>((ownerPlayer->_laserColor)._offset[2]);
(**(code **)(*GHIDRA_CAST<int *>(pEVar31) + 0x3c))();
}
uVar6 = Random();
fVar25 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 0.3 + 0.3;
fVar23 = (heldClub->_sprite)._scale.x;
(pEVar31->_sprite)._scale.y = fVar25 * (heldClub->_sprite)._scale.y;
(pEVar31->_sprite)._scale.x = fVar25 * fVar23;
(pEVar31->_posOffset).x = (heldClub->_posOffset).x;
(pEVar31->_posOffset).y = (heldClub->_posOffset).y;
pEVar31->_renderDepthOffset = -100.0;
unused_01 = heldClub;
club = heldClub;
}
}
}
}
else {
Weapon::UpdateHeadChargeAnimation
(this,0x76,0,&shotDirection,
((GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage / (float)chargeThreshold) * 18.0);
unused_01 = extraout_ECX_13;
}
Weapon::SetBlinkTime(this,1,GHIDRA_INT(unused_01));
pfVar18 = extraout_ECX_16;
}
}
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_250)) + 0x0))) != '\0') {
if ((float)chargeThreshold <= (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage) {
Weapon::UpdateHeadChargeAnimation(this,0xe5,1,&shotDirection,-1.0);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x0))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x4))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0x8))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(clubFlashColor)) + 0xc))) = (void *)0x3f800000;
VStack_20.x = 0.2;
VStack_20.y = 0.2;
puStack_18 = GHIDRA_CAST<uint8_t *>(0x3e4ccccd);
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(clubFlashColor))))->Color::__mul(&club->_color);
iVar30 = extraout_ECX_18;
}
else {
Weapon::UpdateHeadChargeAnimation
(this,0xe5,0,&shotDirection,
((GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage / (float)chargeThreshold) * 18.0);
iVar30 = extraout_ECX_17;
}
Weapon::SetBlinkTime(this,1,iVar30);
pfVar18 = extraout_ECX_19;
}
if ((char)isCSection != '\0') {
local_258.y = (GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage;
if ((float)chargeThreshold <= local_258.y) {
puVar22 = &DAT_bf800000;
iVar30 = 1;
LAB_009fece6:
Weapon::update_c_section_charge_anim(this,GHIDRA_INT(pfVar18),iVar30,aimDirection,(float)puVar22);
pfVar18 = extraout_ECX_21;
}
else {
bVar4 = Weapon::is_c_section_anim_finished(this,GHIDRA_INT(pfVar18));
pfVar18 = extraout_ECX_20;
if (bVar4 != 0) {
puVar22 = GHIDRA_CAST<uint8_t *>(((local_258.y / (float)chargeThreshold) * 18.0));
iVar30 = 0;
goto LAB_009fece6;
}
}
Weapon::SetBlinkTime(this,1,GHIDRA_INT(pfVar18));
}
iVar30 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(club),4.0,0.0);
if ((iVar30 != 0) && (0.0 < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)clubFlashColor)) + 0xc))))) {
(**(code **)(*GHIDRA_CAST<int *>(club) + 0x3c))();
}
pVVar9 = Weapon::get_aim_direction(this,&local_274,&shotDirection);
(GHIDRA_CAST<Entity_Player *>(this))->_index = GHIDRA_INT(pVVar9->x);
(GHIDRA_CAST<Entity_Player *>(this))->_collisionIndex = GHIDRA_INT(pVVar9->y);
owner = newCharge;
LAB_009fb9f2:
if (club->_isFlying != 0) {
Weapon::SetHeadLockTime(this,2);
}
(GHIDRA_CAST<Entity_Player *>(this))->_pendingDamage = (float)owner;
ExceptionList = local_10;
return;
}
// 009fed90
void Weapon_Bone::Reset()
{
this->ClearReferences();
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x1c)) = 0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0xc)) = 0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x10)) = 0x41200000;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x14)) = 0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x18)) = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x38)) = 0;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x20)) = g_vectorZero.x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x24)) = g_vectorZero.y;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x5c)) = 0;
return;
}
// 009fedf0
void Weapon_Bone::ClearReferences()
{
int *entitySlot;
int remaining;
int *local_8;
entitySlot = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 8));
local_8 = this;
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 8)) != GHIDRA_CAST<int *>(0x0)) {
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 8)) + 0x28))();
if (*entitySlot != 0) {
local_8 = entitySlot;
msvc::multiset<unsigned_int>::erase(&local_8);
*entitySlot = 0;
}
}
entitySlot = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x44));
remaining = 4;
do {
if (GHIDRA_CAST<int *>(*entitySlot) != GHIDRA_CAST<int *>(0x0)) {
(**(code **)(*GHIDRA_CAST<int *>(*entitySlot) + 0x28))();
(**(code **)(*GHIDRA_CAST<int *>(*entitySlot) + 0x44))();
}
entitySlot = entitySlot + 1;
remaining = remaining + -1;
} while (remaining != 0);
entitySlot = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x58));
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x58)) != GHIDRA_CAST<int *>(0x0)) {
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x58)) + 0x28))();
if (*entitySlot != 0) {
local_8 = entitySlot;
msvc::multiset<unsigned_int>::erase(&local_8);
*entitySlot = 0;
}
}
entitySlot = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x54));
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x54)) != GHIDRA_CAST<int *>(0x0)) {
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x54)) + 0x28))();
if (*entitySlot != 0) {
local_8 = entitySlot;
msvc::multiset<unsigned_int>::erase(&local_8);
*entitySlot = 0;
}
}
return;
}
// 009feeb0
long double Weapon_Bone::GetMaxCharge()
{
int in_ECX;
float fireDelay;
if (((*GHIDRA_CAST<uint32_t *>((in_ECX + 0x34)) & 0x80e) == 0) || ((*GHIDRA_CAST<uint32_t *>((in_ECX + 0x34)) & 1) != 0)) {
fireDelay = *GHIDRA_CAST<float *>((in_ECX + 0x10));
if (fireDelay < 0.001) {
fireDelay = 0.001;
}
return (long double)fireDelay * (long double)3.0;
}
fireDelay = *GHIDRA_CAST<float *>((in_ECX + 0x10));
if (fireDelay < 0.001) {
fireDelay = 0.001;
}
return (long double)fireDelay + (long double)fireDelay;
}
// 009fef20
void Weapon_Bone::TriggerNewRoom()
{
uint8_t bVar1;
uint8_t *pbVar2;
uint32_t uVar3;
uint8_t *pbVar4;
uint8_t *idleName;
int *knifeSlot;
bool isLess;
int *eraseKey;
int slotsLeft;
int knife;
int *targetRef;
knifeSlot = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x44));
slotsLeft = 4;
do {
knife = *knifeSlot;
if (knife != 0) {
targetRef = GHIDRA_CAST<int *>((knife + 0x3c4));
*GHIDRA_CAST<float *>((knife + 0x334)) = g_vectorZero.x;
*GHIDRA_CAST<float *>((knife + 0x338)) = g_vectorZero.y;
if (*targetRef != 0) {
eraseKey = targetRef;
msvc::multiset<unsigned_int>::erase(&eraseKey);
}
*targetRef = 0;
*GHIDRA_CAST<uint32_t *>((knife + 0x444)) = 0;
*GHIDRA_CAST<uint8_t *>((knife + 0x464)) = 0;
*GHIDRA_CAST<uint32_t *>((knife + 0x448)) = 0;
*GHIDRA_CAST<uint16_t *>((knife + 0x4e5)) = 0;
switch(*GHIDRA_CAST<int *>((knife + 0x2c))) {
case 2:
case 3:
case 4:
case 8:
case 9:
code_r0x009fefcb:
if ((*GHIDRA_CAST<int *>((knife + 0x7c)) != 0) && (*GHIDRA_CAST<char *>((knife + 0x8c)) != '\0')) {
pbVar2 = *GHIDRA_CAST<uint8_t **>((knife + 0x7c));
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
pbVar2 = *GHIDRA_CAST<uint8_t **>(pbVar2);
}
pbVar4 = &DAT_00b602e8;
do {
bVar1 = *pbVar2;
isLess = bVar1 < *pbVar4;
if (bVar1 != *pbVar4) {
LAB_009ff012:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009ff017;
}
if (bVar1 == 0) break;
bVar1 = pbVar2[1];
isLess = bVar1 < pbVar4[1];
if (bVar1 != pbVar4[1]) goto LAB_009ff012;
pbVar2 = pbVar2 + 2;
pbVar4 = pbVar4 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_009ff017:
if (uVar3 == 0) {
pbVar2 = *GHIDRA_CAST<uint8_t **>((knife + 0x7c));
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar4 = pbVar2;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar2);
}
idleName = s_Idle;
do {
bVar1 = *pbVar4;
isLess = bVar1 < *idleName;
if (bVar1 != *idleName) {
LAB_009ff054:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009ff059;
}
if (bVar1 == 0) break;
bVar1 = pbVar4[1];
isLess = bVar1 < idleName[1];
if (bVar1 != idleName[1]) goto LAB_009ff054;
pbVar4 = pbVar4 + 2;
idleName = idleName + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_009ff059:
if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || (*GHIDRA_CAST<char *>((knife + 0x8c)) != '\0')))) break;
}
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>((knife + 0x48)),s_Idle,1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((knife + 0x78)));
*GHIDRA_CAST<uint8_t *>((knife + 0x8c)) = 1;
}
}
}
break;
case 5:
case 0xb:
break;
default:
if (*GHIDRA_CAST<int *>((knife + 0x2c)) == 1) goto code_r0x009fefcb;
}
}
knifeSlot = knifeSlot + 1;
slotsLeft = slotsLeft + -1;
if (slotsLeft == 0) {
return;
}
} while( true );
}
// 009ff0c0
void Weapon_Bone::init_club(int *param_1)
{
int iVar1;
uint64_t qVar2;
ColorMod *pCVar3;
BitSet128 *tearFlags;
Weapon *in_ECX;
float damage;
int iVar4;
int iVar5;
Weapon *this;
uint8_t local_50 [4];
BitSet128 local_4c;
ColorMod tearColor;
uint32_t local_c;
code *setDamageFn;
local_c = __security_cookie ^ GHIDRA_UINT(local_50);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_4c._l)) + 0x0))) = *param_1;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x30)))) == 0xb) {
(**(code **)(GHIDRA_CAST<char *>(local_4c._l) + 0x40))();
return;
}
pCVar3 = Weapon::get_tear_color(in_ECX,&tearColor);
this = GHIDRA_CAST<Weapon *>(0xff);
iVar5 = -1;
(**(code **)(GHIDRA_CAST<char *>(local_4c._l) + 0x3c))(pCVar3,0xffffffff,0xff,0);
tearFlags = Weapon::get_owner_tear_flags(in_ECX,GHIDRA_CAST<BitSet128 *>((local_50 + -0xc)));
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlags->_l) + 4));
qVar2 = tearFlags->_h;
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_INT(&tearFlags->_h) + 4));
param_1[0x104] = GHIDRA_INT(tearFlags->_l);
param_1[0x105] = iVar4;
param_1[0x106] = GHIDRA_INT(qVar2);
param_1[0x107] = iVar1;
setDamageFn = *(code **)(*param_1 + 0x40);
damage = Weapon::get_damage(this);
(*setDamageFn)(damage);
if ((*GHIDRA_CAST<uint32_t *>((iVar5 + 0x34)) >> 7 & 1) == 0) {
iVar4 = 0x40400000;
}
else {
iVar4 = 0x3f000000;
}
param_1[0xdf] = iVar4;
return;
}
// 009ff1a0
uint8_t Weapon_Bone::CanTriggerCursedEyeTeleport()
{
int iVar1;
float minChargeTime;
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x30)) != 0xb) && (iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)), iVar1 != 0)) &&
(*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 1)) {
if ((*GHIDRA_CAST<int *>((iVar1 + 0x140c)) != 0) &&
(iVar1 = this->GetFocusEntity(), iVar1 != 0)) {
return 0;
}
if (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14))) {
minChargeTime = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x10));
if (minChargeTime < 0.001) {
minChargeTime = 0.001;
}
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)) < minChargeTime + minChargeTime) {
return 1;
}
}
}
return 0;
}
// 009ff210
uint8_t Weapon_Bone::CanTriggerKidneyStone()
{
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x30)) == 0xb) ||
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) != 0 && (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) + 0x464)) != '\0'))))
{
return 0;
}
return 1;
}
// 009ff230
uint8_t Weapon_Bone::CanOverrideForgottenThrow()
{
void *player = this;
int iVar1;
bool bVar2;
uint8_t isDrFetusOnly;
Entity_Player *player;
Entity_Player *ownerPlayer;
bool isDrFetusOnly;
uint8_t modifierBits;
uint32_t modifiers;
ownerPlayer = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(player) + 4));
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x30));
if (ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_009ff265:
player = GHIDRA_CAST<Entity_Player *>(0x0);
if ((ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) || (ownerPlayer->_type != 1)) {
LAB_009ff273:
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
}
}
else {
if (ownerPlayer->_type != 1) {
if (ownerPlayer->_type != 3) goto LAB_009ff265;
player = *GHIDRA_CAST<Entity_Player **>(&ownerPlayer->_isControlsEnabled);
goto LAB_009ff273;
}
player = ownerPlayer;
}
modifierBits = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(player) + 0x34));
modifiers = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(player) + 0x34));
if ((((iVar1 == 0xb) || (player == GHIDRA_CAST<Entity_Player *>(0x0))) ||
(isDrFetusOnly = Entity_Player::HasCollectible(player,0x34,0), isDrFetusOnly == 0)) ||
(isDrFetusOnly = Entity_Player::HasCollectible(player,0xa8,0), isDrFetusOnly != 0)) {
isDrFetusOnly = false;
if ((iVar1 != 0xb) && (player != GHIDRA_CAST<Entity_Player *>(0x0))) goto LAB_009ff2f1;
}
else {
isDrFetusOnly = true;
LAB_009ff2f1:
isDrFetusOnly = Entity_Player::HasCollectible(player,0xa8,0);
if (isDrFetusOnly != 0) {
bVar2 = true;
goto LAB_009ff309;
}
}
bVar2 = false;
LAB_009ff309:
if (((((modifierBits & 1) == 0) && ((modifiers >> 1 & 1) == 0)) &&
(((modifiers >> 2 & 1) == 0 && ((modifiers >> 3 & 1) == 0)))) &&
(((((!isDrFetusOnly && (!bVar2)) || (ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0))) ||
(ownerPlayer->_heldEntity == (void *)0x0)) &&
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x44)) == 0 || (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x44)) + 0x466)) == '\0')))
))) {
return 0;
}
return 1;
}