Files
CalamityModPublic/Items/Weapons/Melee/DevilsSunrise.cs
T
2024-09-05 23:45:55 +07:00

61 lines
2.1 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class DevilsSunrise : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetDefaults()
{
Item.width = 66;
Item.height = 66;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.channel = true;
Item.damage = 420;
Item.knockBack = 4f;
Item.useAnimation = 25;
Item.useTime = 5;
Item.autoReuse = false;
Item.useStyle = ItemUseStyleID.Shoot;
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.Calamity().donorItem = true;
Item.shoot = ModContent.ProjectileType<DevilsSunriseProj>();
Item.shootSpeed = 24f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<DevilsSunriseCyclone>(), damage, knockback, player.whoAmI);
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.Terragrim).
AddIngredient<BloodstoneCore>(25).
AddIngredient<ScorchedBone>(10).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}