-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from Controllerdestiny/main
修复: EconomicsAPI 删除调试代码
- Loading branch information
Showing
5 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\template.targets" /> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\EconomicsAPI\EconomicsAPI.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Economics.Projectile.Internet; | ||
|
||
public class CustomProjectile | ||
{ | ||
[JsonProperty("弹幕ID")] | ||
public int Id { get; set; } | ||
|
||
[JsonProperty("伤害")] | ||
public int Damage { get; set; } | ||
|
||
[JsonProperty("击退")] | ||
public float Knockback { get; set; } | ||
|
||
[JsonProperty("射速")] | ||
public float Speed { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.Reflection; | ||
using Terraria; | ||
using TerrariaApi.Server; | ||
using TShockAPI; | ||
|
||
namespace Economics.Projectile; | ||
|
||
[ApiVersion(2, 1)] | ||
public class Plugin : TerrariaPlugin | ||
{ | ||
public override string Author => "少司命"; | ||
|
||
public override string Description => Assembly.GetExecutingAssembly().GetName().Name!; | ||
|
||
public override string Name => Assembly.GetExecutingAssembly().GetName().Name!; | ||
|
||
public override Version Version => Assembly.GetExecutingAssembly().GetName().Version!; | ||
|
||
internal static string PATH = Path.Combine(EconomicsAPI.Economics.SaveDirPath, "Projectile.json"); | ||
|
||
public Plugin(Main game) : base(game) | ||
{ | ||
} | ||
|
||
public override void Initialize() | ||
{ | ||
GetDataHandlers.NewProjectile.Register(OnProj); | ||
ServerApi.Hooks.NetGetData.Register(this, GetData); | ||
|
||
} | ||
|
||
private void GetData(GetDataEventArgs args) | ||
{ | ||
if(args.MsgID == PacketTypes.MinionAttackTargetUpdate) | ||
{ | ||
var reader = new BinaryReader(new MemoryStream(args.Msg.readBuffer, args.Index, args.Length)); | ||
var who = reader.ReadByte(); | ||
var npcid = reader.ReadInt16(); | ||
Console.WriteLine(npcid); | ||
Console.WriteLine(Main.npc[npcid].FullName); | ||
} | ||
} | ||
|
||
private void OnProj(object? sender, GetDataHandlers.NewProjectileEventArgs e) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters