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>
1656 lines
70 KiB
C++
1656 lines
70 KiB
C++
#include "classes.h"
|
|
|
|
// 009f3160
|
|
uint32_t Weapon_Brimstone::GetMainEntity()
|
|
{
|
|
return this->_mainLaser;
|
|
}
|
|
|
|
// 009ff360
|
|
void Weapon_Brimstone::Fire(Vector *direction, uint8_t isShooting, uint8_t isInterpolated)
|
|
{
|
|
int *piVar1;
|
|
uint8_t bVar2;
|
|
uint8_t bVar3;
|
|
char cVar8;
|
|
undefined3 extraout_var;
|
|
float *pfVar4;
|
|
uint16_t uVar9;
|
|
uint32_t uVar5;
|
|
Vector *pVVar6;
|
|
uint32_t uVar7;
|
|
std_string *str;
|
|
Vector *aimDirection;
|
|
int ownerAsPlayer;
|
|
ItemConfig_Item *item;
|
|
Entity_Laser *laser;
|
|
float *extraout_EAX;
|
|
uint8_t *extraout_ECX;
|
|
Entity_Player *pEVar10;
|
|
uint3 uVar13;
|
|
uint32_t extraout_ECX_00;
|
|
int extraout_ECX_01;
|
|
int extraout_ECX_02;
|
|
int unused;
|
|
void *pvVar11;
|
|
int unusedCollectibleId;
|
|
int unusedCollectibleId_00;
|
|
int extraout_ECX_03;
|
|
int extraout_ECX_04;
|
|
int unusedCollectibleId_01;
|
|
int extraout_ECX_05;
|
|
int extraout_ECX_06;
|
|
int unusedCollectibleId_02;
|
|
int unused_00;
|
|
int unusedCollectibleId_03;
|
|
Entity_Player *ownerPlayer;
|
|
uint8_t *extraout_ECX_07;
|
|
uint8_t *puVar12;
|
|
int iVar14;
|
|
uint32_t uVar15;
|
|
ANM2 *sprite;
|
|
Entity *this_00;
|
|
bool bVar16;
|
|
long double fVar17;
|
|
float fVar18;
|
|
Entity_Player *pEVar19;
|
|
float fVar20;
|
|
uint32_t *puVar21;
|
|
uint32_t multiShotParams;
|
|
uint32_t uStack_d4;
|
|
uint32_t uStack_d0;
|
|
uint32_t uStack_cc;
|
|
uint32_t local_c8;
|
|
uint32_t uStack_c4;
|
|
uint32_t uStack_c0;
|
|
uint32_t uStack_bc;
|
|
uint32_t local_b8;
|
|
Vector local_b4;
|
|
Vector local_ac;
|
|
Vector local_a4;
|
|
Vector leftDirX;
|
|
uint32_t isCSection;
|
|
Vector local_90;
|
|
char isHasMarked;
|
|
Vector backDirX;
|
|
char isHasBrimstone;
|
|
uint32_t local_78;
|
|
Vector *shootDirection;
|
|
uint32_t local_70;
|
|
Entity_Player *local_6c;
|
|
uint8_t isChocolateMilk;
|
|
char local_65;
|
|
Entity_Player *local_64;
|
|
Vector local_60;
|
|
Vector local_58;
|
|
uint8_t local_4e;
|
|
char local_4d;
|
|
Entity_Player *local_4c;
|
|
char local_46;
|
|
char isFullyCharged;
|
|
char animSuffix [8];
|
|
uint8_t local_3c [8];
|
|
Vector local_34;
|
|
uint8_t local_2c [20];
|
|
uint32_t tmpStringCapacity;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Entity_Player *owner;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b1072e;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((local_2c + 0x28));
|
|
ExceptionList = &local_10;
|
|
shootDirection = direction;
|
|
local_70 = 0;
|
|
local_58.y = 0.0;
|
|
Weapon::Fire(GHIDRA_CAST<Weapon *>(this),direction,isShooting,isInterpolated);
|
|
uVar15 = this->_modifiers;
|
|
local_b4.y = 1.0;
|
|
local_90.y = 1.0;
|
|
local_78 = uVar15 >> 4 & 0xffffff01;
|
|
local_a4.y = (float)(uVar15 >> 5 & 0xffffff01);
|
|
leftDirX.y = (float)(uVar15 >> 9 & 0xffffff01);
|
|
owner = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
isCSection = uVar15 >> 0xb & 0xffffff01;
|
|
if (owner == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
backDirX.y = g_vectorZero.x;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(g_vectorZero.y);
|
|
LAB_009ff4b6:
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_64 = owner;
|
|
if (owner == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_009ff44f:
|
|
local_6c = ownerPlayer;
|
|
}
|
|
else {
|
|
local_6c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (owner->_type == 1) {
|
|
local_b4.y = owner->_shotspeed;
|
|
goto LAB_009ff4eb;
|
|
}
|
|
}
|
|
ownerPlayer = local_6c;
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (owner->_type == 1) {
|
|
LAB_009ff48a:
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_b4.y = owner->_shotspeed;
|
|
local_6c = ownerPlayer;
|
|
goto LAB_009ff4eb;
|
|
}
|
|
local_6c = ownerPlayer;
|
|
if (owner->_type == 3) {
|
|
owner = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>(&owner->_isControlsEnabled))->x);
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009ff48a;
|
|
}
|
|
}
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
backDirX.y = (float)(owner->_pos).x;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((owner->_pos).y);
|
|
if (owner->_type != 1) {
|
|
if (owner->_type != 3) goto LAB_009ff4b6;
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>(&owner->_isControlsEnabled))->x);
|
|
goto LAB_009ff44f;
|
|
}
|
|
local_b4.y = owner->_shotspeed;
|
|
local_6c = owner;
|
|
local_64 = owner;
|
|
ownerPlayer = owner;
|
|
}
|
|
LAB_009ff4eb:
|
|
puVar12 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)));
|
|
local_ac.y = 0.001;
|
|
pfVar4 = &local_ac.y;
|
|
if (0.001 < *GHIDRA_CAST<float *>(puVar12) || *GHIDRA_CAST<float *>(puVar12) == 0.001) {
|
|
pfVar4 = GHIDRA_CAST<float *>(puVar12);
|
|
}
|
|
local_ac.y = *pfVar4;
|
|
local_58.y = (float)*pfVar4;
|
|
if (ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_009ff534:
|
|
isHasBrimstone = '\0';
|
|
}
|
|
else {
|
|
bVar2 = Entity_Player::HasCollectible(ownerPlayer,0x76,0);
|
|
pfVar4 = GHIDRA_CAST<float *>(CONCAT31(extraout_var,bVar2));
|
|
isHasBrimstone = '\x01';
|
|
puVar12 = extraout_ECX;
|
|
if (bVar2 == 0) goto LAB_009ff534;
|
|
}
|
|
owner = local_6c;
|
|
if ((char)local_78 == '\0') {
|
|
isChocolateMilk = (uint8_t)this->_modifiers & 1;
|
|
if (((GHIDRA_UINT(this->_modifiers) >> 7 & 1) != 0) || (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) <= 1.0)) {
|
|
local_4e = 1;
|
|
local_46 = '\x01';
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_a4.y)) + 0x0))) != '\0') goto LAB_009ff579;
|
|
}
|
|
else {
|
|
local_4e = 0;
|
|
LAB_009ff579:
|
|
local_46 = '\0';
|
|
}
|
|
if ((ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
((bVar2 = Entity_Player::HasCollectible(ownerPlayer,0x18a,0), bVar2 == 0 &&
|
|
(bVar2 = Entity_Player::HasCollectible(ownerPlayer,0x23c,0), bVar2 == 0)))) {
|
|
local_4d = '\0';
|
|
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009ff5b3;
|
|
LAB_009ff5cc:
|
|
isHasMarked = '\0';
|
|
}
|
|
else {
|
|
local_4d = '\x01';
|
|
LAB_009ff5b3:
|
|
bVar2 = Entity_Player::HasCollectible(ownerPlayer,0x18a,0);
|
|
isHasMarked = '\x01';
|
|
if (bVar2 == 0) goto LAB_009ff5cc;
|
|
}
|
|
iVar14 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if ((iVar14 == 0) ||
|
|
((*GHIDRA_CAST<int *>((iVar14 + 0x28)) != 1 &&
|
|
((*GHIDRA_CAST<int *>((iVar14 + 0x28)) != 3 || (iVar14 = *GHIDRA_CAST<int *>((iVar14 + 0x410)), iVar14 == 0)))))) {
|
|
iVar14 = 0;
|
|
}
|
|
else {
|
|
iVar14 = *GHIDRA_CAST<int *>((iVar14 + 0x140c));
|
|
}
|
|
if ((local_4d == '\0') || (iVar14 == 0)) {
|
|
owner = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28))));
|
|
pEVar10 = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))));
|
|
}
|
|
else {
|
|
owner = *GHIDRA_CAST<Entity_Player **>((iVar14 + 0x33c));
|
|
pEVar10 = *GHIDRA_CAST<Entity_Player **>((iVar14 + 0x340));
|
|
}
|
|
local_60.x = (float)owner;
|
|
local_60.y = (float)pEVar10;
|
|
uVar9 = (uint16_t)(GHIDRA_UINT(&local_60) >> 0x10);
|
|
bVar2 = (uint8_t)&local_60;
|
|
uVar5 = CONCAT22(uVar9,(uint16_t)bVar2);
|
|
uVar13 = (uint3)(GHIDRA_UINT(pEVar10) >> 8);
|
|
if (((float)owner == g_vectorZero.x) &&
|
|
(uVar5 = CONCAT22(uVar9,(uint16_t)bVar2), (float)pEVar10 == g_vectorZero.y)) {
|
|
iVar14 = GHIDRA_UINT(uVar13) << 8;
|
|
}
|
|
else {
|
|
iVar14 = CONCAT31(uVar13,1);
|
|
}
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(CONCAT22((short)(GHIDRA_UINT(uVar5) >> 0x10),(uint16_t)(uint8_t)uVar5));
|
|
local_78 = CONCAT31((int3)(GHIDRA_UINT(local_4c) >> 8),isShooting);
|
|
isFullyCharged = '\0';
|
|
local_65 = (char)iVar14;
|
|
pEVar19 = local_4c;
|
|
if (local_4e != 0) {
|
|
if (local_ac.y <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))))) {
|
|
LAB_009ff696:
|
|
pEVar19 = GHIDRA_CAST<Entity_Player *>(0x100);
|
|
isFullyCharged = '\x01';
|
|
}
|
|
else if ((isShooting != 0) && (local_46 != '\0')) {
|
|
if ((this->_mainLaser != 0) && (4 < *GHIDRA_CAST<int *>((this->_mainLaser + 0x458)))) goto LAB_009ff696;
|
|
pEVar19 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
}
|
|
cVar8 = (char)(GHIDRA_UINT(pEVar19) >> 8);
|
|
backDirX.y = (float)*GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
if (((float)*GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) < 0.0) ||
|
|
(local_4d = '\0', 0.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))))) {
|
|
local_4d = '\x01';
|
|
}
|
|
if (cVar8 == '\0') {
|
|
if (((isInterpolated == 0) && (isShooting != 0)) && ((char)iVar14 != '\0')) {
|
|
pEVar19 = GHIDRA_CAST<Entity_Player *>(local_ac.y);
|
|
if (isChocolateMilk != 0) {
|
|
pVVar6 = Weapon::get_owner_position(GHIDRA_CAST<Weapon *>(this),&local_34);
|
|
fVar18 = (float)pEVar10 - pVVar6->y;
|
|
fVar20 = (float)owner - pVVar6->x;
|
|
fVar18 = sqrtf(fVar18 * fVar18 + fVar20 * fVar20);
|
|
iVar14 = CONCAT31((int3)(GHIDRA_UINT(extraout_ECX_00) >> 8),local_65);
|
|
fVar18 = (fVar18 - 50.0) / 250.0;
|
|
if (fVar18 <= 0.0) {
|
|
fVar18 = 0.0;
|
|
}
|
|
if (1.0 <= fVar18) {
|
|
fVar18 = 1.0;
|
|
}
|
|
pEVar19 = (Entity_Player *)
|
|
((local_ac.y * 2.5 - local_ac.y * 0.25) * fVar18 + local_ac.y * 0.25);
|
|
}
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_78 = local_78 & 0xff;
|
|
if ((float)pEVar19 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))))) {
|
|
local_78 = 0;
|
|
}
|
|
}
|
|
if ((((this->_mainLaser != 0) &&
|
|
(ownerAsPlayer = *GHIDRA_CAST<int *>((this->_mainLaser + 0x3bc)), ownerAsPlayer != 0)) &&
|
|
(*GHIDRA_CAST<int *>((ownerAsPlayer + 0x28)) != 1000)) &&
|
|
(((ownerPlayer == GHIDRA_CAST<Entity_Player *>(0x0) || ((char)iVar14 != '\0')) ||
|
|
(ownerPlayer->_twinPlayer != 0)))) {
|
|
local_78 = local_78 & 0xffffff00;
|
|
}
|
|
cVar8 = isFullyCharged;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(leftDirX.y)) + 0x0))) == '\0') {
|
|
if ((char)local_78 != '\0') {
|
|
LAB_009ffb5c:
|
|
if (cVar8 == '\0') goto LAB_009ffb64;
|
|
}
|
|
LAB_009ffebb:
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(0x3a83126f);
|
|
pfVar4 = GHIDRA_CAST<float *>(&local_4c);
|
|
if (0.001 <= local_ac.y) {
|
|
pfVar4 = &local_58.y;
|
|
}
|
|
owner = GHIDRA_CAST<Entity_Player *>(*pfVar4);
|
|
if (isChocolateMilk != 0) {
|
|
local_58.y = 0.001;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((local_ac.y * 0.25));
|
|
pfVar4 = &local_58.y;
|
|
if (0.001 <= local_ac.y * 0.25) {
|
|
pfVar4 = GHIDRA_CAST<float *>(&local_4c);
|
|
}
|
|
owner = GHIDRA_CAST<Entity_Player *>(*pfVar4);
|
|
}
|
|
if (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) < (float)owner) {
|
|
if (this->_mainLaser == 0) {
|
|
iVar14 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (((iVar14 == 0) || (ownerAsPlayer = iVar14, *GHIDRA_CAST<int *>((iVar14 + 0x28)) != 1)) &&
|
|
((ownerAsPlayer = 0, iVar14 != 0 && (*GHIDRA_CAST<int *>((iVar14 + 0x28)) == 3)))) {
|
|
ownerAsPlayer = *GHIDRA_CAST<int *>((iVar14 + 0xd50));
|
|
LAB_00a0049b:
|
|
if (1 < ownerAsPlayer) goto LAB_00a004a0;
|
|
}
|
|
else {
|
|
iVar14 = 0;
|
|
if (ownerAsPlayer != 0) {
|
|
ownerAsPlayer = *GHIDRA_CAST<int *>((ownerAsPlayer + 0x1338));
|
|
goto LAB_00a0049b;
|
|
}
|
|
}
|
|
LAB_00a004ba:
|
|
Weapon::stop_costume_item_anim(GHIDRA_CAST<Weapon *>(this),0x76);
|
|
iVar14 = extraout_ECX_06;
|
|
}
|
|
else {
|
|
LAB_00a004a0:
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) != 0) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x28)) == 1)) {
|
|
bVar2 = Weapon::IsItemAnimFinished(GHIDRA_CAST<Weapon *>(this),0x76);
|
|
iVar14 = extraout_ECX_05;
|
|
if (bVar2 != 0) goto LAB_00a004ba;
|
|
}
|
|
}
|
|
if ((((this->_mainLaser == 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x28)) == 1)) &&
|
|
(((char)isCSection != '\0' &&
|
|
(bVar2 = Weapon::is_c_section_anim_finished(GHIDRA_CAST<Weapon *>(this),iVar14), bVar2 != 0)))) {
|
|
Weapon::update_c_section_charge_anim
|
|
(GHIDRA_CAST<Weapon *>(this),unusedCollectibleId_02,0,shootDirection,0.0);
|
|
}
|
|
}
|
|
else {
|
|
uVar15 = GHIDRA_UINT(local_4e) << 7 | 0x800;
|
|
if ((char)isCSection == '\0') {
|
|
uVar15 = GHIDRA_UINT(local_4e) << 7;
|
|
}
|
|
pVVar6 = shootDirection;
|
|
if ((char)iVar14 == '\0') {
|
|
pVVar6 = GHIDRA_CAST<Vector *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20))));
|
|
}
|
|
local_6c = GHIDRA_CAST<Entity_Player *>(pVVar6->x);
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(pVVar6->y);
|
|
local_70 = uVar15;
|
|
local_60.x = (float)local_6c;
|
|
local_60.y = (float)local_64;
|
|
bVar2 = Weapon::IsAxisAligned(GHIDRA_CAST<Weapon *>(this));
|
|
if (bVar2 == 0) {
|
|
fVar18 = sqrtf((float)local_64 * (float)local_64 + (float)local_6c * (float)local_6c);
|
|
iVar14 = extraout_ECX_04;
|
|
if (0.0 < fVar18) {
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(((1.0 / fVar18) * (float)local_64));
|
|
local_60.x = (1.0 / fVar18) * (float)local_6c;
|
|
goto LAB_009fffc8;
|
|
}
|
|
}
|
|
else {
|
|
pVVar6 = Vector::ToCardinal(&local_34,&local_60);
|
|
local_60.x = pVVar6->x;
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(pVVar6->y);
|
|
iVar14 = extraout_ECX_03;
|
|
LAB_009fffc8:
|
|
local_6c = GHIDRA_CAST<Entity_Player *>(local_60.x);
|
|
local_60.y = (float)local_64;
|
|
}
|
|
if (local_46 == '\0') {
|
|
if (isChocolateMilk == 0) {
|
|
fVar18 = 1.0;
|
|
}
|
|
else {
|
|
fVar18 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) / local_ac.y;
|
|
if (fVar18 <= 0.1) {
|
|
fVar18 = 0.1;
|
|
}
|
|
if (2.5 <= fVar18) {
|
|
fVar18 = 2.5;
|
|
}
|
|
local_90.y = fVar18;
|
|
}
|
|
}
|
|
else {
|
|
fVar18 = (30.0 / (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) + 1.0)) * 0.2;
|
|
local_90.y = fVar18;
|
|
if (isChocolateMilk != 0) {
|
|
fVar18 = fVar18 * 1.25;
|
|
local_90.y = fVar18;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(leftDirX.y)) + 0x0))) != '\0') {
|
|
uVar15 = uVar15 | 0x200;
|
|
local_70 = uVar15;
|
|
if (isHasBrimstone == '\0') {
|
|
local_90.y = fVar18 * 0.5;
|
|
}
|
|
}
|
|
Weapon::GetMultiShotParams(GHIDRA_CAST<Weapon *>(this),&multiShotParams,iVar14);
|
|
fVar18 = atan2f((float)local_64,(float)local_6c);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44)))) = fVar18 * 57.295776;
|
|
if ((char)isCSection == '\0') {
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,2,&local_60,-1.0);
|
|
}
|
|
else {
|
|
Weapon::update_c_section_charge_anim
|
|
(GHIDRA_CAST<Weapon *>(this),unusedCollectibleId_01,2,&local_60,-1.0);
|
|
}
|
|
local_64 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (0 < (short)multiShotParams) {
|
|
do {
|
|
FUN_009f4230(local_2c + 8,local_4c,2,local_60.x,local_60.y,local_b4.y,multiShotParams,
|
|
uStack_d4,uStack_d0,uStack_cc,local_c8,uStack_c4,uStack_c0,uStack_bc,
|
|
local_b8);
|
|
owner = (Entity_Player *)
|
|
Weapon::fire_brimstone_with_color
|
|
(GHIDRA_CAST<Weapon *>(this),GHIDRA_CAST<Vector *>((local_2c + 0x10)),local_90.y,uVar15);
|
|
(**(code **)(*GHIDRA_CAST<int *>(owner) + 0xc))();
|
|
if (local_64 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_64 = owner;
|
|
if (GHIDRA_CAST<Entity_Player *>(this->_mainLaser) != owner) {
|
|
if (GHIDRA_CAST<Entity_Player *>(this->_mainLaser) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_58.y = (float)&this->_mainLaser;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
}
|
|
puVar21 = &this->_mainLaser;
|
|
*puVar21 = owner;
|
|
goto LAB_00a001a4;
|
|
}
|
|
}
|
|
else {
|
|
puVar21 = &owner->_parent;
|
|
if (owner->_parent != 0) {
|
|
local_58.y = (float)puVar21;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
}
|
|
*puVar21 = local_64;
|
|
LAB_00a001a4:
|
|
msvc::multiset<unsigned_int>::insert(puVar21);
|
|
}
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_4c) + 1));
|
|
uVar15 = local_70;
|
|
} while (GHIDRA_INT(local_4c) < GHIDRA_INT((short)multiShotParams));
|
|
}
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((local_b8 & 0xffff));
|
|
uVar7 = local_70;
|
|
while( true ) {
|
|
local_70 = uVar7;
|
|
if (local_4c == GHIDRA_CAST<Entity_Player *>(0x0)) break;
|
|
uVar7 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_58.y = fVar18 + fVar18;
|
|
backDirX.y = sin(local_58.y);
|
|
local_b4.x = cos(local_58.y);
|
|
local_b4.y = backDirX.y;
|
|
leftDirX.y = (float)Weapon::fire_brimstone_with_color
|
|
(GHIDRA_CAST<Weapon *>(this),&local_b4,local_90.y,uVar15);
|
|
backDirX.y = (float)this->_mainLaser;
|
|
puVar21 = &(GHIDRA_CAST<Entity_Player *>(leftDirX.y))->_parent;
|
|
if (*puVar21 != 0) {
|
|
local_58.y = (float)puVar21;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
}
|
|
*puVar21 = backDirX.y;
|
|
if (GHIDRA_CAST<Entity_Player *>(backDirX.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(puVar21);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(leftDirX.y) + 0xc))();
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_4c) - 1));
|
|
uVar15 = local_70;
|
|
uVar7 = local_70;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_bc)) + 0x1))) = (char)(GHIDRA_UINT(uStack_bc) >> 8);
|
|
bVar16 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_bc)) + 0x1))) != '\0';
|
|
owner = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (bVar16) {
|
|
local_58.x = (float)(GHIDRA_UINT(local_60.x) ^ 0x80000000);
|
|
local_58.y = (float)(GHIDRA_UINT(local_60.y) ^ 0x80000000);
|
|
leftDirX.y = (float)Weapon::fire_brimstone_with_color
|
|
(GHIDRA_CAST<Weapon *>(this),&local_58,local_90.y,uVar7);
|
|
backDirX.y = (float)this->_mainLaser;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(&(GHIDRA_CAST<Entity_Player *>(leftDirX.y))->_parent);
|
|
if ((GHIDRA_CAST<Entity_Player *>(leftDirX.y))->_parent != 0) {
|
|
local_58.y = (float)local_4c;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
}
|
|
*GHIDRA_CAST<float *>(local_4c) = backDirX.y;
|
|
if (GHIDRA_CAST<Entity_Player *>(backDirX.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(local_4c);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(leftDirX.y) + 0xc))();
|
|
owner = local_4c;
|
|
}
|
|
local_4c = owner;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_bc)) + 0x2))) != '\0') {
|
|
local_58.x = (float)(GHIDRA_UINT(local_60.y) ^ 0x80000000);
|
|
local_58.y = local_60.x;
|
|
leftDirX.y = (float)Weapon::fire_brimstone_with_color
|
|
(GHIDRA_CAST<Weapon *>(this),&local_58,local_90.y,uVar7);
|
|
backDirX.y = (float)this->_mainLaser;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(&(GHIDRA_CAST<Entity_Player *>(leftDirX.y))->_parent);
|
|
if ((GHIDRA_CAST<Entity_Player *>(leftDirX.y))->_parent != 0) {
|
|
local_58.y = (float)local_4c;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
}
|
|
*GHIDRA_CAST<float *>(local_4c) = backDirX.y;
|
|
if (backDirX.y != 0.0) {
|
|
msvc::multiset<unsigned_int>::insert(local_4c);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(leftDirX.y) + 0xc))();
|
|
owner = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_60.x) ^ 0x80000000));
|
|
local_60.x = local_60.y;
|
|
local_60.y = (float)owner;
|
|
backDirX.y = (float)Weapon::fire_brimstone_with_color
|
|
(GHIDRA_CAST<Weapon *>(this),&local_60,local_90.y,uVar7);
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(this->_mainLaser);
|
|
puVar21 = &(GHIDRA_CAST<Entity_Player *>(backDirX.y))->_parent;
|
|
if (*puVar21 != 0) {
|
|
local_58.y = (float)puVar21;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
}
|
|
*puVar21 = local_4c;
|
|
if (local_4c != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(puVar21);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(backDirX.y) + 0xc))();
|
|
}
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_a4.y)) + 0x0))) != '\0') && ((char)isCSection != '\0')) {
|
|
fire_c_section_fetuses(this);
|
|
}
|
|
}
|
|
if ((GHIDRA_CAST<Entity *>(this->_mainLaser) == GHIDRA_CAST<Entity *>(0x0)) || (isInterpolated != 0)) {
|
|
LAB_00a00882:
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = 0;
|
|
}
|
|
else {
|
|
iVar14 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(this->_mainLaser),4.0,0.0);
|
|
Weapon::TriggerTearEffects(GHIDRA_CAST<Weapon *>(this),shootDirection,iVar14);
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_a4.y)) + 0x0))) == '\0') &&
|
|
((iVar14 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(this->_mainLaser),4.0,0.0), iVar14 != 0 &&
|
|
((char)isCSection != '\0')))) {
|
|
fire_c_section_fetuses(this);
|
|
}
|
|
if ((isHasMarked != '\0') || ((local_46 != '\0' && (isFullyCharged != '\0')))) {
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_3c),7,-1,-1,0
|
|
,0);
|
|
local_8 = 0;
|
|
fVar18 = atan2f(shootDirection->y,shootDirection->x);
|
|
owner = GHIDRA_CAST<Entity_Player *>((fVar18 * 57.295776));
|
|
leftDirX.y = local_34.y;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
backDirX.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_3c)) + 0x4)));
|
|
local_64 = owner;
|
|
if (GHIDRA_CAST<Entity_Player *>(local_34.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
do {
|
|
iVar14 = *GHIDRA_CAST<int *>((GHIDRA_INT((&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(backDirX.y) + 0x48)))->_filename + -3)) +
|
|
GHIDRA_INT(local_4c) * 4));
|
|
if ((iVar14 == this->_mainLaser) || (*GHIDRA_CAST<int *>((iVar14 + 0x3bc)) == this->_mainLaser)) {
|
|
local_58.y = *GHIDRA_CAST<float *>((iVar14 + 0x41c));
|
|
fVar18 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44))));
|
|
*GHIDRA_CAST<uint8_t *>((iVar14 + 0x4c0)) = 1;
|
|
*GHIDRA_CAST<uint32_t *>((iVar14 + 0x4c4)) = 0;
|
|
fVar18 = angle_difference(local_58.y,(local_58.y - fVar18) + (float)owner);
|
|
*GHIDRA_CAST<float *>((iVar14 + 0x4c8)) = fVar18;
|
|
if (0.0 <= fVar18) {
|
|
uVar5 = 0x41000000;
|
|
}
|
|
else {
|
|
uVar5 = 0xc1000000;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((iVar14 + 0x4cc)) = uVar5;
|
|
fVar18 = sin(local_58.y * 0.017453292);
|
|
if (fVar18 <= -0.5) {
|
|
uVar5 = 0xc1200000;
|
|
}
|
|
else {
|
|
uVar5 = 0x453b8000;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((iVar14 + 0x358)) = uVar5;
|
|
if ((local_46 == '\0') || (isFullyCharged == '\0')) {
|
|
owner = local_64;
|
|
}
|
|
else {
|
|
Weapon::GetOwnerLaserOffset(GHIDRA_CAST<Weapon *>(this),&local_60,4,shootDirection);
|
|
*GHIDRA_CAST<float *>((iVar14 + 0x34c)) = local_60.x;
|
|
*GHIDRA_CAST<float *>((iVar14 + 0x350)) = local_60.y;
|
|
owner = local_64;
|
|
if (*GHIDRA_CAST<int *>((iVar14 + 0x458)) < 8) {
|
|
*GHIDRA_CAST<uint32_t *>((iVar14 + 0x458)) = 8;
|
|
}
|
|
}
|
|
}
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_4c)) + 0x1))));
|
|
} while (local_4c < GHIDRA_UINT(leftDirX.y));
|
|
}
|
|
local_58.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44))));
|
|
fVar18 = angle_difference(local_58.y,(float)owner);
|
|
if (fVar18 <= -8.0) {
|
|
fVar18 = -8.0;
|
|
}
|
|
if (8.0 <= fVar18) {
|
|
fVar18 = 8.0;
|
|
}
|
|
fVar18 = local_58.y + fVar18;
|
|
if (360.0 < ABS(fVar18)) {
|
|
fVar18 = fmodf(fVar18,360.0);
|
|
}
|
|
if (fVar18 <= 180.0) {
|
|
if (fVar18 < -180.0) {
|
|
fVar18 = fVar18 + 360.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar18 = fVar18 - 360.0;
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44)))) = fVar18;
|
|
bVar2 = Weapon::IsItemAnimFinished(GHIDRA_CAST<Weapon *>(this),0x76);
|
|
pVVar6 = shootDirection;
|
|
if (bVar2 == 0) {
|
|
if ((char)isCSection == '\0') {
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,2,shootDirection,-2.0);
|
|
if (((isFullyCharged != '\0') && (local_46 != '\0')) &&
|
|
((((owner = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))), owner != GHIDRA_CAST<Entity_Player *>(0x0) &&
|
|
(ownerPlayer = owner, owner->_type == 1)) ||
|
|
((ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0), owner == GHIDRA_CAST<Entity_Player *>(0x0) ||
|
|
(owner->_type != 3)))) && (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0))))) {
|
|
pvVar11 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2 < 0x77) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar11) + 0x1d8));
|
|
}
|
|
ownerAsPlayer = 0xa0083e;
|
|
iVar14 = Entity_Player::get_costume_anim_frame
|
|
(ownerPlayer,ownerPlayer,item,GHIDRA_INT(ownerPlayer));
|
|
if (0xf < iVar14) {
|
|
Weapon::play_brimstone_costume_shoot
|
|
(GHIDRA_CAST<Weapon *>(this),ownerAsPlayer,GHIDRA_INT(ownerPlayer),pVVar6,8.0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
Weapon::update_c_section_charge_anim
|
|
(GHIDRA_CAST<Weapon *>(this),unusedCollectibleId_03,2,shootDirection,0.0);
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (local_3c[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(void *)backDirX.y,0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
goto LAB_00a00882;
|
|
}
|
|
Weapon::SetHeadLockTime(GHIDRA_CAST<Weapon *>(this),2);
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) || (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x28)) != 3))
|
|
goto LAB_00a00882;
|
|
Weapon::SetBlinkTime(GHIDRA_CAST<Weapon *>(this),10,unused_00);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = 0;
|
|
}
|
|
}
|
|
else {
|
|
if ((char)local_78 == '\0') goto LAB_009ffebb;
|
|
if (((isInterpolated != 0) || (0.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))))) || (0.0 <= backDirX.y))
|
|
goto LAB_009ffb5c;
|
|
if (cVar8 != '\0') goto LAB_009ffebb;
|
|
local_64 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_4e) << 7));
|
|
local_58.x = shootDirection->x;
|
|
local_58.y = shootDirection->y;
|
|
bVar2 = Weapon::IsAxisAligned(GHIDRA_CAST<Weapon *>(this));
|
|
if (bVar2 == 0) {
|
|
(GHIDRA_CAST<Vector *>((&local_58)))->Vector::Normalize();
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(local_58.x);
|
|
iVar14 = extraout_ECX_02;
|
|
}
|
|
else {
|
|
pVVar6 = Vector::ToCardinal(&local_60,&local_58);
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(pVVar6->x);
|
|
local_58.y = pVVar6->y;
|
|
iVar14 = extraout_ECX_01;
|
|
}
|
|
backDirX.y = local_58.y;
|
|
local_58.x = (float)local_4c;
|
|
Weapon::GetMultiShotParams(GHIDRA_CAST<Weapon *>(this),&multiShotParams,iVar14);
|
|
fVar18 = atan2f(backDirX.y,(float)local_4c);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44)))) = fVar18 * 57.295776;
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,3,&local_58,-1.0);
|
|
Weapon::SetBlinkTime(GHIDRA_CAST<Weapon *>(this),10,unused);
|
|
iVar14 = 0;
|
|
local_4e = 0;
|
|
if (0 < (short)multiShotParams) {
|
|
do {
|
|
FUN_009f4230(local_2c + 8,iVar14,10,local_58.x,local_58.y,local_b4.y,multiShotParams,
|
|
uStack_d4,uStack_d0,uStack_cc,local_c8,uStack_c4,uStack_c0,uStack_bc,local_b8
|
|
);
|
|
if (local_4e == 0) {
|
|
bVar2 = fire_hitscan(this,&g_vectorZero,GHIDRA_CAST<Vector *>((local_2c + 0x10)),GHIDRA_INT(local_64),1.0);
|
|
local_4e = 0;
|
|
if (bVar2 != 0) goto LAB_009ff93e;
|
|
}
|
|
else {
|
|
LAB_009ff93e:
|
|
local_4e = 1;
|
|
}
|
|
iVar14 = iVar14 + 1;
|
|
} while (iVar14 < (short)multiShotParams);
|
|
}
|
|
uVar15 = local_b8 & 0xffff;
|
|
owner = local_64;
|
|
bVar2 = local_4e;
|
|
while( true ) {
|
|
local_64 = owner;
|
|
if (uVar15 == 0) break;
|
|
if (bVar2 == 0) {
|
|
uVar7 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((fVar18 + fVar18));
|
|
backDirX.y = sin((float)local_4c);
|
|
local_60.x = cos((float)local_4c);
|
|
local_60.y = backDirX.y;
|
|
bVar3 = fire_hitscan(this,&g_vectorZero,&local_60,GHIDRA_INT(local_64),1.0);
|
|
bVar2 = 0;
|
|
if (bVar3 != 0) goto LAB_009ff9ec;
|
|
}
|
|
else {
|
|
LAB_009ff9ec:
|
|
bVar2 = 1;
|
|
}
|
|
uVar15 = uVar15 - 1;
|
|
owner = local_64;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_bc)) + 0x1))) = (char)(GHIDRA_UINT(uStack_bc) >> 8);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_bc)) + 0x1))) == '\0') {
|
|
if (bVar2 != 0) goto LAB_009ffafb;
|
|
LAB_009ffa68:
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_bc)) + 0x2))) != '\0') {
|
|
leftDirX.x = -local_58.y;
|
|
leftDirX.y = local_58.x;
|
|
bVar2 = fire_hitscan(this,&g_vectorZero,&leftDirX,GHIDRA_INT(owner),1.0);
|
|
if (bVar2 == 0) {
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_58.x) ^ 0x80000000));
|
|
local_58.x = local_58.y;
|
|
local_58.y = (float)ownerPlayer;
|
|
bVar2 = fire_hitscan(this,&g_vectorZero,&local_58,GHIDRA_INT(owner),1.0);
|
|
if (bVar2 == 0) goto LAB_009ffae1;
|
|
}
|
|
goto LAB_009ffafb;
|
|
}
|
|
LAB_009ffae1:
|
|
owner = local_6c;
|
|
if ((local_6c != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(bVar2 = TemporaryEffects::HasNullEffect(&local_6c->_temporaryeffects,0x7f), bVar2 != 0))
|
|
goto LAB_009ffafe;
|
|
}
|
|
else {
|
|
if (bVar2 == 0) {
|
|
backDirX.y = (float)(GHIDRA_UINT(local_58.y) ^ 0x80000000);
|
|
backDirX.x = -local_58.x;
|
|
bVar2 = fire_hitscan(this,&g_vectorZero,&backDirX,GHIDRA_INT(owner),1.0);
|
|
if (bVar2 == 0) goto LAB_009ffa68;
|
|
}
|
|
LAB_009ffafb:
|
|
owner = local_6c;
|
|
LAB_009ffafe:
|
|
fVar17 = (long double)this->GetMaxCharge();
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((float)fVar17);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) =
|
|
((float)local_4c - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))))) * 0.5 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))));
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
TemporaryEffects::RemoveNullEffect(&owner->_temporaryeffects,0x7f,-1);
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = local_ac.y;
|
|
local_4d = '\x01';
|
|
LAB_009ffb64:
|
|
piVar1 = GHIDRA_CAST<int *>(this->_mainLaser);
|
|
if (((piVar1 != GHIDRA_CAST<int *>(0x0)) && (piVar1[0xef] != 0)) && (*GHIDRA_CAST<int *>((piVar1[0xef] + 0x28)) != 1000)
|
|
) {
|
|
(**(code **)(*piVar1 + 0x28))();
|
|
}
|
|
local_a4.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
local_46 = '\0';
|
|
if ((GHIDRA_CAST<Entity_Player *>(local_a4.y) != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
((GHIDRA_CAST<Entity_Player *>(local_a4.y))->_type == 1)) {
|
|
pvVar11 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar11) >> 2 < 0x77) {
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
local_4c = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(pvVar11) + 0x1d8));
|
|
}
|
|
leftDirX.y = (float)(GHIDRA_CAST<Entity_Player *>(local_a4.y))->_playerCostumeMap;
|
|
backDirX.y = 0.0;
|
|
do {
|
|
if ((-1 < *GHIDRA_CAST<int *>(leftDirX.y)) && (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(leftDirX.y) + 0xc)) == '\0')) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x10))) = 0;
|
|
sprite = GHIDRA_CAST<ANM2 *>((*GHIDRA_CAST<int *>(leftDirX.y) * 0x130 +
|
|
GHIDRA_INT((GHIDRA_CAST<std_vector *>((GHIDRA_INT(local_a4.y) + 0x1220)))->_begin)));
|
|
tmpStringCapacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) = (void *)0x0;
|
|
(GHIDRA_CAST<msvc::string *>((local_2c)))->msvc::string::assign(&s_empty,0);
|
|
local_70 = local_70 | 2;
|
|
bVar2 = Weapon::is_held_item(sprite,GHIDRA_CAST<std_string *>(local_2c),local_4c);
|
|
if ((bVar2 == 0) ||
|
|
(((sprite->_animState)._animData == (void *)0x0 ||
|
|
(local_65 = '\x01', (sprite->_animState)._isPlaying == 0)))) {
|
|
local_65 = '\0';
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (((local_70 & 2) != 0) && (local_70 = local_70 & 0xfffffffd, 0xf < tmpStringCapacity)
|
|
) {
|
|
uVar15 = tmpStringCapacity + 1;
|
|
pvVar11 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_2c)) + 0x0)));
|
|
if (0xfff < uVar15) {
|
|
pvVar11 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + -4);
|
|
uVar15 = tmpStringCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) + (-4 - GHIDRA_INT(pvVar11))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar11,uVar15);
|
|
}
|
|
if (local_65 != '\0') {
|
|
if ((sprite != GHIDRA_CAST<ANM2 *>(0x0)) && (bVar2 = ANM2::IsPlaying(sprite,&s_empty), bVar2 != 0))
|
|
{
|
|
ANM2::GetAnimation(GHIDRA_CAST<ANM2 *>(&sprite->_animState),GHIDRA_CAST<std_string *>(local_2c));
|
|
local_8 = 3;
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_2c))) + 0x10))) < 8) {
|
|
LAB_009ffd27:
|
|
local_46 = '\0';
|
|
}
|
|
else {
|
|
str = GHIDRA_CAST<std_string *>(FUN_00651a90(animSuffix,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x10))) - 8,0xffffffff));
|
|
local_70 = local_70 | 1;
|
|
bVar2 = str_eq_cstr(str,GHIDRA_CAST<uint8_t *>("ShootAlt"));
|
|
local_46 = '\x01';
|
|
if (bVar2 == 0) goto LAB_009ffd27;
|
|
}
|
|
if ((local_70 & 1) != 0) {
|
|
(GHIDRA_CAST<msvc::string *>((animSuffix)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_2c)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
backDirX.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(backDirX.y)))) + 0x1)));
|
|
leftDirX.y = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity_Player *>(leftDirX.y)))) + 0x10)));
|
|
} while (GHIDRA_UINT(backDirX.y) < &DAT_0000000f);
|
|
}
|
|
if (local_4d == '\0') {
|
|
LAB_009ffde2:
|
|
pVVar6 = shootDirection;
|
|
}
|
|
else {
|
|
fVar17 = (long double)this->GetMaxCharge();
|
|
pVVar6 = shootDirection;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>((float)fVar17);
|
|
if (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) < (float)local_4c) {
|
|
owner = GHIDRA_CAST<Entity_Player *>(((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) / (float)local_4c) * 18.0));
|
|
local_4c = owner;
|
|
if ((char)isCSection == '\0') {
|
|
if (local_46 == '\0') {
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,0,shootDirection,(float)owner);
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = Weapon::is_c_section_anim_finished(GHIDRA_CAST<Weapon *>(this),unusedCollectibleId);
|
|
if (bVar2 != 0) {
|
|
owner = local_4c;
|
|
Weapon::update_c_section_charge_anim
|
|
(GHIDRA_CAST<Weapon *>(this),unusedCollectibleId_00,0,shootDirection,(float)local_4c);
|
|
}
|
|
}
|
|
if (isInterpolated == 0) {
|
|
FUN_009f4130();
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = (float)owner + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))));
|
|
}
|
|
goto LAB_009ffde2;
|
|
}
|
|
if ((char)isCSection == '\0') {
|
|
if (local_46 != '\0') goto LAB_009ffde2;
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,1,shootDirection,-1.0);
|
|
}
|
|
else {
|
|
Weapon::update_c_section_charge_anim
|
|
(GHIDRA_CAST<Weapon *>(this),unusedCollectibleId,1,shootDirection,-1.0);
|
|
}
|
|
}
|
|
bVar2 = Weapon::IsAxisAligned(GHIDRA_CAST<Weapon *>(this));
|
|
if (bVar2 == 0) {
|
|
aimDirection = Weapon::get_aim_direction(GHIDRA_CAST<Weapon *>(this),&local_34,pVVar6);
|
|
}
|
|
else {
|
|
local_60.x = (float)pVVar6->x;
|
|
aimDirection = &local_60;
|
|
local_60.y = (float)pVVar6->y;
|
|
}
|
|
fVar18 = aimDirection->x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = fVar18;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = aimDirection->y;
|
|
Weapon::SetBlinkTime(GHIDRA_CAST<Weapon *>(this),1,GHIDRA_INT(fVar18));
|
|
}
|
|
}
|
|
else {
|
|
local_90.y = 1.0;
|
|
this_00 = GHIDRA_CAST<Entity *>(this->_mainLaser);
|
|
local_a4.x = backDirX.y;
|
|
local_a4.y = (float)local_4c;
|
|
if (this_00 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_a4.x = (this_00->_pos).x;
|
|
local_a4.y = (this_00->_pos).y;
|
|
}
|
|
if (isInterpolated == 0) {
|
|
bVar2 = Entity_Player::HasCollectible(local_6c,0x44,0);
|
|
local_70 = 1;
|
|
if (bVar2 != 0) {
|
|
local_70 = 9;
|
|
}
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(leftDirX.y)) + 0x0))) != '\0') && (isHasBrimstone == '\0')) {
|
|
local_90.y = 0.5;
|
|
}
|
|
iVar14 = Entity_Player::GetCollectibleNum(owner,0x76,0);
|
|
if (1 < iVar14) {
|
|
local_90.y = local_90.y + local_90.y;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) != 0) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x28)) == 3)) {
|
|
local_90.y = local_90.y * 0.5;
|
|
}
|
|
if (1.5 < local_90.y) {
|
|
bVar16 = local_70 == 9;
|
|
local_70 = 0xb;
|
|
local_90.y = local_90.y * 0.5;
|
|
if (bVar16) {
|
|
local_70 = 0xe;
|
|
}
|
|
}
|
|
this_00 = GHIDRA_CAST<Entity *>(this->_mainLaser);
|
|
pfVar4 = GHIDRA_CAST<float *>(&this->_mainLaser);
|
|
if ((this_00 != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
((this_00->_subtype != 1 || (this_00->_variant != local_70)))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this_00) + 0x28))();
|
|
if (this->_mainLaser != 0) {
|
|
local_58.y = (float)&this->_mainLaser;
|
|
msvc::multiset<unsigned_int>::erase(&local_58.y);
|
|
this->_mainLaser = 0;
|
|
}
|
|
LAB_00a009e9:
|
|
uVar15 = Random();
|
|
laser = (Entity_Laser *)
|
|
Game::Spawn(g_game,7,local_70,&local_a4,&g_vectorZero,*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))),1
|
|
,uVar15);
|
|
if ((laser == GHIDRA_CAST<Entity_Laser *>(0x0)) || (laser->_type != 7)) {
|
|
laser = GHIDRA_CAST<Entity_Laser *>(0x0);
|
|
}
|
|
(laser->_posOffset).x = 0.0;
|
|
(laser->_posOffset).y = -20.0;
|
|
Entity::SetParent(GHIDRA_CAST<Entity *>(laser),*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))));
|
|
laser->_renderDepthOffset = 3000.0;
|
|
laser->_scale = local_90.y;
|
|
Entity_Laser::ResetSpriteScale(laser);
|
|
init_laser(this,laser);
|
|
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0xc))();
|
|
EntityPtr::Set(GHIDRA_CAST<EntityPtr *>(&this->_mainLaser),GHIDRA_CAST<Entity *>(laser));
|
|
this_00 = GHIDRA_CAST<Entity *>(this->_mainLaser);
|
|
pfVar4 = extraout_EAX;
|
|
puVar12 = extraout_ECX_07;
|
|
goto LAB_00a00a7b;
|
|
}
|
|
if (this_00 == GHIDRA_CAST<Entity *>(0x0)) goto LAB_00a009e9;
|
|
}
|
|
else {
|
|
LAB_00a00a7b:
|
|
if (this_00 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
uVar15 = CONCAT31((int3)(GHIDRA_UINT(puVar12) >> 8),isShooting);
|
|
goto LAB_009ffe67;
|
|
}
|
|
}
|
|
local_78 = CONCAT31((int3)(GHIDRA_UINT(pfVar4) >> 8),isShooting);
|
|
if (isShooting == 0) {
|
|
ownerAsPlayer = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12c4)) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x12c0));
|
|
iVar14 = 0;
|
|
if (0 < ownerAsPlayer) {
|
|
iVar14 = ownerAsPlayer;
|
|
}
|
|
if (iVar14 < 1) {
|
|
fVar18 = backDirX.y - (this_00->_pos).x;
|
|
fVar20 = (float)local_4c - (this_00->_pos).y;
|
|
if (10000.0 < fVar20 * fVar20 + fVar18 * fVar18) {
|
|
local_60.x = fVar18;
|
|
local_60.y = fVar20;
|
|
pVVar6 = (GHIDRA_CAST<Vector *>((&local_60)))->Vector::Normalized(&local_34);
|
|
local_60.x = pVVar6->x * 0.3 * 0.5;
|
|
local_60.y = pVVar6->y * 0.3 * 0.5;
|
|
goto LAB_00a00bb9;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
local_60.x = shootDirection->x;
|
|
local_60.y = shootDirection->y;
|
|
if (1.0 < local_60.x * local_60.x + local_60.y * local_60.y) {
|
|
(GHIDRA_CAST<Vector *>((&local_60)))->Vector::Normalize();
|
|
}
|
|
local_60.x = local_60.x * 2.0 * 0.5 * local_b4.y;
|
|
local_60.y = local_60.y * 2.0 * 0.5 * local_b4.y;
|
|
LAB_00a00bb9:
|
|
Entity::AddVelocity_divided(this_00,&local_60,0);
|
|
}
|
|
puVar21 = &this->_mainLaser;
|
|
if (isInterpolated == 0) {
|
|
init_laser(this,GHIDRA_CAST<Entity_Laser *>(*puVar21));
|
|
laser = GHIDRA_CAST<Entity_Laser *>(*puVar21);
|
|
laser->_scale = local_90.y;
|
|
Entity_Laser::ResetSpriteScale(laser);
|
|
if ((local_64 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(iVar14 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(local_64),local_ac.y,0.0), iVar14 != 0)) {
|
|
iVar14 = *puVar21;
|
|
if (iVar14 != 0) {
|
|
local_58.x = *GHIDRA_CAST<float *>((iVar14 + 0x33c));
|
|
local_58.y = *GHIDRA_CAST<float *>((iVar14 + 0x340));
|
|
local_60.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x33c));
|
|
local_60.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x340));
|
|
bVar2 = (GHIDRA_CAST<Vector *>((&local_58)))->Vector::operator_ne(&local_60);
|
|
if (bVar2 != 0) {
|
|
local_60.x = *GHIDRA_CAST<float *>((*puVar21 + 0x33c)) - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x33c))
|
|
;
|
|
local_60.y = *GHIDRA_CAST<float *>((*puVar21 + 0x340)) - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x340))
|
|
;
|
|
pVVar6 = (GHIDRA_CAST<Vector *>((&local_60)))->Vector::Normalized(&local_ac);
|
|
Weapon::TriggerTearEffects(GHIDRA_CAST<Weapon *>(this),pVVar6,1);
|
|
goto LAB_009ffe64;
|
|
}
|
|
}
|
|
pVVar6 = MusicManager::RandomVector(&local_90);
|
|
Weapon::TriggerTearEffects(GHIDRA_CAST<Weapon *>(this),pVVar6,1);
|
|
}
|
|
}
|
|
}
|
|
LAB_009ffe64:
|
|
uVar15 = local_78;
|
|
LAB_009ffe67:
|
|
if ((char)isCSection != '\0') {
|
|
if (this->_mainLaser == 0) {
|
|
if (((char)uVar15 != '\0') ||
|
|
(bVar2 = Weapon::is_c_section_anim_finished(GHIDRA_CAST<Weapon *>(this),uVar15), bVar2 != 0)) {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3c)))) = shootDirection->x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x40)))) = shootDirection->y;
|
|
}
|
|
}
|
|
else {
|
|
local_58.y = *GHIDRA_CAST<float *>((this->_mainLaser + 0x41c)) * 0.017453292;
|
|
local_4c = GHIDRA_CAST<Entity_Player *>(cos(local_58.y));
|
|
fVar18 = sin(local_58.y);
|
|
*GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3c)))) = local_4c;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x40)))) = fVar18;
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00a00d10
|
|
void Weapon_Brimstone::fire_c_section_fetuses()
|
|
{
|
|
Entity *source;
|
|
uint32_t rngResult;
|
|
Entity_Tear *tear;
|
|
int iVar1;
|
|
uint64_t *allocatedBytes;
|
|
uint32_t rngResult;
|
|
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;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint64_t oldAllocated;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b1076d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
shotSpeed = 1.0;
|
|
if ((iVar1 != 0) &&
|
|
((*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 1 ||
|
|
((*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 3 && (iVar1 = *GHIDRA_CAST<int *>((iVar1 + 0x410)), iVar1 != 0)))))) {
|
|
shotSpeed = *GHIDRA_CAST<float *>((iVar1 + 0x1464));
|
|
}
|
|
weapon = this;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&lasers,7,-1,-1,0,0);
|
|
rngResult = 0;
|
|
local_8 = 0;
|
|
if (lasers._size != 0) {
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lasers)) + 0x4))) + rngResult * 4));
|
|
if ((iVar1 == this->_mainLaser) || (*GHIDRA_CAST<int *>((iVar1 + 0x3bc)) == this->_mainLaser)) {
|
|
local_1c = *GHIDRA_CAST<float *>((iVar1 + 0x41c)) * 0.017453292;
|
|
dirY = sin(local_1c);
|
|
source = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
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 *>((iVar1 + 0x33c));
|
|
laserPos.y = *GHIDRA_CAST<float *>((iVar1 + 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);
|
|
(**(code **)(*GHIDRA_CAST<int *>(tear) + 0xc))();
|
|
}
|
|
rngResult = rngResult + 1;
|
|
} while (rngResult < GHIDRA_UINT(lasers._size));
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(lasers)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lasers)) + 0x4))) != 0) {
|
|
rngResult = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lasers)) + 0x4))) + -4));
|
|
oldAllocated = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - rngResult;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < rngResult));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lasers)) + 0x4))) + -4)));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00a00f30
|
|
long double 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 (long double)0.0;
|
|
}
|
|
baseCharge = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10))));
|
|
if (baseCharge < 0.001) {
|
|
baseCharge = 0.001;
|
|
}
|
|
return (long double)(baseCharge * chargeMultiplier);
|
|
}
|
|
|
|
// 00a00f90
|
|
void Weapon_Brimstone::init_laser(Entity_Laser *laser)
|
|
{
|
|
int iVar1;
|
|
BitSet128 *tearFlags;
|
|
ColorMod *laserColor;
|
|
float damage;
|
|
int *piVar2;
|
|
uint8_t auStack_50 [4];
|
|
Entity_Laser *local_4c;
|
|
BitSet128 tearFlagsResult;
|
|
ColorMod laserColorResult;
|
|
uint32_t local_c;
|
|
code *laserMethod;
|
|
uint64_t tearFlagsHigh;
|
|
uint32_t tearFlagsHighHigh;
|
|
uint32_t tearFlagsLowHigh;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(auStack_50);
|
|
local_4c = laser;
|
|
tearFlags = Weapon::get_owner_tear_flags(GHIDRA_CAST<Weapon *>(this),&tearFlagsResult);
|
|
tearFlagsLowHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&tearFlags->_l) + 4));
|
|
tearFlagsHigh = tearFlags->_h;
|
|
tearFlagsHighHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&tearFlags->_h) + 4));
|
|
iVar1 = *GHIDRA_CAST<int *>(laser);
|
|
*GHIDRA_CAST<int *>(&(laser->_tearFlags)._l) = GHIDRA_INT(tearFlags->_l);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(laser->_tearFlags)._l) + 4)) = tearFlagsLowHigh;
|
|
*GHIDRA_CAST<int *>(&(laser->_tearFlags)._h) = GHIDRA_INT(tearFlagsHigh);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(laser->_tearFlags)._h) + 4)) = tearFlagsHighHigh;
|
|
laserMethod = *(code **)(iVar1 + 0x3c);
|
|
laserColor = Weapon::get_laser_color(GHIDRA_CAST<Weapon *>(this),&laserColorResult);
|
|
piVar2 = GHIDRA_CAST<int *>(0x0);
|
|
(*laserMethod)(laserColor,0xffffffff,0xff,0,1);
|
|
laserMethod = *(code **)(*piVar2 + 0x40);
|
|
damage = Weapon::get_damage(GHIDRA_CAST<Weapon *>(this));
|
|
(*laserMethod)(damage);
|
|
return;
|
|
}
|
|
|
|
// 00a02790
|
|
void Weapon_Brimstone::ClearReferences()
|
|
{
|
|
Weapon_Brimstone *local_8;
|
|
uint32_t *laserRef;
|
|
|
|
laserRef = &this->_technology2Laser;
|
|
local_8 = this;
|
|
if (GHIDRA_CAST<int *>(this->_technology2Laser) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_technology2Laser) + 0x28))();
|
|
if (*laserRef != 0) {
|
|
local_8 = GHIDRA_CAST<Weapon_Brimstone *>(laserRef);
|
|
msvc::multiset<unsigned_int>::erase(&local_8);
|
|
*laserRef = 0;
|
|
}
|
|
}
|
|
laserRef = &this->_mainLaser;
|
|
if (GHIDRA_CAST<int *>(this->_mainLaser) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_mainLaser) + 0x28))();
|
|
if (*laserRef != 0) {
|
|
local_8 = GHIDRA_CAST<Weapon_Brimstone *>(laserRef);
|
|
msvc::multiset<unsigned_int>::erase(&local_8);
|
|
*laserRef = 0;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00a02800
|
|
int Weapon_Brimstone::GetMarkedTargetVariant()
|
|
{
|
|
uint8_t isHasItem;
|
|
Entity_Player *owner;
|
|
|
|
if ((GHIDRA_UINT(this->_modifiers) >> 4 & 1) != 0) {
|
|
return 0;
|
|
}
|
|
owner = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
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 = Entity_Player::HasCollectible(owner,0x23c,0);
|
|
if (isHasItem != 0) {
|
|
return 0x99;
|
|
}
|
|
isHasItem = Entity_Player::HasCollectible(owner,0x18a,0);
|
|
if (isHasItem == 0) {
|
|
return 0;
|
|
}
|
|
return 0x1e;
|
|
}
|
|
|
|
// 00a02870
|
|
uint32_t Weapon_Brimstone::GetFocusEntity()
|
|
{
|
|
if ((GHIDRA_UINT(this->_modifiers) >> 4 & 1) == 0) {
|
|
return 0;
|
|
}
|
|
return this->_mainLaser;
|
|
}
|
|
|
|
// 00a02890
|
|
void Weapon_Brimstone::fire(float Speed, uint8_t IgnoreStatusEffects)
|
|
{
|
|
void *pvVar1;
|
|
Entity *pEVar2;
|
|
Vector *pVVar3;
|
|
uint8_t isHitscanHit;
|
|
uint8_t isAnyHit;
|
|
uint32_t rngValue;
|
|
Entity_Laser *pEVar4;
|
|
ColorMod *laserColor;
|
|
int unused;
|
|
float extraout_ECX;
|
|
float extraout_ECX_00;
|
|
float extraout_ECX_01;
|
|
float extraout_ECX_02;
|
|
int iVar5;
|
|
uint32_t uVar6;
|
|
bool isShootingBackwards;
|
|
long double fVar7;
|
|
float fVar8;
|
|
float in_XMM2_Da;
|
|
int *piVar9;
|
|
int *piVar10;
|
|
uint8_t auStack_a8 [2];
|
|
uint8_t auStack_a6 [2];
|
|
uint8_t local_a4 [8];
|
|
float local_9c;
|
|
float *local_98;
|
|
Vector VStack_94;
|
|
Entity_Laser *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;
|
|
uint8_t auStack_54 [64];
|
|
uint32_t stackCookie;
|
|
code *setColorFn;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(auStack_a8);
|
|
aimDir = GHIDRA_CAST<Vector *>(Speed);
|
|
damageMultiplier = in_XMM2_Da;
|
|
Weapon::GetMultiShotParams(GHIDRA_CAST<Weapon *>(this),multiShotParams,GHIDRA_INT(this));
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (iVar5 == 0) {
|
|
LAB_00a02903:
|
|
local_8c = GHIDRA_CAST<Entity_Laser *>(0x0);
|
|
if (iVar5 != 0) {
|
|
local_8c = GHIDRA_CAST<Entity_Laser *>(0x0);
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 1) goto LAB_00a02934;
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 3) goto LAB_00a02924;
|
|
}
|
|
LAB_00a0293e:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = GHIDRA_CAST<Entity_Laser *>(0x3f800000);
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 1) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((iVar5 + 0x1464));
|
|
local_8c = GHIDRA_CAST<Entity_Laser *>(iVar5);
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>((iVar5 + 0x28)) != 3) goto LAB_00a02903;
|
|
local_8c = *GHIDRA_CAST<Entity_Laser **>((iVar5 + 0x410));
|
|
LAB_00a02924:
|
|
iVar5 = *GHIDRA_CAST<int *>((iVar5 + 0x410));
|
|
if (iVar5 == 0) goto LAB_00a0293e;
|
|
LAB_00a02934:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((iVar5 + 0x1464));
|
|
}
|
|
if ((GHIDRA_UINT(this->_modifiers) >> 9 & 1) == 0) {
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,2,GHIDRA_CAST<Vector *>(Speed),-1.0);
|
|
fVar8 = 0.0;
|
|
local_8c = GHIDRA_CAST<Entity_Laser *>(0x0);
|
|
local_98 = GHIDRA_CAST<float *>(0x0);
|
|
if (0 < multiShotParams[0]) {
|
|
do {
|
|
(*GHIDRA_CAST<uint32_t *>((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<uint32_t *>((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<uint16_t *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))));
|
|
pEVar4 = Weapon::fire_brimstone_with_color(GHIDRA_CAST<Weapon *>(this),&local_78,damageMultiplier,0);
|
|
(**(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0xc))();
|
|
if (local_8c == GHIDRA_CAST<Entity_Laser *>(0x0)) {
|
|
local_8c = pEVar4;
|
|
if (GHIDRA_CAST<Entity_Laser *>(this->_mainLaser) != pEVar4) {
|
|
if (GHIDRA_CAST<Entity_Laser *>(this->_mainLaser) != GHIDRA_CAST<Entity_Laser *>(0x0)) {
|
|
VStack_94.y = (float)&this->_mainLaser;
|
|
msvc::multiset<unsigned_int>::erase();
|
|
}
|
|
this->_mainLaser = pEVar4;
|
|
goto LAB_00a02da1;
|
|
}
|
|
}
|
|
else {
|
|
if (pEVar4->_parent != 0) {
|
|
VStack_94.y = (float)&pEVar4->_parent;
|
|
msvc::multiset<unsigned_int>::erase();
|
|
}
|
|
pEVar4->_parent = local_8c;
|
|
LAB_00a02da1:
|
|
msvc::multiset<unsigned_int>::insert();
|
|
}
|
|
fVar8 = (float)(GHIDRA_INT(local_98) + 1);
|
|
Speed = (float)aimDir;
|
|
local_98 = GHIDRA_CAST<float *>(fVar8);
|
|
} while (GHIDRA_INT(fVar8) < GHIDRA_INT(multiShotParams[0]));
|
|
}
|
|
for (local_98 = GHIDRA_CAST<float *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))) & 0xffff)); local_98 != GHIDRA_CAST<float *>(0x0);
|
|
local_98 = GHIDRA_CAST<float *>((GHIDRA_INT(local_98) + -1))) {
|
|
uVar6 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
VStack_94.y = fVar8 + fVar8;
|
|
local_80.x = cos(VStack_94.y);
|
|
local_80.y = sin(VStack_94.y);
|
|
pEVar2 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_9c = g_vectorZero.y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = g_vectorZero.x;
|
|
fVar8 = extraout_ECX;
|
|
}
|
|
else {
|
|
fVar8 = (pEVar2->_pos).y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (pEVar2->_pos).x;
|
|
local_9c = fVar8;
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) =
|
|
Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((local_a4 + 4)),&local_80,damageMultiplier,fVar8,0)
|
|
;
|
|
setColorFn = *(code **)(*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a4))) + 0x0))) + 0x3c);
|
|
laserColor = Weapon::get_laser_color(GHIDRA_CAST<Weapon *>(this),GHIDRA_CAST<ColorMod *>((auStack_54 + 0x14)));
|
|
piVar9 = GHIDRA_CAST<int *>(0x0);
|
|
(*setColorFn)(laserColor,0xffffffff,0xff);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = this->_mainLaser;
|
|
pEVar4 = GHIDRA_CAST<Entity_Laser *>((piVar9 + 0xef));
|
|
if (*GHIDRA_CAST<float *>(pEVar4) != 0.0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = pEVar4;
|
|
msvc::multiset<unsigned_int>::erase(local_a4);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(pEVar4) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4)));
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)local_a4)) + 0x4))) != 0.0) {
|
|
msvc::multiset<unsigned_int>::insert(pEVar4);
|
|
}
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
fVar8 = extraout_ECX_00;
|
|
}
|
|
auStack_54[1] = (char)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(auStack_54))) + 0x0))) >> 8);
|
|
isShootingBackwards = auStack_54[1] != '\0';
|
|
if (isShootingBackwards) {
|
|
pEVar2 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
local_80.x = -aimDir->x;
|
|
local_80.y = -aimDir->y;
|
|
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = g_vectorZero.x;
|
|
local_9c = g_vectorZero.y;
|
|
}
|
|
else {
|
|
fVar8 = (pEVar2->_pos).y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (pEVar2->_pos).x;
|
|
local_9c = fVar8;
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) =
|
|
Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((local_a4 + 4)),&local_80,damageMultiplier,fVar8,0)
|
|
;
|
|
setColorFn = *(code **)(*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a4))) + 0x0))) + 0x3c);
|
|
laserColor = Weapon::get_laser_color(GHIDRA_CAST<Weapon *>(this),GHIDRA_CAST<ColorMod *>((auStack_54 + 0x14)));
|
|
piVar9 = GHIDRA_CAST<int *>(0x0);
|
|
(*setColorFn)(laserColor,0xffffffff,0xff);
|
|
fVar8 = (float)this->_mainLaser;
|
|
pEVar4 = GHIDRA_CAST<Entity_Laser *>((piVar9 + 0xef));
|
|
if (*GHIDRA_CAST<float *>(pEVar4) != 0.0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = pEVar4;
|
|
msvc::multiset<unsigned_int>::erase(local_a4);
|
|
}
|
|
*GHIDRA_CAST<float *>(pEVar4) = fVar8;
|
|
if (fVar8 != 0.0) {
|
|
msvc::multiset<unsigned_int>::insert(pEVar4);
|
|
}
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
fVar8 = extraout_ECX_01;
|
|
}
|
|
if (auStack_54[2] == '\0') {
|
|
return;
|
|
}
|
|
pEVar2 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
local_80.x = -aimDir->y;
|
|
local_80.y = aimDir->x;
|
|
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_9c = g_vectorZero.y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = g_vectorZero.x;
|
|
}
|
|
else {
|
|
fVar8 = (pEVar2->_pos).y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = (pEVar2->_pos).x;
|
|
local_9c = fVar8;
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) =
|
|
Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((local_a4 + 4)),&local_80,damageMultiplier,fVar8,0);
|
|
setColorFn = *(code **)(*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a4))) + 0x0))) + 0x3c);
|
|
laserColor = Weapon::get_laser_color(GHIDRA_CAST<Weapon *>(this),GHIDRA_CAST<ColorMod *>((auStack_54 + 0x14)));
|
|
piVar10 = GHIDRA_CAST<int *>(0x0);
|
|
piVar9 = GHIDRA_CAST<int *>(0xffffffff);
|
|
(*setColorFn)(laserColor,0xffffffff,0xff);
|
|
iVar5 = this->_mainLaser;
|
|
pEVar4 = GHIDRA_CAST<Entity_Laser *>((piVar10 + 0xef));
|
|
if (*GHIDRA_CAST<int *>(pEVar4) != 0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x0))) = pEVar4;
|
|
msvc::multiset<unsigned_int>::erase(local_a4);
|
|
}
|
|
*GHIDRA_CAST<int *>(pEVar4) = iVar5;
|
|
if (iVar5 != 0) {
|
|
msvc::multiset<unsigned_int>::insert(pEVar4);
|
|
}
|
|
(**(code **)(*piVar10 + 0xc))();
|
|
pEVar2 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
VStack_94.x = local_98[1];
|
|
VStack_94.y = -*local_98;
|
|
if (pEVar2 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
fVar8 = extraout_ECX_02;
|
|
}
|
|
else {
|
|
fVar8 = (pEVar2->_pos).y;
|
|
}
|
|
pEVar4 = Weapon::FireBrimstone(pEVar2,GHIDRA_CAST<Vector *>((auStack_a8 + -0xc)),&VStack_94,local_9c,fVar8,0)
|
|
;
|
|
setColorFn = *(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0x3c);
|
|
laserColor = Weapon::get_laser_color(GHIDRA_CAST<Weapon *>(this),GHIDRA_CAST<ColorMod *>(auStack_54));
|
|
(*setColorFn)(laserColor,0xffffffff,0xff,0,1);
|
|
iVar5 = this->_mainLaser;
|
|
piVar10 = piVar9 + 0xef;
|
|
if (*piVar10 != 0) {
|
|
msvc::multiset<unsigned_int>::erase(auStack_a8 + -0x10);
|
|
}
|
|
*piVar10 = iVar5;
|
|
if (iVar5 != 0) {
|
|
msvc::multiset<unsigned_int>::insert(piVar10);
|
|
}
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
return;
|
|
}
|
|
Weapon::UpdateHeadChargeAnimation(GHIDRA_CAST<Weapon *>(this),0x76,3,GHIDRA_CAST<Vector *>(Speed),-1.0);
|
|
Weapon::SetBlinkTime(GHIDRA_CAST<Weapon *>(this),10,unused);
|
|
isAnyHit = 0;
|
|
iVar5 = 0;
|
|
VStack_94.x = (float)(GHIDRA_UINT(VStack_94.x) & 0xffffff);
|
|
if (0 < multiShotParams[0]) {
|
|
do {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = aimDir->x;
|
|
local_9c = aimDir->y;
|
|
Entity_Player::GetMultiShotPositionVelocity
|
|
(&local_80,iVar5,10,*aimDir,(*GHIDRA_CAST<uint32_t *>((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<uint16_t *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))));
|
|
if ((*GHIDRA_CAST<uint8_t *>((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;
|
|
}
|
|
iVar5 = iVar5 + 1;
|
|
VStack_94.x = (float)CONCAT13(isAnyHit,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(VStack_94.x)) + 0x0))));
|
|
} while (iVar5 < multiShotParams[0]);
|
|
}
|
|
pVVar3 = aimDir;
|
|
fVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)auStack_54)) + 0x0)));
|
|
for (uVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x4))) & 0xffff; aimDir = pVVar3, (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_54)) + 0x0))) = fVar8, uVar6 != 0;
|
|
uVar6 = uVar6 - 1) {
|
|
if (isAnyHit == 0) {
|
|
rngValue = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_98 = GHIDRA_CAST<float *>((fVar8 + fVar8));
|
|
(*GHIDRA_CAST<uint32_t *>((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;
|
|
fVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)auStack_54)) + 0x0)));
|
|
}
|
|
auStack_54[1] = (char)(GHIDRA_UINT(fVar8) >> 8);
|
|
if (auStack_54[1] != '\0') {
|
|
if (isAnyHit != 0) goto LAB_00a02bed;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4))) = -pVVar3->x;
|
|
local_9c = -pVVar3->y;
|
|
isAnyHit = fire_hitscan(this,&g_vectorZero,GHIDRA_CAST<Vector *>((local_a4 + 4)),0,damageMultiplier);
|
|
fVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)auStack_54)) + 0x0)));
|
|
}
|
|
if (isAnyHit != 0) goto LAB_00a02bed;
|
|
auStack_54[2] = (char)(GHIDRA_UINT(fVar8) >> 0x10);
|
|
if (auStack_54[2] != '\0') {
|
|
(*GHIDRA_CAST<uint32_t *>((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;
|
|
(*GHIDRA_CAST<uint32_t *>((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 == GHIDRA_CAST<Entity_Laser *>(0x0)) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_8c) + 0x1519)) != '\0') {
|
|
return;
|
|
}
|
|
piVar9 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_8c) + 0x150c));
|
|
if (piVar9 == *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_8c) + 0x1510))) {
|
|
return;
|
|
}
|
|
while ((*GHIDRA_CAST<int *>(*piVar9) != 0 || ((GHIDRA_CAST<int *>(*piVar9))[1] != 0x7f))) {
|
|
piVar9 = piVar9 + 4;
|
|
if (piVar9 == *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_8c) + 0x1510))) {
|
|
return;
|
|
}
|
|
}
|
|
LAB_00a02bed:
|
|
fVar7 = (long double)this->GetMaxCharge();
|
|
local_98 = GHIDRA_CAST<float *>((float)fVar7);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) =
|
|
((float)local_98 - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))))) * 0.5 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))));
|
|
if (local_8c != GHIDRA_CAST<Entity_Laser *>(0x0)) {
|
|
pvVar1 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if ((0x1fc < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)))
|
|
&& (local_80.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 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;
|
|
TemporaryEffects::RemoveEffect(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(local_8c) + 0x1508)),&local_80,-1);
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|