Files
CalamityModPublic/Items/Armor/StatigelHood.cs
T

83 lines
3.3 KiB
C#

using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor
{
[AutoloadEquip(EquipType.Head)]
public class StatigelHood : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Statigel Hood");
Tooltip.SetDefault("Increased minion knockback and +1 max minion");
}
public override void SetDefaults()
{
item.width = 18;
item.height = 18;
item.value = Item.buyPrice(0, 5, 0, 0);
item.rare = 4;
item.defense = 4; //20
}
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == ModContent.ItemType<StatigelArmor>() && legs.type == ModContent.ItemType<StatigelGreaves>();
}
public override void UpdateArmorSet(Player player)
{
player.setBonus = "18% increased minion damage\n" +
"Summons a mini slime god to fight for you, the type depends on what world evil you have\n" +
"When you take over 100 damage in one hit you become immune to damage for an extended period of time\n" +
"Grants an extra jump and increased jump height\n" +
"30% increased jump speed";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.statigelSet = true;
modPlayer.slimeGod = true;
modPlayer.statigelJump = true;
Player.jumpHeight += 5;
player.jumpSpeedBoost += 1.5f;
player.minionDamage += 0.18f;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<StatigelSummonSetBuff>()) == -1)
{
player.AddBuff(ModContent.BuffType<StatigelSummonSetBuff>(), 3600, true);
}
if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType<CrimsonSlimeGodMinion>()] < 1)
{
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<CrimsonSlimeGodMinion>(), (int)(33f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f);
}
else if (!WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType<CorruptionSlimeGodMinion>()] < 1)
{
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<CorruptionSlimeGodMinion>(), (int)(33f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f);
}
}
}
public override void UpdateEquip(Player player)
{
player.minionKB += 1.5f;
player.maxMinions++;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<PurifiedGel>(), 5);
recipe.AddIngredient(ItemID.HellstoneBar, 9);
recipe.AddTile(ModContent.TileType<StaticRefiner>());
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}