From 3d84022e340caaabd615bc8797e07e71d77d79c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E6=B2=A2=E5=93=8D=E4=B9=9F?= <72963826+Hibiya615@users.noreply.github.com> Date: Sun, 6 Apr 2025 05:24:07 +0800 Subject: [PATCH] update --- 03-Heavensward/Raid-Alexander/Normal/A6N.cs | 168 ++++++++++++++++++++ 04-Stormblood/Trial/Tsukuyomi.cs | 6 +- obj/rider.project.model.nuget.info | 2 +- 3 files changed, 170 insertions(+), 6 deletions(-) create mode 100644 03-Heavensward/Raid-Alexander/Normal/A6N.cs diff --git a/03-Heavensward/Raid-Alexander/Normal/A6N.cs b/03-Heavensward/Raid-Alexander/Normal/A6N.cs new file mode 100644 index 0000000..6ebea26 --- /dev/null +++ b/03-Heavensward/Raid-Alexander/Normal/A6N.cs @@ -0,0 +1,168 @@ +using System; +using System.ComponentModel; +using System.Linq; +using System.Numerics; +using System.Collections.Generic; +// using Dalamud.Game.ClientState.Objects.Subkinds; +// using Dalamud.Game.ClientState.Objects.Types; +using Newtonsoft.Json; +using Dalamud.Utility.Numerics; +using KodakkuAssist.Script; +using KodakkuAssist.Module.GameEvent; +using KodakkuAssist.Module.Draw; +using KodakkuAssist.Data; +using ECommons; +using ECommons.DalamudServices; +using ECommons.GameFunctions; +using ECommons.MathHelpers; +using System.Threading.Tasks; + +namespace A6N; + +[ScriptType(guid: "288f4f47-b94d-400a-bc07-ae244c2a432c", name: "A6N", territorys: [521], + version: "0.0.0.1", author: "Tetora", note: noteStr)] + +public class A6N +{ + const string noteStr = + """ + v0.0.0.1: + LV60 亚历山大机神城 律动之章2(正义四傻) 初版绘制 + """; + + [UserSetting("TTS开关")] + public bool isTTS { get; set; } = true; + + [UserSetting("弹窗文本提示开关")] + public bool isText { get; set; } = true; + + +} + +public static class EventExtensions +{ + private static bool ParseHexId(string? idStr, out uint id) + { + id = 0; + if (string.IsNullOrEmpty(idStr)) return false; + try + { + var idStr2 = idStr.Replace("0x", ""); + id = uint.Parse(idStr2, System.Globalization.NumberStyles.HexNumber); + return true; + } + catch (Exception) + { + return false; + } + } + + public static uint ActionId(this Event @event) + { + return JsonConvert.DeserializeObject(@event["ActionId"]); + } + + public static uint SourceId(this Event @event) + { + return ParseHexId(@event["SourceId"], out var id) ? id : 0; + } + + public static uint SourceDataId(this Event @event) + { + return JsonConvert.DeserializeObject(@event["SourceDataId"]); + } + + public static uint Command(this Event @event) + { + return ParseHexId(@event["Command"], out var cid) ? cid : 0; + } + + public static uint DurationMilliseconds(this Event @event) + { + return JsonConvert.DeserializeObject(@event["DurationMilliseconds"]); + } + + public static float SourceRotation(this Event @event) + { + return JsonConvert.DeserializeObject(@event["SourceRotation"]); + } + + public static float TargetRotation(this Event @event) + { + return JsonConvert.DeserializeObject(@event["TargetRotation"]); + } + + public static byte Index(this Event @event) + { + return (byte)(ParseHexId(@event["Index"], out var index) ? index : 0); + } + + public static uint State(this Event @event) + { + return ParseHexId(@event["State"], out var state) ? state : 0; + } + + public static string SourceName(this Event @event) + { + return @event["SourceName"]; + } + + public static string TargetName(this Event @event) + { + return @event["TargetName"]; + } + + public static uint TargetId(this Event @event) + { + return ParseHexId(@event["TargetId"], out var id) ? id : 0; + } + + public static Vector3 SourcePosition(this Event @event) + { + return JsonConvert.DeserializeObject(@event["SourcePosition"]); + } + + public static Vector3 TargetPosition(this Event @event) + { + return JsonConvert.DeserializeObject(@event["TargetPosition"]); + } + + public static Vector3 EffectPosition(this Event @event) + { + return JsonConvert.DeserializeObject(@event["EffectPosition"]); + } + + public static uint DirectorId(this Event @event) + { + return ParseHexId(@event["DirectorId"], out var id) ? id : 0; + } + + public static uint StatusId(this Event @event) + { + return JsonConvert.DeserializeObject(@event["StatusId"]); + } + + public static uint StackCount(this Event @event) + { + return JsonConvert.DeserializeObject(@event["StackCount"]); + } + + public static uint Param(this Event @event) + { + return JsonConvert.DeserializeObject(@event["Param"]); + } +} +public static class Extensions +{ + public static void TTS(this ScriptAccessory accessory, string text, bool isTTS, bool isDRTTS) + { + if (isDRTTS) + { + accessory.Method.SendChat($"/pdr tts {text}"); + } + else if (isTTS) + { + accessory.Method.TTS(text); + } + } +} \ No newline at end of file diff --git a/04-Stormblood/Trial/Tsukuyomi.cs b/04-Stormblood/Trial/Tsukuyomi.cs index f1282f7..181d8d2 100644 --- a/04-Stormblood/Trial/Tsukuyomi.cs +++ b/04-Stormblood/Trial/Tsukuyomi.cs @@ -106,13 +106,9 @@ public class Tsukuyomi public void 月读(Event @event, ScriptAccessory accessory) { if (@event.TargetId() != accessory.Data.Me) return; - string statusID = @event.StatusId.ToString(); - if (System.Text.RegularExpressions.Regex.IsMatch(statusID, "^153[89]$")) - { - string color = statusID == "1538" ? "黑色" : "白色"; + var color = @event.StatusId == 1538 ? "黑色" : "白色"; if (isText) accessory.Method.TextInfo($"吃{color}", duration: 2000, true); if (isTTS) accessory.Method.EdgeTTS($"吃{color}"); - } } [ScriptMethod(name: "月下缭乱(连续分摊)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:11259"])] diff --git a/obj/rider.project.model.nuget.info b/obj/rider.project.model.nuget.info index a210e24..e6b39fa 100644 --- a/obj/rider.project.model.nuget.info +++ b/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17378256062330333 \ No newline at end of file +17437957392858991 \ No newline at end of file