棍类武器模板是一类近战武器的模板,主要由3个部分ClubItem, ClubProj, ClubProjSmash组成.

ClubItem

范例

      public class ExampleClubItem : ClubItem
{
    public override void SetCustomDefaults()
    {
        ProjType = {ClubProj}.type;
        ProjSmashType = {ClubProjSmash}.type;
        // ...
    }
}

    

属性

名称描述
ProjType主Projectile, 设置Item.projectile
ProjSmashType视觉效果Projectile

ClubProj

范例

属性

名称可写描述
Omega⛔角速度
Beta✅角加速度
MaxOmega✅最大角速度
HitLength✅伤害半径
WarpValue✅扭曲度
StrikeOmegaDecrease✅击中时角速度减速量
MinStrikeOmegaDecrease✅最小击中时角速度减速量
DamageStartValue✅初始伤害
TrailLength✅尾迹长度
TrailVecs⛔尾迹坐标队列

方法

名称描述
PostPreDrawPreDraw()结尾
DrawTrail绘制尾迹
DrawWarp绘制扭曲
TrailAlpha尾迹透明度

用例 - 铜棍

CopperClub.cs
      public class CopperClub_Item : ClubItem
{
    public override void SetCustomDefaults()
    {
        Item.damage = 6;
        Item.value = 65;
        ProjType = ModContent.ProjectileType<CopperClub>();
        ProjSmashType = ModContent.ProjectileType<CopperClubSmash>();
    }
}

public class CopperClub : ClubProj_Metal
{
}

public class CopperClubSmash : ClubProjSmash_Metal
{
    public override string Texture => ModAsset.CopperClub_Mod;
}