55 lines
2.0 KiB
C#
55 lines
2.0 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Summon;
|
|
using CalamityMod.Rarities;
|
|
using CalamityMod.Tiles.Furniture.CraftingStations;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Summon
|
|
{
|
|
public class MidnightSunBeacon : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Summon";
|
|
public const float MachineGunRate = 18f;
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 150;
|
|
Item.mana = 10;
|
|
Item.width = Item.height = 32;
|
|
Item.useTime = Item.useAnimation = 10;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.knockBack = 1f;
|
|
Item.UseSound = SoundID.Item90;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<MidnightSunBeaconProj>();
|
|
Item.shootSpeed = 10f;
|
|
Item.DamageType = DamageClass.Summon;
|
|
|
|
Item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
|
Item.rare = ModContent.RarityType<Violet>();
|
|
}
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
|
if (Main.projectile.IndexInRange(p))
|
|
Main.projectile[p].originalDamage = Item.damage;
|
|
return false;
|
|
}
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.XenoStaff).
|
|
AddIngredient(ItemID.MoonlordTurretStaff).
|
|
AddIngredient<AuricBar>(5).
|
|
AddTile<CosmicAnvil>().
|
|
Register();
|
|
}
|
|
}
|
|
}
|