Files
CalamityModPublic/Items/Weapons/Magic/Rancor.cs
T
CongratsIsTrash 290b77f5ed A few Rancor fixes
1 - Fixed it scaling three times with damage; damage buff to compensate
2 - Fixed possible errors from attempting to spawn tile stuff outside of the world
3 - Converted the fog to a particle to fix laser jankiness issues caused by hitting the projectile cap
2026-07-19 17:48:49 -04:00

50 lines
1.7 KiB
C#

using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class Rancor : ExhumedItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.width = 66;
Item.height = 82;
Item.damage = 333;
Item.DamageType = DamageClass.Magic;
Item.noUseGraphic = true;
Item.channel = true;
Item.mana = 25;
Item.useTime = 25;
Item.useAnimation = 25;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5f;
Item.shootSpeed = 9f;
Item.shoot = ModContent.ProjectileType<RancorHoldout>();
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<CalamityRed>();
}
public override void SetStaticDefaults()
{
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<BurningSea>();
}
// This weapon uses a holdout projectile.
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
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, Item.shoot, damage, knockback, player.whoAmI);
return false;
}
}
}