Files
CalamityModPublic/Items/Weapons/Ranged/Deathwind.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

61 lines
2.5 KiB
C#

using CalamityMod.Projectiles.Ranged;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class Deathwind : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.width = 40;
Item.height = 82;
Item.damage = 148;
Item.DamageType = DamageClass.Ranged;
Item.useTime = 14;
Item.useAnimation = 14;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5f;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.UseSound = SoundID.Item5;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<DWArrow>();
Item.shootSpeed = 20f;
Item.useAmmo = AmmoID.Arrow;
Item.Calamity().canFirePointBlankShots = true;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/DeathwindGlow").Value);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
for (int index = 0; index < 4; ++index)
{
float SpeedX = velocity.X + Main.rand.Next(-20, 21) * 0.05f;
float SpeedY = velocity.Y + Main.rand.Next(-20, 21) * 0.05f;
if (CalamityUtils.CheckWoodenAmmo(type, player))
{
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<DWArrow>(), (int)(damage * 1.75), knockback, player.whoAmI);
}
else
{
int baseArrow = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.75), knockback, player.whoAmI);
Main.projectile[baseArrow].noDropItem = true;
}
}
return false;
}
}
}