Skip to content

Commit

Permalink
更新: Economics.Skill AI样式添加AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Controllerdestiny committed Jul 18, 2024
1 parent e1c54c8 commit 70a43bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Economics.Skill/AIStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down
3 changes: 3 additions & 0 deletions Economics.Skill/Model/Options/AIStyleOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ public class AIStyleOption

[JsonProperty("攻击间隔")]
public int Interval { get; set; } = 10;

[JsonProperty("AI")]
public float[] AI { get; set; } = new float[3];
}

0 comments on commit 70a43bd

Please sign in to comment.