Files
CalamityModPublic/Items/Accessories/GladiatorsLocket.cs
T
Andrew Marheine 8685cfc584 1 - Buffed Fulguration Halberd, Gladiator's Locket, Anarchy Blade, Basher, Corrupted Crusher Blade, Crimson Crusher Blade, Depth Crusher, Vulcanite Lance, Feralthorn Claymore, Hellkite, Majestic Guard, Marnite Spear, Mycelial Claws, Old Lord Oathsword, Omniblade and Profaned Sword.
2 - Nerfed Pumpler exploding pumpkin damage.
3 - Nerfed most vanilla prehardmode desert enemies pre-Desert Scourge.
4 - Added some block drop code so that two instances of the same item cannot be dropped.
5 - Unloaded some lists that were previously forgotten about and added more items to said lists.
2021-04-25 05:25:58 -05:00

57 lines
1.9 KiB
C#

using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace CalamityMod.Items.Accessories
{
public class GladiatorsLocket : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Gladiator's Locket");
Tooltip.SetDefault("Summons two spirit swords to protect you");
}
public override void SetDefaults()
{
item.width = 42;
item.height = 36;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = ItemRarityID.Orange;
item.defense = 5;
item.accessory = true;
}
public override bool CanEquipAccessory(Player player, int slot)
{
if (player.Calamity().gladiatorSword)
return false;
return true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.gladiatorSword = true;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<GladiatorSwords>()) == -1)
player.AddBuff(ModContent.BuffType<GladiatorSwords>(), 3600, true);
int damage = 30;
int swordDmg = (int)(damage * player.AverageDamage());
if (player.ownedProjectileCounts[ModContent.ProjectileType<GladiatorSword>()] < 1)
{
Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType<GladiatorSword>(), swordDmg, 2f, Main.myPlayer);
Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType<GladiatorSword2>(), swordDmg, 2f, Main.myPlayer);
}
}
}
}
}