65 lines
2.3 KiB
C#
65 lines
2.3 KiB
C#
using CalamityMod.Projectiles.Magic;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Magic
|
|
{
|
|
public class RelicofRuin : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Relic of Ruin");
|
|
Tooltip.SetDefault("Casts a spread of sand blades");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 26;
|
|
item.magic = true;
|
|
item.mana = 16;
|
|
item.width = 28;
|
|
item.height = 32;
|
|
item.useTime = 35;
|
|
item.useAnimation = 35;
|
|
item.useStyle = 5;
|
|
item.noMelee = true;
|
|
item.knockBack = 4.25f;
|
|
item.value = Item.buyPrice(0, 36, 0, 0);
|
|
item.rare = 5;
|
|
item.UseSound = SoundID.Item84;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<ForbiddenAxeBlade>();
|
|
item.shootSpeed = 30f;
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
float spread = 22.5f * 0.0174f;
|
|
double startAngle = Math.Atan2(speedX, speedY) - spread / 2;
|
|
double deltaAngle = spread / 8f;
|
|
double offsetAngle;
|
|
int i;
|
|
for (i = 0; i < 8; i++)
|
|
{
|
|
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
|
Projectile.NewProjectile(position.X, position.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), type, damage, knockBack, Main.myPlayer);
|
|
Projectile.NewProjectile(position.X, position.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), type, damage, knockBack, Main.myPlayer);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2);
|
|
recipe.AddIngredient(ItemID.SpellTome);
|
|
recipe.AddTile(TileID.Bookcases);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|