Files
CalamityModPublic/Items/Weapons/Magic/Waywasher.cs
T
2024-08-03 17:53:31 +07:00

43 lines
1.6 KiB
C#

using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class Waywasher : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.width = 30;
Item.height = 30;
Item.damage = 16;
Item.DamageType = DamageClass.Magic;
Item.mana = 4;
Item.useTime = 15;
Item.useAnimation = 15;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2.5f;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item8;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<WaywasherProj>();
Item.shootSpeed = 12f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float SpeedX = velocity.X + (float)Main.rand.Next(-20, 21) * 0.05f;
float SpeedY = velocity.Y + (float)Main.rand.Next(-20, 21) * 0.05f;
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<WaywasherProj>(), damage, knockback, player.whoAmI);
return false;
}
}
}