Files
isaac-port/generated-src/weapon_brimstone.cpp
T
shweetandClaude Opus 5.5 3ce74c6e2d Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function
defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body.
src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read
from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT,
from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra).
structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:10:23 -05:00

577 lines
23 KiB
C++

#include "classes.h"
// 009f3160
undefined4 Weapon_Brimstone::GetMainEntity()
{
return this->_mainLaser;
}
// 00a00d10
void Weapon_Brimstone::fire_c_section_fetuses()
{
EntityPtr EVar1;
Entity *source;
uint rngResult;
Entity_Tear *tear;
void *pvVar2;
qword *allocatedBytes;
uint uVar3;
float jitterX;
int unused;
EntityList_EL lasers;
Vector laserPos;
Vector tearVelocity;
Weapon_Brimstone *weapon;
float dirX;
float jitterY;
float local_1c;
float shotSpeed;
float dirY;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
qword oldAllocated;
local_8 = 0xffffffff;
puStack_c = &LAB_00b1076d;
local_10 = ExceptionList;
ExceptionList = &local_10;
pvVar2 = this->_owner;
shotSpeed = 1.0;
if ((pvVar2 != (void *)0x0) &&
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x28)) == 1 ||
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x28)) == 3 &&
(pvVar2 = *(void **)(GHIDRA_CAST<char *>(pvVar2) + 0x410), pvVar2 != (void *)0x0)))))) {
shotSpeed = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x1464));
}
weapon = this;
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&lasers,7,-1,-1,0,0);
uVar3 = 0;
local_8 = 0;
if (lasers._size != 0) {
do {
EVar1 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(lasers._data) + uVar3 * 4));
if ((EVar1 == this->_mainLaser) || (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar1) + 0x3bc)) == this->_mainLaser)) {
local_1c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar1) + 0x41c)) * 0.017453292;
dirY = sin(local_1c);
source = this->_owner;
dirX = cos(local_1c);
dirX = dirX * 10.0;
dirY = dirY * 10.0;
rngResult = Random();
local_1c = (float)((double)GHIDRA_INT(rngResult) +
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 * 3.14;
local_1c = local_1c + local_1c;
jitterY = sin(local_1c);
unused = 0xa00e61;
jitterX = cos(local_1c);
this = weapon;
laserPos.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar1) + 0x33c));
laserPos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar1) + 0x340));
tearVelocity.x = (jitterX * 3.0 + dirX) * shotSpeed;
tearVelocity.y = (jitterY * 3.0 + dirY) * shotSpeed;
tear = fire_fetus_tear(weapon,&laserPos,&tearVelocity,0,source,1.0,unused);
tear->Update();
}
uVar3 = uVar3 + 1;
} while (uVar3 < GHIDRA_UINT(lasers._size));
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(lasers)) + 0x0))) == '\0') {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (lasers._data != (void *)0x0) {
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(lasers._data) + -4));
oldAllocated = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar3;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar3));
free(GHIDRA_CAST<uint *>((GHIDRA_INT(lasers._data) + -4)));
}
}
ExceptionList = local_10;
return;
}
// 00a00f30
float10 Weapon_Brimstone::GetMaxCharge()
{
float baseCharge;
float chargeMultiplier;
chargeMultiplier = 1.0;
if ((this->_modifiers & 1) != 0) {
chargeMultiplier = 2.5;
}
if ((GHIDRA_UINT(this->_modifiers) >> 4 & 1) != 0) {
return (float10)0.0;
}
baseCharge = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x10))));
if (baseCharge < 0.001) {
baseCharge = 0.001;
}
return (float10)(baseCharge * chargeMultiplier);
}
// 00a00f90
void Weapon_Brimstone::init_laser(Entity_Laser *laser)
{
int iVar1;
BitSet128 *tearFlags;
ColorMod *laserColor;
float damage;
int *piVar2;
undefined1 auStack_50 [4];
Entity_Laser *local_4c;
BitSet128 tearFlagsResult;
ColorMod laserColorResult;
uint local_c;
code *laserMethod;
qword tearFlagsHigh;
undefined4 tearFlagsHighHigh;
undefined4 tearFlagsLowHigh;
local_c = __security_cookie ^ GHIDRA_UINT(auStack_50);
local_4c = laser;
tearFlags = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_owner_tear_flags(&tearFlagsResult);
tearFlagsLowHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlags->_l) + 4));
tearFlagsHigh = tearFlags->_h;
tearFlagsHighHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&tearFlags->_h) + 4));
iVar1 = *GHIDRA_CAST<int *>(laser);
*GHIDRA_CAST<int *>(&(laser->_tearFlags)._l) = GHIDRA_INT(tearFlags->_l);
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(laser->_tearFlags)._l) + 4)) = tearFlagsLowHigh;
*GHIDRA_CAST<int *>(&(laser->_tearFlags)._h) = GHIDRA_INT(tearFlagsHigh);
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(laser->_tearFlags)._h) + 4)) = tearFlagsHighHigh;
laserMethod = *(code **)(iVar1 + 0x3c);
laserColor = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_laser_color(&laserColorResult);
piVar2 = GHIDRA_CAST<int *>(0x0);
(*laserMethod)(laserColor,0xffffffff,0xff,0,1);
laserMethod = *(code **)(*piVar2 + 0x40);
damage = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_damage();
(*laserMethod)(damage);
return;
}
// 00a02790
void Weapon_Brimstone::ClearReferences()
{
Weapon_Brimstone *local_8;
EntityPtr *laserRef;
laserRef = &this->_technology2Laser;
local_8 = this;
if (this->_technology2Laser != (EntityPtr)0x0) {
(**(code **)(*GHIDRA_CAST<int *>(this->_technology2Laser) + 0x28))();
if (*laserRef != (EntityPtr)0x0) {
local_8 = GHIDRA_CAST<Weapon_Brimstone *>(laserRef);
std::multiset<unsigned_int>::erase(&local_8);
*laserRef = (EntityPtr)0x0;
}
}
laserRef = &this->_mainLaser;
if (this->_mainLaser != (EntityPtr)0x0) {
(**(code **)(*GHIDRA_CAST<int *>(this->_mainLaser) + 0x28))();
if (*laserRef != (EntityPtr)0x0) {
local_8 = GHIDRA_CAST<Weapon_Brimstone *>(laserRef);
std::multiset<unsigned_int>::erase(&local_8);
*laserRef = (EntityPtr)0x0;
}
}
return;
}
// 00a02800
undefined4 Weapon_Brimstone::GetMarkedTargetVariant()
{
byte isHasItem;
Entity_Player *owner;
if ((GHIDRA_UINT(this->_modifiers) >> 4 & 1) != 0) {
return 0;
}
owner = this->_owner;
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (owner->_type == 1) goto LAB_00a02830;
if (owner->_type == 3) {
owner = *GHIDRA_CAST<Entity_Player **>(&owner->_isControlsEnabled);
goto LAB_00a02830;
}
}
owner = GHIDRA_CAST<Entity_Player *>(0x0);
LAB_00a02830:
isHasItem = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasCollectible(0x23c,0);
if (isHasItem != 0) {
return 0x99;
}
isHasItem = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasCollectible(0x18a,0);
if (isHasItem == 0) {
return 0;
}
return 0x1e;
}
// 00a02870
undefined4 Weapon_Brimstone::GetFocusEntity()
{
if ((GHIDRA_UINT(this->_modifiers) >> 4 & 1) == 0) {
return (EntityPtr)0x0;
}
return this->_mainLaser;
}
// 00a02890
void Weapon_Brimstone::fire(float Speed, byte IgnoreStatusEffects)
{
EntityPtr *pEVar1;
Entity *pEVar2;
Vector *pVVar3;
byte isHitscanHit;
byte isAnyHit;
uint rngValue;
EntityPtr EVar4;
ColorMod *laserColor;
Entity_Laser *pEVar5;
void *pvVar6;
int unused;
float extraout_ECX;
float extraout_ECX_00;
float extraout_ECX_01;
float extraout_ECX_02;
int loopIndex;
uint rngValue;
bool isShootingBackwards;
float10 fVar8;
float fVar9;
float in_XMM2_Da;
int *piVar10;
int *piVar11;
undefined1 auStack_a8 [2];
undefined1 auStack_a6 [2];
undefined1 local_a4 [8];
float local_9c;
float *local_98;
Vector VStack_94;
EntityPtr local_8c;
float damageMultiplier;
Vector *aimDir;
Vector local_80;
Vector local_78;
short multiShotParams [2];
float fStack_6c;
float fStack_68;
float fStack_64;
float local_60;
int iStack_5c;
float fStack_58;
undefined1 auStack_54 [64];
uint stackCookie;
code *setColorFn;
stackCookie = __security_cookie ^ GHIDRA_UINT(auStack_a8);
aimDir = GHIDRA_CAST<Vector *>(Speed);
damageMultiplier = in_XMM2_Da;
(GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::GetMultiShotParams(multiShotParams,GHIDRA_INT(this));
pvVar6 = this->_owner;
if (pvVar6 == (void *)0x0) {
LAB_00a02903:
local_8c = (EntityPtr)0x0;
if (pvVar6 != (void *)0x0) {
local_8c = (EntityPtr)0x0;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x28)) == 1) goto LAB_00a02934;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x28)) == 3) goto LAB_00a02924;
}
LAB_00a0293e:
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = GHIDRA_CAST<Entity_Laser *>(0x3f800000);
}
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x28)) == 1) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x1464));
local_8c = (EntityPtr)pvVar6;
}
else {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x28)) != 3) goto LAB_00a02903;
local_8c = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(pvVar6) + 0x410));
LAB_00a02924:
pvVar6 = *(void **)(GHIDRA_CAST<char *>(pvVar6) + 0x410);
if (pvVar6 == (void *)0x0) goto LAB_00a0293e;
LAB_00a02934:
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar6) + 0x1464));
}
if ((GHIDRA_UINT(this->_modifiers) >> 9 & 1) == 0) {
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,2,GHIDRA_CAST<Vector *>(Speed),-1.0);
fVar9 = 0.0;
local_8c = (EntityPtr)0x0;
local_98 = GHIDRA_CAST<float *>(0x0);
if (0 < multiShotParams[0]) {
do {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (GHIDRA_CAST<Vector *>(Speed))->x;
local_9c = (GHIDRA_CAST<Vector *>(Speed))->y;
Entity_Player::GetMultiShotPositionVelocity
(&local_80,GHIDRA_INT(local_98),2,*GHIDRA_CAST<Vector *>(Speed),(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a4)) + 0x0))),
multiShotParams[0],fStack_6c,fStack_68,fStack_64,local_60,iStack_5c,fStack_58,
auStack_54[0],(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))));
EVar4 = (EntityPtr)
(GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::fire_brimstone_with_color(&local_78,damageMultiplier,0);
(**(code **)(*GHIDRA_CAST<int *>(EVar4) + 0xc))();
if (local_8c == (EntityPtr)0x0) {
local_8c = EVar4;
if (this->_mainLaser != EVar4) {
if (this->_mainLaser != (EntityPtr)0x0) {
VStack_94.y = (float)&this->_mainLaser;
std::multiset<unsigned_int>::erase();
}
this->_mainLaser = EVar4;
goto LAB_00a02da1;
}
}
else {
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar4) + 0x3bc)) != (EntityPtr)0x0) {
VStack_94.y = (float)(GHIDRA_INT(EVar4) + 0x3bc);
std::multiset<unsigned_int>::erase();
}
*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar4) + 0x3bc)) = local_8c;
LAB_00a02da1:
std::multiset<unsigned_int>::insert();
}
fVar9 = (float)(GHIDRA_INT(local_98) + 1);
Speed = (float)aimDir;
local_98 = GHIDRA_CAST<float *>(fVar9);
} while (GHIDRA_INT(fVar9) < GHIDRA_INT(multiShotParams[0]));
}
for (local_98 = GHIDRA_CAST<float *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))) & 0xffff)); local_98 != GHIDRA_CAST<float *>(0x0);
local_98 = GHIDRA_CAST<float *>((GHIDRA_INT(local_98) + -1))) {
rngValue = Random();
fVar9 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
2.3283064e-10 * 3.14;
VStack_94.y = fVar9 + fVar9;
local_80.x = cos(VStack_94.y);
local_80.y = sin(VStack_94.y);
pEVar2 = this->_owner;
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
local_9c = g_vectorZero.y;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = g_vectorZero.x;
fVar9 = extraout_ECX;
}
else {
fVar9 = (pEVar2->_pos).y;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (pEVar2->_pos).x;
local_9c = fVar9;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) =
Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((local_a4 + 4)),&local_80,damageMultiplier,fVar9,0)
;
setColorFn = *(code **)(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a4))) + 0x0))) + 0x3c);
laserColor = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_laser_color(GHIDRA_CAST<ColorMod *>((auStack_54 + 0x14)));
piVar10 = GHIDRA_CAST<int *>(0x0);
(*setColorFn)(laserColor,0xffffffff,0xff);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = this->_mainLaser;
pEVar5 = GHIDRA_CAST<Entity_Laser *>((piVar10 + 0xef));
if (*GHIDRA_CAST<float *>(pEVar5) != 0.0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = pEVar5;
std::multiset<unsigned_int>::erase(local_a4);
}
*GHIDRA_CAST<undefined4 *>(pEVar5) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4)));
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((EntityPtr)local_a4)) + 0x4))) != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(pEVar5);
}
(**(code **)(*piVar10 + 0xc))();
fVar9 = extraout_ECX_00;
}
auStack_54[1] = (char)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(auStack_54))) + 0x0))) >> 8);
isShootingBackwards = auStack_54[1] != '\0';
if (isShootingBackwards) {
pEVar2 = this->_owner;
local_80.x = -aimDir->x;
local_80.y = -aimDir->y;
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = g_vectorZero.x;
local_9c = g_vectorZero.y;
}
else {
fVar9 = (pEVar2->_pos).y;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (pEVar2->_pos).x;
local_9c = fVar9;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) =
Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((local_a4 + 4)),&local_80,damageMultiplier,fVar9,0)
;
setColorFn = *(code **)(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a4))) + 0x0))) + 0x3c);
laserColor = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_laser_color(GHIDRA_CAST<ColorMod *>((auStack_54 + 0x14)));
piVar10 = GHIDRA_CAST<int *>(0x0);
(*setColorFn)(laserColor,0xffffffff,0xff);
EVar4 = this->_mainLaser;
pEVar5 = GHIDRA_CAST<Entity_Laser *>((piVar10 + 0xef));
if (*GHIDRA_CAST<float *>(pEVar5) != 0.0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = pEVar5;
std::multiset<unsigned_int>::erase(local_a4);
}
*GHIDRA_CAST<EntityPtr *>(pEVar5) = EVar4;
if (EVar4 != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(pEVar5);
}
(**(code **)(*piVar10 + 0xc))();
fVar9 = extraout_ECX_01;
}
if (auStack_54[2] == '\0') {
return;
}
pEVar2 = this->_owner;
local_80.x = -aimDir->y;
local_80.y = aimDir->x;
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
local_9c = g_vectorZero.y;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = g_vectorZero.x;
}
else {
fVar9 = (pEVar2->_pos).y;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (pEVar2->_pos).x;
local_9c = fVar9;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) =
Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((local_a4 + 4)),&local_80,damageMultiplier,fVar9,0);
setColorFn = *(code **)(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a4))) + 0x0))) + 0x3c);
laserColor = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_laser_color(GHIDRA_CAST<ColorMod *>((auStack_54 + 0x14)));
piVar11 = GHIDRA_CAST<int *>(0x0);
piVar10 = GHIDRA_CAST<int *>(0xffffffff);
(*setColorFn)(laserColor,0xffffffff,0xff);
EVar4 = this->_mainLaser;
pEVar5 = GHIDRA_CAST<Entity_Laser *>((piVar11 + 0xef));
if (*GHIDRA_CAST<int *>(pEVar5) != 0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = pEVar5;
std::multiset<unsigned_int>::erase(local_a4);
}
*GHIDRA_CAST<EntityPtr *>(pEVar5) = EVar4;
if (EVar4 != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(pEVar5);
}
(**(code **)(*piVar11 + 0xc))();
pEVar2 = this->_owner;
VStack_94.x = local_98[1];
VStack_94.y = -*local_98;
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
fVar9 = extraout_ECX_02;
}
else {
fVar9 = (pEVar2->_pos).y;
}
pEVar5 = Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((auStack_a8 + -0xc)),&VStack_94,local_9c,fVar9,0)
;
setColorFn = *(code **)(*GHIDRA_CAST<int *>(pEVar5) + 0x3c);
laserColor = (GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::get_laser_color(GHIDRA_CAST<ColorMod *>(auStack_54));
(*setColorFn)(laserColor,0xffffffff,0xff,0,1);
EVar4 = this->_mainLaser;
pEVar1 = GHIDRA_CAST<EntityPtr *>((piVar10 + 0xef));
if (*pEVar1 != (EntityPtr)0x0) {
std::multiset<unsigned_int>::erase(auStack_a8 + -0x10);
}
*pEVar1 = EVar4;
if (EVar4 != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(pEVar1);
}
(**(code **)(*piVar10 + 0xc))();
return;
}
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,3,GHIDRA_CAST<Vector *>(Speed),-1.0);
(GHIDRA_CAST<Weapon *>((GHIDRA_CAST<Weapon *>(this))))->Weapon::SetBlinkTime(10,unused);
isAnyHit = 0;
loopIndex = 0;
VStack_94.x = (float)(GHIDRA_UINT(VStack_94.x) & 0xffffff);
if (0 < multiShotParams[0]) {
do {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = aimDir->x;
local_9c = aimDir->y;
Entity_Player::GetMultiShotPositionVelocity
(&local_80,loopIndex,10,*aimDir,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_a4)) + 0x0))),multiShotParams[0],fStack_6c,
fStack_68,fStack_64,local_60,iStack_5c,fStack_58,auStack_54[0],(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))));
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(VStack_94.x)) + 0x3))) == '\0') {
isHitscanHit = fire_hitscan(this,&g_vectorZero,&local_78,0,damageMultiplier);
isAnyHit = 0;
if (isHitscanHit != 0) goto LAB_00a02a08;
}
else {
LAB_00a02a08:
isAnyHit = 1;
}
loopIndex = loopIndex + 1;
VStack_94.x = (float)CONCAT13(isAnyHit,(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(VStack_94.x)) + 0x0))));
} while (loopIndex < multiShotParams[0]);
}
pVVar3 = aimDir;
fVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_54)) + 0x0)));
for (rngValue = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))) & 0xffff; aimDir = pVVar3, (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x0))) = fVar9, rngValue != 0;
rngValue = rngValue - 1) {
if (isAnyHit == 0) {
rngValue = Random();
fVar9 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
2.3283064e-10 * 3.14;
local_98 = GHIDRA_CAST<float *>((fVar9 + fVar9));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = cos((float)local_98);
local_9c = sin((float)local_98);
isHitscanHit = fire_hitscan(this,&g_vectorZero,GHIDRA_CAST<Vector *>((local_a4 + 4)),0,damageMultiplier);
isAnyHit = 0;
if (isHitscanHit != 0) goto LAB_00a02aa9;
}
else {
LAB_00a02aa9:
isAnyHit = 1;
}
pVVar3 = aimDir;
fVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_54)) + 0x0)));
}
auStack_54[1] = (char)(GHIDRA_UINT(fVar9) >> 8);
if (auStack_54[1] != '\0') {
if (isAnyHit != 0) goto LAB_00a02bed;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = GHIDRA_UINT(pVVar3->x) ^ 0x80000000;
local_9c = -pVVar3->y;
isAnyHit = fire_hitscan(this,&g_vectorZero,GHIDRA_CAST<Vector *>((local_a4 + 4)),0,damageMultiplier);
fVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_54)) + 0x0)));
}
if (isAnyHit != 0) goto LAB_00a02bed;
auStack_54[2] = (char)(GHIDRA_UINT(fVar9) >> 0x10);
if (auStack_54[2] != '\0') {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = GHIDRA_UINT(pVVar3->y) ^ 0x80000000;
local_9c = pVVar3->x;
isAnyHit = fire_hitscan(this,&g_vectorZero,GHIDRA_CAST<Vector *>((local_a4 + 4)),0,damageMultiplier);
if (isAnyHit != 0) goto LAB_00a02bed;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = pVVar3->y;
local_9c = -pVVar3->x;
isAnyHit = fire_hitscan(this,&g_vectorZero,GHIDRA_CAST<Vector *>((local_a4 + 4)),0,damageMultiplier);
if (isAnyHit != 0) goto LAB_00a02bed;
}
if (local_8c == (EntityPtr)0x0) {
return;
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_8c) + 0x1519)) != '\0') {
return;
}
piVar10 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_8c) + 0x150c));
if (piVar10 == *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_8c) + 0x1510))) {
return;
}
while ((*GHIDRA_CAST<int *>(*piVar10) != 0 || ((GHIDRA_CAST<int *>(*piVar10))[1] != 0x7f))) {
piVar10 = piVar10 + 4;
if (piVar10 == *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_8c) + 0x1510))) {
return;
}
}
LAB_00a02bed:
fVar8 = (float10)this->GetMaxCharge();
local_98 = GHIDRA_CAST<float *>((float)fVar8);
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x14)))) =
((float)local_98 - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x14))))) * 0.5 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x14))));
if (local_8c != (EntityPtr)0x0) {
pvVar6 = (g_manager->_itemConfig)._nullItems._begin;
if ((0x1fc < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU)))
&& (local_80.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x1fc)), local_80.x != 0.0)) {
local_78.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_80.x) + 0x78));
local_80.y = 0.0;
local_78.y = 0.0;
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(local_8c) + 0x1508)))))->TemporaryEffects::RemoveEffect(&local_80,-1);
return;
}
}
return;
}