This commit is contained in:
南沢响也
2025-09-19 13:53:31 +08:00
parent 2be0d6d626
commit f744cca396
3 changed files with 67 additions and 36 deletions

View File

@@ -12,22 +12,22 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw; using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data; using KodakkuAssist.Data;
using KodakkuAssist.Extensions; using KodakkuAssist.Extensions;
using ECommons; // using ECommons;
using ECommons.DalamudServices; // using ECommons.DalamudServices;
using ECommons.GameFunctions; // using ECommons.GameFunctions;
using ECommons.MathHelpers; // using ECommons.MathHelpers;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MainScenario_Roulette; namespace MainScenario_Roulette;
[ScriptType(guid: "84c15eea-2a19-4477-ad21-cd43d1263cfa", name: "随机任务:主线任务", territorys: [1043, 1044, 1048], [ScriptType(guid: "84c15eea-2a19-4477-ad21-cd43d1263cfa", name: "随机任务:主线任务", territorys: [1043, 1044, 1048],
version: "0.0.0.1", author: "Tetora", note: noteStr)] version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class MainScenario_Roulette public class MainScenario_Roulette
{ {
const string noteStr = const string noteStr =
""" """
v0.0.0.1: v0.0.0.2:
LV50 线 LV50 线
DR辅助需要你正确安装Daily Routines插件才可使用 DR辅助需要你正确安装Daily Routines插件才可使用
"""; """;
@@ -253,13 +253,13 @@ public class MainScenario_Roulette
switch (@event.ActionId()) switch (@event.ActionId())
{ {
case 29010: // 左 case 29010: // 左
dp.Rotation = 45f.DegToRad(); dp.Rotation = MathHelpers.DegToRad(45f);
break; break;
case 29008: // 中 case 29008: // 中
dp.Rotation = 0f.DegToRad(); dp.Rotation = MathHelpers.DegToRad(0f);
break; break;
case 29009: // 右 case 29009: // 右
dp.Rotation = 315f.DegToRad(); dp.Rotation = MathHelpers.DegToRad(315f);
break; break;
} }
dp.DestoryAt = 1900; dp.DestoryAt = 1900;
@@ -423,4 +423,27 @@ public static class EventExtensions
{ {
return JsonConvert.DeserializeObject<uint>(@event["Param"]); return JsonConvert.DeserializeObject<uint>(@event["Param"]);
} }
}
public static class MathHelpers
{
public static float DegToRad(float degrees)
{
return degrees * (float)(Math.PI / 180.0);
}
public static double DegToRad(double degrees)
{
return degrees * Math.PI / 180.0;
}
public static float RadToDeg(float radians)
{
return radians * (float)(180.0 / Math.PI);
}
public static double RadToDeg(double radians)
{
return radians * 180.0 / Math.PI;
}
} }

View File

@@ -11,22 +11,22 @@ using KodakkuAssist.Script;
using KodakkuAssist.Module.GameEvent; using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw; using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data; using KodakkuAssist.Data;
using ECommons; // using ECommons;
using ECommons.DalamudServices; // using ECommons.DalamudServices;
using ECommons.GameFunctions; // using ECommons.GameFunctions;
using ECommons.MathHelpers; // using ECommons.MathHelpers;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DhormeChimera; namespace DhormeChimera;
[ScriptType(guid: "e24bb311-704f-4f4c-8188-87eaa8da8b29", name: "死化奇美拉讨伐战", territorys: [368], [ScriptType(guid: "e24bb311-704f-4f4c-8188-87eaa8da8b29", name: "死化奇美拉讨伐战", territorys: [368],
version: "0.0.0.2", author: "Tetora", note: noteStr)] version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class DhormeChimera public class DhormeChimera
{ {
const string noteStr = const string noteStr =
""" """
v0.0.0.2: v0.0.0.3:
LV50 LV50
"""; """;
@@ -83,8 +83,8 @@ public class DhormeChimera
dp.Color = new Vector4(1f, 0.2f, 1f, 0.4f); dp.Color = new Vector4(1f, 0.2f, 1f, 0.4f);
dp.Owner = @event.SourceId(); dp.Owner = @event.SourceId();
dp.Scale = new Vector2(9.7f); dp.Scale = new Vector2(9.7f);
dp.Radian = 120f.DegToRad(); dp.Radian = MathHelpers.DegToRad(120f);
dp.Rotation = 45f.DegToRad(); dp.Rotation = MathHelpers.DegToRad(45);
dp.DestoryAt = 60000; dp.DestoryAt = 60000;
accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Fan, dp); accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Fan, dp);
} }
@@ -97,8 +97,8 @@ public class DhormeChimera
dp.Color = new Vector4(0f, 1f, 1f, 0.4f); dp.Color = new Vector4(0f, 1f, 1f, 0.4f);
dp.Owner = @event.SourceId(); dp.Owner = @event.SourceId();
dp.Scale = new Vector2(9.7f); dp.Scale = new Vector2(9.7f);
dp.Radian = 120f.DegToRad(); dp.Radian = MathHelpers.DegToRad(120f);
dp.Rotation = -45f.DegToRad(); dp.Rotation = MathHelpers.DegToRad(-45);
dp.DestoryAt = 60000; dp.DestoryAt = 60000;
accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Fan, dp); accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Fan, dp);
} }
@@ -279,17 +279,25 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]); return JsonConvert.DeserializeObject<uint>(@event["Param"]);
} }
} }
public static class Extensions public static class MathHelpers
{ {
public static void TTS(this ScriptAccessory accessory, string text, bool isTTS, bool isDRTTS) public static float DegToRad(float degrees)
{ {
if (isDRTTS) return degrees * (float)(Math.PI / 180.0);
{
accessory.Method.SendChat($"/pdr tts {text}");
}
else if (isTTS)
{
accessory.Method.TTS(text);
}
} }
}
public static double DegToRad(double degrees)
{
return degrees * Math.PI / 180.0;
}
public static float RadToDeg(float radians)
{
return radians * (float)(180.0 / Math.PI);
}
public static double RadToDeg(double radians)
{
return radians * 180.0 / Math.PI;
}
}

