rodecomp/Source/Contents/Effects/ViolentQuakeEffect.cpp
ragnarok-clanker 804b2d4d7a Decompile 10 functions in Source/Contents/Effects/TetraBallEffect.cpp, Source/Contents/Effects/TetraBallEffect.h, ...
Batch #3793 by eAthena: 0 byte-identical, 10 confirmed by peer review.

- fn_07514 CTetraBallEffect::ActiveCount: logic confirmed by peer review (annotation added to existing code)
- fn_07517 CTetraBallEffect::Slot03: logic confirmed by peer review (annotation added to existing code)
- fn_07518 CTetraBallEffect::Slot04: logic confirmed by peer review (annotation added to existing code)
- fn_07519 CTetraBallEffect::Spread: logic confirmed by peer review (annotation added to existing code)
- fn_07520 CTetraBallEffect::MoveFirstTo: logic confirmed by peer review (annotation added to existing code)
- fn_07521 CTriangleShotArrow::CTriangleShotArrow: logic confirmed by peer review (annotation added to existing code)
- fn_07525 CTriangleShotArrow::Slot06: logic confirmed by peer review (annotation added to existing code)
- fn_07527 CTriangleShotArrow::Slot04: logic confirmed by peer review (annotation added to existing code)
- fn_07528 CTriangleShotArrow::Slot16: logic confirmed by peer review (annotation added to existing code)
- fn_07529 CViolentQuakeEffect::CViolentQuakeEffect: logic confirmed by peer review (annotation added to existing code)

Peer-reviewed-by: youko, superintelligence
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-29 23:25:11 +00:00

56 lines
2.1 KiB
C++

#include "Contents/Effects/ViolentQuakeEffect.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Contents/Camera/Camera.h"
#include "Contents/Effects/Particle.h"
#include "Utility/Math/AffineMatrix.h"
// OFFSET: 0x0072F4E0
// FUNCTION: fn_07529
CViolentQuakeEffect::CViolentQuakeEffect() : CEffect(-1) {
}
// OFFSET: 0x0072FD00
bool CViolentQuakeEffect::Slot06() {
for (auto it = this->emitters.begin(); it != this->emitters.end(); ++it) {
CEZ2STRParticle* emitter = *it;
if (emitter->life == 0.0f || emitter->life * 60.0f > static_cast<float>(emitter->unknown_00E8)) {
return true;
}
}
return false;
}
// OFFSET: 0x0072FD60
void CViolentQuakeEffect::Slot03() {
for (auto it = this->emitters.begin(); it != this->emitters.end(); ++it) {
CEZ2STRParticle* emitter = *it;
if (!emitter) {
continue;
}
const float x = this->position[0];
const float y = this->position[1];
const float z = this->position[2];
const float* view = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->camera->frame.view.values;
const float* inverse = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->camera->frame.inverse.values;
const float viewX = view[0] * x + view[3] * y + view[6] * z + view[9] + emitter->unknown_00D0;
const float viewY = view[1] * x + view[4] * y + view[7] * z + view[10] + emitter->unknown_00D4;
const float viewZ = view[2] * x + view[5] * y + view[8] * z + view[11] + emitter->unknown_00D8;
emitter->position.x = viewY * inverse[3] + viewX * inverse[0] + viewZ * inverse[6] + inverse[9];
emitter->position.y = viewY * inverse[4] + viewX * inverse[1] + viewZ * inverse[7] + inverse[10];
emitter->position.z = viewY * inverse[5] + viewX * inverse[2] + viewZ * inverse[8] + inverse[11];
emitter->Process(0.0f, 0.0f, 0.0f);
}
}
// OFFSET: 0x00730190
void CViolentQuakeEffect::Slot04() {
for (auto it = this->emitters.begin(); it != this->emitters.end(); ++it) {
if (*it) {
(*it)->DrawScreen(static_cast<CGameMode*>(g_modeMgr.GetGameMode())->camera->frame.view);
}
}
}