64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
using CalamityMod.Items.Materials;
|
|
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 TerraRay : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Magic";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.staff[Item.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 50;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 10;
|
|
Item.width = 54;
|
|
Item.height = 54;
|
|
Item.useTime = 24;
|
|
Item.useAnimation = 24;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 4f;
|
|
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
|
|
Item.rare = ItemRarityID.Yellow;
|
|
Item.UseSound = SoundID.Item60;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<TerraBeam>();
|
|
Item.shootSpeed = 6f;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
Vector2 shootVelocity = velocity;
|
|
Vector2 shootPosition = position + shootVelocity * 8f;
|
|
Projectile.NewProjectile(source, shootPosition, shootVelocity, type, damage, knockback, player.whoAmI);
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<NightsRay>().
|
|
AddIngredient<ValkyrieRay>().
|
|
AddIngredient<LivingShard>(12).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
CreateRecipe().
|
|
AddIngredient<CarnageRay>().
|
|
AddIngredient<ValkyrieRay>().
|
|
AddIngredient<LivingShard>(12).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
}
|
|
}
|
|
}
|