62 lines
2.0 KiB
C#
62 lines
2.0 KiB
C#
using CalamityMod.Items.Materials;
|
|
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 AcidGun : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Acid Gun");
|
|
Tooltip.SetDefault("Releases three streams of acid");
|
|
SacrificeTotal = 1;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 17;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 9;
|
|
Item.width = 42;
|
|
Item.height = 28;
|
|
Item.useTime = Item.useAnimation = 45;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 1.5f;
|
|
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.UseSound = SoundID.Item13;
|
|
Item.autoReuse = true;
|
|
Item.shootSpeed = 14f;
|
|
Item.shoot = ModContent.ProjectileType<AcidGunStream>();
|
|
}
|
|
|
|
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 i = 0; i < 3; i++)
|
|
{
|
|
float angle = MathHelper.Lerp(-0.145f, 0.145f, i / 3f);
|
|
Projectile.NewProjectile(source, position, velocity.RotatedBy(angle), type, damage, knockback, player.whoAmI);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<SulphuricScale>(10).
|
|
AddIngredient<Acidwood>(35).
|
|
AddTile(TileID.Anvils).
|
|
Register();
|
|
}
|
|
}
|
|
}
|