添加武器还是比较简单的,只需要在 Data/Weapons
中添加一个新的武器数据即可。
这里做一张16x16
格式为png
的图。
if (e.Name.IsEquivalentTo("Data/Weapons"))
{
e.Edit(assets =>
{
var dict = assets.AsDictionary<string, WeaponData>();
dict.Data["Awesome_TheLastSword"] = new WeaponData
{
Name = "Awesome_TheLastSword",
DisplayName = "The Last Sword",
Description = "The Last Sword You Will Ever Need",
MinDamage = 999,
MaxDamage = 999,
CritChance = 1,
CanBeLostOnDeath = false,
Texture = "Awesome_TheLastSword"
};
});
}
if (e.Name.IsEquivalentTo("Awesome_TheLastSword"))
{
e.LoadFromModFile<Texture2D>("assets/TheLastSword.png", AssetLoadPriority.Medium);
}