Files
CalamityModPublic/Items/Weapons/Rogue/Celestus.cs
T
2023-05-28 06:14:26 +07:00

87 lines
3.1 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.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.GameContent;
namespace CalamityMod.Items.Weapons.Rogue
{
public class Celestus : RogueWeapon
{
public override float StealthDamageMultiplier => 0.8f;
public override void SetDefaults()
{
Item.damage = 280;
Item.DamageType = RogueDamageClass.Instance;
Item.useAnimation = Item.useTime = 22;
Item.shootSpeed = 25f;
Item.knockBack = 6f;
Item.shoot = ModContent.ProjectileType<CelestusProj>();
Item.width = 150;
Item.height = 132;
Item.useStyle = ItemUseStyleID.Swing;
Item.UseSound = SoundID.Item1;
Item.rare = ModContent.RarityType<Violet>();
Item.value = CalamityGlobalItem.Rarity15BuyPrice;
Item.autoReuse = true;
Item.noMelee = true;
Item.noUseGraphic = true;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable()) // Setting the Stealth Strike.
{
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
if (stealth.WithinBounds(Main.maxProjectiles))
Main.projectile[stealth].Calamity().stealthStrike = true;
return false;
}
return true;
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
CalamityUtils.DrawInventoryCustomScale(
spriteBatch,
texture: TextureAssets.Item[Type].Value,
position,
frame,
drawColor,
itemColor,
origin,
scale,
wantedScale: 0.3f,
drawOffset: default
);
return false;
}
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/CelestusGlow").Value);
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ElementalDisk>().
AddIngredient<MoltenAmputator>().
AddIngredient<SubductionSlicer>().
AddIngredient<EnchantedAxe>().
AddIngredient<MiracleMatter>().
AddTile<DraedonsForge>().
Register();
}
}
}