Files
CalamityModPublic/Items/Weapons/Magic/WintersFury.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.3 KiB
C#

using System;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class WintersFury : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.width = 36;
Item.height = 40;
Item.damage = 70;
Item.DamageType = DamageClass.Magic;
Item.mana = 7;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Shoot;
Item.useTurn = false;
Item.noMelee = true;
Item.knockBack = 5f;
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.UseSound = SoundID.Item9;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<Icicle>();
Item.shootSpeed = 15f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (!Main.rand.NextBool(4))
{
Vector2 speed = velocity.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-15, 16)));
speed.Normalize();
speed *= 15f;
speed.Y -= Math.Abs(speed.X) * 0.2f;
int p = Projectile.NewProjectile(source, position, speed, ModContent.ProjectileType<FrostShardFriendly>(), damage, knockback, player.whoAmI);
if (p.WithinBounds(Main.maxProjectiles))
Main.projectile[p].DamageType = DamageClass.Magic;
}
if (Main.rand.NextBool(4))
{
SoundEngine.PlaySound(SoundID.Item1, position);
Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 1.2f, velocity.Y * 1.2f, ModContent.ProjectileType<Snowball>(), damage, knockback * 2f, player.whoAmI);
}
velocity.X += Main.rand.Next(-40, 41) * 0.05f;
velocity.Y += Main.rand.Next(-40, 41) * 0.05f;
return true;
}
}
}