From 93c51bf3ec78c5ead11faffa866de242440a2dc0 Mon Sep 17 00:00:00 2001 From: Joshua Andrew Date: Sat, 22 Jun 2024 15:05:05 -0400 Subject: [PATCH] match `SkeletalFishGuard::rotateVertical` --- csv/Boss.csv | 2 +- data/Game.json | 2 +- data/json/Boss.json | 2 +- data/json/Enemy.json | 2 +- data/json/MapObj.json | 2 +- docs/PROGRESS.md | 2 +- docs/lib/Boss.md | 2 +- docs/lib/Boss/SkeletalFishGuard.md | 4 +-- .../include/JSystem/JGeometry/TQuat.hpp | 4 +-- source/Game/Boss/SkeletalFishGuard.cpp | 29 ++++++++++++++++++- 10 files changed, 39 insertions(+), 12 deletions(-) diff --git a/csv/Boss.csv b/csv/Boss.csv index 1d949c70..c57042b5 100644 --- a/csv/Boss.csv +++ b/csv/Boss.csv @@ -3184,7 +3184,7 @@ receiveMsgPlayerAttack__17SkeletalFishGuardFUlP9HitSensorP9HitSensor,SkeletalFis initSensor__17SkeletalFishGuardFv,SkeletalFishGuard.o,Boss.a,true calcTransAndFront__17SkeletalFishGuardFv,SkeletalFishGuard.o,Boss.a,true rotateHorizontal__17SkeletalFishGuardFRCQ29JGeometry8TVec3f,SkeletalFishGuard.o,Boss.a,true -rotateVertical__17SkeletalFishGuardFRCQ29JGeometry8TVec3f,SkeletalFishGuard.o,Boss.a,false +rotateVertical__17SkeletalFishGuardFRCQ29JGeometry8TVec3f,SkeletalFishGuard.o,Boss.a,true tryShiftApart__17SkeletalFishGuardFv,SkeletalFishGuard.o,Boss.a,true tryShiftStraight__17SkeletalFishGuardFv,SkeletalFishGuard.o,Boss.a,true tryShiftKill__17SkeletalFishGuardFv,SkeletalFishGuard.o,Boss.a,true diff --git a/data/Game.json b/data/Game.json index 78ba40b4..3c715892 100644 --- a/data/Game.json +++ b/data/Game.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, "label": "Game", - "message": "14.784%", + "message": "14.791%", "color": "blue" } \ No newline at end of file diff --git a/data/json/Boss.json b/data/json/Boss.json index c9b6914d..56bfb10b 100644 --- a/data/json/Boss.json +++ b/data/json/Boss.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, "label": "Boss", - "message": "8.487%", + "message": "8.556%", "color": "orange" } \ No newline at end of file diff --git a/data/json/Enemy.json b/data/json/Enemy.json index fcee2f19..5edecfe2 100644 --- a/data/json/Enemy.json +++ b/data/json/Enemy.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, "label": "Enemy", - "message": "3.265%", + "message": "3.845%", "color": "magenta" } \ No newline at end of file diff --git a/data/json/MapObj.json b/data/json/MapObj.json index 51f8357c..e2be9ee1 100644 --- a/data/json/MapObj.json +++ b/data/json/MapObj.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, "label": "MapObj", - "message": "31.922%", + "message": "32.277%", "color": "tan" } \ No newline at end of file diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 86b0ee21..1754df6b 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -3,7 +3,7 @@ | [Animation](https://github.com/shibbo/Petari/blob/master/docs/lib/Animation.md) | 5.303240099695375% | | [AreaObj](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj.md) | 58.14029363784665% | | [AudioLib](https://github.com/shibbo/Petari/blob/master/docs/lib/AudioLib.md) | 0.0% | -| [Boss](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss.md) | 8.487111739863108% | +| [Boss](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss.md) | 8.556806124784156% | | [Camera](https://github.com/shibbo/Petari/blob/master/docs/lib/Camera.md) | 34.12644987572494% | | [Demo](https://github.com/shibbo/Petari/blob/master/docs/lib/Demo.md) | 3.7442572741194486% | | [Effect](https://github.com/shibbo/Petari/blob/master/docs/lib/Effect.md) | 1.855215360664245% | diff --git a/docs/lib/Boss.md b/docs/lib/Boss.md index 191f6b81..f6aaf08d 100644 --- a/docs/lib/Boss.md +++ b/docs/lib/Boss.md @@ -137,7 +137,7 @@ | [SkeletalFishBossInfo.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishBossInfo.md) | 100.0% | 8 / 8 | 100.0% | :white_check_mark: | [SkeletalFishBossRail.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishBossRail.md) | 100.0% | 9 / 9 | 100.0% | :white_check_mark: | [SkeletalFishBossRailHolder.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishBossRailHolder.md) | 100.0% | 7 / 7 | 100.0% | :white_check_mark: -| [SkeletalFishGuard.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishGuard.md) | 56.558773424190804% | 45 / 62 | 72.58064516129032% | :eight_pointed_black_star: +| [SkeletalFishGuard.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishGuard.md) | 59.412265758092% | 46 / 62 | 74.19354838709677% | :eight_pointed_black_star: | [SkeletalFishGuardHolder.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishGuardHolder.md) | 100.0% | 15 / 15 | 100.0% | :white_check_mark: | [SkeletalFishJointCalc.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishJointCalc.md) | 100.0% | 1 / 1 | 100.0% | :white_check_mark: | [SkeletalFishRailControl.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss/SkeletalFishRailControl.md) | 100.0% | 6 / 6 | 100.0% | :white_check_mark: diff --git a/docs/lib/Boss/SkeletalFishGuard.md b/docs/lib/Boss/SkeletalFishGuard.md index d1b13b90..4c2369aa 100644 --- a/docs/lib/Boss/SkeletalFishGuard.md +++ b/docs/lib/Boss/SkeletalFishGuard.md @@ -5,7 +5,7 @@ | :white_check_mark: | Function is completed. -# 45 / 62 Completed -- (72.58064516129032%) +# 46 / 62 Completed -- (74.19354838709677%) # SkeletalFishGuard.o | Symbol | Decompiled? | | ------------- | ------------- | @@ -38,7 +38,7 @@ | `initSensor__17SkeletalFishGuardFv` | :white_check_mark: | | `calcTransAndFront__17SkeletalFishGuardFv` | :white_check_mark: | | `rotateHorizontal__17SkeletalFishGuardFRCQ29JGeometry8TVec3f` | :white_check_mark: | -| `rotateVertical__17SkeletalFishGuardFRCQ29JGeometry8TVec3f` | :x: | +| `rotateVertical__17SkeletalFishGuardFRCQ29JGeometry8TVec3f` | :white_check_mark: | | `tryShiftApart__17SkeletalFishGuardFv` | :white_check_mark: | | `tryShiftStraight__17SkeletalFishGuardFv` | :white_check_mark: | | `tryShiftKill__17SkeletalFishGuardFv` | :white_check_mark: | diff --git a/libs/JSystem/include/JSystem/JGeometry/TQuat.hpp b/libs/JSystem/include/JSystem/JGeometry/TQuat.hpp index 2370f26d..8116ac45 100644 --- a/libs/JSystem/include/JSystem/JGeometry/TQuat.hpp +++ b/libs/JSystem/include/JSystem/JGeometry/TQuat.hpp @@ -4,7 +4,7 @@ namespace JGeometry { template - struct TQuat4 { + struct TQuat4 : public TVec3 { public: /* Constructors */ inline TQuat4() {} @@ -42,7 +42,7 @@ namespace JGeometry { /* Operators */ TQuat4& operator=(const TQuat4 &rSrc); - T x, y, z, w; + T w; }; }; diff --git a/source/Game/Boss/SkeletalFishGuard.cpp b/source/Game/Boss/SkeletalFishGuard.cpp index 37c66bb2..ef2aa89c 100644 --- a/source/Game/Boss/SkeletalFishGuard.cpp +++ b/source/Game/Boss/SkeletalFishGuard.cpp @@ -435,7 +435,34 @@ void SkeletalFishGuard::rotateHorizontal(const TVec3f &a2, f32 scalar) { } } -// SkeletalFishGuard::rotateVertical +void SkeletalFishGuard::rotateVertical(const TVec3f &a2, f32 a3) { + TVec3f v12; + PSVECCrossProduct(mGravity.toCVec(), _D0.toCVec(), v12.toVec()); + + if (!MR::isNearZero(v12, 0.001f)) { + MR::normalize(&v12); + f32 angle = mGravity.angle(a2); + f32 v7 = (angle - mGravity.angle(_D0)); + + if (v7 > 0.0f) { + if (v7 > a3) { + v7 = a3; + } + } + else { + if (v7 < -a3) { + v7 = -a3; + } + } + + f32 v8 = (0.5f * v7); + f32 v9 = sin(v8); + TQuat4f v10; + v10.scale(v9, v12); + v10.w = cos(v8); + v10.transform(_D0); + } +} bool SkeletalFishGuard::tryShiftApart() { if (mAttackDelay > 0) {