- *Re-scaled price of most Calamity materials* (most drastically post-DoG) - Shimmer transmutation price parity (same as og items) - Applied consistent vanilla sell anchor values to Calamity items: - Buff potions: 2 silver - Flask: 5 silver - Uncommon critters: 10 silver - Potion fish: 15 silver - Lootable fish: 10 silver - Sashimi fish: 7.5 silver - Plentiful fish: 5 silver - Added value to Calamity seeds and saplings to match vanilla
56 lines
2.1 KiB
C#
56 lines
2.1 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
|
|
{
|
|
[LegacyName("Thunderstorm")]
|
|
public class Thunderbolt : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Magic";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 220;
|
|
Item.height = 60;
|
|
Item.damage = 840;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 50;
|
|
Item.useAnimation = Item.useTime = 80; // 42 frames of firing animation
|
|
Item.knockBack = 2f;
|
|
Item.shoot = ModContent.ProjectileType<ThunderboltHoldout>();
|
|
Item.shootSpeed = 16f;
|
|
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.autoReuse = true;
|
|
Item.channel = true;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
|
|
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
|
Item.rare = ModContent.RarityType<Turquoise>();
|
|
}
|
|
|
|
// Cancels out the mana used to summon the holdout
|
|
public override void OnConsumeMana(Player player, int manaConsumed)
|
|
{
|
|
if (player.ownedProjectileCounts[Item.shoot] <= 0)
|
|
player.statMana += manaConsumed;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
|
|
|
public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
|
Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI);
|
|
return false;
|
|
}
|
|
}
|
|
}
|