Not uses the laser aesthetic and lasers look smooth as hell Changed stealth strike to throw two multitarget disks instead of one that could deal regular damage with lasers
80 lines
2.9 KiB
C#
80 lines
2.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using CalamityMod.CustomRecipes;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Items.Placeables.SunkenSea;
|
|
using CalamityMod.Items.Weapons.Rogue;
|
|
using CalamityMod.Projectiles.DraedonsArsenal;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
|
{
|
|
public class TrackingDisk : RogueWeapon, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
|
|
public override void SetDefaults()
|
|
{
|
|
CalamityGlobalItem modItem = Item.Calamity();
|
|
|
|
Item.width = 52;
|
|
Item.height = 40;
|
|
Item.damage = 16;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
Item.useTime = 40;
|
|
Item.useAnimation = 40;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.useTurn = false;
|
|
Item.knockBack = 3f;
|
|
|
|
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
|
|
Item.rare = ItemRarityID.Orange;
|
|
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
|
|
Item.shoot = ModContent.ProjectileType<TrackingDiskProjectile>();
|
|
Item.shootSpeed = 8f;
|
|
}
|
|
|
|
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 = -1; i <= 1; i += 2)
|
|
{
|
|
Vector2 vel = (velocity * 1.2f).RotatedBy(0.6f * i);
|
|
int proj = Projectile.NewProjectile(source, position, vel, type, (int)(damage * 0.8f), knockback, player.whoAmI);
|
|
Main.projectile[proj].Calamity().stealthStrike = true;
|
|
Main.projectile[proj].ai[2] = i;
|
|
Main.projectile[proj].extraUpdates = 3;
|
|
Main.projectile[proj].tileCollide = false;
|
|
}
|
|
}
|
|
else
|
|
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
|
return false;
|
|
}
|
|
|
|
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1);
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<MysteriousCircuitry>(5).
|
|
AddIngredient<DubiousPlating>(7).
|
|
AddIngredient<AerialiteBar>(4).
|
|
AddIngredient<SeaPrism>(7).
|
|
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Func<bool> condition), condition).
|
|
AddTile(TileID.Anvils).
|
|
Register();
|
|
}
|
|
}
|
|
}
|