using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace Emiliasmod.Content.Items.Accessories { public class Spacesuit : ModItem { public static readonly int DefenseBonus = 8; //public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(); public override void SetDefaults() { Item.width = 40; Item.height = 40; Item.accessory = true; Item.rare = ItemRarityID.Red; Item.value = Item.sellPrice(platinum: 1, gold: 35); } public override void AddRecipes() { Recipe recipe = CreateRecipe(); recipe.AddTile(TileID.LunarMonolith); recipe.AddIngredient(ItemID.TerrasparkBoots, 1); recipe.AddIngredient(ItemID.CelestialShell, 1); recipe.AddIngredient(ItemID.ArcticDivingGear, 1); recipe.AddIngredient(ItemID.CharmofMyths, 1); recipe.AddIngredient(ItemID.AnkhShield, 1); recipe.AddCondition(Condition.DownedMoonLord); recipe.Register(); } public override void UpdateAccessory(Player player, bool hideVisual) { player.rocketBoots = 2; player.vanityRocketBoots = 2; player.waterWalk2 = true; player.waterWalk = true; player.iceSkate = true; player.desertBoots = true; player.fireWalk = true; player.noFallDmg = true; player.lavaRose = true; player.lavaImmune = true; player.statDefense += DefenseBonus; if (player.wet || player.honeyWet || player.lavaWet || player.shimmerWet) { player.arcticDivingGear = true; player.accMerman = true; } if (Main.dayTime == false) { player.wereWolf = true; } player.buffImmune[BuffID.BrokenArmor] = true; player.buffImmune[BuffID.Bleeding] = true; player.buffImmune[BuffID.Burning] = true; player.buffImmune[BuffID.Chilled] = true; player.buffImmune[BuffID.Confused] = true; player.buffImmune[BuffID.Cursed] = true; player.buffImmune[BuffID.Darkness] = true; player.buffImmune[BuffID.Poisoned] = true; player.buffImmune[BuffID.Silenced] = true; player.buffImmune[BuffID.Slow] = true; player.buffImmune[BuffID.Stoned] = true; player.buffImmune[BuffID.Weak] = true; player.noKnockback = true; player.lifeRegen += 4; player.PotionDelayModifier -= 0.25f; player.GetDamage(DamageClass.Generic) += 0.10f; player.GetAttackSpeed(DamageClass.Generic) += 0.10f; player.GetCritChance(DamageClass.Generic) += 4f; player.GetKnockback(DamageClass.Summon) += 0.5f; player.blockRange += 1; player.pickSpeed -= 0.15f; player.moveSpeed += 0.08f; player.accRunSpeed *= 3.75f; player.runSlowdown *= 1.75f; if (!hideVisual) { player.CancelAllBootRunVisualEffects(); // This ensures that boot visual effects don't overlap if multiple are equipped // Hellfire Treads sprint dust. For more info on sprint dusts see Player.SpawnFastRunParticles() method in Player.cs player.hellfireTreads = true; // Other boot run visual effects include: sailDash, coldDash, desertDash, fairyBoots if (!player.mount.Active || player.mount.Type != MountID.WallOfFleshGoat) { // Spawns flames when walking, like Flame Waker Boots. We also check the Goat Skull mount so the effects don't overlap. player.DoBootsEffect(player.DoBootsEffect_PlaceFlamesOnTile); } } } } }