52 lines
2.0 KiB
C#
52 lines
2.0 KiB
C#
using CalamityMod.Items.BaseItems;
|
|
using CalamityMod.Items.Weapons.Ranged;
|
|
using CalamityMod.Projectiles.Melee;
|
|
using CalamityMod.Rarities;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using static Terraria.ModLoader.ModContent;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class HolyCollider : CustomUseProjItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Melee";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 114;
|
|
Item.height = 146;
|
|
Item.damage = 2900;
|
|
Item.DamageType = TrueMeleeDamageClass.Instance;
|
|
Item.useAnimation = 45;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.useTime = 45;
|
|
Item.useTurn = true;
|
|
Item.knockBack = 7.75f;
|
|
Item.autoReuse = true;
|
|
Item.shootSpeed = 10f;
|
|
|
|
Item.channel = true;
|
|
Item.shoot = ModContent.ProjectileType<HolyColliderHoldout>();
|
|
Item.noUseGraphic = true;
|
|
Item.noMelee = true;
|
|
|
|
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
|
Item.rare = ModContent.RarityType<Turquoise>();
|
|
}
|
|
public override bool MeleePrefix() => true;
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 5);
|
|
return false;
|
|
}
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request<Texture2D>(Texture + "Glow").Value);
|
|
}
|
|
}
|
|
}
|