55 lines
2.0 KiB
C#
55 lines
2.0 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Summon;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Summon
|
|
{
|
|
public class SunGodStaff : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Summon";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 60;
|
|
Item.mana = 10;
|
|
Item.width = 72;
|
|
Item.height = 72;
|
|
Item.useTime = Item.useAnimation = 25;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 1.25f;
|
|
Item.value = CalamityGlobalItem.Rarity6BuyPrice;
|
|
Item.rare = ItemRarityID.LightPurple;
|
|
Item.UseSound = SoundID.Item44;
|
|
Item.shoot = ModContent.ProjectileType<SolarGod>();
|
|
Item.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
CalamityUtils.KillShootProjectiles(true, type, player);
|
|
int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
|
if (Main.projectile.IndexInRange(p))
|
|
Main.projectile[p].originalDamage = Item.damage;
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<SunSpiritStaff>().
|
|
AddIngredient<EssenceofSunlight>(5).
|
|
AddIngredient(ItemID.SoulofFright, 3).
|
|
AddIngredient(ItemID.SoulofMight, 3).
|
|
AddIngredient(ItemID.SoulofSight, 3).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
}
|
|
}
|
|
}
|