59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.Audio;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using ForgottenWawiTech.Content.Projectiles.FragmentedPrism;
|
|
using ForgottenWawiTech.Content.Rarities;
|
|
|
|
namespace ForgottenWawiTech.Content.Items.Weapons.Magic
|
|
{
|
|
public class FragmentedPrism : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.ResearchUnlockCount = 1;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 200;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 36;
|
|
Item.width = 54;
|
|
Item.height = 54;
|
|
Item.useTime = 30;
|
|
Item.useAnimation = 30;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.channel = true;
|
|
Item.noUseGraphic = true;
|
|
Item.knockBack = 3.5f;
|
|
Item.value = Item.buyPrice(platinum: 2, gold: 50);
|
|
Item.rare = ModContent.RarityType<SingularityItem>();
|
|
Item.UseSound = SoundID.Item15;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<FragmentedPrismController>();
|
|
Item.shootSpeed = 0f;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => true;
|
|
|
|
public override bool Shoot(Player player, Terraria.DataStructures.EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) => false;
|
|
|
|
public override void HoldItem(Player player)
|
|
{
|
|
if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[Item.shoot] == 0)
|
|
{
|
|
IEntitySource spawnSource = player.GetSource_ItemUse(Item);
|
|
int damage = player.GetWeaponDamage(Item);
|
|
float knockBack = player.GetWeaponKnockback(Item, Item.knockBack);
|
|
Projectile.NewProjectile(spawnSource, player.Center, Vector2.Zero, Item.shoot, damage, knockBack, player.whoAmI);
|
|
}
|
|
|
|
Lighting.AddLight(player.Center, new Vector3(0.08f, 0.16f, 0.26f));
|
|
}
|
|
}
|
|
}
|