A lot of testing is needed because it's a NPC converted to a projectile and a bit hacky.
Known bugs:
* Tail does not spawn
* Minion slots are ignored
29 lines
834 B
C#
29 lines
834 B
C#
using Decimation.Lib.Util;
|
|
using Terraria;
|
|
|
|
namespace Decimation.Lib.Items
|
|
{
|
|
public abstract class DecimationAmmo : DecimationItem
|
|
{
|
|
protected abstract string Projectile { get; }
|
|
protected abstract int Ammo { get; }
|
|
protected virtual int Damages { get; set; } = 0;
|
|
protected virtual bool VanillaProjectile { get; } = false;
|
|
protected abstract void InitAmmo();
|
|
|
|
protected sealed override void Init()
|
|
{
|
|
this.item.maxStack = 999;
|
|
this.item.consumable = true;
|
|
|
|
InitAmmo();
|
|
|
|
this.item.damage = Damages;
|
|
|
|
this.item.shoot = ItemUtils.GetIdFromName(this.Projectile, typeof(Terraria.Projectile), this.VanillaProjectile);
|
|
this.item.ammo = this.Ammo;
|
|
|
|
this.item.ranged = true;
|
|
}
|
|
}
|
|
} |