73 lines
2.6 KiB
C#
73 lines
2.6 KiB
C#
using CalamityMod.CustomRecipes;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.DraedonsArsenal;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
|
{
|
|
public class PulseTurretRemote : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
|
|
public override void SetDefaults()
|
|
{
|
|
CalamityGlobalItem modItem = Item.Calamity();
|
|
|
|
Item.width = 28;
|
|
Item.height = 26;
|
|
Item.DamageType = DamageClass.Summon;
|
|
Item.sentry = true;
|
|
Item.damage = 150;
|
|
Item.knockBack = 0f;
|
|
Item.mana = 10;
|
|
Item.useTime = Item.useAnimation = 24;
|
|
Item.autoReuse = true;
|
|
|
|
Item.useStyle = ItemUseStyleID.HoldUp;
|
|
Item.UseSound = SoundID.Item15;
|
|
Item.noMelee = true;
|
|
|
|
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
|
|
Item.rare = ItemRarityID.Yellow;
|
|
|
|
Item.shoot = ModContent.ProjectileType<PulseTurret>();
|
|
Item.shootSpeed = 1f;
|
|
|
|
modItem.UsesCharge = true;
|
|
modItem.MaxCharge = 135f;
|
|
modItem.ChargePerUse = 1f;
|
|
modItem.ChargePerAltUse = 0f;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
CalamityUtils.OnlyOneSentry(player, type);
|
|
int turret = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
|
if (Main.projectile.IndexInRange(turret))
|
|
Main.projectile[turret].originalDamage = Item.damage;
|
|
|
|
player.UpdateMaxTurrets();
|
|
return false;
|
|
}
|
|
|
|
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3);
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<MysteriousCircuitry>(12).
|
|
AddIngredient<DubiousPlating>(18).
|
|
AddIngredient<InfectedArmorPlating>(10).
|
|
AddIngredient<LifeAlloy>(5).
|
|
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Func<bool> condition), condition).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
}
|
|
}
|
|
}
|