diff --git a/Source/Contents/Effects/MagnumBreak.cpp b/Source/Contents/Effects/MagnumBreak.cpp index e943ccd2..38fd3f2c 100644 --- a/Source/Contents/Effects/MagnumBreak.cpp +++ b/Source/Contents/Effects/MagnumBreak.cpp @@ -4,6 +4,55 @@ #include "Utility/Math/AffineMatrix.h" // OFFSET: 0x00B49E60 +// FUNCTION: fn_18942 +void CMagnumBreak::Slot03() { + for (std::vector::iterator it = this->rings.begin(); it != this->rings.end(); ++it) { + CParticle* ring = *it; + float& growth = *reinterpret_cast(&ring->unknown_0048[0x0C]); + float& maximum = *reinterpret_cast(&ring->unknown_0048[0x10]); + float& spin = *reinterpret_cast(&ring->unknown_0048[0x14]); + const float angle = spin; + float speed = growth + ring->unknown_00C0; + speed = speed > 0.0f ? speed : 0.0f; + float scale = speed + ring->scale; + scale = scale < maximum ? scale : maximum; + matrix rotation; + rotation.MakeXRotation(1.5707964f); + ring->scale = scale; + ring->unknown_00C0 = speed; + spin = angle + speed; + ++ring->unknown_00E8; + ring->alpha = this->alpha; + ring->transform = rotation; + } + + for (std::vector::iterator it = this->waves.begin(); it != this->waves.end(); ++it) { + CParticle* wave = *it; + const float speed = *reinterpret_cast(&wave->unknown_0048[0x0C]) + wave->unknown_00C0; + wave->unknown_00C0 = speed; + wave->scale = speed + wave->scale; + *reinterpret_cast(&wave->unknown_0048[0x14]) = + *reinterpret_cast(&wave->unknown_0048[0x10]) + *reinterpret_cast(&wave->unknown_0048[0x14]); + ++wave->unknown_00E8; + wave->alpha = this->alpha; + } + + float step; + if (this->frame == this->fadeFrame) { + step = static_cast(-(this->alpha / (this->unknown_002C - this->frame))); + this->fadeStep = step; + } else { + step = this->fadeStep; + } + + const int value = static_cast(static_cast(this->alpha) + step); + this->alpha = value; + if (static_cast(value) < 0.0f) { + this->alpha = 0; + } else { + this->alpha = value > 255 ? 255 : value; + } +} // OFFSET: 0x00B4A150 // FUNCTION: fn_18943 diff --git a/Source/Contents/Effects/MapChainEffect.cpp b/Source/Contents/Effects/MapChainEffect.cpp index 4ebe84c9..8eacf37a 100644 --- a/Source/Contents/Effects/MapChainEffect.cpp +++ b/Source/Contents/Effects/MapChainEffect.cpp @@ -3,6 +3,10 @@ #include "Contents/Effects/Particle.h" // OFFSET: 0x00B4A9E0 +// FUNCTION: fn_18945 +CMapChainEffect::CMapChainEffect() + : CEffect(1024), particles(), unknown_00F0(2), unknown_00F4(2), unknown_00F8(2), unknown_00FC(2), unknown_0100(2) { +} // OFFSET: 0x00B4B130 // FUNCTION: fn_18951 diff --git a/Source/Contents/Effects/SquareRangeEffect.cpp b/Source/Contents/Effects/SquareRangeEffect.cpp index dda31721..0f9d52ea 100644 --- a/Source/Contents/Effects/SquareRangeEffect.cpp +++ b/Source/Contents/Effects/SquareRangeEffect.cpp @@ -6,8 +6,38 @@ #include // OFFSET: 0x00B4C5E0 +// FUNCTION: fn_18960 +CSquareRangeEffect::CSquareRangeEffect() : CEffect(-1), size(1.0f), resize(0), particles() { +} // OFFSET: 0x00B4C8E0 +// FUNCTION: fn_18965 +void CSquareRangeEffect::Slot03() { + for (std::vector::iterator it = this->particles.begin(); it != this->particles.end(); ++it) { + CParticle* particle = *it; + particle->position.x = this->position[0]; + particle->position.y = this->position[1]; + particle->position.z = this->position[2]; + if (particle) { + if (this->resize) { + particle->scale = this->size * 2.5f; + this->resize = 0; + } + + matrix rotation; + std::memcpy(rotation.values, g_identityMatrix, sizeof(rotation.values)); + rotation.MakeXRotation(1.5707964f); + matrix scale; + std::memcpy(scale.values, g_identityMatrix, sizeof(scale.values)); + scale.SetScale(particle->scale, particle->scale, 1.0f); + matrix transform; + transform.Compose(scale, rotation); + particle->transform = transform; + } + + ++particle->unknown_00E8; + } +} // OFFSET: 0x00B4CB40 // FUNCTION: fn_18966