58 lines
2.0 KiB
C#
58 lines
2.0 KiB
C#
using CalamityMod.Items.Placeables;
|
|
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 Effervescence : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Magic";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 64;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 17;
|
|
Item.width = 56;
|
|
Item.height = 26;
|
|
Item.useTime = 15;
|
|
Item.useAnimation = 15;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 3.75f;
|
|
Item.value = CalamityGlobalItem.Rarity10BuyPrice;
|
|
Item.rare = ItemRarityID.Red;
|
|
Item.UseSound = SoundID.Item95;
|
|
Item.autoReuse = true;
|
|
Item.shootSpeed = 13f;
|
|
Item.shoot = ModContent.ProjectileType<UberBubble>();
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
for (int randomBullets = 0; randomBullets < 4; randomBullets++)
|
|
{
|
|
float SpeedX = velocity.X + Main.rand.Next(-25, 26) * 0.05f;
|
|
float SpeedY = velocity.Y + Main.rand.Next(-25, 26) * 0.05f;
|
|
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.BubbleGun).
|
|
AddIngredient(ItemID.LunarBar, 5).
|
|
AddIngredient<SeaPrism>(15).
|
|
AddTile(TileID.LunarCraftingStation).
|
|
Register();
|
|
}
|
|
}
|
|
}
|