Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新: Economics.Skill AI样式添加AI #328

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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];
}
2 changes: 1 addition & 1 deletion Economics.Skill/Skill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Skill : TerrariaPlugin

public override string Name => Assembly.GetExecutingAssembly().GetName().Name!;

public override Version Version => new(1, 2, 0, 3);
public override Version Version => new(1, 2, 0, 4);

internal static string PATH = Path.Combine(EconomicsAPI.Economics.SaveDirPath, "Skill.json");

Expand Down
Loading