View File

@@ -2,12 +2,12 @@
{ {
"Name": "随机任务:主线任务", "Name": "随机任务:主线任务",
"Guid": "84c15eea-2a19-4477-ad21-cd43d1263cfa", "Guid": "84c15eea-2a19-4477-ad21-cd43d1263cfa",
"Version": "0.0.0.1", "Version": "0.0.0.2",
"Author": "Tetora", "Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main", "Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Dungeon/MainScenario_Roulette.cs", "DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Dungeon/MainScenario_Roulette.cs",
"Note": "v0.0.0.1:\r\nLV50 随机任务:主线任务 初版绘制\r\n选项中的DR辅助需要你正确安装Daily Routines插件才可使用", "Note": "v0.0.0.2:\r\nLV50 随机任务:主线任务 初版绘制\r\n选项中的DR辅助需要你正确安装Daily Routines插件才可使用",
"UpdateInfo": "", "UpdateInfo": "v0.0.0.2: 7.3",
"TerritoryIds": [ "TerritoryIds": [
1043, 1043,
1044, 1044,
@@ -173,12 +173,12 @@
{ {
"Name": "死化奇美拉讨伐战", "Name": "死化奇美拉讨伐战",
"Guid": "e24bb311-704f-4f4c-8188-87eaa8da8b29", "Guid": "e24bb311-704f-4f4c-8188-87eaa8da8b29",
"Version": "0.0.0.2", "Version": "0.0.0.3",
"Author": "Tetora", "Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main", "Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/DhormeChimera.cs", "DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/DhormeChimera.cs",
"Note": "v0.0.0.2:\r\nLV50 死化奇美拉讨伐战 初版绘制", "Note": "v0.0.0.3:\r\nLV50 死化奇美拉讨伐战 初版绘制",
"UpdateInfo": "增加TTS选项", "UpdateInfo": "v0.0.0.3: 7.3",
"TerritoryIds": [ "TerritoryIds": [
368 368
] ]