棍类武器模板是一类近战武器的模板,主要由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;
}