Files
CalamityModPublic/Items/Weapons/Ranged/SeasSearing.cs
T
Altixal 52b7e8d29f clockwork use limit + balancing heck
removed child safety check on the dialogue that is no longer suggestive
2023-07-15 01:03:56 +07:00

83 lines
2.7 KiB
C#

using Terraria.DataStructures;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class SeasSearing : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public static int BaseDamage = 40;
public override void SetStaticDefaults()
{
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
}
public override void SetDefaults()
{
Item.damage = BaseDamage;
Item.DamageType = DamageClass.Ranged;
Item.width = 88;
Item.height = 44;
Item.useTime = 5;
Item.useAnimation = 15;
Item.reuseDelay = 20;
Item.useLimitPerAnimation = 3;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5f;
Item.UseSound = SoundID.Item11;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<SeasSearingBubble>();
Item.shootSpeed = 11f;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-10, -5);
}
public override bool AltFunctionUse(Player player)
{
return true;
}
public override bool CanUseItem(Player player)
{
if (player.altFunctionUse == 2)
{
Item.useTime = 30;
Item.useAnimation = 30;
Item.reuseDelay = 0;
}
else
{
Item.useTime = 5;
Item.useAnimation = 15;
Item.reuseDelay = 20;
}
return base.CanUseItem(player);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse == 2)
{
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<SeasSearingSecondary>(), (int)(damage * 1.22f), knockback, player.whoAmI, 0f, 0f);
}
else
{
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<SeasSearingBubble>(), damage, knockback, player.whoAmI, 1f, 0f);
}
return false;
}
}
}