49 lines
1.7 KiB
C#
49 lines
1.7 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 GodspawnHelixStaff : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Godspawn Helix Staff");
|
|
Tooltip.SetDefault("Summons astral probes to protect you");
|
|
SacrificeTotal = 1;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 60;
|
|
Item.mana = 10;
|
|
Item.width = 50;
|
|
Item.height = 50;
|
|
Item.useTime = Item.useAnimation = 20;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 1.25f;
|
|
Item.value = CalamityGlobalItem.Rarity9BuyPrice;
|
|
Item.rare = ItemRarityID.Cyan;
|
|
Item.UseSound = SoundID.Item44;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<AstralProbeSummon>();
|
|
Item.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
position = Main.MouseWorld;
|
|
velocity.X = 0;
|
|
velocity.Y = 0;
|
|
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;
|
|
}
|
|
}
|
|
}
|