Files
CalamityModPublic/Items/Weapons/Rogue/BlastBarrel.cs
T
Ozzatron 22afdd3933 1 - Calamity sell prices increase much more sharply with rarity.
2 - (Example) Post DoG items are now 2 platinum instead of 1 platinum 40 gold.
3 - (Example) Dev items are now 2 platinum 80 gold instead of 2 platinum.
4 - Privated numeric rarity item values.
5 - All assigned item values use the rarity's names, e.g. RarityLightPurpleBuyPrice.
2024-04-17 21:20:17 -04:00

48 lines
1.8 KiB
C#

using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class BlastBarrel : RogueWeapon
{
public override void SetDefaults()
{
Item.width = 48;
Item.height = 48;
Item.damage = 32;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.useAnimation = 22;
Item.useTime = 22;
Item.knockBack = 8f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.shoot = ModContent.ProjectileType<BlastBarrelProjectile>();
Item.shootSpeed = 12f;
Item.DamageType = RogueDamageClass.Instance;
}
public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
// A vertical offset is added to ensure that the barrel does not immediately collide with tiles and explode.
position = position - Vector2.UnitY * 12f;
velocity.Y *= 0.85f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
Main.projectile[p].Calamity().stealthStrike = true;
return false;
}
}
}