61 lines
2.1 KiB
C#
61 lines
2.1 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using CalamityMod.Rarities;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class ShatteredSun : RogueWeapon
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 56;
|
|
Item.height = 56;
|
|
Item.damage = 80;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.useAnimation = 12;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.useTime = 12;
|
|
Item.knockBack = 6f;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
Item.value = CalamityGlobalItem.Rarity12BuyPrice;
|
|
Item.rare = ModContent.RarityType<Turquoise>();
|
|
Item.shoot = ModContent.ProjectileType<ShatteredSunKnife>();
|
|
Item.shootSpeed = 25f;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
// Terraria seems to really dislike high crit values in SetDefaults
|
|
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
|
|
|
|
public override float StealthDamageMultiplier => 1.2f;
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable())
|
|
{
|
|
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 void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<RadiantStar>().
|
|
AddIngredient<DivineGeode>(6).
|
|
AddTile(TileID.LunarCraftingStation).
|
|
Register();
|
|
}
|
|
}
|
|
}
|