From 07ec7420cda7c466920fc9d387555a0aed11cb3f Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 17:41:02 +0000 Subject: [PATCH] Decompile fn_19827 (CEffectPrim::PrimBubbleSwirl) Batch #5821 by Lumen: 0 byte-identical, 1 confirmed by peer review. - fn_19827 CEffectPrim::PrimBubbleSwirl: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, ntrl, Snow, SapitoSucio, Tanke Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Effects/EffectPrimitiveMotion.cpp | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 5bafc66f..9af46f6f 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -6656,6 +6656,107 @@ void CEffectPrim::PrimAuraGlow() { } // OFFSET: 0x00BC1080 +// FUNCTION: fn_19827 +void CEffectPrim::PrimBubbleSwirl() { + const CView* view = static_cast(g_modeMgr.GetGameMode())->camera; + this->state.slots[0].alphaT = static_cast(360 - static_cast(view->camera.yaw)); + const short pitch = static_cast(-static_cast(view->camera.pitch)); + short anglePitch = pitch + 450; + this->state.slots[1].alphaT = anglePitch; + if (anglePitch > 359) { + this->state.slots[1].alphaT = pitch + 90; + } + + this->render.position.x = this->state.master->render.position.x; + this->render.position.y = this->state.master->render.position.y; + this->render.position.z = this->state.master->render.position.z; + + if (this->state.slots[0].life != 1) { + return; + } + + const int process = ++this->state.slots[0].process; + if (process < 1) { + return; + } + + if (process > 3) { + this->state.slots[3].fullDisplayAngle = this->state.slots[2].fullDisplayAngle; + this->state.slots[3].distance = this->state.slots[2].distance; + this->state.slots[3].height[8] = this->state.slots[2].height[8]; + const short alpha = this->state.slots[2].alphaB - 25; + this->state.slots[3].alphaB = alpha < 0 ? 0 : alpha; + this->state.slots[3].vecBNow = this->state.slots[2].vecBNow; + this->state.slots[3].flag1[0] = this->state.slots[2].flag1[0]; + } + + if (process > 2) { + this->state.slots[2].fullDisplayAngle = this->state.slots[1].fullDisplayAngle; + this->state.slots[2].distance = this->state.slots[1].distance; + this->state.slots[2].height[8] = this->state.slots[1].height[8]; + const short alpha = this->state.slots[1].alphaB - 25; + this->state.slots[2].alphaB = alpha < 0 ? 0 : alpha; + this->state.slots[2].vecBNow = this->state.slots[1].vecBNow; + this->state.slots[2].flag1[0] = this->state.slots[1].flag1[0]; + } + + if (process > 1) { + this->state.slots[1].fullDisplayAngle = this->state.slots[0].fullDisplayAngle; + this->state.slots[1].distance = this->state.slots[0].distance; + this->state.slots[1].height[8] = this->state.slots[0].height[8]; + const short alpha = this->state.slots[0].alphaB - 100; + this->state.slots[1].alphaB = alpha < 0 ? 0 : alpha; + this->state.slots[1].vecBNow = this->state.slots[0].vecBNow; + this->state.slots[1].flag1[0] = this->state.slots[0].flag1[0]; + } + + if (process <= 10) { + this->state.slots[0].alphaB += 20; + } + + const char pattern = this->state.slots[0].flag1[4]; + if (pattern == 4) { + short angle = this->state.slots[0].fullDisplayAngle - 15; + if (angle < 0) { + angle += 360; + } + this->state.slots[0].fullDisplayAngle = angle; + this->state.slots[0].height[9] += this->state.slots[0].maxHeight; + this->state.slots[0].vecBNow.x = this->render.position.x + this->state.slots[0].height[8]; + this->state.slots[0].vecBNow.y = this->render.position.y + this->state.slots[0].height[9]; + this->state.slots[0].vecBNow.z = this->render.position.z + this->state.slots[0].height[10]; + + if (this->state.slots[0].height[9] >= -60.0f && static_cast(this->state.slots[0].fullDisplayAngle - 250) < 31) { + this->state.slots[0].flag1[4] = 0; + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); + mode->SendMsg(122, 0, 0, 0, 0); + return; + } + } else { + if (process < 33) { + if (pattern == 0 || process < 25) { + short angle = this->state.slots[0].fullDisplayAngle - 15; + if (angle < 0) { + angle += 360; + } + this->state.slots[0].fullDisplayAngle = angle; + this->state.slots[0].height[9] += this->state.slots[0].maxHeight; + } + this->state.slots[0].vecBNow.x = this->render.position.x + this->state.slots[0].height[8]; + this->state.slots[0].vecBNow.y = this->render.position.y + this->state.slots[0].height[9]; + this->state.slots[0].vecBNow.z = this->render.position.z + this->state.slots[0].height[10]; + return; + } + if (pattern == 0 && process == 33) { + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); + mode->SendMsg(122, 0, 0, 0, 0); + } + this->state.slots[0].alphaB -= 5; + if (this->state.slots[0].alphaB < 0) { + this->state.slots[0].alphaB = 0; + } + } +} // OFFSET: 0x00BC1B50 // FUNCTION: fn_19831