Files
CalamityModPublic/Items/Weapons/Magic/HeliumFlash.cs
T
Ozzatron eaa04280ba 1 - Properly separated all Cosmic Anvil and Draedon's Forge recipes.
2 - An extremely large number of recipe changes. Far too many to remember.
3 - Occult Stone and furniture are now made at the Ancient Manipulator.
4 - 1 Core of Calamity now requires 1 Ashes of Calamity.
5 - Renamed the Calamitous Altar to Altar of the Accursed.
6 - All Cosmilite tier items are made at the Cosmic Anvil.
7 - Standardized the costs of all late game (Cosmilite tier and beyond) items.
2021-09-12 20:07:50 -04:00

109 lines
4.4 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class HeliumFlash : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Helium Flash");
Tooltip.SetDefault("The power of a galaxy, if only for mere moments\n" +
"Launches volatile star cores which erupt into colossal fusion blasts");
Item.staff[item.type] = true;
}
public override void SetDefaults()
{
item.width = 76;
item.height = 76;
item.magic = true;
item.damage = 1111;
item.knockBack = 9.5f;
item.mana = 26;
item.useAnimation = 37;
item.useTime = 37;
item.autoReuse = true;
item.noMelee = true;
item.useStyle = ItemUseStyleID.HoldingOut;
item.UseSound = SoundID.Item73;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
item.rare = ItemRarityID.Purple;
item.Calamity().customRarity = CalamityRarity.Violet;
item.shoot = ModContent.ProjectileType<VolatileStarcore>();
item.shootSpeed = 15f;
}
// Creates dust at the tip of the staff when used.
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 dir = new Vector2(speedX, speedY);
double angle = Math.Atan2(speedY, speedX) + MathHelper.PiOver4;
dir = dir.SafeNormalize(Vector2.Zero);
dir *= 64f * 1.4142f; // distance to gleaming point on staff
Vector2 dustPos = position + dir;
int dustType = 162;
int dustCount = 72;
float minSpeed = 4f;
float maxSpeed = 11f;
float minScale = 0.8f;
float maxScale = 1.4f;
Vector2 leftVec = new Vector2(-1f, 0f).RotatedBy(angle);
Vector2 rightVec = new Vector2(1f, 0f).RotatedBy(angle);
Vector2 upVec = new Vector2(0f, -1f).RotatedBy(angle);
Vector2 downVec = new Vector2(0f, 1f).RotatedBy(angle);
for (int i = 0; i < dustCount; i += 4)
{
int left = Dust.NewDust(dustPos, 1, 1, dustType, 0f, 0f);
Main.dust[left].position = dustPos;
Main.dust[left].velocity = leftVec * Main.rand.NextFloat(minSpeed, maxSpeed);
Main.dust[left].scale = Main.rand.NextFloat(minScale, maxScale);
Main.dust[left].noGravity = true;
int right = Dust.NewDust(dustPos, 1, 1, dustType, 0f, 0f);
Main.dust[right].position = dustPos;
Main.dust[right].velocity = rightVec * Main.rand.NextFloat(minSpeed, maxSpeed);
Main.dust[right].scale = Main.rand.NextFloat(minScale, maxScale);
Main.dust[right].noGravity = true;
int up = Dust.NewDust(dustPos, 1, 1, dustType, 0f, 0f);
Main.dust[up].position = dustPos;
Main.dust[up].velocity = upVec * Main.rand.NextFloat(minSpeed, maxSpeed);
Main.dust[up].scale = Main.rand.NextFloat(minScale, maxScale);
Main.dust[up].noGravity = true;
int down = Dust.NewDust(dustPos, 1, 1, dustType, 0f, 0f);
Main.dust[down].position = dustPos;
Main.dust[down].velocity = downVec * Main.rand.NextFloat(minSpeed, maxSpeed);
Main.dust[down].scale = Main.rand.NextFloat(minScale, maxScale);
Main.dust[down].noGravity = true;
}
return true;
}
public override void AddRecipes()
{
ModRecipe r = new ModRecipe(mod);
r.SetResult(this);
r.AddIngredient(ModContent.ItemType<VenusianTrident>());
r.AddIngredient(ModContent.ItemType<CalamitasInferno>());
r.AddIngredient(ModContent.ItemType<ForbiddenSun>());
r.AddIngredient(ItemID.FragmentSolar, 20);
r.AddIngredient(ItemID.FragmentNebula, 5);
r.AddIngredient(ModContent.ItemType<AuricBar>(), 5);
r.AddTile(ModContent.TileType<CosmicAnvil>());
r.AddRecipe();
}
}
}