From 70a43bd6f503ecf9e213e6dd8c1ca061646b0ac5 Mon Sep 17 00:00:00 2001 From: Controllerdestiny <523321293@qq.co> Date: Thu, 18 Jul 2024 22:03:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0:=20Economics.Skill=20AI?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=B7=BB=E5=8A=A0AI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Economics.Skill/AIStyle.cs | 4 ++-- Economics.Skill/Model/Options/AIStyleOption.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Economics.Skill/AIStyle.cs b/Economics.Skill/AIStyle.cs index d4446458..f927867f 100644 --- a/Economics.Skill/AIStyle.cs +++ b/Economics.Skill/AIStyle.cs @@ -52,7 +52,7 @@ public static void Revolve(Projectile projectile, AIStyleOption aIStyleOption) if (Main.time % aIStyleOption.Interval == 0.0 && target != null) { var speed = projectile.DirectionTo(target.Center).SafeNormalize(-Vector2.UnitY); - int index = EconomicsAPI.Utils.SpawnProjectile.NewProjectile(Terraria.Projectile.GetNoneSource(), projectile.Center, speed.ToLenOf(aIStyleOption.Speed), aIStyleOption.ProjID, aIStyleOption.Damage, 10, projectile.owner); + int index = EconomicsAPI.Utils.SpawnProjectile.NewProjectile(Terraria.Projectile.GetNoneSource(), projectile.Center, speed.ToLenOf(aIStyleOption.Speed), aIStyleOption.ProjID, aIStyleOption.Damage, 10, projectile.owner, aIStyleOption.AI[0], aIStyleOption.AI[1], aIStyleOption.AI[2]); TSPlayer.All.SendData(PacketTypes.ProjectileNew, "", index); } } @@ -65,7 +65,7 @@ public static void Hover(Projectile projectile, AIStyleOption aIStyleOption) if (Main.time % aIStyleOption.Interval == 0.0 && target != null) { var speed = projectile.DirectionTo(target.Center).SafeNormalize(-Vector2.UnitY); - int index = EconomicsAPI.Utils.SpawnProjectile.NewProjectile(Terraria.Projectile.GetNoneSource(), projectile.Center, speed.ToLenOf(aIStyleOption.Speed), aIStyleOption.ProjID, aIStyleOption.Damage, 10, projectile.owner); + int index = EconomicsAPI.Utils.SpawnProjectile.NewProjectile(Terraria.Projectile.GetNoneSource(), projectile.Center, speed.ToLenOf(aIStyleOption.Speed), aIStyleOption.ProjID, aIStyleOption.Damage, 10, projectile.owner, aIStyleOption.AI[0], aIStyleOption.AI[1], aIStyleOption.AI[2]); TSPlayer.All.SendData(PacketTypes.ProjectileNew, "", index); } } diff --git a/Economics.Skill/Model/Options/AIStyleOption.cs b/Economics.Skill/Model/Options/AIStyleOption.cs index dc29d9ea..ea9086af 100644 --- a/Economics.Skill/Model/Options/AIStyleOption.cs +++ b/Economics.Skill/Model/Options/AIStyleOption.cs @@ -23,4 +23,7 @@ public class AIStyleOption [JsonProperty("攻击间隔")] public int Interval { get; set; } = 10; + + [JsonProperty("AI")] + public float[] AI { get; set; } = new float[3]; }