44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Projectiles.Summon;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Summon
|
|
{
|
|
public class SeaboundStaff : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Summon";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 11;
|
|
Item.mana = 10;
|
|
Item.width = Item.height = 44;
|
|
Item.useTime = Item.useAnimation = 35;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 2f;
|
|
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.UseSound = SoundID.Item44;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<BrittleStarMinion>();
|
|
Item.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.altFunctionUse != 2)
|
|
{
|
|
position = Main.MouseWorld;
|
|
velocity = Vector2.Zero;
|
|
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
|
if (Main.projectile.IndexInRange(p))
|
|
Main.projectile[p].originalDamage = Item.damage;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|