rodecomp/Source/Contents/Effects/TriangleShotArrow.cpp
ragnarok-clanker a77d887bad Decompile fn_07523 (CTriangleShotArrow::Close)
Batch #4062 by Gravity: 1 byte-identical, 0 confirmed by peer review.

- fn_07523 CTriangleShotArrow::Close: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-10-30 00:39:52 +00:00

73 lines
1.9 KiB
C++

#include "Contents/Effects/TriangleShotArrow.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Contents/Camera/Camera.h"
#include "Contents/Configuration/ServiceOptions.h"
#include "Contents/Effects/Particle.h"
#include "Utility/Math/AffineMatrix.h"
#include <cmath>
CParticle* sub_B82ED0(const vector3d* position, int flags);
void sub_B82FD0(CParticle* particle);
// OFFSET: 0x0072ED00
// FUNCTION: fn_07521
CTriangleShotArrow::CTriangleShotArrow() : CEffect(-1), current{}, direction{}, origin{} {
this->unknown_0050 = 0;
}
// OFFSET: 0x0072EE80
// FUNCTION: fn_07523
void CTriangleShotArrow::Close() {
sub_B82FD0(this->arrow);
}
// OFFSET: 0x0072EE90
// OFFSET: 0x0072F2B0
// FUNCTION: fn_07525
bool CTriangleShotArrow::Slot06() {
return static_cast<float>(this->step) <= 8.0f / this->speed;
}
// OFFSET: 0x0072F2E0
// FUNCTION: fn_07526
void CTriangleShotArrow::Slot03() {
if (this->delay > 0) {
this->delay -= 16;
return;
}
CEZ2STRParticle* arrow = this->arrow;
if (arrow) {
const float step = static_cast<float>(this->step);
this->current.x = step * this->direction.x + this->origin.x;
this->current.y = step * this->direction.y + this->origin.y;
this->current.z = step * this->direction.z + this->origin.z;
this->position[0] = this->current.x;
this->position[1] = this->current.y;
this->position[2] = this->current.z;
arrow->position.x = this->current.x;
arrow->position.y = this->current.y;
arrow->position.z = this->current.z;
arrow->Process(0.0f, 0.0f, 0.0f);
}
++this->step;
}
// OFFSET: 0x0072F470
// FUNCTION: fn_07527
void CTriangleShotArrow::Slot04() {
if (this->arrow) {
this->arrow->DrawScreen(static_cast<CGameMode*>(g_modeMgr.GetGameMode())->camera->frame.view);
}
}
// OFFSET: 0x0072F4D0
// FUNCTION: fn_07528
void CTriangleShotArrow::Slot16(int delay) {
this->delay = delay;
}