Add Essence of Clutches, nerf Singularity Set to pre-SCal

This commit is contained in:
2025-11-19 11:55:18 +00:00
parent f95a4aa7ed
commit 89889bede5
6 changed files with 91 additions and 31 deletions
@@ -0,0 +1,48 @@
using System;
using System.Linq;
using Terraria;
using Terraria.ModLoader;
using ForgottenWawiTech.Content.Rarities;
namespace ForgottenWawiTech.Content.Items.Accessories
{
public class EssenceOfClutches : ModItem
{
public override void SetDefaults()
{
Item.width = 28;
Item.height = 28;
Item.accessory = true;
Item.rare = ModContent.RarityType<FWTDeveloperItem>();
Item.value = Item.sellPrice(platinum: 90);
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
// The more players have died during a boss, the more damage you both deal and take (up to a maximum of +50% damage dealt and +50% damage taken).
// Count the number of dead players during a boss fight
int deadPlayerCount = 0;
if (Main.npc.Any(npc => npc.active && npc.boss))
{
for (int i = 0; i < Main.maxPlayers; i++)
{
Player otherPlayer = Main.player[i];
if (otherPlayer.active && otherPlayer.dead)
{
deadPlayerCount++;
}
}
}
// Each dead player grants +10% damage dealt and +10% damage taken, capped at 5 dead players (50%)
float damageBonus = Math.Min(deadPlayerCount * 0.10f, 0.50f);
if (damageBonus > 0)
{
player.GetDamage(DamageClass.Generic) += damageBonus;
player.endurance -= damageBonus; // Negative endurance means taking more damage
}
}
}
}