Files
CalamityModPublic/Items/Weapons/Rogue/WaveSkipper.cs
T
tomat 67bceff6e7 Initial dotnet format pass.
This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
2024-02-28 21:49:50 -08:00

65 lines
2.3 KiB
C#

using System;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
[LegacyName("DuneHopper")]
public class WaveSkipper : RogueWeapon
{
public static int SpreadAngle = 8;
public override void SetDefaults()
{
Item.width = 44;
Item.height = 44;
Item.damage = 80;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useAnimation = Item.useTime = 22;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 4f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
Item.shoot = ModContent.ProjectileType<WaveSkipperProjectile>();
Item.shootSpeed = 12f;
Item.DamageType = RogueDamageClass.Instance;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable())
{
for (int i = -SpreadAngle; i < SpreadAngle * 2; i += SpreadAngle)
{
Vector2 spreadVelocity = player.SafeDirectionTo(Main.MouseWorld).RotatedBy(MathHelper.ToRadians(i)) * Item.shootSpeed;
int stealth = Projectile.NewProjectile(source, position, spreadVelocity, ModContent.ProjectileType<WaveSkipperProjectile>(), damage, knockback, player.whoAmI);
if (stealth.WithinBounds(Main.maxProjectiles))
Main.projectile[stealth].Calamity().stealthStrike = true;
}
return false;
}
return true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ScourgeoftheDesert>().
AddIngredient<MolluskHusk>(5).
AddIngredient<SeaPrism>(15).
AddIngredient<PrismShard>(20).
AddTile(TileID.Anvils).
Register();
}
}
}