74 lines
2.4 KiB
C#
74 lines
2.4 KiB
C#
using CalamityMod.Items.Materials;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Microsoft.Xna.Framework;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class Helstorm : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Helstorm");
|
|
Tooltip.SetDefault("Fires two bullets at once\n" +
|
|
"The gun also deals damage to enemies that touch it");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 31;
|
|
item.ranged = true;
|
|
item.width = 50;
|
|
item.height = 24;
|
|
item.useTime = 7;
|
|
item.useAnimation = 7;
|
|
item.useStyle = ItemUseStyleID.HoldingOut;
|
|
item.knockBack = 2.5f;
|
|
item.value = Item.buyPrice(0, 80, 0, 0);
|
|
item.rare = ItemRarityID.Yellow;
|
|
item.UseSound = SoundID.Item11;
|
|
item.autoReuse = true;
|
|
item.shoot = ProjectileID.PurificationPowder;
|
|
item.shootSpeed = 11.5f;
|
|
item.useAmmo = AmmoID.Bullet;
|
|
item.Calamity().canFirePointBlankShots = true;
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset()
|
|
{
|
|
return new Vector2(-5, 0);
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
for (int index = 0; index < 2; ++index)
|
|
{
|
|
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
|
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
|
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<CruptixBar>(), 7);
|
|
recipe.AddTile(TileID.MythrilAnvil);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.OnFire, 360);
|
|
}
|
|
|
|
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.OnFire, 360);
|
|
}
|
|
}
|
|
}
|