feat: api13, remove ecommon

This commit is contained in:
VeeverSW
2025-09-19 15:21:51 +08:00
parent f744cca396
commit 2d1a945a9b
75 changed files with 5122 additions and 614 deletions

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
// using ECommons;
// using ECommons.DalamudServices;
// using ECommons.GameFunctions;
// using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace MainScenario_Roulette;
[ScriptType(guid: "84c15eea-2a19-4477-ad21-cd43d1263cfa", name: "随机任务:主线任务", territorys: [1043, 1044, 1048],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class MainScenario_Roulette
{

View File

@@ -3,24 +3,18 @@ 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 Bahamute_NormalRaid_for_BLU;
[ScriptType(guid: "8d41b5f9-0ab6-404a-9572-aabb390023f0", name: "巴哈姆特大迷宫(青魔专用)", territorys: [196,245,358],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Bahamute_NormalRaid_for_BLU
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Garuda_Extreme;
[ScriptType(guid: "3e4685ed-1425-4ddc-8222-a2c15dcc9ad5", name: "迦楼罗歼殛战", territorys: [297],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Garuda_Extreme
{
@@ -290,3 +284,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Thornmarch_Extreme;
[ScriptType(guid: "fc6a6125-4a1d-4669-be4c-9b375dc70ae0", name: "莫古力贤王歼殛战", territorys: [364],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class ThornmarchExtreme
{
@@ -693,3 +687,112 @@ public static class DirectionCalc
return v2.Length();
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Ifrit_Extreme;
[ScriptType(guid: "dbb7983a-d2c4-4621-9734-76772e3f206a", name: "伊弗利特歼殛战", territorys: [295],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class Ifrit_Extreme
{

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace the_Whorleater_Extreme;
[ScriptType(guid: "07f20e0e-9463-4a10-9dd1-956fde6a9c46", name: "利维亚桑歼殛战", territorys: [359],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class the_Whorleater_Extreme
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,17 +10,13 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
using KodakkuAssist.Extensions;
namespace Battle_in_the_Big_Keep;
[ScriptType(guid: "90783a42-7947-4392-9c3e-f3162d52c248", name: "无限城的死斗", territorys: [396],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Battle_in_the_Big_Keep
{
@@ -311,3 +305,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace BattleOnTheBigBridgen;
[ScriptType(guid: "3e4102cb-9410-44fd-85e8-d43a3bc25737", name: "大桥上的决斗", territorys: [366],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class BattleOnTheBigBridge
{

View File

@@ -3,24 +3,18 @@ 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 DhormeChimera;
[ScriptType(guid: "e24bb311-704f-4f4c-8188-87eaa8da8b29", name: "死化奇美拉讨伐战", territorys: [368],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class DhormeChimera
{

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Garuda_Hard;
[ScriptType(guid: "ef230d41-5fbf-413d-b745-7227efebec48", name: "迦楼罗歼灭战", territorys: [294],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Garuda_Hard_
{
@@ -241,3 +235,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 Garuda_Normal;
[ScriptType(guid: "0887dadc-e415-48c9-bab1-cb51554457a2", name: "迦楼罗讨伐战", territorys: [1047],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Garuda_Normal
{

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Thornmarch_Hard;
[ScriptType(guid: "cd81e178-12e6-4e53-9b81-63002cc51ecb", name: "莫古力贤王歼灭战(整活版)", territorys: [1067],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Thornmarch_Hard
{
@@ -688,3 +682,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 A_Relic_Reborn_the_Hydra;
[ScriptType(guid: "d32d7489-a1bb-4117-98dd-ee895390804d", name: "海德拉讨伐战", territorys: [369],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class theBowlofEmbers_Hard
{
@@ -191,3 +185,113 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 theBowlofEmbers_Hard;
[ScriptType(guid: "d3d532f1-0707-427f-ac04-871a22022c11", name: "伊弗利特歼灭战", territorys: [292],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class theBowlofEmbers_Hard
{
@@ -38,7 +32,7 @@ public class theBowlofEmbers_Hard
{
if (!) return;
var dp = accessory.Data.GetDefaultDrawProperties();
var ifrits = Svc.Objects.Where(x => x.DataId == 209);
var ifrits = accessory.Data.Objects.Where(x => x.DataId == 209);
foreach (var ifrit in ifrits)
{
if (ifrit.IsTargetable)
@@ -62,7 +56,7 @@ public class theBowlofEmbers_Hard
{
if (!) return;
var dp = accessory.Data.GetDefaultDrawProperties();
var ifrits = Svc.Objects.Where(x => x.DataId == 209);
var ifrits = accessory.Data.Objects.Where(x => x.DataId == 209);
foreach (var ifrit in ifrits)
{
if (ifrit.IsTargetable)
@@ -233,3 +227,113 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 Nabriales;
[ScriptType(guid: "64206b9e-cd0a-47ec-960d-15f39a888f9e", name: "那布里亚勒斯讨伐战", territorys: [426],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class Nabriales
{

View File

@@ -3,24 +3,18 @@ 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 Urths_Fount;
[ScriptType(guid: "1a07440d-a7bd-4b67-b781-90d14087ee60", name: "奥丁歼灭战", territorys: [394],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Urths_Fount
{
const string noteStr =
@@ -207,3 +201,111 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 theStrikingTree_Hard;
[ScriptType(guid: "de6d6f10-775d-4c45-91ec-2bd4ed6762c7", name: "拉姆歼灭战", territorys: [374],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class theStrikingTree_Hard_
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Shiva;
[ScriptType(guid: "cddb93a8-e01e-40fe-989c-5153ad62bfbc", name: "希瓦歼灭战", territorys: [377],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Shiva
{
@@ -286,3 +280,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace the_Aery;
[ScriptType(guid: "ac6caf4e-5eee-406c-8621-a5f3c5c7e9b0", name: "邪龙王座龙巢神殿", territorys: [1065],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class the_Aery
{
@@ -390,3 +384,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
// using ECommons;
// using ECommons.DalamudServices;
// using ECommons.GameFunctions;
// using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace A3N;
[ScriptType(guid: "69712d1f-26c4-441f-97f0-e63f8baf98a6", name: "A3N", territorys: [444],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class A3N
{

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace A5N;
[ScriptType(guid: "1462516c-2bc2-4560-8244-387845cc098d", name: "A5N", territorys: [520],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class A5N
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
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)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class A6N
{

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Bismarck_Extreme;
[ScriptType(guid: "56751be8-113f-4496-8b46-982ff96d90c3", name: "俾斯麦歼殛战", territorys: [447],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Bismarck_Extreme
{

View File

@@ -3,24 +3,18 @@ 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 Ravana_Extreme;
[ScriptType(guid: "336990c6-8686-4691-8b7a-3ec8ffedfc19", name: "罗波那歼殛战", territorys: [446],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Ravana_Extreme
{
@@ -180,3 +174,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Nidhogg;
[ScriptType(guid: "dcfdb19e-0357-4214-b64e-205100f55822", name: "尼德霍格征龙战", territorys: [559],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Nidhogg
{
@@ -206,3 +200,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Sephirot;
[ScriptType(guid: "6d0824b3-6d67-4450-8b4e-46857257579e", name: "萨菲洛特歼灭战", territorys: [517],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Sephirot
{
@@ -309,3 +303,111 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Sophia;
[ScriptType(guid: "0909b7dc-2079-449a-97ca-f46204180bc0", name: "索菲娅歼灭战", territorys: [576],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Sophia
{
@@ -226,3 +220,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Extensions;
using KodakkuAssist.Data;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Zurvan;
[ScriptType(guid: "214f8fbd-ad04-430f-8bba-fd7319581780", name: "祖尔宛歼灭战", territorys: [637],
version: "0.0.0.4", author: "Tetora", note: noteStr)]
version: "0.0.0.5", author: "Tetora", note: noteStr)]
public class Zurvan
{
@@ -320,3 +314,4 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Ala_Mhigo;
[ScriptType(guid: "aa0ae191-da3f-48f1-9340-46a56cfeeabf", name: "鏖战红莲阿拉米格", territorys: [1146],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Ala_Mhigo
{
@@ -276,3 +272,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace SaintMociannesArboretum_Hard;
[ScriptType(guid: "7e87b5d1-ae21-4115-9483-d8dc0f1d1652", name: "污染庭园圣茉夏娜植物园", territorys: [788],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class SaintMociannesArboretum_Hard
{
@@ -412,3 +406,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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 the_Fractal_Continuum_Hard;
[ScriptType(guid: "c76136e1-1b5b-4cfb-a677-4cc0917fa050", name: "疯狂战舰无限回廊", territorys: [743],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class the_Fractal_Continuum_Hard
{
@@ -350,3 +344,111 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 O11n;
[ScriptType(guid: "2232ae84-c1e7-4382-88b4-d691887f27cf", name: "O11N", territorys: [800],
version: "0.0.0.3" , author: "Tetora", note: noteStr)]
version: "0.0.0.4" , author: "Tetora", note: noteStr)]
public class O11n
{
@@ -308,3 +302,111 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 O4n;
[ScriptType(guid: "f24f9cef-717e-4a2a-9616-d470443d6d8a", name: "O4N", territorys: [694],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class O4n
{

View File

@@ -11,16 +11,12 @@ 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 O5n;
[ScriptType(guid: "af11ce46-2c6a-46ba-b2bc-c542e5f5b7b5", name: "O5N", territorys: [748],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class O5n
{

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace O7n;
[ScriptType(guid: "70419862-28f5-4ebb-b1b3-220419cd502f", name: "O7N", territorys: [750],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class O7n
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Byakko;
[ScriptType(guid: "6a9e30e9-c58e-4f39-9f1e-ad26e5d49dc3", name: "白虎镇魂战", territorys: [746],
version: "0.0.0.11", author: "Tetora", note: noteStr)]
version: "0.0.0.12", author: "Tetora", note: noteStr)]
public class Byakko
{

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Emanation;
[ScriptType(guid: "a7bacd3e-834f-41ba-a210-c66e2c12d208", name: "吉祥天女歼灭战", territorys: [719],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class Lakshmi
{
@@ -220,3 +216,112 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace theRoyalMenagerie;
[ScriptType(guid: "da23fd13-2d1f-41d3-b2c9-91fd8d948a98", name: "神龙歼灭战", territorys: [679],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Shinryu
{

View File

@@ -3,24 +3,18 @@ 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 Susano;
[ScriptType(guid: "2c4b6205-6a77-4c89-b641-2c2359a43f25", name: "须佐之男歼灭战", territorys: [674],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Susano
{

View File

@@ -3,24 +3,18 @@ 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 Suzaku;
[ScriptType(guid: "fc907987-bad9-4c70-97f6-b91e2e70544b", name: "朱雀镇魂战", territorys: [810],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Suzaku
{
@@ -299,3 +293,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Tsukuyomi;
[ScriptType(guid: "97415dc8-cd16-4c9b-87be-026a297c3451", name: "月读歼灭战", territorys: [778],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Tsukuyomi
{
@@ -253,3 +247,112 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 Kugane_Ohashi;
[ScriptType(guid: "944c8879-0d4e-4182-87ea-c38769990f2d", name: "保镖歼灭战", territorys: [806],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Yojimbo
{
const string noteStr =

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace theTwinning;
[ScriptType(guid: "bfb00cd3-ccec-4b21-b3d7-e290f49e6a75", name: "异界遗构希尔科斯孪晶塔", territorys: [840],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class theTwinning
{
@@ -347,3 +341,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace E10n;
[ScriptType(guid: "038e00e8-d378-4f43-89ab-e27df5561d5a", name: "E10N", territorys: [943],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class E10n
{
@@ -414,3 +408,112 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace E12n;
[ScriptType(guid: "3f88ad9c-e7a7-4e00-b19e-546609b319ba", name: "E12N", territorys: [945],
version: "0.0.0.2" , author: "Tetora", note: noteStr)]
version: "0.0.0.3" , author: "Tetora", note: noteStr)]
public class E12n
{
@@ -290,3 +284,111 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Extensions;
using KodakkuAssist.Data;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace E1n;
[ScriptType(guid: "35c751e5-2958-4f55-b783-405b4acfde1b", name: "E1N", territorys: [849],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class E1n
{
@@ -240,3 +234,112 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -11,16 +11,12 @@ 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 E2n;
[ScriptType(guid: "b59c7db9-1fba-4476-8701-1e3043cb7dc8", name: "E2N", territorys: [850],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class E2n
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace E8n;
[ScriptType(guid: "c4d533c8-8798-441d-b849-fc3cd5cf63d9", name: "E8N", territorys: [905],
version: "0.0.0.3" , author: "Tetora", note: noteStr)]
version: "0.0.0.4" , author: "Tetora", note: noteStr)]
public class E8n
{
@@ -386,3 +380,112 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -11,16 +11,12 @@ 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 E9n;
[ScriptType(guid: "e4b80c15-7885-46b7-8e3d-201a6a248c89", name: "E9N", territorys: [942],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class E9n
{
@@ -219,3 +215,112 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace E12S;
[ScriptType(guid: "f2ebc170-00af-415d-8dfe-30bc27f7fc06", name: "E12S", territorys: [949],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class E12S
{
@@ -421,3 +415,111 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -1,37 +1,33 @@
using Dalamud.Game.ClientState.Objects.Types;
using ECommons.DalamudServices;
using System;
using System.Linq;
using System.Numerics;
using Newtonsoft.Json;
using Dalamud.Utility.Numerics;
using KodakkuAssist.Script;
using KodakkuAssist.Module.GameEvent;
using FFXIVClientStructs;
using FFXIVClientStructs.FFXIV.Client.Game.Character;
using FFXIVClientStructs.FFXIV.Client.UI;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Module.Draw.Manager;
using ECommons.ExcelServices.TerritoryEnumeration;
using System.Reflection.Metadata;
using System.Net;
using System.Threading.Tasks;
using System.Runtime.Intrinsics.Arm;
using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Script;
using Lumina.Data.Structs;
using Newtonsoft.Json;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using ECommons.Reflection;
using System.Windows;
using ECommons;
using ECommons.GameFunctions;
using FFXIVClientStructs;
using System;
using System.Linq;
using System.Net;
using System.Numerics;
using System.Reflection.Metadata;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.Arm;
using System.Threading.Tasks;
using System.Windows;
using System.Xml.Linq;
using FFXIVClientStructs.FFXIV.Client.UI;
using Lumina.Data.Structs;
namespace E7S;
[ScriptType(name: "E7S", territorys: [908], guid: "edb1e7fd-79cf-4bff-b134-7c55a1d31b36",
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class E7S
{
@@ -113,7 +109,7 @@ public class E7S
[ScriptMethod(name: "debug", eventType: EventTypeEnum.Chat, eventCondition: ["Message:debug"])]
public async void debug(Event @event, ScriptAccessory accessory)
{
var myself = IbcHelper.GetByEntityId(accessory.Data.Me);
var myself = accessory.Data.Objects.SearchByEntityId(accessory.Data.Me) as IBattleChara;
if (myself == null) return;
var buffId = myself.HasStatus(2238) ? 2238 : 2239;
DebugMsg($"buffId: {buffId}", accessory);
@@ -297,7 +293,7 @@ public class E7S
// 2238 Light //19516 & 19490 // 0x8BE
// 2239 Darkness //19517 & 19491 // 0x8BF
DebugMsg($"{LightsCourseCount}: {@event.ActionId()}", accessory);
var myself = IbcHelper.GetByEntityId(accessory.Data.Me);
var myself = accessory.Data.Objects.SearchByEntityId(accessory.Data.Me) as IBattleChara;
if (myself == null) return;
var buffId = myself.HasStatus(2238) ? 2238 : 2239;
DebugMsg($"buffId: {buffId}", accessory);
@@ -333,7 +329,7 @@ public class E7S
// 2238 Light //19516 & 19490 // 0x8BE
// 2239 Darkness //19517 & 19491 & 19521 // 0x8BF
DebugMsg($"{LightsCourseCount}: {@event.ActionId()}", accessory);
var myself = IbcHelper.GetByEntityId(accessory.Data.Me);
var myself = accessory.Data.Objects.SearchByEntityId(accessory.Data.Me) as IBattleChara;
if (myself == null) return;
var buffId = myself.HasStatus(2238) ? 2238 : 2239;
DebugMsg($"buffId: {buffId}", accessory);
@@ -745,36 +741,47 @@ public static class Extensions
public static class IbcHelper
{
public static IBattleChara? GetById(uint id)
public static KodakkuAssist.Data.IGameObject? GetById(ScriptAccessory accessory, uint id)
{
return (IBattleChara?)Svc.Objects.SearchByEntityId(id);
return accessory.Data.Objects.SearchByEntityId(id);
}
public static IBattleChara? GetMe()
public static KodakkuAssist.Data.IGameObject? GetMe(ScriptAccessory accessory)
{
return Svc.ClientState.LocalPlayer;
return accessory.Data.Objects.SearchByEntityId(accessory.Data.Me);
}
public static IGameObject? GetFirstByDataId(uint dataId)
public static KodakkuAssist.Data.IGameObject? GetFirstByDataId(ScriptAccessory accessory, uint dataId)
{
return Svc.Objects.Where(x => x.DataId == dataId).FirstOrDefault();
return accessory.Data.Objects.Where(x => x.DataId == dataId).FirstOrDefault();
}
public static IEnumerable<IGameObject?> GetByDataId(uint dataId)
public static IEnumerable<KodakkuAssist.Data.IGameObject> GetByDataId(ScriptAccessory accessory, uint dataId)
{
return Svc.Objects.Where(x => x.DataId == dataId);
}
public static IBattleChara? GetByEntityId(uint id)
{
return (IBattleChara?)Svc.Objects.SearchByEntityId(id);
}
public static bool HasStatus(this IBattleChara chara, uint statusId)
{
return chara.StatusList.Any(x => x.StatusId == statusId);
return accessory.Data.Objects.Where(x => x.DataId == dataId);
}
public static bool HasStatus(this IBattleChara chara, uint[] statusIds)
public static IEnumerable<KodakkuAssist.Data.IGameObject> GetParty(ScriptAccessory accessory)
{
return chara.StatusList.Any(x => statusIds.Contains(x.StatusId));
foreach (var pid in accessory.Data.PartyList)
{
var obj = accessory.Data.Objects.SearchByEntityId(pid);
if (obj != null) yield return obj;
}
}
public static IEnumerable<KodakkuAssist.Data.IGameObject> GetPartyEntities(ScriptAccessory accessory)
{
return accessory.Data.Objects.Where(obj => accessory.Data.PartyList.Contains(obj.EntityId));
}
public static bool HasStatus(this IBattleChara ibc, uint statusId)
{
return ibc.StatusList.Any(x => x.StatusId == statusId);
}
public static bool HasStatusAny(this IBattleChara ibc, uint[] statusIds)
{
return ibc.StatusList.Any(x => statusIds.Contains(x.StatusId));
}
}

View File

@@ -3,25 +3,19 @@ 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;
using KodakkuAssist.Extensions;
namespace Hades;
[ScriptType(guid: "ebcac22b-8a1d-49c4-ae1f-1470be15f7e3", name: "哈迪斯歼灭战", territorys: [847],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Hades
{
@@ -323,3 +317,114 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Titania;
[ScriptType(guid: "71a3a109-0ac3-4041-aa87-ff156f5aaeea", name: "缇坦妮雅歼灭战", territorys: [845],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Titania
{
@@ -332,3 +326,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace the_Lunar_Subterrane;
[ScriptType(guid: "080d15f8-1663-45c4-8919-73c8dea22617", name: "异界深渊月面地下溪谷", territorys: [1164],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class the_Lunar_Subterrane
{
@@ -335,3 +329,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Pandæmonium.Normal;
[ScriptType(guid: "f28cc2f2-6ce2-4526-a303-56fe1c02dea8", name: "P10N", territorys: [1149],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class P10n
{
@@ -306,3 +300,113 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 P11n;
[ScriptType(guid: "07be068a-65ea-4fd9-a324-9ec5326bb04b", name: "P11N", territorys: [1151],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class P11n
{

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace the_Voidcast_Dais;
[ScriptType(guid: "8a526afb-eefd-44ec-a105-7dc8fcd28e47", name: "高贝扎歼灭战", territorys: [1140],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class Golbez
{
@@ -262,3 +258,112 @@ public static class Extensions
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -11,16 +11,12 @@ 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 Hydaelyn;
[ScriptType(guid: "d9106d0c-3c5e-4feb-ae49-f27a70acf39f", name: "海德林歼灭战", territorys: [995],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Hydaelyn
{
@@ -378,3 +374,113 @@ public static class Extensions
}
}
#endregion
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,24 +3,18 @@ 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 Zeromus;
[ScriptType(guid: "1d6d7238-e986-408c-9c25-b24955542ee0", name: "泽罗姆斯歼灭战", territorys: [1168],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Zeromus
{
@@ -392,3 +386,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace the_Voidcast_Dais_Extreme;
[ScriptType(guid: "ef5d2622-37eb-45ba-a40a-b93f494dd097", name: "高贝扎歼殛战", territorys: [1141],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class Golbez_Extreme
{
@@ -458,3 +452,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace SinusArdorum;
[ScriptType(guid: "8f9e094e-2aa2-4dfc-9020-ac9dac53e525", name: "宇宙探索小工具", territorys: [1237],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class SinusArdorum
{
@@ -414,3 +410,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
// using ECommons;
// using ECommons.DalamudServices;
// ECommons.GameFunctions;
// using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace FRU_DLC;
[ScriptType(guid: "981e39b5-ea99-4b85-a4b1-0e698d4c4036", name: "FRU_DLC [光暗未来绝境战_额外补充]", territorys: [1238],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class FRU_DLC
{

View File

@@ -12,17 +12,13 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Celestium;
[ScriptType(guid: "7703f1a9-5698-4896-8908-bb8e415c1321", name: "天青斗场", territorys: [796],
version: "0.0.0.5", author: "Tetora", note: noteStr)]
version: "0.0.0.6", author: "Tetora", note: noteStr)]
public class Celestium {
const string noteStr =
@@ -278,3 +274,112 @@ public static class EventExtensions
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -12,10 +12,6 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
@@ -23,7 +19,7 @@ namespace Eureka_Orthos;
[ScriptType(guid: "5e8a4051-53f7-4eb3-bb32-b18df8b113aa", name: "正统优雷卡",
territorys: [1099,1100,1101,1102,1103,1104,1105,1106,1107,1108],
version: "0.0.0.31", author: "Tetora", note: noteStr)]
version: "0.0.0.32", author: "Tetora", note: noteStr)]
public class Eureka_Orthos {
const string noteStr =
@@ -1652,3 +1648,114 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,17 +10,13 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace the_Palace_of_the_Dead;
[ScriptType(guid: "4210c323-eba4-4d67-a7e7-b90799494729", name: "死者宫殿", author: "Tetora",
territorys: [561,562,563,564,565,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607],
version: "0.0.0.6",note: noteStr)]
version: "0.0.0.7",note: noteStr)]
public class the_Palace_of_the_Dead
{
@@ -1245,3 +1239,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace TheHead_theTail_theWholeDamnedThing;
[ScriptType(guid: "f11c3069-d163-41dd-904e-b016cfcf089c", name: "灾厄的古塔尼亚之深海讨伐战", territorys: [818],
version: "0.0.0.4", author: "Tetora", note: noteStr)]
version: "0.0.0.5", author: "Tetora", note: noteStr)]
public class Archaeotania
{

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Omicron_Recall_Killing_Order;
[ScriptType(guid: "b73d07ef-aa90-45a9-ab4b-fc3ccce8791b", name: "侵略兵器召回指令:破坏侵略兵器希", territorys: [960],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Chi
{
@@ -335,3 +331,113 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
// using ECommons;
// using ECommons.DalamudServices;
// using ECommons.GameFunctions;
// using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace DevoutPilgrimsVSDaivadipa;
[ScriptType(guid: "da82aeb0-9635-4f13-a1c1-39a0c859f596", name: "兽道诸神信仰:伪神降临", territorys: [957],
version: "0.0.0.4", author: "Tetora", note: noteStr)]
version: "0.0.0.5", author: "Tetora", note: noteStr)]
public class Daivadipa
{
@@ -400,3 +394,113 @@ public static class EventExtensions
return JsonConvert.DeserializeObject<uint>(@event["Param"]);
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace A_Finale_Most_Formidable;
[ScriptType(guid: "5f55a121-1fcc-48ce-a0e8-b6fbd4ce8489", name: "激斗畏惧装甲之秘密武器", territorys: [814],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class Formidable
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,17 +10,13 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace Mascot_Murder;
[ScriptType(guid: "22134617-0ca4-463e-a40d-675ef1c20cf2", name: "亩鼠米卡:盛装巡游皆大欢喜", territorys: [1192],
version: "0.0.0.2", author: "Tetora", note: noteStr)]
version: "0.0.0.3", author: "Tetora", note: noteStr)]
public class Mica_the_Magical_Mu
{
@@ -315,3 +309,113 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -12,16 +12,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace The_Serpentlord_Seethes;
[ScriptType(guid: "ab67129e-880f-48e8-852e-f92b4afa68e5", name: "蛇王得酷热涅:荒野的死斗", territorys: [1190],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class Ttokrrone
{
@@ -500,3 +496,113 @@ public static class Extensions
}
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,17 +10,13 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
using ECommons;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace The_Baldesion_Arsenal_Eureka;
[ScriptType(guid: "cb001385-81e0-4c16-8bb3-fb51fd70336a", name: "禁地优雷卡 - 巴尔德西昂兵武塔", territorys: [827],
version: "0.0.0.3", author: "Tetora", note: noteStr)]
version: "0.0.0.4", author: "Tetora", note: noteStr)]
public class The_Baldesion_Arsenal
{
@@ -780,3 +774,112 @@ public static class IbcHelper
return chara.StatusList.Any(x => statusIds.Contains(x.StatusId));
}
}
#region
public static class MathTools
{
public static float DegToRad(this float deg) => (deg + 360f) % 360f / 180f * float.Pi;
public static float RadToDeg(this float rad) => (rad + 2 * float.Pi) % (2 * float.Pi) / float.Pi * 180f;
/// <summary>
/// 获得任意点与中心点的弧度值,以(0, 0, 1)方向为0以(1, 0, 0)方向为pi/2。
/// 即,逆时针方向增加。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetRadian(this Vector3 point, Vector3 center)
=> MathF.Atan2(point.X - center.X, point.Z - center.Z);
/// <summary>
/// 获得任意点与中心点的长度。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static float GetLength(this Vector3 point, Vector3 center)
=> new Vector2(point.X - center.X, point.Z - center.Z).Length();
/// <summary>
/// 将任意点以中心点为圆心,逆时针旋转并延长。
/// </summary>
/// <param name="point">任意点</param>
/// <param name="center">中心点</param>
/// <param name="radian">旋转弧度</param>
/// <param name="length">基于该点延伸长度</param>
/// <returns></returns>
public static Vector3 RotateAndExtend(this Vector3 point, Vector3 center, float radian, float length)
{
var baseRad = point.GetRadian(center);
var baseLength = point.GetLength(center);
var rotRad = baseRad + radian;
return new Vector3(
center.X + MathF.Sin(rotRad) * (length + baseLength),
center.Y,
center.Z + MathF.Cos(rotRad) * (length + baseLength)
);
}
/// <summary>
/// 获得某角度所在划分区域
/// </summary>
/// <param name="radian">输入弧度</param>
/// <param name="regionNum">区域划分数量</param>
/// <param name="baseRegionIdx">0度所在区域的初始Idx</param>>
/// <param name="isDiagDiv">是否为斜分割默认为false</param>
/// <param name="isCw">是否顺时针增加默认为false</param>
/// <returns></returns>
public static int RadianToRegion(this float radian, int regionNum, int baseRegionIdx = 0, bool isDiagDiv = false, bool isCw = false)
{
var sepRad = float.Pi * 2 / regionNum;
var inputAngle = radian * (isCw ? -1 : 1) + (isDiagDiv ? sepRad / 2 : 0);
var rad = (inputAngle + 4 * float.Pi) % (2 * float.Pi);
return ((int)Math.Floor(rad / sepRad) + baseRegionIdx + regionNum) % regionNum;
}
/// <summary>
/// 将输入点左右折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerX">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointHorizon(this Vector3 point, float centerX)
=> point with { X = 2 * centerX - point.X };
/// <summary>
/// 将输入点上下折叠
/// </summary>
/// <param name="point">待折叠点</param>
/// <param name="centerZ">中心折线坐标点</param>
/// <returns></returns>
public static Vector3 FoldPointVertical(this Vector3 point, float centerZ)
=> point with { Z = 2 * centerZ - point.Z };
/// <summary>
/// 将输入点中心对称
/// </summary>
/// <param name="point">输入点</param>
/// <param name="center">中心点</param>
/// <returns></returns>
public static Vector3 PointCenterSymmetry(this Vector3 point, Vector3 center)
=> point.RotateAndExtend(center, float.Pi, 0);
/// <summary>
/// 获取给定数的指定位数
/// </summary>
/// <param name="val">给定数值</param>
/// <param name="x">对应位数个位为1</param>
/// <returns></returns>
public static int GetDecimalDigit(this int val, int x)
{
var valStr = val.ToString();
var length = valStr.Length;
if (x < 1 || x > length) return -1;
var digitChar = valStr[length - x]; // 从右往左取第x位
return int.Parse(digitChar.ToString());
}
}
#endregion

View File

@@ -2,7 +2,7 @@
{
"Name": "随机任务:主线任务",
"Guid": "84c15eea-2a19-4477-ad21-cd43d1263cfa",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"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",
@@ -17,7 +17,7 @@
{
"Name": "邪龙王座龙巢神殿",
"Guid": "ac6caf4e-5eee-406c-8621-a5f3c5c7e9b0",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Dungeon/theAery.cs",
@@ -30,7 +30,7 @@
{
"Name": "鏖战红莲阿拉米格",
"Guid": "aa0ae191-da3f-48f1-9340-46a56cfeeabf",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Dungeon/AlaMhigo.cs",
@@ -43,7 +43,7 @@
{
"Name": "疯狂战舰无限回廊",
"Guid": "c76136e1-1b5b-4cfb-a677-4cc0917fa050",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Dungeon/theFractalContinuum-Hard.cs",
@@ -56,7 +56,7 @@
{
"Name": "污染庭园圣茉夏娜植物园",
"Guid": "7e87b5d1-ae21-4115-9483-d8dc0f1d1652",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Dungeon/SaintMocianne'sArboretum%20(Hard).cs",
@@ -69,7 +69,7 @@
{
"Name": "异界遗构希尔科斯孪晶塔",
"Guid": "bfb00cd3-ccec-4b21-b3d7-e290f49e6a75",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Dungeon/theTwinning.cs",
@@ -82,7 +82,7 @@
{
"Name": "伊弗利特歼灭战",
"Guid": "d3d532f1-0707-427f-ac04-871a22022c11",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Ifrit(Hard).cs",
@@ -95,7 +95,7 @@
{
"Name": "迦楼罗歼灭战",
"Guid": "ef230d41-5fbf-413d-b745-7227efebec48",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Garuda(Hard).cs",
@@ -108,7 +108,7 @@
{
"Name": "拉姆歼灭战",
"Guid": "de6d6f10-775d-4c45-91ec-2bd4ed6762c7",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Ramuh(Hard).cs",
@@ -121,7 +121,7 @@
{
"Name": "希瓦歼灭战",
"Guid": "cddb93a8-e01e-40fe-989c-5153ad62bfbc",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Shiva.cs",
@@ -134,7 +134,7 @@
{
"Name": "莫古力贤王歼灭战(整活版)",
"Guid": "cd81e178-12e6-4e53-9b81-63002cc51ecb",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Good_King_Moggle-Hard.cs",
@@ -147,7 +147,7 @@
{
"Name": "那布里亚勒斯讨伐战",
"Guid": "64206b9e-cd0a-47ec-960d-15f39a888f9e",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Nabriales.cs",
@@ -160,7 +160,7 @@
{
"Name": "海德拉讨伐战",
"Guid": "d32d7489-a1bb-4117-98dd-ee895390804d",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Hydra.cs",
@@ -173,7 +173,7 @@
{
"Name": "死化奇美拉讨伐战",
"Guid": "e24bb311-704f-4f4c-8188-87eaa8da8b29",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"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",
@@ -186,7 +186,7 @@
{
"Name": "奥丁歼灭战",
"Guid": "1a07440d-a7bd-4b67-b781-90d14087ee60",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/Odin.cs",
@@ -199,7 +199,7 @@
{
"Name": "大桥上的决斗",
"Guid": "3e4102cb-9410-44fd-85e8-d43a3bc25737",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/BattleOnTheBigBridge.cs",
@@ -212,7 +212,7 @@
{
"Name": "无限城的死斗",
"Guid": "90783a42-7947-4392-9c3e-f3162d52c248",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials/BattleInTheBigKeep.cs",
@@ -225,7 +225,7 @@
{
"Name": "尼德霍格征龙战",
"Guid": "dcfdb19e-0357-4214-b64e-205100f55822",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Trials/Nidhogg.cs",
@@ -238,7 +238,7 @@
{
"Name": "萨菲洛特歼灭战",
"Guid": "6d0824b3-6d67-4450-8b4e-46857257579e",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Trials/Sephirot.cs",
@@ -251,7 +251,7 @@
{
"Name": "祖尔宛歼灭战",
"Guid": "214f8fbd-ad04-430f-8bba-fd7319581780",
"Version": "0.0.0.4",
"Version": "0.0.0.5",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Trials/Zurvan.cs",
@@ -264,7 +264,7 @@
{
"Name": "须佐之男歼灭战",
"Guid": "2c4b6205-6a77-4c89-b641-2c2359a43f25",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Susano.cs",
@@ -277,7 +277,7 @@
{
"Name": "吉祥天女歼灭战",
"Guid": "a7bacd3e-834f-41ba-a210-c66e2c12d208",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Lakshmi.cs",
@@ -290,7 +290,7 @@
{
"Name": "神龙歼灭战",
"Guid": "da23fd13-2d1f-41d3-b2c9-91fd8d948a98",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Shinryu.cs",
@@ -303,7 +303,7 @@
{
"Name": "月读歼灭战",
"Guid": "97415dc8-cd16-4c9b-87be-026a297c3451",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Tsukuyomi.cs",
@@ -316,7 +316,7 @@
{
"Name": "白虎镇魂战",
"Guid": "6a9e30e9-c58e-4f39-9f1e-ad26e5d49dc3",
"Version": "0.0.0.11",
"Version": "0.0.0.12",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main ",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Byakko.cs",
@@ -329,7 +329,7 @@
{
"Name": "朱雀镇魂战",
"Guid": "fc907987-bad9-4c70-97f6-b91e2e70544b",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Suzaku.cs",
@@ -342,7 +342,7 @@
{
"Name": "保镖歼灭战",
"Guid": "944c8879-0d4e-4182-87ea-c38769990f2d",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Trial/Yojimbo.cs",
@@ -355,7 +355,7 @@
{
"Name": "缇坦妮雅歼灭战",
"Guid": "71a3a109-0ac3-4041-aa87-ff156f5aaeea",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Trials/Titania.cs",
@@ -368,7 +368,7 @@
{
"Name": "哈迪斯歼灭战",
"Guid": "ebcac22b-8a1d-49c4-ae1f-1470be15f7e3",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Trials/Hades.cs",
@@ -381,7 +381,7 @@
{
"Name": "高贝扎歼灭战",
"Guid": "8a526afb-eefd-44ec-a105-7dc8fcd28e47",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/06-EndWalker/Trial/Golbez.cs",
@@ -394,7 +394,7 @@
{
"Name": "泽罗姆斯歼灭战",
"Guid": "1d6d7238-e986-408c-9c25-b24955542ee0",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/06-EndWalker/Trial/Zeromus.cs",
@@ -407,7 +407,7 @@
{
"Name": "迦楼罗歼殛战",
"Guid": "3e4685ed-1425-4ddc-8222-a2c15dcc9ad5",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials-Extreme/Garuda(Extreme).cs",
@@ -420,7 +420,7 @@
{
"Name": "伊弗利特歼殛战",
"Guid": "dbb7983a-d2c4-4621-9734-76772e3f206a",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials-Extreme/Ifrit(Extreme).cs",
@@ -433,7 +433,7 @@
{
"Name": "莫古力贤王歼殛战",
"Guid": "fc6a6125-4a1d-4669-be4c-9b375dc70ae0",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials-Extreme/Good_King_Moggle(Extreme).cs",
@@ -446,7 +446,7 @@
{
"Name": "利维亚桑歼殛战",
"Guid": "07f20e0e-9463-4a10-9dd1-956fde6a9c46",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/02-A-Realm-Reborn/Trials-Extreme/Leviathan(Extreme).cs",
@@ -459,7 +459,7 @@
{
"Name": "俾斯麦歼殛战",
"Guid": "56751be8-113f-4496-8b46-982ff96d90c3",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Trials-Extreme/Bismarck-Extreme.cs",
@@ -472,7 +472,7 @@
{
"Name": "A3N",
"Guid": "69712d1f-26c4-441f-97f0-e63f8baf98a6",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Raid-Alexander/Normal/A3N.cs",
@@ -485,7 +485,7 @@
{
"Name": "A5N",
"Guid": "1462516c-2bc2-4560-8244-387845cc098d",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/03-Heavensward/Raid-Alexander/Normal/A5N.cs",
@@ -498,7 +498,7 @@
{
"Name": "O4N",
"Guid": "f24f9cef-717e-4a2a-9616-d470443d6d8a",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Raid-Omega_Quests/Normal/O4n.cs",
@@ -511,7 +511,7 @@
{
"Name": "O5N",
"Guid": "af11ce46-2c6a-46ba-b2bc-c542e5f5b7b5",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Raid-Omega_Quests/Normal/O5n.cs",
@@ -524,7 +524,7 @@
{
"Name": "O11N",
"Guid": "2232ae84-c1e7-4382-88b4-d691887f27cf",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/04-Stormblood/Raid-Omega_Quests/Normal/O11n.cs",
@@ -537,7 +537,7 @@
{
"Name": "E1N",
"Guid": "35c751e5-2958-4f55-b783-405b4acfde1b",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Raid-Eden/Normal/E1n.cs",
@@ -550,7 +550,7 @@
{
"Name": "E2N",
"Guid": "b59c7db9-1fba-4476-8701-1e3043cb7dc8",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Raid-Eden/Normal/E2n.cs",
@@ -563,7 +563,7 @@
{
"Name": "E8N",
"Guid": "c4d533c8-8798-441d-b849-fc3cd5cf63d9",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Raid-Eden/Normal/E8n.cs",
@@ -576,7 +576,7 @@
{
"Name": "E9N",
"Guid": "e4b80c15-7885-46b7-8e3d-201a6a248c89",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Raid-Eden/Normal/E9n.cs",
@@ -589,7 +589,7 @@
{
"Name": "E10N",
"Guid": "038e00e8-d378-4f43-89ab-e27df5561d5a",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Raid-Eden/Normal/E10n.cs",
@@ -602,7 +602,7 @@
{
"Name": "E12N",
"Guid": "3f88ad9c-e7a7-4e00-b19e-546609b319ba",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/05-Shadowbringers/Raid-Eden/Normal/E12n.cs",
@@ -615,7 +615,7 @@
{
"Name": "P10N",
"Guid": "f28cc2f2-6ce2-4526-a303-56fe1c02dea8",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/06-EndWalker/Raid-Pand%C3%A6monium/Normal/P10n.cs",
@@ -628,7 +628,7 @@
{
"Name": "P11N",
"Guid": "07be068a-65ea-4fd9-a324-9ec5326bb04b",
"Version": "0.0.0.1",
"Version": "0.0.0.2",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/06-EndWalker/Raid-Pand%C3%A6monium/Normal/P11n.cs",
@@ -641,7 +641,7 @@
{
"Name": "死者宫殿",
"Guid": "4210c323-eba4-4d67-a7e7-b90799494729",
"Version": "0.0.0.6",
"Version": "0.0.0.7",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Deep_Dungeon/the_Palace_of_the_Dead.cs",
@@ -673,7 +673,7 @@
{
"Name": "天青斗场",
"Guid": "7703f1a9-5698-4896-8908-bb8e415c1321",
"Version": "0.0.0.5",
"Version": "0.0.0.6",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Celestium/Celestium.cs",
@@ -686,7 +686,7 @@
{
"Name": "激斗畏惧装甲之秘密武器",
"Guid": "5f55a121-1fcc-48ce-a0e8-b6fbd4ce8489",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Fate/Formidable.cs",
@@ -699,7 +699,7 @@
{
"Name": "灾厄的古塔尼亚之深海讨伐战",
"Guid": "f11c3069-d163-41dd-904e-b016cfcf089c",
"Version": "0.0.0.4",
"Version": "0.0.0.5",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Fate/Archaeotania.cs",
@@ -712,7 +712,7 @@
{
"Name": "兽道诸神信仰:伪神降临",
"Guid": "da82aeb0-9635-4f13-a1c1-39a0c859f596",
"Version": "0.0.0.4",
"Version": "0.0.0.5",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Fate/Daivadipa.cs",
@@ -725,7 +725,7 @@
{
"Name": "侵略兵器召回指令:破坏侵略兵器希",
"Guid": "b73d07ef-aa90-45a9-ab4b-fc3ccce8791b",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Fate/Chi.cs",
@@ -738,7 +738,7 @@
{
"Name": "蛇王得酷热涅:荒野的死斗",
"Guid": "ab67129e-880f-48e8-852e-f92b4afa68e5",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Fate/Ttokrrone.cs",
@@ -751,7 +751,7 @@
{
"Name": "亩鼠米卡:盛装巡游皆大欢喜",
"Guid": "22134617-0ca4-463e-a40d-675ef1c20cf2",
"Version": "0.0.0.2",
"Version": "0.0.0.3",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/Fate/Mica_the_MagicalMu.cs",
@@ -764,7 +764,7 @@
{
"Name": "FRU_DLC [光暗未来绝境战_额外补充]",
"Guid": "981e39b5-ea99-4b85-a4b1-0e698d4c4036",
"Version": "0.0.0.3",
"Version": "0.0.0.4",
"Author": "Tetora",
"Repo": "https://github.com/Hibiya615/TetoraKAScript/tree/main",
"DownloadUrl": "https://raw.githubusercontent.com/Hibiya615/TetoraKAScript/refs/heads/main/07-Dawntrail/FRU_DLC.cs",

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
// using ECommons;
// using ECommons.DalamudServices;
// using ECommons.GameFunctions;
// using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace PVPToy;
[ScriptType(guid: "2312052e-6575-4a91-9e3d-b84699dca8fe", name: "PVP小玩具", territorys: [250, 431, 554, 888, 1273],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class PVPToy
{

View File

@@ -3,8 +3,6 @@ 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;
@@ -12,16 +10,12 @@ using KodakkuAssist.Module.GameEvent;
using KodakkuAssist.Module.Draw;
using KodakkuAssist.Data;
using KodakkuAssist.Extensions;
// using ECommons;
// using ECommons.DalamudServices;
// using ECommons.GameFunctions;
// using ECommons.MathHelpers;
using System.Threading.Tasks;
namespace The_Borderland_Ruins;
[ScriptType(guid: "ec9c9f7d-be48-4974-82cf-396b0fc29261", name: "周边遗迹群(阵地战)", territorys: [1273],
version: "0.0.0.1", author: "Tetora", note: noteStr)]
version: "0.0.0.2", author: "Tetora", note: noteStr)]
public class The_Borderland_Ruins
{