using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class VictideHelmet : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Victide Helmet"); Tooltip.SetDefault("9% increased minion damage\n" + "+1 max minion"); } public override void SetDefaults() { item.width = 18; item.height = 18; item.value = Item.buyPrice(0, 1, 50, 0); item.rare = 2; item.defense = 1; //8 } public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void UpdateArmorSet(Player player) { player.setBonus = "Increased life regen and minion damage while submerged in liquid\n" + "Summons a sea urchin to protect you\n" + "When using any weapon you have a 10% chance to throw a returning seashell projectile\n" + "This seashell does true damage and does not benefit from any damage class\n" + "Slightly reduces breath loss in the abyss"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.victideSet = true; modPlayer.urchin = true; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(7f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } player.ignoreWater = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.minionDamage += 0.1f; player.lifeRegen += 3; } } public override void UpdateEquip(Player player) { player.minionDamage += 0.09f; player.maxMinions++; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); } } }