75 lines
2.8 KiB
C#
75 lines
2.8 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using CalamityMod.Rarities;
|
|
using CalamityMod.Tiles.Furniture.CraftingStations;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.Audio;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class Supernova : RogueWeapon
|
|
{
|
|
public static float StealthTimeInSeconds => 2f;
|
|
public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Item/SupernovaBoom") { Volume = 0.9f };
|
|
public static readonly SoundStyle StealthExplosionSound = new("CalamityMod/Sounds/Item/SupernovaStealthExplode") { Volume = 1f };
|
|
public static readonly SoundStyle StealthChargeSound = new("CalamityMod/Sounds/Item/SupernovaStealthCharge") { Volume = 1f };
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
|
}
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 106;
|
|
Item.height = 112;
|
|
Item.damage = 5200;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.useAnimation = 70;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.useTime = 70;
|
|
Item.knockBack = 18f;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
|
Item.shoot = ModContent.ProjectileType<SupernovaHoldout>();
|
|
Item.shootSpeed = 16f;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
Item.rare = ModContent.RarityType<ExoticRainbow>();
|
|
Item.channel = true;
|
|
}
|
|
|
|
public override bool AltFunctionUse(Player player) => true;
|
|
|
|
public override float StealthDamageMultiplier => 0.8f;
|
|
|
|
public override void HoldItem(Player player)
|
|
{
|
|
if (player.ownedProjectileCounts[Item.shoot] <= 0)
|
|
player.Calamity().rogueStealth = 0;
|
|
}
|
|
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/SupernovaGlow").Value);
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<SealedSingularity>().
|
|
AddIngredient<StarofDestruction>().
|
|
AddIngredient<TotalityBreakers>().
|
|
AddIngredient<BallisticPoisonBomb>().
|
|
AddIngredient<MiracleMatter>().
|
|
AddTile<DraedonsForge>().
|
|
Register();
|
|
}
|
|
}
|
|
}
|